Browse Source

Some improvements to the main menu.

Iñigo Valentin 3 years ago
parent
commit
b46a71540f

+ 1 - 0
.gitattributes

@@ -0,0 +1 @@
+*.h linguist-language=C++

+ 1 - 0
V-Gears-Installer/src/KernelDataInstaller.cpp

@@ -2004,6 +2004,7 @@ void KernelDataInstaller::WriteInitialSaveMap(std::string file_name){
           << "    name = \"" << character.name << "\",\n"
           << "    level = " << static_cast<int>(character.level) << ",\n"
           << "    kills = " << character.kills << ",\n"
+          << "    back_row = " << character.back_row << ",\n"
           << "    exp = " << character.exp << ",\n"
           << "    exp_to_next = " << character.exp_to_next << ",\n"
           << "    stats = {\n"

+ 1 - 1
data/data/screens/item_menu/item_menu.xml

@@ -5,7 +5,7 @@
             <text_area name="ItemText" x="36" y="6" text_name="ItemMenuUse" font="FFVIIFont" visible="true" />
             <text_area name="ItemText" x="96" y="6" text_name="ItemMenuOrder" font="FFVIIFont" visible="true" />
             <text_area name="ItemText" x="156" y="6" text_name="ItemMenuKey" font="FFVIIFont" visible="true" />
-            <sprite name="Cursor" image="screens/images/cursor.png" x="-11" y="6" width="24" height="17" visible="true">
+            <sprite name="Cursor" image="screens/images/cursor.png" x="6" y="6" width="24" height="17" visible="true">
                 <animation name="Position1" length="0" x="0:6" />
                 <animation name="Position2" length="0" x="0:66" />
                 <animation name="Position3" length="0" x="0:126" />

+ 73 - 2
data/data/screens/main_menu/main_menu.lua

@@ -9,6 +9,17 @@ UiContainer.MainMenu = {
     -- Max cursor position in the main menu.
     position_total = 10,
 
+    --- When selecting a character, the menu in this position will be opened.
+    --
+    -- If 0, not selecting character.
+    select_character_for_menu = 0,
+
+    --- Current cursorposition in the charaster list (1-3).
+    character_position = 1,
+
+    --- Max cursor position in the characetr list.
+    character_position_total = 3,
+
     --- Run when the menu is creaded.
     --
     -- It does nothing.
@@ -31,8 +42,20 @@ UiContainer.MainMenu = {
             if UiContainer.current_submenu == "" then
                 if button == "Escape" and event == "Press" then
                     script:request_end_sync(Script.UI, "MainMenu", "hide", 0)
-                elseif button == "Enter" and event == "Press" and self.position == 1 then
-                    script:request_end_sync(Script.UI, "ItemMenu", "show", 0)
+                elseif button == "Enter" and event == "Press" then
+                    if self.position == 1 then -- Item menu
+                        script:request_end_sync(Script.UI, "ItemMenu", "show", 0)
+                    elseif self.position == 8 then -- Config menu
+                        print("TODO: Open config menu")
+                    elseif self.position == 9 then -- PHS menu
+                        print("TODO: Open PHS menu")
+                    elseif self.position == 10 then -- Save menu
+                        print("TODO: Open save menu")
+                    else -- Any other menu that needs a character
+                        self.select_character_for_menu = self.position
+                        UiContainer.current_submenu = "main_character"
+                        ui_manager:get_widget("MainMenu.Container.Characters.Cursor"):set_visible(true)
+                    end
                 elseif button == "Down" then
                     self.position = self.position + 1
                     if self.position > self.position_total then
@@ -46,6 +69,39 @@ UiContainer.MainMenu = {
                     end
                     menu_cursor:set_default_animation("Position" .. self.position)
                 end
+            elseif UiContainer.current_submenu == "main_character" then
+                if button == "Escape" and event == "Press" then
+                    UiContainer.current_submenu = ""
+                    ui_manager:get_widget("MainMenu.Container.Characters.Cursor"):set_visible(false)
+                elseif button == "Down" then
+                    -- TODO: Skip empty character slots
+                    self.character_position = self.character_position + 1
+                    if self.character_position > self.character_position_total then
+                        self.character_position = 1
+                    end
+                    ui_manager:get_widget("MainMenu.Container.Characters.Cursor"):set_default_animation("Position" .. self.character_position)
+                elseif button == "Up" then
+                    -- TODO: Skip empty character slots
+                    self.character_position = self.character_position - 1
+                    if self.character_position < 1 then
+                        self.character_position = self.character_position_total
+                    end
+                    ui_manager:get_widget("MainMenu.Container.Characters.Cursor"):set_default_animation("Position" .. self.character_position)
+                elseif button == "Enter" then
+                    if self.select_character_for_menu == 2 then -- Magic menu
+                        print("Open magic menu for char in slot " .. self.character_position)
+                    elseif self.select_character_for_menu == 3 then -- Materia menu
+                        print("Open materia menu for char in slot " .. self.character_position)
+                    elseif self.select_character_for_menu == 4 then -- Equip menu
+                        print("Open equip menu for char in slot " .. self.character_position)
+                    elseif self.select_character_for_menu == 5 then -- Status menu
+                        print("Open status menu for char in slot " .. self.character_position)
+                    elseif self.select_character_for_menu == 6 then -- Order menu
+                        print("Open order menu for char in slot " .. self.character_position)
+                    elseif self.select_character_for_menu == 7 then -- Limit menu
+                        print("Open limit menu for char in slot " .. self.character_position)
+                    end
+                end
             end
         elseif ui_manager:get_widget("MainMenu"):is_visible() == false and FFVII.MenuSettings.available == true then
             if button == "Escape" and event == "Press" then
@@ -73,17 +129,32 @@ UiContainer.MainMenu = {
         local timegil = ui_manager:get_widget("MainMenu.Container.TimeGil")
         local location = ui_manager:get_widget("MainMenu.Container.Location")
 
+
         for c = 1, 3 do
             if FFVII.Party[c] ~= nil then
                 UiContainer.populate_character_data("MainMenu.Container.Characters.Character" .. tostring(c), Characters[FFVII.Party[c]])
+                if Characters[FFVII.Party[c]].back_row == 1 then
+                    ui_manager:get_widget("MainMenu.Container.Characters.Character" .. tostring(c) .. ".Portrait"):set_default_animation("RowBack")
+                else
+                    ui_manager:get_widget("MainMenu.Container.Characters.Character" .. tostring(c) .. ".Portrait"):set_default_animation("RowFront")
+                end
             else
                 UiContainer.populate_character_data("MainMenu.Container.Characters.Character" .. tostring(c), nil)
             end
         end
 
+        -- TODO: Set portraits of the correct char
+
         --ui_manager:get_widget("MainMenu.Container.Menu.PHSText"):set_visible(false)
         ui_manager:get_widget("MainMenu.Container.Menu.SaveText"):set_colour(0.4, 0.4, 0.4)
 
+        -- Set money
+        local money_str = tostring(Inventory.money)
+        while #(money_str) < 8 do
+            money_str = " " .. money_str
+        end
+        ui_manager:get_widget("MainMenu.Container.TimeGil.Gil"):set_text(money_str)
+
         characters:play_animation_stop("Appear")
         menu:play_animation_stop("Appear")
         menu_cursor:set_default_animation("Position" .. self.position)

+ 50 - 40
data/data/screens/main_menu/main_menu.xml

@@ -1,58 +1,66 @@
 <screen name="MainMenu" script="screens/main_menu/main_menu.lua" visible="false">
     <widget name="Container" width="368" height="240" origin_x="50%" origin_y="50%" align="center" valign="middle" scale="3 3" visible="true">
-        <widget name="Characters" x="0" y="17" width="300" height="190" visible="true">
+        <widget name="Characters" x="30" y="17" width="300" height="190" visible="true">
             <prototype name="Window" />
-            <animation name="Appear" length="0.3" x="0:736,0.3:0" />
-            <animation name="Disappear" length="0.3" x="0:0,0.3:736" />
+            <animation name="Appear" length="0.3" x="0:736,0.3:30" />
+            <animation name="Disappear" length="0.3" x="0:30,0.3:736" />
 
             <widget name="Character1" x="0" y="0" width="100%" height="60" visible="true">
-                <sprite name="Portrait" image="screens/images/cloud.png" x="22" y="12" width="48" height="48" visible="true" />
-                <widget name="Data" x="102" y="14" width="100%" height="100%" visible="true">
+                <sprite name="Portrait" image="screens/images/cloud.png" x="22" y="12" width="48" height="48" visible="true">
+                    <animation name="RowFront" length="0" x="0:10" />
+                    <animation name="RowBack" length="0" x="0:22" />
+                </sprite>
+                <widget name="Data" x="80" y="14" width="100%" height="100%" visible="true">
                     <prototype name="MenuCharacterData" />
                 </widget>
-                <text_area name="NextLevelText" x="186" y="17" text_name="CharacterDataNextLevel" font="FFVIIFont" visible="true" />
-                <sprite name="NextLevelBar" image="screens/images/menu_bar.png" x="202" y="28" width="64" height="8" visible="true" />
-                <sprite name="NextLevelLinePart1" x="203" y="29" width="20" height="3" colours="0.5 0.5 0.5, 0.5 0.5 0.5, 0.5 0.125 0.125, 0.5 0.125 0.125" alpha="0.8" visible="false" />
-                <sprite name="NextLevelLinePart2" x="203" y="32" width="20" height="3" colours="0.5 0.125 0.125, 0.5 0.125 0.125, 0 0 0, 0 0 0" alpha="0.8" visible="false" />
-                <text_area name="LimitLevelText" x="186" y="38" text_name="CharacterDataLimitLevel" font="FFVIIFont" visible="true" />
-                <sprite name="LimitLevelBar" image="screens/images/menu_bar.png" x="202" y="49" width="64" height="8" visible="true" />
-                <text_area name="LimitLevel" x="250" y="40" text_name="CharacterDataLimitLevelNumber" font="FFVIIMenuDigits" visible="true" />
-                <sprite name="LimitLinePart1" x="203" y="50" width="25" height="3" colours="0.5 0.5 0.5, 0.5 0.5 0.5, 0.5 0.125 0.31, 0.5 0.125 0.31" alpha="0.8" visible="false" />
-                <sprite name="LimitLinePart2" x="203" y="53" width="25" height="3" colours="0.5 0.125 0.31, 0.5 0.125 0.31, 0 0 0, 0 0 0" alpha="0.8" visible="false" />
+                <text_area name="NextLevelText" x="172" y="17" text_name="CharacterDataNextLevel" font="FFVIIFont" visible="true" />
+                <sprite name="NextLevelBar" image="screens/images/menu_bar.png" x="172" y="28" width="64" height="8" visible="true" />
+                <sprite name="NextLevelLinePart1" x="173" y="29" width="20" height="3" colours="0.5 0.5 0.5, 0.5 0.5 0.5, 0.5 0.125 0.125, 0.5 0.125 0.125" alpha="0.8" visible="false" />
+                <sprite name="NextLevelLinePart2" x="173" y="32" width="20" height="3" colours="0.5 0.125 0.125, 0.5 0.125 0.125, 0 0 0, 0 0 0" alpha="0.8" visible="false" />
+                <text_area name="LimitLevelText" x="172" y="38" text_name="CharacterDataLimitLevel" font="FFVIIFont" visible="true" />
+                <sprite name="LimitLevelBar" image="screens/images/menu_bar.png" x="172" y="49" width="64" height="8" visible="true" />
+                <text_area name="LimitLevel" x="225" y="40" text_name="CharacterDataLimitLevelNumber" font="FFVIIMenuDigits" visible="true" />
+                <sprite name="LimitLinePart1" x="173" y="50" width="25" height="3" colours="0.5 0.5 0.5, 0.5 0.5 0.5, 0.5 0.125 0.31, 0.5 0.125 0.31" alpha="0.8" visible="false" />
+                <sprite name="LimitLinePart2" x="173" y="53" width="25" height="3" colours="0.5 0.125 0.31, 0.5 0.125 0.31, 0 0 0, 0 0 0" alpha="0.8" visible="false" />
             </widget>
             <widget name="Character2" x="0" y="65" width="100%" height="60" visible="true">
                 <sprite name="Portrait" image="screens/images/cloud.png" x="22" y="12" width="48" height="48" visible="true" />
-                <widget name="Data" x="102" y="14" width="100%" height="100%" visible="true">
+                <widget name="Data" x="80" y="14" width="100%" height="100%" visible="true">
                     <prototype name="MenuCharacterData" />
                 </widget>
-                <text_area name="NextLevelText" x="186" y="17" text_name="CharacterDataNextLevel" font="FFVIIFont" visible="true" />
-                <sprite name="NextLevelBar" image="screens/images/menu_bar.png" x="202" y="28" width="64" height="8" visible="true" />
-                <sprite name="NextLevelLinePart1" x="203" y="29" width="20" height="3" colours="0.5 0.5 0.5, 0.5 0.5 0.5, 0.5 0.125 0.125, 0.5 0.125 0.125" alpha="0.8" visible="false" />
-                <sprite name="NextLevelLinePart2" x="203" y="32" width="20" height="3" colours="0.5 0.125 0.125, 0.5 0.125 0.125, 0 0 0, 0 0 0" alpha="0.8" visible="false" />
-                <text_area name="LimitLevelText" x="186" y="38" text_name="CharacterDataLimitLevel" font="FFVIIFont" visible="true" />
-                <sprite name="LimitLevelBar" image="screens/images/menu_bar.png" x="202" y="49" width="64" height="8" visible="true" />
-                <text_area name="LimitLevel" x="250" y="40" text_name="CharacterDataLimitLevelNumber" font="FFVIIMenuDigits" visible="true" />
-                <sprite name="LimitLinePart1" x="203" y="50" width="25" height="3" colours="0.5 0.5 0.5, 0.5 0.5 0.5, 0.5 0.125 0.31, 0.5 0.125 0.31" alpha="0.8" visible="false" />
-                <sprite name="LimitLinePart2" x="203" y="53" width="25" height="3" colours="0.5 0.125 0.31, 0.5 0.125 0.31, 0 0 0, 0 0 0" alpha="0.8" visible="false" />
+                <text_area name="NextLevelText" x="172" y="17" text_name="CharacterDataNextLevel" font="FFVIIFont" visible="true" />
+                <sprite name="NextLevelBar" image="screens/images/menu_bar.png" x="172" y="28" width="64" height="8" visible="true" />
+                <sprite name="NextLevelLinePart1" x="173" y="29" width="20" height="3" colours="0.5 0.5 0.5, 0.5 0.5 0.5, 0.5 0.125 0.125, 0.5 0.125 0.125" alpha="0.8" visible="false" />
+                <sprite name="NextLevelLinePart2" x="173" y="32" width="20" height="3" colours="0.5 0.125 0.125, 0.5 0.125 0.125, 0 0 0, 0 0 0" alpha="0.8" visible="false" />
+                <text_area name="LimitLevelText" x="172" y="38" text_name="CharacterDataLimitLevel" font="FFVIIFont" visible="true" />
+                <sprite name="LimitLevelBar" image="screens/images/menu_bar.png" x="172" y="49" width="64" height="8" visible="true" />
+                <text_area name="LimitLevel" x="225" y="40" text_name="CharacterDataLimitLevelNumber" font="FFVIIMenuDigits" visible="true" />
+                <sprite name="LimitLinePart1" x="173" y="50" width="25" height="3" colours="0.5 0.5 0.5, 0.5 0.5 0.5, 0.5 0.125 0.31, 0.5 0.125 0.31" alpha="0.8" visible="false" />
+                <sprite name="LimitLinePart2" x="173" y="53" width="25" height="3" colours="0.5 0.125 0.31, 0.5 0.125 0.31, 0 0 0, 0 0 0" alpha="0.8" visible="false" />
             </widget>
             <widget name="Character3" x="0" y="130" width="100%" height="60" visible="true">
                 <sprite name="Portrait" image="screens/images/cloud.png" x="22" y="12" width="48" height="48" visible="true" />
-                <widget name="Data" x="102" y="14" width="100%" height="100%" visible="true">
+                <widget name="Data" x="80" y="14" width="100%" height="100%" visible="true">
                     <prototype name="MenuCharacterData" />
                 </widget>
-                <text_area name="NextLevelText" x="186" y="17" text_name="CharacterDataNextLevel" font="FFVIIFont" visible="true" />
-                <sprite name="NextLevelBar" image="screens/images/menu_bar.png" x="202" y="28" width="64" height="8" visible="true" />
-                <sprite name="NextLevelLinePart1" x="203" y="29" width="20" height="3" colours="0.5 0.5 0.5, 0.5 0.5 0.5, 0.5 0.125 0.125, 0.5 0.125 0.125" alpha="0.8" visible="false" />
-                <sprite name="NextLevelLinePart2" x="203" y="32" width="20" height="3" colours="0.5 0.125 0.125, 0.5 0.125 0.125, 0 0 0, 0 0 0" alpha="0.8" visible="false" />
-                <text_area name="LimitLevelText" x="186" y="38" text_name="CharacterDataLimitLevel" font="FFVIIFont" visible="true" />
-                <sprite name="LimitLevelBar" image="screens/images/menu_bar.png" x="202" y="49" width="64" height="8" visible="true" />
-                <text_area name="LimitLevel" x="250" y="40" text_name="CharacterDataLimitLevelNumber" font="FFVIIMenuDigits" visible="true" />
-                <sprite name="LimitLinePart1" x="203" y="50" width="25" height="3" colours="0.5 0.5 0.5, 0.5 0.5 0.5, 0.5 0.125 0.31, 0.5 0.125 0.31" alpha="0.8" visible="false" />
-                <sprite name="LimitLinePart2" x="203" y="53" width="25" height="3" colours="0.5 0.125 0.31, 0.5 0.125 0.31, 0 0 0, 0 0 0" alpha="0.8" visible="false" />
+                <text_area name="NextLevelText" x="172" y="17" text_name="CharacterDataNextLevel" font="FFVIIFont" visible="true" />
+                <sprite name="NextLevelBar" image="screens/images/menu_bar.png" x="172" y="28" width="64" height="8" visible="true" />
+                <sprite name="NextLevelLinePart1" x="173" y="29" width="20" height="3" colours="0.5 0.5 0.5, 0.5 0.5 0.5, 0.5 0.125 0.125, 0.5 0.125 0.125" alpha="0.8" visible="false" />
+                <sprite name="NextLevelLinePart2" x="173" y="32" width="20" height="3" colours="0.5 0.125 0.125, 0.5 0.125 0.125, 0 0 0, 0 0 0" alpha="0.8" visible="false" />
+                <text_area name="LimitLevelText" x="172" y="38" text_name="CharacterDataLimitLevel" font="FFVIIFont" visible="true" />
+                <sprite name="LimitLevelBar" image="screens/images/menu_bar.png" x="172" y="49" width="64" height="8" visible="true" />
+                <text_area name="LimitLevel" x="225" y="40" text_name="CharacterDataLimitLevelNumber" font="FFVIIMenuDigits" visible="true" />
+                <sprite name="LimitLinePart1" x="173" y="50" width="25" height="3" colours="0.5 0.5 0.5, 0.5 0.5 0.5, 0.5 0.125 0.31, 0.5 0.125 0.31" alpha="0.8" visible="false" />
+                <sprite name="LimitLinePart2" x="173" y="53" width="25" height="3" colours="0.5 0.125 0.31, 0.5 0.125 0.31, 0 0 0, 0 0 0" alpha="0.8" visible="false" />
             </widget>
+            <sprite name="Cursor" image="screens/images/cursor.png" x="0" y="35" width="24" height="16" visible="false">
+                <animation name="Position1" length="0" y="0:35" />
+                <animation name="Position2" length="0" y="0:95" />
+                <animation name="Position3" length="0" y="0:155" />
+            </sprite>
         </widget>
 
-        <widget name="Menu" x="278" y="5" width="86" height="132" visible="true">
+        <widget name="Menu" x="270" y="5" width="75" height="132" visible="true">
             <prototype name="Window" />
             <text_area name="ItemText" x="16" y="6" text_name="MainMenuItem" font="FFVIIFont" visible="true" />
             <text_area name="MagicText" x="16" y="18" text_name="MainMenuMagic" font="FFVIIFont" visible="true" />
@@ -80,21 +88,23 @@
             <animation name="Disappear" length="0.3" y="0:5,0.3:405" />
         </widget>
 
-        <widget name="TimeGil" x="278" y="164" width="86" height="36" visible="true">
+        <widget name="TimeGil" x="270" y="164" width="75" height="36" visible="true">
             <prototype name="Window" />
             <text_area name="TimeText" x="4" y="6" text_name="MainMenuTime" font="FFVIIFont" visible="true" />
             <text_area name="TimeHours" x="31" y="8" text_name="MainMenuHours" font="FFVIIMenuDigits" visible="true" />
             <text_area name="TimeSemicolon1" x="44" y="1" text_name="MainMenuSemicolon" font="FFVIIMenuFont" visible="true" />
             <text_area name="TimeMinutes" x="50" y="8" text_name="MainMenuMinutes" font="FFVIIMenuDigits" visible="true" />
+            <!--
             <text_area name="TimeSemicolon2" x="62" y="1" text_name="MainMenuSemicolon" font="FFVIIMenuFont" visible="true" />
             <text_area name="TimeSeconds" x="67" y="8" text_name="MainMenuSeconds" font="FFVIIMenuDigits" visible="true" />
+            -->
             <text_area name="GilText" x="5" y="20" text_name="MainMenuGil" font="FFVIIFont" visible="true" />
-            <text_area name="GilText" x="11" y="22" text_name="MainMenuGilAmount" font="FFVIIMenuDigits" visible="true" />
-            <animation name="Appear" length="0.3" x="0:-458,0.3:278" />
-            <animation name="Disappear" length="0.3" x="0:278,0.3:-458" />
+            <text_area name="Gil" x="14" y="22" text_name="MainMenuGilAmount" font="FFVIIMenuDigits" visible="true" />
+            <animation name="Appear" length="0.3" x="0:-458,0.3:270" />
+            <animation name="Disappear" length="0.3" x="0:270,0.3:-458" />
         </widget>
 
-        <widget name="Location" x="184" y="200" width="180" height="24" visible="true">
+        <widget name="Location" x="165" y="200" width="180" height="24" visible="true">
             <prototype name="Window" />
             <text_area name="Text" x="8" y="6" text_name="MainMenuLocation" font="FFVIIFont" visible="true" />
             <animation name="Appear" length="0.3" y="0:-136,0.3:200" />

+ 15 - 15
data/data/screens/main_menu/prototypes.xml

@@ -1,22 +1,22 @@
 <prototypes>
     <prototype name="MenuCharacterData">
-        <text_area name="Name" x="0" y="0" text_name="CharacterDataName" font="FFVIIFont" visible="true" />
+        <text_area name="Name" x="0" y="0" font="FFVIIFont" visible="true" />
         <text_area name="Lv" x="0" y="5" text_name="CharacterDataLv" colour="0 0.9 0.9" font="FFVIIMenuFont" visible="true" />
-        <text_area name="LvNumber" x="18" y="13" text_name="CharacterDataLvNumber" font="FFVIIMenuDigits" visible="true" />
+        <text_area name="LvNumber" x="18" y="13" font="FFVIIMenuDigits" visible="true" />
         <text_area name="Hp" x="0" y="16" text_name="CharacterDataHp" colour="0 0.9 0.9" font="FFVIIMenuFont" visible="true" />
-        <text_area name="HpCurrent" x="18" y="23" text_name="CharacterDataHpCurrent" colour="0.9 0.9 0.9" font="FFVIIMenuDigits" visible="true" />
-        <sprite name="HpSlash" image="screens/images/slash.png" x="46" y="23" width="4" height="8" visible="true" />
-        <text_area name="HpMax" x="50" y="23" text_name="CharacterDataHpMax" font="FFVIIMenuDigits" visible="true" />
-        <sprite name="HpLine" x="18" y="31" width="60" height="1" colour="0.3 0 0" visible="true" />
-        <sprite name="HpLineCurrent" x="18" y="31" width="5" height="1" colours="0 0.5 1, 0.78 0.78 0.78, 0.78 0.78 0.78, 0 0.5 1" visible="true" />
-        <sprite name="HpLineShadow" x="18" y="32" width="60" height="1" colour="0 0 0" visible="true" />
+        <text_area name="HpCurrent" x="16" y="23" colour="0.9 0.9 0.9" font="FFVIIMenuDigits" visible="true" />
+        <sprite name="HpSlash" image="screens/images/slash.png" x="51" y="23" width="4" height="8" visible="true" />
+        <text_area name="HpMax" x="55" y="23" font="FFVIIMenuDigits" visible="true" />
+        <sprite name="HpLine" x="16" y="31" width="72" height="1" colour="0.3 0 0" visible="true" />
+        <sprite name="HpLineCurrent" x="16" y="31" height="1" colours="0 0.5 1, 0.78 0.78 0.78, 0.78 0.78 0.78, 0 0.5 1" visible="true" />
+        <sprite name="HpLineShadow" x="16" y="32" width="72" height="1" colour="0 0 0" visible="true" />
         <text_area name="Mp" x="0" y="26" text_name="CharacterDataMp" colour="0 0.9 0.9" font="FFVIIMenuFont" visible="true" />
-        <text_area name="MpCurrent" x="18" y="33" text_name="CharacterDataMpCurrent" font="FFVIIMenuDigits" visible="true" />
-        <sprite name="MpSlash" image="screens/images/slash.png" x="46" y="33" width="4" height="8" visible="true" />
-        <text_area name="MpMax" x="50" y="33" text_name="CharacterDataMpMax" font="FFVIIMenuDigits" visible="true" />
-        <sprite name="MpLine" x="18" y="41" width="60" height="1" colour="0.3 0 0" visible="true" />
-        <sprite name="MpLineCurrent" x="18" y="41" width="60" height="1" colours="0 1 0.5, 0.78 0.78 0.78, 0.78 0.78 0.78, 0 1 0.5" visible="true" />
-        <sprite name="MpLineShadow" x="18" y="42" width="60" height="1" colour="0 0 0" visible="true" />
-        <text_area name="Status" x="36" y="11" text_name="CharacterDataFury" colour="0.9 0 0.9" font="FFVIIFont" visible="true" />
+        <text_area name="MpCurrent" x="16" y="33" font="FFVIIMenuDigits" visible="true" />
+        <sprite name="MpSlash" image="screens/images/slash.png" x="51" y="33" width="4" height="8" visible="true" />
+        <text_area name="MpMax" x="55" y="33" font="FFVIIMenuDigits" visible="true" />
+        <sprite name="MpLine" x="16" y="41" width="72" height="1" colour="0.3 0 0" visible="true" />
+        <sprite name="MpLineCurrent" x="16" y="41" height="1" colours="0 1 0.5, 0.78 0.78 0.78, 0.78 0.78 0.78, 0 1 0.5" visible="true" />
+        <sprite name="MpLineShadow" x="16" y="42" width="72" height="1" colour="0 0 0" visible="true" />
+        <text_area name="Status" x="36" y="11" colour="0.8 0 0.8" font="FFVIIFont" visible="true" />
     </prototype>
 </prototypes>

+ 14 - 5
data/data/screens/menu_helpers.lua

@@ -8,6 +8,15 @@ print("ADD helpers")
 -- @param character The character to get the data from. If nill, the character details will be
 -- hidden.
 UiContainer.populate_character_data = function(widget, character)
+
+    space_pad = function(val, length)
+        str = tostring(val)
+        while #(str) < length do
+            str = " " .. str
+        end
+        return str
+    end
+
     if character == nil then
         ui_manager:get_widget(widget):set_visible(false)
         return 0
@@ -29,11 +38,11 @@ UiContainer.populate_character_data = function(widget, character)
 
     -- Text data
     ui_manager:get_widget(widget .. ".Data.Name"):set_text(character.name)
-    ui_manager:get_widget(widget .. ".Data.LvNumber"):set_text(tostring(character.level))
-    ui_manager:get_widget(widget .. ".Data.HpCurrent"):set_text(tostring(character.stats.hp.current))
-    ui_manager:get_widget(widget .. ".Data.HpMax"):set_text(tostring(character.stats.hp.base))
-    ui_manager:get_widget(widget .. ".Data.MpCurrent"):set_text(tostring(character.stats.mp.current))
-    ui_manager:get_widget(widget .. ".Data.MpMax"):set_text(tostring(character.stats.mp.base))
+    ui_manager:get_widget(widget .. ".Data.LvNumber"):set_text(space_pad(character.level, 3))
+    ui_manager:get_widget(widget .. ".Data.HpCurrent"):set_text(space_pad(character.stats.hp.current, 5))
+    ui_manager:get_widget(widget .. ".Data.HpMax"):set_text(space_pad(character.stats.hp.base, 5))
+    ui_manager:get_widget(widget .. ".Data.MpCurrent"):set_text(space_pad(character.stats.mp.current, 5))
+    ui_manager:get_widget(widget .. ".Data.MpMax"):set_text(space_pad(character.stats.mp.base, 5))
 
     -- Calculate the HP and MP bar.
     local max_hp_width= ui_manager:get_widget(widget .. ".Data.HpLine"):get_width()

+ 3 - 1
data/data/scripts/debug_data.lua

@@ -22,5 +22,7 @@ Inventory.add_key_item(21)
 Inventory.add_key_item(22)
 Inventory.add_key_item(33)
 Inventory.add_key_item(38)
+Inventory.money = 1234567
 Inventory.sort(Inventory.ORDER.NAME)
-Characters[0].stats.hp.current = 10
+Characters[0].stats.hp.current = 12345
+Characters[0].stats.hp.base = 54321