Prechádzať zdrojové kódy

Installer improvements: Added a TEX file parser that extracts almost all images from OG data, in every required color palette, and cuts composite textures into individual images.
The main and item menus now used the newly generated images, among other improvements.
Equip menu partially implemented.
Deleted original images included in the repo.

Iñigo Valentin 3 rokov pred
rodič
commit
97b1f31a17
55 zmenil súbory, kde vykonal 1478 pridanie a 209 odobranie
  1. 4 0
      V-Gears-Installer/CMakeLists.txt
  2. 6 0
      V-Gears-Installer/include/DataInstaller.h
  3. 73 0
      V-Gears-Installer/include/MediaDataInstaller.h
  4. 457 0
      V-Gears-Installer/include/TexFile.h
  5. 12 0
      V-Gears-Installer/src/DataInstaller.cpp
  6. 38 38
      V-Gears-Installer/src/KernelDataInstaller.cpp
  7. 277 0
      V-Gears-Installer/src/MediaDataInstaller.cpp
  8. 228 0
      V-Gears-Installer/src/TexFile.cpp
  9. 1 0
      V-Gears/include/core/ScriptManagerBinds.h
  10. 8 1
      V-Gears/include/core/UiSprite.h
  11. 10 1
      V-Gears/include/core/UiWidget.h
  12. 5 0
      V-Gears/include/data/VGearsTexFile.h
  13. 2 0
      V-Gears/src/core/UiSprite.cpp
  14. 2 0
      V-Gears/src/core/UiWidget.cpp
  15. 5 3
      V-Gears/src/data/VGearsTexFile.cpp
  16. 1 0
      data/data/screens.xml
  17. 3 3
      data/data/screens/begin_menu/begin_menu.xml
  18. 1 1
      data/data/screens/dialog/prototypes.xml
  19. 53 0
      data/data/screens/equip_menu/equip_menu.xml
  20. BIN
      data/data/screens/images/barret.png
  21. BIN
      data/data/screens/images/border_b.png
  22. BIN
      data/data/screens/images/border_bl.png
  23. BIN
      data/data/screens/images/border_br.png
  24. BIN
      data/data/screens/images/border_l.png
  25. BIN
      data/data/screens/images/border_r.png
  26. BIN
      data/data/screens/images/border_t.png
  27. BIN
      data/data/screens/images/border_tl.png
  28. BIN
      data/data/screens/images/border_tr.png
  29. BIN
      data/data/screens/images/buster.tex
  30. BIN
      data/data/screens/images/button_circle.png
  31. BIN
      data/data/screens/images/button_cross.png
  32. BIN
      data/data/screens/images/button_square.png
  33. BIN
      data/data/screens/images/button_triangle.png
  34. BIN
      data/data/screens/images/cloud.png
  35. BIN
      data/data/screens/images/cursor.png
  36. BIN
      data/data/screens/images/menu_bar.png
  37. BIN
      data/data/screens/images/slash.png
  38. BIN
      data/data/screens/images/sword.png
  39. BIN
      data/data/screens/images/tifa.png
  40. BIN
      data/data/screens/images/yuffie.png
  41. 22 122
      data/data/screens/item_menu/item_menu.xml
  42. 1 1
      data/data/screens/item_menu/prototypes.xml
  43. 12 12
      data/data/screens/main_menu/main_menu.xml
  44. 4 4
      data/data/screens/main_menu/prototypes.xml
  45. 2 2
      data/data/screens/pause_menu/pause_menu.xml
  46. 9 9
      data/data/screens/prototypes.xml
  47. 1 1
      data/data/scripts.xml
  48. 1 0
      data/data/scripts/debug_data.lua
  49. 0 0
      data/data/scripts/menu/begin_menu.lua
  50. 168 0
      data/data/scripts/menu/equip_menu.lua
  51. 21 0
      data/data/scripts/menu/item_menu.lua
  52. 2 1
      data/data/scripts/menu/main_menu.lua
  53. 2 1
      data/data/scripts/menu/menu_helpers.lua
  54. 0 0
      data/data/scripts/menu/pause_menu.lua
  55. 47 9
      data/data/texts/english/menu.xml

+ 4 - 0
V-Gears-Installer/CMakeLists.txt

@@ -92,8 +92,10 @@ set(HEADER_FILES
     include/common/Lzs.h
     include/ModelsAndAnimationsDb.h
     include/ScopedLgp.h
+    include/TexFile.h
     include/SpawnPointDb.h
     include/KernelDataInstaller.h
+    include/MediaDataInstaller.h
 )
 
 
@@ -166,7 +168,9 @@ set(SOURCE_FILES
     src/decompiler/world/WorldEngine.cpp
     src/ModelsAndAnimationsDb.cpp
     src/ScopedLgp.cpp
+    src/TexFile.cpp
     src/KernelDataInstaller.cpp
+    src/MediaDataInstaller.cpp
 )
 
 # For SUDM. TODO: Add elses.

+ 6 - 0
V-Gears-Installer/include/DataInstaller.h

@@ -24,6 +24,7 @@
 #include "data/VGearsFLevelFile.h"
 #include "FieldTextWriter.h"
 #include "KernelDataInstaller.h"
+#include "MediaDataInstaller.h"
 #include "ModelsAndAnimationsDb.h"
 #include "ScopedLgp.h"
 #include "SpawnPointDb.h"
@@ -293,6 +294,11 @@ class DataInstaller{
          */
         std::unique_ptr<KernelDataInstaller> kernel_installer_;
 
+        /**
+         * The installer for media files.
+         */
+        std::unique_ptr<MediaDataInstaller> media_installer_;
+
         /**
          * LGP archive with texture data.
          */

+ 73 - 0
V-Gears-Installer/include/MediaDataInstaller.h

@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2022 The V-Gears Team
+ *
+ * This file is part of V-Gears
+ *
+ * V-Gears is free software: you can redistribute it and/or modify it under
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation, version 3.0 (GPLv3) of the License.
+ *
+ * V-Gears is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#pragma once
+
+#include "data/VGearsLGPArchive.h"
+#include "common/BinGZipFile.h"
+#include "TexFile.h"
+
+/**
+ * The media data installer.
+ */
+class MediaDataInstaller{
+
+
+    public:
+
+        /**
+         * Constructor
+         *
+         * @param[in] input_dir Path to the directory containing the original data to parse.
+         * @param[out] input_dir Path to the directory of the installation data.
+         */
+        MediaDataInstaller(const std::string input_dir, const std::string output_dir);
+
+        /**
+         * Destructor.
+         */
+        ~MediaDataInstaller();
+
+        /**
+         * Extracts all images contained in the menu LGP file and installs them.
+         *
+         * For composed  textures, it extracts individual images. All images are saved under the
+         * "images" directory. This also includes font maps.
+         */
+        void InstallSprites();
+
+    private:
+
+        /**
+         * The path to the directory from which to read the PC game data.
+         */
+        std::string input_dir_;
+
+        /**
+         * The path to the directory where to save the V-Gears data.
+         */
+        std::string output_dir_;
+
+        /**
+         * The menu.lgp file.
+         */
+        VGears::LGPArchive menu_;
+
+        /**
+         * The WINDOW.BIN file.
+         */
+        BinGZipFile window_;
+
+};

+ 457 - 0
V-Gears-Installer/include/TexFile.h

@@ -0,0 +1,457 @@
+/*
+ * Copyright (C) 2022 The V-Gears Team
+ *
+ * This file is part of V-Gears
+ *
+ * V-Gears is free software: you can redistribute it and/or modify it under
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation, version 3.0 (GPLv3) of the License.
+ *
+ * V-Gears is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#pragma once
+
+#include "common/TypeDefine.h"
+
+class TexFile{
+
+    public:
+
+        TexFile(std::string path);
+
+        ~TexFile();
+
+        /**
+         * Saves a fragment of the TEX file as a PNG file.
+         *
+         * @param[in] file_name Full path of the destination file.
+         * @param[in] x X coordinate of the image to extract from the TEX file.
+         * @param[in] y Y coordinate of the image to extract from the TEX file.
+         * @param[in] w Width of the image to extract from the TEX file.
+         * @param[in] h Height of the image to extract from the TEX file.
+         * @param[in] palette Index of the color palette to use. For non paletted files it's
+         * ignored.
+         */
+        void SavePng(
+          std::string file_name, unsigned int x, unsigned int y, unsigned int w, unsigned int h,
+          unsigned int palette = 0
+        );
+
+        /**
+         * Saves the TEX file as a PNG file.
+         *
+         * @param[in] file_name Full path of the destination file.
+         * @param[in] palette Index of the color palette to use. For non paletted files it's
+         * ignored.
+         */
+        void SavePng(std::string file_name, unsigned int palette = 0);
+
+        /**
+         * Saves two fragments of the TEX file as a single PNG image.
+         *
+         * The second fragment will be at the right of the first one. They must have the same
+         * height.
+         *
+         * @param[in] file_name Full path of the destination file.
+         * @param[in] x1 X coordinate of the first image to extract from the TEX file.
+         * @param[in] x2 X coordinate of the second image to extract from the TEX file.
+         * @param[in] y1 Y coordinate of the first image to extract from the TEX file.
+         * @param[in] y2 Y coordinate of the first image to extract from the TEX file.
+         * @param[in] w1 Width of the first image to extract from the TEX file.
+         * @param[in] w2 Width of the second image to extract from the TEX file.
+         * @param[in] h Height of the images to extract from the TEX file.
+         * @param[in] palette Index of the color palette to use. For non paletted files it's
+         * ignored.
+         */
+        void SavePng(
+          std::string file_name, unsigned int x1, unsigned int x2, unsigned int y1, unsigned int y2,
+          unsigned int w1, unsigned int w2, unsigned int h, unsigned int palette
+        );
+
+    private:
+
+        // HEADER
+
+        /**
+         * File format version. Always 1. 4 bytes.
+         */
+        u32 version_;
+
+        /**
+         * Unknown data. 4 bytes.
+         */
+        u32 unknown_0_;
+
+        /**
+         * Color key flag. 4 bytes.
+         */
+        u32 colour_key_;
+
+        /**
+         * Unknown data. 4 bytes.
+         */
+        u32 unknown_1_;
+
+        /**
+         * Unknown data. 4 bytes.
+         */
+        u32 unknown_2_;
+
+        /**
+         * Minimum bits per color. 4 bytes.
+         *
+         * Ignored by V-Geas.
+         */
+        u32 min_bpc_;
+
+        /**
+         * Maximum bits per color. 4 bytes.
+         *
+         * Ignored by V-Geas.
+         */
+        u32 max_bpc_;
+
+        /**
+         * Minimum alpha bits. 4 bytes.
+         *
+         * Ignored by V-Gears.
+         */
+        u32 min_alpha_bits_;
+
+        /**
+         * Minimum alpha bits. 4 bytes.
+         *
+         * Ignored by V-Gears.
+         */
+        u32 max_alpha_bits_;
+
+        /**
+         * Minimum bits per pixel. 4 bytes.
+         *
+         * Ignored by V-Gears.
+         */
+        u32 min_bpp_;
+
+        /**
+         * Maximum bits per pixel. 4 bytes.
+         *
+         * Ignored by V-Gears.
+         */
+        u32 max_bpp_;
+
+        /**
+         * Unknown data. 4 bytes.
+         */
+        u32 unknown_3_;
+
+        /**
+         * Number of colour palettes. 4 bytes.
+         */
+        u32 palette_count_;
+
+        /**
+         * Number of colours per palette. 4 bytes.
+         */
+        u32 palette_colour_count_;
+
+        /**
+         * Bit depth. 4 Bytes.
+         *
+         * Can be ignores, always follow {@see bpp}.
+         */
+        u32 bit_depth_;
+
+        /**
+         * Image width. 4 bytes
+         */
+        u32 width_;
+
+        /**
+         * Image height. 4 bytes
+         */
+        u32 height_;
+
+        /**
+         * Pitch or bytes per row. 4 bytes.
+         *
+         * Ignored, use {@see bytes_per_pixel} * {@see width}.
+         */
+        u32 pitch_;
+
+        /**
+         * Unknown data. 4 bytes.
+         */
+        u32 unknown_4_;
+
+        /**
+         * Indicates a paletted image. 4 bytes.
+         */
+        u32 has_palette_;
+
+        /**
+         * Bits per index. 4 bytes.
+         *
+         * For paletted images only. 0 for non-paletted.
+         */
+        u32 bits_per_index_;
+
+        /**
+         * Indexed to 8 bit flag.
+         *
+         * Ignored by OG and V-Gears.
+         */
+        u32 indexed_to_8_bit_;
+
+        /**
+         * Palette size. 4 bytes.
+         *
+         * It must match {@see palette_count} * {@see colours_per_palette}.
+         */
+        u32 palette_size_;
+
+        /**
+         * Number of colours per palette. 4 bytes.
+         *
+         * Ignore, use {@see palette_colour_count}
+         */
+        u32 colours_per_palette_;
+
+        /**
+         * Runtime data.
+         *
+         * V-gears ignores it.
+         */
+        u32 run_0_;
+
+        /**
+         * Bits per pixel.
+         */
+        u32 bits_per_pixel_;
+
+        /**
+         * Bytes per pixel.
+         */
+        u32 bytes_per_pixel_;
+
+        // Pixel format 0 for non-paletted images.
+
+        /**
+         * Number of red bits.
+         */
+        u32 bits_red_;
+
+        /**
+         * Number of green bits
+         */
+        u32 bits_green_;
+
+        /**
+         * Number of blue bits
+         */
+        u32 bits_blue_;
+
+        /**
+         * Number of alpha bits
+         */
+        u32 bits_alpha_;
+
+        /**
+         * Red shift. 4 bytes.
+         */
+        u32 bitmask_red_;
+
+        /**
+         * Green bitmask. 4 bytes.
+         */
+        u32 bitmask_green_;
+
+        /**
+         * Blue bitmask. 4 bytes.
+         */
+        u32 bitmask_blue_;
+
+        /**
+         * Alpha bitmask. 4 bytes.
+         */
+        u32 bitmask_alpha_;
+
+        /**
+         * Red shift. 4 bytes.
+         */
+        u32 shift_red_;
+
+        /**
+         * Green shift. 4 bytes.
+         */
+        u32 shift_green_;
+
+        /**
+         * Blue shift. 4 bytes.
+         */
+        u32 shift_blue_;
+
+        /**
+         * Alpha shift. 4 bytes.
+         */
+        u32 shift_alpha_;
+
+        /**
+         * Red bits. Always 8. 4 bytes.
+         *
+         * Unused, use {@see bits_red}.
+         */
+        u32 bits_red_2_;
+
+        /**
+         * Green bits. Always 8. 4 bytes.
+         *
+         * Unused, use {@see bits_green}.
+         */
+        u32 bits_green_2_;
+
+        /**
+         * Blue bits. Always 8. 4 bytes.
+         *
+         * Unused, use {@see bits_blue}.
+         */
+        u32 bits_blue_2_;
+
+        /**
+         * Alpha bits. Always 8. 4 bytes.
+         *
+         * Unused, use {@see bits_alpha}.
+         */
+        u32 bits_alpha_2_;
+
+        /**
+         * Max value for red colour. 4 bytes.
+         */
+        u32 max_red_;
+
+        /**
+         * Max value for green colour. 4 bytes.
+         */
+        u32 max_green_;
+
+        /**
+         * Max value for blue colour. 4 bytes.
+         */
+        u32 max_blue_;
+
+        /**
+         * Max alpha value. 4 bytes.
+         */
+        u32 max_alpha_;
+
+        // Pixel format end.
+
+        /**
+         * Colour key array flag. 4 bytes.
+         *
+         * Indicates the presence of a color key array,
+         */
+        u32 colour_k_array_;
+
+        /**
+         * Runtime data. 4 bytes.
+         *
+         * V-Gears ignores it.
+         */
+        u32 run_1_;
+
+        /**
+         * Alpha reference value. 4 bytes.
+         *
+         * Only applies to paltted images, if the alpha value sampled from the palee is 0xFE, this
+         * value should be replaced with the reference alpha.
+         */
+        u32 ref_alpha_;
+
+        /**
+         * Runtime data. 4 bytes.
+         *
+         * V-Gears ignores it.
+         */
+        u32 run_2_;
+
+        /**
+         * Unknown data. 4 bytes.
+         */
+        u32 unknown_5_;
+
+        /**
+         * Palette index. 4 bytes.
+         *
+         * Runtime data.
+         */
+        u32 palette_index_;
+
+        /**
+         * Runtime data. 4 bytes.
+         *
+         * V-Gears ignores it.
+         */
+        u32 run_3_;
+
+        /**
+         * Runtime data. 4 bytes.
+         *
+         * V-Gears ignores it.
+         */
+        u32 run_4_;
+
+        /**
+         * Unknown data. 4 bytes.
+         */
+        u32 unknown_6_;
+
+        /**
+         * Unknown data. 4 bytes.
+         */
+        u32 unknown_7_;
+
+        /**
+         * Unknown data. 4 bytes.
+         */
+        u32 unknown_8_;
+
+        /**
+         * Unknown data. 4 bytes.
+         */
+        u32 unknown_9_;
+
+        // Palette data.
+
+        /**
+         * Palette data. 4 * {@see palette_size} bytes.
+         *
+         * Used only for paletted images. Blocks of 32-bit BGRA colour format.
+         */
+        std::vector<std::vector<Ogre::ColourValue>> palettes_;
+
+        // Pixel data.
+
+        /**
+         * Pixel data for non paletted images. {@see width} * {@see height}.
+         */
+        std::vector<Ogre::ColourValue> pixel_colour_;
+
+        /**
+         * Pixel data for paletted images. {@see width} * {@see height} * {@see bytes_per pixels}.
+         *
+         * In paletted images, every byte is a color reference in the palette. For non-paletted
+         * images, a pixel format section.
+         */
+        std::vector<u8> pixel_ref_;
+
+        // Colour key array
+
+        /**
+         * Colour key array. {@see palette_count} bytes.
+         */
+        std::vector<u8> colour_key_array_;
+};

+ 12 - 0
V-Gears-Installer/src/DataInstaller.cpp

@@ -126,6 +126,18 @@ int DataInstaller::Progress(){
             kernel_installer_->WriteSummonNames(output_dir_ + "game/summons.lua");
             kernel_installer_->ReadInitialSaveMap();
             kernel_installer_->WriteInitialSaveMap(output_dir_ + "game/initial_savemap.lua");
+
+
+
+            media_installer_ = std::make_unique<MediaDataInstaller>(input_dir_, output_dir_);
+            CreateDir("images/icons");
+            CreateDir("images/other");
+            CreateDir("images/characters");
+            CreateDir("images/fonts");
+            CreateDir("images/reels");
+            CreateDir("images/window");
+            media_installer_->InstallSprites();
+
             //exit(0);
 
             installation_state_ = SPAWN_POINTS_AND_SCALE_FACTORS_INIT;

+ 38 - 38
V-Gears-Installer/src/KernelDataInstaller.cpp

@@ -351,7 +351,7 @@ int KernelDataInstaller::ReadCharacters(){
     File characters_file = kernel_.ExtractGZip(KERNEL_BATTLE_AND_GROWTH_DATA);
     int character_count = 0;
 
-    for (int i = 0; i < 10; i ++){ // 9 characters
+    for (int i = 0; i < 11; i ++){ // 11 characters
 
         CharacterData data;
 
@@ -937,17 +937,17 @@ int KernelDataInstaller::ReadWeapons(){
         data.damage_modifier = data.damage_raw & 15; // Lower nybble.
         data.animation_index = data.model_raw >> 4; // Upper nybble.
         data.model = data.model_raw & 15; // Lower nybble.
-        if (data.equip_raw == (data.equip_raw | 0x0001)) data.equip.push_back(1);
-        if (data.equip_raw == (data.equip_raw | 0x0002)) data.equip.push_back(2);
-        if (data.equip_raw == (data.equip_raw | 0x0004)) data.equip.push_back(3);
-        if (data.equip_raw == (data.equip_raw | 0x0008)) data.equip.push_back(4);
-        if (data.equip_raw == (data.equip_raw | 0x0010)) data.equip.push_back(5);
-        if (data.equip_raw == (data.equip_raw | 0x0020)) data.equip.push_back(6);
-        if (data.equip_raw == (data.equip_raw | 0x0040)) data.equip.push_back(7);
-        if (data.equip_raw == (data.equip_raw | 0x0080)) data.equip.push_back(8);
-        if (data.equip_raw == (data.equip_raw | 0x0100)) data.equip.push_back(9);
-        if (data.equip_raw == (data.equip_raw | 0x0200)) data.equip.push_back(10);
-        if (data.equip_raw == (data.equip_raw | 0x0400)) data.equip.push_back(11);
+        if (data.equip_raw == (data.equip_raw | 0x0001)) data.equip.push_back(0);
+        if (data.equip_raw == (data.equip_raw | 0x0002)) data.equip.push_back(1);
+        if (data.equip_raw == (data.equip_raw | 0x0004)) data.equip.push_back(2);
+        if (data.equip_raw == (data.equip_raw | 0x0008)) data.equip.push_back(3);
+        if (data.equip_raw == (data.equip_raw | 0x0010)) data.equip.push_back(4);
+        if (data.equip_raw == (data.equip_raw | 0x0020)) data.equip.push_back(5);
+        if (data.equip_raw == (data.equip_raw | 0x0040)) data.equip.push_back(6);
+        if (data.equip_raw == (data.equip_raw | 0x0080)) data.equip.push_back(7);
+        if (data.equip_raw == (data.equip_raw | 0x0100)) data.equip.push_back(8);
+        if (data.equip_raw == (data.equip_raw | 0x0200)) data.equip.push_back(9);
+        if (data.equip_raw == (data.equip_raw | 0x0400)) data.equip.push_back(10);
         for (int i = 0; i < 4; i ++){
             if (data.stat_raw[i] < 0XFF && data.stat_bonus_raw[i] > 0){
                 StatBonus stat_bonus;
@@ -1136,17 +1136,17 @@ int KernelDataInstaller::ReadArmors(){
         data.sellable = !(data.restrict_raw & (1 << 0));
         data.useable_battle = !(data.restrict_raw & (2 << 0));
         data.useable_menu = !(data.restrict_raw & (4 << 0));
-        if (data.equip_raw == (data.equip_raw | 0x0001)) data.equip.push_back(1);
-        if (data.equip_raw == (data.equip_raw | 0x0002)) data.equip.push_back(2);
-        if (data.equip_raw == (data.equip_raw | 0x0004)) data.equip.push_back(3);
-        if (data.equip_raw == (data.equip_raw | 0x0008)) data.equip.push_back(4);
-        if (data.equip_raw == (data.equip_raw | 0x0010)) data.equip.push_back(5);
-        if (data.equip_raw == (data.equip_raw | 0x0020)) data.equip.push_back(6);
-        if (data.equip_raw == (data.equip_raw | 0x0040)) data.equip.push_back(7);
-        if (data.equip_raw == (data.equip_raw | 0x0080)) data.equip.push_back(8);
-        if (data.equip_raw == (data.equip_raw | 0x0100)) data.equip.push_back(9);
-        if (data.equip_raw == (data.equip_raw | 0x0200)) data.equip.push_back(10);
-        if (data.equip_raw == (data.equip_raw | 0x0400)) data.equip.push_back(11);
+        if (data.equip_raw == (data.equip_raw | 0x0001)) data.equip.push_back(0);
+        if (data.equip_raw == (data.equip_raw | 0x0002)) data.equip.push_back(1);
+        if (data.equip_raw == (data.equip_raw | 0x0004)) data.equip.push_back(2);
+        if (data.equip_raw == (data.equip_raw | 0x0008)) data.equip.push_back(3);
+        if (data.equip_raw == (data.equip_raw | 0x0010)) data.equip.push_back(4);
+        if (data.equip_raw == (data.equip_raw | 0x0020)) data.equip.push_back(5);
+        if (data.equip_raw == (data.equip_raw | 0x0040)) data.equip.push_back(6);
+        if (data.equip_raw == (data.equip_raw | 0x0080)) data.equip.push_back(7);
+        if (data.equip_raw == (data.equip_raw | 0x0100)) data.equip.push_back(8);
+        if (data.equip_raw == (data.equip_raw | 0x0200)) data.equip.push_back(9);
+        if (data.equip_raw == (data.equip_raw | 0x0400)) data.equip.push_back(10);
         for (int i = 0; i < 4; i ++){
             if (data.stat_raw[i] < 0XFF && data.stat_bonus_raw[i] > 0){
                 StatBonus stat_bonus;
@@ -1218,7 +1218,7 @@ void KernelDataInstaller::WriteArmors(std::string file_name){
           << static_cast<int>(armor.m_defense) << "},\n"
           << "    evasion = {physical = " << static_cast<int>(armor.evasion) << ", magical = "
           << static_cast<int>(armor.m_evasion) << "},\n"
-          << "    growth = " << static_cast<int>(armor.growth) << ",\n"
+          << "    growth = " << static_cast<int>(armor.growth) + 1 << ",\n"
           << "    status = {";
         if (armor.status != 0XFF) file << armor.status;
         file
@@ -1357,17 +1357,17 @@ int KernelDataInstaller::ReadAccessories(){
         if (data.status_raw == (data.status_raw | 0x20000000)) data.status.push_back(RESIST);
         if (data.status_raw == (data.status_raw | 0x40000000)) data.status.push_back(LUCKY_GIRL);
         if (data.status_raw == (data.status_raw | 0x80000000)) data.status.push_back(IMPRISONED);
-        if (data.equip_raw == (data.equip_raw | 0x0001)) data.equip.push_back(1);
-        if (data.equip_raw == (data.equip_raw | 0x0002)) data.equip.push_back(2);
-        if (data.equip_raw == (data.equip_raw | 0x0004)) data.equip.push_back(3);
-        if (data.equip_raw == (data.equip_raw | 0x0008)) data.equip.push_back(4);
-        if (data.equip_raw == (data.equip_raw | 0x0010)) data.equip.push_back(5);
-        if (data.equip_raw == (data.equip_raw | 0x0020)) data.equip.push_back(6);
-        if (data.equip_raw == (data.equip_raw | 0x0040)) data.equip.push_back(7);
-        if (data.equip_raw == (data.equip_raw | 0x0080)) data.equip.push_back(8);
-        if (data.equip_raw == (data.equip_raw | 0x0100)) data.equip.push_back(9);
-        if (data.equip_raw == (data.equip_raw | 0x0200)) data.equip.push_back(10);
-        if (data.equip_raw == (data.equip_raw | 0x0400)) data.equip.push_back(11);
+        if (data.equip_raw == (data.equip_raw | 0x0001)) data.equip.push_back(0);
+        if (data.equip_raw == (data.equip_raw | 0x0002)) data.equip.push_back(1);
+        if (data.equip_raw == (data.equip_raw | 0x0004)) data.equip.push_back(2);
+        if (data.equip_raw == (data.equip_raw | 0x0008)) data.equip.push_back(3);
+        if (data.equip_raw == (data.equip_raw | 0x0010)) data.equip.push_back(4);
+        if (data.equip_raw == (data.equip_raw | 0x0020)) data.equip.push_back(5);
+        if (data.equip_raw == (data.equip_raw | 0x0040)) data.equip.push_back(6);
+        if (data.equip_raw == (data.equip_raw | 0x0080)) data.equip.push_back(7);
+        if (data.equip_raw == (data.equip_raw | 0x0100)) data.equip.push_back(8);
+        if (data.equip_raw == (data.equip_raw | 0x0200)) data.equip.push_back(9);
+        if (data.equip_raw == (data.equip_raw | 0x0400)) data.equip.push_back(10);
         for (int i = 0; i < 2; i ++){
             if (data.stat_raw[i] < 0XFF && data.stat_bonus_raw[i] > 0){
                 StatBonus stat_bonus;
@@ -2048,7 +2048,7 @@ void KernelDataInstaller::WriteInitialSaveMap(std::string file_name){
           << character.limit_uses[1] << ", [3] = " << character.limit_uses[2] << ", [4] = 0}\n"
           << "    },\n"
           << "    weapon = {\n"
-          << "        id = " << static_cast<int>(character.weapon) << ",\n"
+          << "        id = " << static_cast<int>(character.weapon) + 128 << ",\n"
           << "        materia = {";
         total_count = 0;
         for (int m = 0; m < 8; m ++){
@@ -2063,7 +2063,7 @@ void KernelDataInstaller::WriteInitialSaveMap(std::string file_name){
         else file << "}\n    },\n";
         file
           << "    armor = {\n"
-          << "        id = " << static_cast<int>(character.armor) << ",\n"
+          << "        id = " << static_cast<int>(character.armor) + 256 << ",\n"
           << "        materia = {";
         total_count = 0;
         for (int m = 0; m < 8; m ++){
@@ -2077,7 +2077,7 @@ void KernelDataInstaller::WriteInitialSaveMap(std::string file_name){
         if (total_count > 0) file << "\n        }\n    },\n";
         else file << "}\n    },\n";
         file << "    accessory = ";
-        if (character.accessory < 0xFF) file << static_cast<int>(character.accessory);
+        if (character.accessory < 0xFF) file << static_cast<int>(character.accessory) + 287;
         else file << "nil";
         file << ",\n    status = {";
         if (character.fury) file << FURY;

+ 277 - 0
V-Gears-Installer/src/MediaDataInstaller.cpp

@@ -0,0 +1,277 @@
+/*
+ * Copyright (C) 2022 The V-Gears Team
+ *
+ * This file is part of V-Gears
+ *
+ * V-Gears is free software: you can redistribute it and/or modify it under
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation, version 3.0 (GPLv3) of the License.
+ *
+ * V-Gears is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <string>
+#include <iostream>
+#include <cstdio>
+#include <OgreDataStream.h>
+#include <OgreResourceGroupManager.h>
+#include <OgreImage.h>
+#include <OgreColourValue.h>
+#include "MediaDataInstaller.h"
+#include "data/VGearsLGPArchive.h"
+#include "data/VGearsTexFile.h"
+#include "TexFile.h"
+
+
+MediaDataInstaller::MediaDataInstaller(const std::string input_dir, const std::string output_dir):
+  input_dir_(input_dir), output_dir_(output_dir),
+  menu_(input_dir + "menu/menu_us.lgp", "LGP"), window_(input_dir + "kernel/WINDOW.BIN")
+{}
+
+MediaDataInstaller::~MediaDataInstaller(){}
+
+void MediaDataInstaller::InstallSprites(){
+    // Actually open the lgp as a file for reading
+    File menu(input_dir_ + "menu/menu_us.lgp");
+
+    // Also, open it as a LGP archive.
+    menu_.open(input_dir_ + "menu/menu_us.lgp", true);
+    menu_.load();
+
+
+    Ogre::StringVectorPtr file_list = menu_.list(true, true);
+    //std::cout << " " << file_list << " files \n";
+    VGears::LGPArchive::FileList files = menu_.GetFiles();
+
+    for (int i = 0; i < file_list->size(); i ++){
+        VGears::LGPArchive::FileEntry f = files.at(i);
+        if (
+          f.file_name != "barre.tex"
+          && f.file_name != "barre.tex"
+          && f.file_name != "bins.tex"
+          && f.file_name != "cido.tex"
+          && f.file_name != "cloud.tex"
+          && f.file_name != "earith.tex"
+          && f.file_name != "ketc.tex"
+          && f.file_name != "pcefi.tex"
+          && f.file_name != "pcloud.tex"
+          && f.file_name != "red.tex"
+          && f.file_name != "tifa.tex"
+          && f.file_name != "yufi.tex"
+          && f.file_name != "buster.tex"
+          && f.file_name != "choco.tex"
+          && f.file_name != "btl_win_c_l.tex"
+          && f.file_name != "btl_win_a_h.tex"
+          && f.file_name != "btl_win_b_h.tex"
+          && f.file_name != "btl_win_b_l.tex"
+        ){
+            continue;
+        }
+
+        // Save the TEX File
+        std::fstream out;
+        out.open(output_dir_ + "images/" + f.file_name, std::ios::out);
+        menu.SetOffset(f.data_offset);
+        for (int j = 0; j < f.data_size; j ++) out << menu.readU8();
+        out.close();
+
+        // Open the TEX file and save PNGs.
+        std::string img_dir = output_dir_ + "images/";
+        TexFile tex(output_dir_ + "images/" + f.file_name);
+        if (f.file_name == "barre.tex")
+            tex.SavePng(img_dir + "characters/1.png", 0, 0, 83, 95, 0);
+        else if (f.file_name == "bins.tex")
+            tex.SavePng(img_dir + "characters/7.png", 0, 0, 83, 95, 0);
+        else if (f.file_name == "cido.tex")
+            tex.SavePng(img_dir + "characters/8.png", 0, 0, 83, 95, 0);
+        else if (f.file_name == "cloud.tex")
+            tex.SavePng(img_dir + "characters/0.png", 0, 0, 83, 95, 0);
+        else if (f.file_name == "earith.tex")
+            tex.SavePng(img_dir + "characters/3.png", 0, 0, 83, 95, 0);
+        else if (f.file_name == "ketc.tex")
+            tex.SavePng(img_dir + "characters/6.png", 0, 0, 83, 95, 0);
+        else if (f.file_name == "pcefi.tex")
+            tex.SavePng(img_dir + "characters/10.png", 0, 0, 83, 95, 0);
+        else if (f.file_name == "pcloud.tex")
+            tex.SavePng(img_dir + "characters/9.png", 0, 0, 83, 95, 0);
+        else if (f.file_name == "red.tex")
+            tex.SavePng(img_dir + "characters/4.png", 0, 0, 83, 95, 0);
+        else if (f.file_name == "tifa.tex")
+            tex.SavePng(img_dir + "characters/2.png", 0, 0, 83, 95, 0);
+        else if (f.file_name == "yufi.tex")
+            tex.SavePng(img_dir + "characters/5.png", 0, 0, 83, 95, 0);
+        else if (f.file_name == "buster.tex")
+            tex.SavePng(img_dir + "other/begin_menu.png", 0, 0, 150, 150, 0);
+        else if (f.file_name == "choco.tex")
+            tex.SavePng(img_dir + "other/choco.png", 0, 0, 83, 95, 0);
+        else if (f.file_name == "btl_win_c_l.tex"){
+            // Weapon (no index 0), armor, accessory icons, palette 1.
+            tex.SavePng(img_dir + "icons/item_weapon_1.png", 192, 0, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/item_weapon_2.png", 224, 0, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/item_weapon_3.png", 192, 32, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/item_weapon_4.png", 224, 32, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/item_weapon_5.png", 192, 64, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/item_weapon_6.png", 224, 64, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/item_weapon_7.png", 192, 96, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/item_weapon_8.png", 224, 96, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/item_armor.png", 192, 128, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/item_accessory.png", 224, 128, 32, 32, 1);
+            // Status effects battle animations, palette 1.
+            tex.SavePng(img_dir + "icons/status_2_0.png", 128, 188, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/status_2_1.png", 160, 188, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/status_2_2.png", 192, 188, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/status_2_3.png", 224, 188, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/status_7_0.png", 128, 219, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/status_7_1.png", 160, 219, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/status_7_2.png", 192, 219, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/status_7_3.png", 224, 219, 32, 32, 1);
+            // Door arrows, palette 9.
+            tex.SavePng(img_dir + "icons/pointer_gateway_0.png", 96, 160, 18, 12, 9);
+            tex.SavePng(img_dir + "icons/pointer_gateway_1.png", 128, 160, 18, 12, 9);
+            tex.SavePng(img_dir + "icons/pointer_gateway_1.png", 160, 160, 18, 12, 9);
+            tex.SavePng(img_dir + "icons/pointer_gateway_3.png", 192, 160, 18, 12, 9);
+            tex.SavePng(img_dir + "icons/pointer_gateway_4.png", 224, 160, 18, 12, 9);
+            // Ladder arrows, palette 4.
+            tex.SavePng(img_dir + "icons/pointer_ladder_0.png", 96, 160, 18, 12, 4);
+            tex.SavePng(img_dir + "icons/pointer_ladder_1.png", 128, 160, 18, 12, 4);
+            tex.SavePng(img_dir + "icons/pointer_ladder_1.png", 160, 160, 18, 12, 4);
+            tex.SavePng(img_dir + "icons/pointer_ladder_3.png", 192, 160, 18, 12, 4);
+            tex.SavePng(img_dir + "icons/pointer_ladder_4.png", 224, 160, 18, 12, 4);
+            // Recovery word, palette 4.
+            tex.SavePng(img_dir + "icons/battle_recovery.png", 64, 64, 212, 232, 64, 36, 20, 4);
+            // Death word, palette 2.
+            tex.SavePng(img_dir + "icons/battle_death.png", 64, 192, 64, 20, 2);
+            // Window borders and corners, palette 0
+            tex.SavePng(img_dir + "window/b_t.png", 0, 192, 32, 16, 0);
+            tex.SavePng(img_dir + "window/b_b.png", 32, 208, 32, 16, 0);
+            tex.SavePng(img_dir + "window/b_l.png", 0, 224, 16, 32, 0);
+            tex.SavePng(img_dir + "window/b_r.png", 48, 224, 16, 32, 0);
+            tex.SavePng(img_dir + "window/c_tl.png", 0, 208, 16, 16, 0);
+            tex.SavePng(img_dir + "window/c_tr.png", 16, 208, 16, 16, 0);
+            tex.SavePng(img_dir + "window/c_bl.png", 32, 192, 16, 16, 0);
+            tex.SavePng(img_dir + "window/c_br.png", 48, 192, 16, 16, 0);
+        }
+        else if (f.file_name == "btl_win_a_h.tex"){
+            // Items and weapon 0, palette 1.
+            tex.SavePng(img_dir + "icons/item_item.png", 192, 223, 32, 32, 1);
+            tex.SavePng(img_dir + "icons/item_weapon_0.png", 220, 223, 32, 32, 1);
+            // Battle bar and texts, palette 1.
+            tex.SavePng(img_dir + "icons/battle_bar.png", 32, 0, 76, 18, 1);
+            tex.SavePng(img_dir + "icons/battle_limit.png", 112, 0, 48, 10, 1);
+            tex.SavePng(img_dir + "icons/battle_hp.png", 160, 0, 28, 10, 1);
+            tex.SavePng(img_dir + "icons/battle_mp.png", 192, 0, 30, 10, 1);
+            tex.SavePng(img_dir + "icons/battle_time.png", 224, 162, 0, 16, 32, 14, 10, 1);
+            tex.SavePng(img_dir + "icons/battle_barrier.png", 112, 16, 76, 10, 1);
+            tex.SavePng(img_dir + "icons/battle_wait.png", 192, 16, 44, 10, 1);
+            tex.SavePng(img_dir + "icons/battle_1.png", 130, 34, 10, 12, 1);
+            tex.SavePng(img_dir + "icons/battle_2.png", 146, 34, 10, 12, 1);
+            tex.SavePng(img_dir + "icons/battle_3.png", 162, 34, 10, 12, 1);
+            tex.SavePng(img_dir + "icons/battle_4.png", 178, 34, 10, 12, 1);
+            tex.SavePng(img_dir + "icons/battle_5.png", 194, 34, 10, 12, 1);
+            tex.SavePng(img_dir + "icons/battle_mp_needed.png", 0, 40, 80, 24, 1);
+            // Some other battle text, palette 7.
+            tex.SavePng(img_dir + "icons/battle_all.png", 240, 32, 16, 16, 7);
+            tex.SavePng(img_dir + "icons/battle_x.png", 240, 16, 16, 16, 7);
+            // No growth materia slot and linker, palette 1.
+            tex.SavePng(img_dir + "icons/materia_slot_no_growth.png", 224, 63, 24, 24, 1);
+            tex.SavePng(img_dir + "icons/materia_slot_link.png", 227, 95, 14, 24, 1);
+            // Buttons, palette 7.
+            tex.SavePng(img_dir + "icons/bt_up.png", 160, 70, 26, 20, 7);
+            tex.SavePng(img_dir + "icons/bt_down.png", 192, 70, 26, 20, 7);
+            tex.SavePng(img_dir + "icons/bt_right.png", 160, 102, 26, 20, 7);
+            tex.SavePng(img_dir + "icons/bt_left.png", 192, 102, 26, 20, 7);
+            tex.SavePng(img_dir + "icons/bt_3.png", 192, 134, 26, 20, 7);
+            tex.SavePng(img_dir + "icons/bt_2.png", 224, 134, 26, 20, 7);
+            tex.SavePng(img_dir + "icons/bt_6.png", 192, 166, 26, 20, 7);
+            tex.SavePng(img_dir + "icons/bt_8.png", 224, 166, 26, 20, 7);
+            tex.SavePng(img_dir + "icons/bt_9.png", 192, 198, 26, 20, 7);
+            tex.SavePng(img_dir + "icons/bt_10.png", 224, 198, 26, 20, 7);
+            // Crossed out cursor, palette 7.
+            tex.SavePng(img_dir + "icons/cursor_crossed.png", 80, 32, 48, 32, 7);
+            // Sound settings, palette 1.
+            tex.SavePng(img_dir + "icons/settings_music.png", 101, 131, 30, 30, 1);
+            tex.SavePng(img_dir + "icons/settings_fx.png", 133, 131, 30, 30, 1);
+        }
+        else if (f.file_name == "btl_win_b_h.tex"){
+            // Don't take cursors fom here, they don't have shadows and are too narrow.
+            // Take them from btl_win_b_l.tex
+
+            // Menu and battle text, palette 1.
+            tex.SavePng(img_dir + "icons/slash.png", 176, 0, 8, 16, 1);
+            tex.SavePng(img_dir + "icons/battle_name.png", 0, 32, 52, 10, 1);
+            tex.SavePng(img_dir + "icons/battle_status.png", 0, 48, 64, 10, 1);
+            tex.SavePng(img_dir + "icons/battle_status.png", 144, 48, 52, 10, 1);
+            // Up/Down pointers, palette 1.
+            tex.SavePng(img_dir + "icons/pointer_up.png", 198, 0, 22, 16, 1);
+            tex.SavePng(img_dir + "icons/pointer_down.png", 230, 0, 22, 16, 1);
+            // Materia slot, palette 1.
+            tex.SavePng(img_dir + "icons/materia_slot.png", 0, 95, 24, 24, 1);
+            // Materia stuff, several plettes.
+            tex.SavePng(img_dir + "icons/materia_1.png", 3, 67, 18, 18, 4);
+            tex.SavePng(img_dir + "icons/materia_2.png", 3, 67, 18, 18, 5);
+            tex.SavePng(img_dir + "icons/materia_3.png", 3, 67, 18, 18, 8);
+            tex.SavePng(img_dir + "icons/materia_4.png", 3, 67, 18, 18, 9);
+            tex.SavePng(img_dir + "icons/materia_5.png", 3, 67, 18, 18, 10);
+            tex.SavePng(img_dir + "icons/materia_star_1.png", 32, 64, 23, 26, 4);
+            tex.SavePng(img_dir + "icons/materia_star_2.png", 32, 64, 23, 26, 5);
+            tex.SavePng(img_dir + "icons/materia_star_3.png", 32, 64, 23, 26, 8);
+            tex.SavePng(img_dir + "icons/materia_star_4.png", 32, 64, 23, 26, 9);
+            tex.SavePng(img_dir + "icons/materia_star_5.png", 32, 64, 23, 26, 10);
+            tex.SavePng(img_dir + "icons/materia_star_empty_1.png", 32, 96, 23, 26, 4);
+            tex.SavePng(img_dir + "icons/materia_star_empty_2.png", 32, 96, 23, 26, 5);
+            tex.SavePng(img_dir + "icons/materia_star_empty_3.png", 32, 96, 23, 26, 8);
+            tex.SavePng(img_dir + "icons/materia_star_empty_4.png", 32, 96, 23, 26, 9);
+            tex.SavePng(img_dir + "icons/materia_star_empty_5.png", 32, 96, 23, 26, 10);
+            // Buttons, palette 7.
+            tex.SavePng(img_dir + "icons/bt_1.png", 0, 134, 26, 20, 7);
+            tex.SavePng(img_dir + "icons/bt_4.png", 32, 134, 26, 20, 7);
+            tex.SavePng(img_dir + "icons/bt_5.png", 0, 166, 26, 20, 7);
+            tex.SavePng(img_dir + "icons/bt_7.png", 32, 16, 26, 20, 7);
+            // Some other battle text, palette 7.
+            tex.SavePng(img_dir + "icons/battle_inf.png", 36, 194, 26, 14, 7);
+            // Right pointer, palette 7.
+            tex.SavePng(img_dir + "icons/pointer_right.png", 4, 16, 10, 16, 7);
+            // Battle and menu bars, palette 1.
+            tex.SavePng(img_dir + "icons/battle_bar_barriers.png", 64, 32, 76, 24, 1);
+            tex.SavePng(img_dir + "icons/menu_bar.png", 16, 16, 126, 16, 1);
+            // Fonts, save all palettes, make one default.
+            for (int p = 0; p < 16; p ++){
+                // Digits font. Default palette 7.
+                tex.SavePng(
+                  img_dir + "fonts/digits_" + std::to_string(p) + ".png", 16, 0, 156, 16, p
+                );
+                if (p == 7) tex.SavePng(img_dir + "fonts/digits.png", 16, 0, 156, 16, p);
+            }
+            for (int p = 0; p < 16; p ++){
+                // Time font. Default palette 12.
+                tex.SavePng(
+                  img_dir + "fonts/timer_" + std::to_string(p) + ".png", 32, 160, 224, 90, p
+                );
+                if (p == 12) tex.SavePng(img_dir + "fonts/timer.png", 32, 160, 224, 90, p);
+            }
+            // Reels, palete 11.
+            tex.SavePng(img_dir + "reels/yeah.png", 64, 64, 64, 30, 11);
+            tex.SavePng(img_dir + "reels/luck.png", 64, 98, 64, 30, 11);
+            tex.SavePng(img_dir + "reels/hit.png", 128, 64, 64, 30, 11);
+            tex.SavePng(img_dir + "reels/bar.png", 128, 97, 64, 30, 11);
+            tex.SavePng(img_dir + "reels/miss.png", 192, 64, 64, 30, 11);
+            tex.SavePng(img_dir + "reels/choso.png", 192, 98, 64, 30, 11);
+
+        }
+        else if (f.file_name == "btl_win_b_l.tex"){
+            // Cursors, palette 1.
+            tex.SavePng(img_dir + "icons/cursor.png", 192, 16, 48, 32, 1);
+            tex.SavePng(img_dir + "icons/cursor_left.png", 144, 16, 48, 32, 1);
+            tex.SavePng(img_dir + "icons/pointer_position.png", 0, 192, 32, 26, 1);
+        }
+
+        // TODO: Extract arena reels from coloa.tex, colob.tex and coloc.tex
+
+        // Delete Tex file.
+        std::remove((output_dir_ + "images/" + f.file_name).c_str());
+    }
+
+}

+ 228 - 0
V-Gears-Installer/src/TexFile.cpp

@@ -0,0 +1,228 @@
+/*
+ * Copyright (C) 2022 The V-Gears Team
+ *
+ * This file is part of V-Gears
+ *
+ * V-Gears is free software: you can redistribute it and/or modify it under
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation, version 3.0 (GPLv3) of the License.
+ *
+ * V-Gears is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <string>
+#include <iostream>
+#include <OgreImage.h>
+#include <OgreColourValue.h>
+#include "common/File.h"
+#include "TexFile.h"
+
+TexFile::TexFile(std::string path){
+    File file(path);
+    version_ = file.readU32LE();
+    unknown_0_ = file.readU32LE();
+    colour_key_ = file.readU32LE();
+    unknown_1_ = file.readU32LE();
+    unknown_2_ = file.readU32LE();
+    min_bpc_ = file.readU32LE();
+    max_bpc_ = file.readU32LE();
+    min_alpha_bits_ = file.readU32LE();
+    max_alpha_bits_ = file.readU32LE();
+    min_bpp_ = file.readU32LE();
+    max_bpp_ = file.readU32LE();
+    unknown_3_ = file.readU32LE();
+    palette_count_ = file.readU32LE();
+    palette_colour_count_ = file.readU32LE();
+    bit_depth_ = file.readU32LE();
+    width_ = file.readU32LE();
+    height_ = file.readU32LE();
+    pitch_ = file.readU32LE();
+    unknown_4_ = file.readU32LE();
+    has_palette_ = file.readU32LE();
+    bits_per_index_ = file.readU32LE();
+    indexed_to_8_bit_ = file.readU32LE();
+    palette_size_ = file.readU32LE();
+    colours_per_palette_ = file.readU32LE();
+    run_0_ = file.readU32LE();
+    bits_per_pixel_ = file.readU32LE();
+    bytes_per_pixel_ = file.readU32LE();
+    bits_red_ = file.readU32LE();
+    bits_green_ = file.readU32LE();
+    bits_blue_ = file.readU32LE();
+    bits_alpha_ = file.readU32LE();
+    bitmask_red_ = file.readU32LE();
+    bitmask_green_ = file.readU32LE();
+    bitmask_blue_ = file.readU32LE();
+    bitmask_alpha_ = file.readU32LE();
+    shift_red_ = file.readU32LE();
+    shift_green_ = file.readU32LE();
+    shift_blue_ = file.readU32LE();
+    shift_alpha_ = file.readU32LE();
+    bits_red_2_ = file.readU32LE();
+    bits_green_2_ = file.readU32LE();
+    bits_blue_2_ = file.readU32LE();
+    bits_alpha_2_ = file.readU32LE();
+    max_red_ = file.readU32LE();
+    max_green_ = file.readU32LE();
+    max_blue_ = file.readU32LE();
+    max_alpha_ = file.readU32LE();
+    colour_k_array_ = file.readU32LE();
+    run_1_ = file.readU32LE();
+    ref_alpha_ = file.readU32LE();
+    run_2_ = file.readU32LE();
+    unknown_5_ = file.readU32LE();
+    palette_index_ = file.readU32LE();
+    run_3_ = file.readU32LE();
+    run_4_ = file.readU32LE();
+    unknown_6_ = file.readU32LE();
+    unknown_7_ = file.readU32LE();
+    unknown_8_ = file.readU32LE();
+    unknown_9_ = file.readU32LE();
+    if (has_palette_ == 0){
+        // Non palleted images.
+        // Read 32 byte colours in format BGRA.
+        for (int p = 0; p < width_ * height_; p ++){
+            float b = file.readU8() / 255.0f;
+            float g = file.readU8() / 255.0f;
+            float r = file.readU8() / 255.0f;
+            float a = file.readU8() / 255.0f;
+            Ogre::ColourValue colour(r, g, b, a);
+            pixel_colour_.push_back(colour);
+        }
+    }
+    else {
+        // Palleted_images.
+
+        // Read palette data.
+        for (int c = 0; c < palette_count_; c ++){
+            std::vector<Ogre::ColourValue> palette_colours;
+            for (int p = 0; p < colours_per_palette_; p ++){
+                float b = file.readU8() / 255.0f;
+                float g = file.readU8() / 255.0f;
+                float r = file.readU8() / 255.0f;
+                float a = file.readU8() / 255.0f;
+                Ogre::ColourValue colour(r, g, b, a);
+                palette_colours.push_back(colour);
+            }
+            palettes_.push_back(palette_colours);
+        }
+        // Read bytes as references to a palette colour.
+        for (int p = 0; p < width_ * height_; p ++)
+            pixel_ref_.push_back(file.readU8());
+    }
+}
+
+TexFile::~TexFile(){}
+
+void TexFile::SavePng(
+  std::string file_name, unsigned int x, unsigned int y, unsigned int w, unsigned int h,
+  unsigned int palette
+){
+    // TODO: Warn if wrong palette index.
+    Ogre::Image* image = new Ogre::Image(Ogre::PF_R8G8B8A8_UINT, w, h);
+    int target_x = 0;
+    int target_y = 0;
+    for (int c_y = y; c_y < height_ && c_y < y + h; c_y ++){
+        for (int c_x = x; c_x < width_ && c_x < x + w; c_x ++){
+            int i = (width_ * c_y) + c_x;
+            float r;
+            float g;
+            float b;
+            float a;
+            if (has_palette_ == 0){
+                r = pixel_colour_.at(i).r;
+                g = pixel_colour_.at(i).g;
+                b = pixel_colour_.at(i).b;
+                a = pixel_colour_.at(i).a;
+            }
+            else{
+                r = palettes_.at(palette).at(pixel_ref_.at(i)).r;
+                g = palettes_.at(palette).at(pixel_ref_.at(i)).g;
+                b = palettes_.at(palette).at(pixel_ref_.at(i)).b;
+                a = palettes_.at(palette).at(pixel_ref_.at(i)).a;
+            }
+            image->setColourAt(Ogre::ColourValue(r, g, b, a), target_x, target_y, 0);
+            target_x ++;
+            if (target_x >= w){
+                target_y ++;
+                target_x = 0;
+            }
+        }
+    }
+    image->save(file_name);
+}
+
+void TexFile::SavePng(std::string file_name, unsigned int palette){
+    SavePng(file_name, 0, 0, width_, height_, palette);
+}
+
+void TexFile::SavePng(
+  std::string file_name, unsigned int x1, unsigned int x2, unsigned int y1, unsigned int y2,
+  unsigned int w1, unsigned int w2, unsigned int h, unsigned int palette
+){
+    // TODO: Warn if wrong palette index.
+    Ogre::Image* image = new Ogre::Image(Ogre::PF_R8G8B8A8_UINT, w1 + w2, h);
+    int target_x = 0;
+    int target_y = 0;
+    // First image
+    for (int c_y = y1; c_y < height_ && c_y < y1 + h; c_y ++){
+        for (int c_x = x1; c_x < width_ && c_x < x1 + w1; c_x ++){
+            int i = (width_ * c_y) + c_x;
+            float r;
+            float g;
+            float b;
+            float a;
+            if (has_palette_ == 0){
+                r = pixel_colour_.at(i).r;
+                g = pixel_colour_.at(i).g;
+                b = pixel_colour_.at(i).b;
+                a = pixel_colour_.at(i).a;
+            }
+            else{
+                r = palettes_.at(palette).at(pixel_ref_.at(i)).r;
+                g = palettes_.at(palette).at(pixel_ref_.at(i)).g;
+                b = palettes_.at(palette).at(pixel_ref_.at(i)).b;
+                a = palettes_.at(palette).at(pixel_ref_.at(i)).a;
+            }
+            image->setColourAt(Ogre::ColourValue(r, g, b, a), target_x, target_y, 0);
+            target_x ++;
+            if (target_x >= w1){
+                target_y ++;
+                target_x = 0;
+            }
+        }
+    }
+    target_x = w1;
+    target_y = 0;
+    for (int c_y = y2; c_y < height_ && c_y < y2 + h; c_y ++){
+        for (int c_x = x2; c_x < width_ && c_x < x2 + w2; c_x ++){
+            int i = (width_ * c_y) + c_x;
+            float r;
+            float g;
+            float b;
+            float a;
+            if (has_palette_ == 0){
+                r = pixel_colour_.at(i).r;
+                g = pixel_colour_.at(i).g;
+                b = pixel_colour_.at(i).b;
+                a = pixel_colour_.at(i).a;
+            }
+            else{
+                r = palettes_.at(palette).at(pixel_ref_.at(i)).r;
+                g = palettes_.at(palette).at(pixel_ref_.at(i)).g;
+                b = palettes_.at(palette).at(pixel_ref_.at(i)).b;
+                a = palettes_.at(palette).at(pixel_ref_.at(i)).a;
+            }
+            image->setColourAt(Ogre::ColourValue(r, g, b, a), target_x, target_y, 0);
+            target_x ++;
+            if (target_x >= w1 + w2){
+                target_y ++;
+                target_x = w1;
+            }
+        }
+    }
+    image->save(file_name);
+}

+ 1 - 0
V-Gears/include/core/ScriptManagerBinds.h

@@ -386,6 +386,7 @@ void ScriptManager::InitBinds(){
           .def("get_height", (float(UiWidget::*)()) &UiWidget::ScriptGetHeight)
           .def("set_height", (void(UiWidget::*)(const float)) &UiWidget::ScriptSetHeight)
           .def("set_text", (void(UiWidget::*)(const char*)) &UiWidget::SetText)
+          .def("set_image", (void(UiWidget::*)(const char*)) &UiWidget::SetImage)
     ];
 
     // UI manager commands. Use to get a specific widget.

+ 8 - 1
V-Gears/include/core/UiSprite.h

@@ -75,10 +75,17 @@ class UiSprite : public UiWidget{
         /**
          * Sets the sprite image.
          *
-         * @param[in] image @todo file path or just a name?
+         * @param[in] Path to the image.
          */
         void SetImage(const Ogre::String& image);
 
+        /**
+         * Sets the sprite image.
+         *
+         * @param[in] Path to the image.
+         */
+        void SetImage(const char* image) override;
+
         /**
          * Sets the vertex shader for the sprite.
          *

+ 10 - 1
V-Gears/include/core/UiWidget.h

@@ -532,12 +532,21 @@ class UiWidget{
         /**
          * Sets the text of the widget.
          *
-         * If the widget dones't have text, it won't do anything.
+         * If the widget doesn't have text, it won't do anything.
          *
          * @param[in] Text the text to set.
          */
         virtual void SetText(const char* text);
 
+        /**
+         * Sets the text of the widget.
+         *
+         * If the widget doesn't have an image, it won't do anything.
+         *
+         * @param[in] image Path to the image.
+         */
+        virtual void SetImage(const char* image);
+
         /**
          * Retrieves the absolute width of the widget.
          *

+ 5 - 0
V-Gears/include/data/VGearsTexFile.h

@@ -516,5 +516,10 @@ namespace VGears{
              * @todo Understand and document.
              */
             static const Ogre::uint8 USE_REFERENCE_ALPHA;
+
+            /**
+             * Colour palettes in the TEXT file.
+             */
+            Palette palettes_[8];
     };
 }

+ 2 - 0
V-Gears/src/core/UiSprite.cpp

@@ -87,6 +87,8 @@ void UiSprite::SetImage(const Ogre::String& image){
     tex->setTextureName(image);
 }
 
+void UiSprite::SetImage(const char* image){SetImage(Ogre::String(image));}
+
 void UiSprite::SetVertexShader(const Ogre::String& shader){
     Ogre::Pass* pass = material_->getTechnique(0)->getPass(0);
     pass->setVertexProgram(shader, true);

+ 2 - 0
V-Gears/src/core/UiWidget.cpp

@@ -632,6 +632,8 @@ void UiWidget::SetAlpha(const float a){
 
 void UiWidget::SetText(const char* text){}
 
+void UiWidget::SetImage(const char* image){}
+
 float UiWidget::ScriptGetWidth(){return width_;}
 
 void UiWidget::ScriptSetWidth(float width){

+ 5 - 3
V-Gears/src/data/VGearsTexFile.cpp

@@ -37,9 +37,7 @@ namespace VGears{
         size_t image_pixel_count(
           header_.image_data.width * header_.image_data.height);
         image_data_.resize(image_pixel_count);
-        memset(
-          &image_data_[0], 0, image_pixel_count * sizeof(TexImageData::value_type)
-        );
+        memset(&image_data_[0], 0, image_pixel_count * sizeof(TexImageData::value_type));
 
         if (header_.palette_data.flag) ReadPalleted(input);
         else{
@@ -101,6 +99,8 @@ namespace VGears{
         }
     }
 
+    //OgreColourValue TexFile::GetPalettedPixel(unsigned int pixel_index, unsigned int palette){}
+
     MemoryDataStream* TexFile::GetPixelData() const{
         size_t data_size(
           image_data_.size() * sizeof(TexImageData::value_type)
@@ -125,6 +125,7 @@ namespace VGears{
 
     void TexFile::FlipEndian(void * pData, size_t size, size_t count) const{
 #if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+        std::cout << "FLIP ENDIAN 1\n";
         for (unsigned int index = 0; index < count; index ++)
             FlipEndian((void *)((long)pData + (index * size)), size);
 #endif
@@ -132,6 +133,7 @@ namespace VGears{
 
     void TexFile::FlipEndian(void * pData, size_t size) const{
 #if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+        std::cout << "FLIP ENDIAN 2\n";
         char swap_byte;
         for(unsigned int byteIndex = 0; byteIndex < size/2; byteIndex ++){
             swap_byte = *(char *)((long)pData + byteIndex);

+ 1 - 0
data/data/screens.xml

@@ -9,6 +9,7 @@
     <screen file_name="screens/pause_menu/pause_menu.xml" />
     <prototype file_name="screens/item_menu/prototypes.xml" />
     <screen file_name="screens/item_menu/item_menu.xml" />
+    <screen file_name="screens/equip_menu/equip_menu.xml" />
 
     <!-- Dialogs -->
     <prototype file_name="screens/dialog/prototypes.xml" />

+ 3 - 3
data/data/screens/begin_menu/begin_menu.xml

@@ -1,7 +1,7 @@
-<screen name="BeginMenu" script="screens/begin_menu/begin_menu.lua" visible="true">
+<screen name="BeginMenu" script="scripts/menu/begin_menu.lua" visible="true">
     <widget name="Container" width="368" height="240" origin_x="50%" origin_y="50%" align="center" valign="middle" scale="2.61 3" visible="true">
-        <sprite name="Sword" image="screens/images/sword.png" x="111" y="84" width="170" height="150" visible="true" />
-        <sprite name="Cursor" image="screens/images/cursor.png" x="132" y="99" width="24" height="16" visible="true">
+        <sprite name="Sword" image="images/other/begin_menu.png" x="111" y="84" width="170" height="150" visible="true" />
+        <sprite name="Cursor" image="images/icons/cursor.png" x="132" y="99" width="24" height="16" visible="true">
             <animation name="Position1" length="0" y="0:99" />
             <animation name="Position2" length="0" y="0:111" />
             <animation name="Position3" length="0" y="0:123" />

+ 1 - 1
data/data/screens/dialog/prototypes.xml

@@ -23,6 +23,6 @@
                 scissor_area="0:0 0 100% 100%,100%:50%-5 50%-5 50%+5 50%+5"
             />
         </text_area>
-        <sprite name="Cursor" image="screens/images/cursor.png" x="15" y="6" width="24" height="16" visible="false" />
+        <sprite name="Cursor" image="images/icons/cursor.png" x="15" y="6" width="24" height="16" visible="false" />
     </prototype>
 </prototypes>

+ 53 - 0
data/data/screens/equip_menu/equip_menu.xml

@@ -0,0 +1,53 @@
+<screen name="EquipMenu" script="scripts/menu/equip_menu.lua" visible="false">
+    <widget name="Container" width="425" height="240" origin_x="50%" origin_y="49%" align="center" valign="middle" scale="3 3" visible="true">
+        <widget name="Character" width="100%" height="70" visible="true">
+            <prototype name="Window"/>
+            <sprite name="Portrait" image="images/other/choco.png" x="10" y="12" width="48" height="48" visible="true" />
+            <widget name="Data" x="66" y="14" width="100%-66" height="100%-14" visible="true">
+                <prototype name="MenuCharacterData" />
+            </widget>
+            <sprite name="WpnIcon" image="images/icons/item_weapon_0.png" x="170" y="3" width="18" height="18" visible="true" />
+            <sprite name="ArmIcon" image="images/icons/item_armor.png" x="170" y="23" width="18" height="18" visible="true" />
+            <sprite name="AccIcon" image="images/icons/item_accessory.png" x="170" y="43" width="18" height="18" visible="true" />
+            <text_area name="WpnLbl" x="192" y="8" font="FFVIIFont" visible="true" />
+            <text_area name="ArmLbl" x="192" y="28" font="FFVIIFont" visible="true" />
+            <text_area name="AccLbl" x="192" y="48" font="FFVIIFont" visible="true" />
+            <sprite name="Cursor" image="images/icons/cursor.png" x="150" y="10" width="24" height="17" visible="true">
+                <animation name="Position1" length="0" y="0:10" />
+                <animation name="Position2" length="0" y="0:30" />
+                <animation name="Position3" length="0" y="0:50" />
+            </sprite>
+        </widget>
+        <widget name="Title" x="100%-86" y="0" width="86" height="24" visible="true">
+            <prototype name="Window" />
+            <text_area name="Title" x="16" y="6" text_name="EquipMenuTitle" font="FFVIIFont" visible="true" />
+        </widget>
+        <widget name="Help" x="0" y="70" width="100%" height="24" visible="true">
+            <prototype name="Window" />
+            <text_area name="Help" x="16" y="6" font="FFVIIFont" visible="true" />
+        </widget>
+        <widget name="Slots" x="0" y="94" width="260" height="60" visible="true">
+            <prototype name="Window" />
+            <text_area name="SlotsLbl" colours="0 0.8 1, 0 0.8 1, 0 0.8 1, 0 0.8 1" text_name="EquipMenuSlots" x="16" y="12" font="FFVIIFont" visible="true" />
+            <text_area name="GrowthLbl" text_name="EquipMenuGrowth" x="16" y="32" font="FFVIIFont" visible="true" colour="0 0.8 1" />
+            <text_area name="Growth1" text_name="EquipMenuGrowth1" x="80" y="32" font="FFVIIFont" visible="true" colour="0 0.8 1" />
+            <text_area name="Growth2" text_name="EquipMenuGrowth2" x="80" y="32" font="FFVIIFont" visible="false" colour="0 0.8 1" />
+            <text_area name="Growth3" text_name="EquipMenuGrowth3" x="80" y="32" font="FFVIIFont" visible="false" colour="0 0.8 1" />
+            <sprite name="Slot1" image="images/icons/materia_slot.png" x="80" y="10" width="18" height="18" visible="true"/>
+            <sprite name="Slot2" image="images/icons/materia_slot.png" x="100" y="10" width="18" height="18" visible="true"/>
+            <sprite name="Link1" image="images/icons/materia_slot_link.png" x="94" y="10" width="10" height="18" visible="true"/>
+            <sprite name="Slot3" image="images/icons/materia_slot.png" x="120" y="10" width="18" height="18" visible="true"/>
+            <sprite name="Slot4" image="images/icons/materia_slot.png" x="140" y="10" width="18" height="18" visible="true"/>
+            <sprite name="Link2" image="images/icons/materia_slot_link.png" x="134" y="10" width="10" height="18" visible="true"/>
+            <sprite name="Slot5" image="images/icons/materia_slot.png" x="160" y="10" width="18" height="18" visible="true"/>
+            <sprite name="Slot6" image="images/icons/materia_slot.png" x="180" y="10" width="18" height="18" visible="true"/>
+            <sprite name="Link3" image="images/icons/materia_slot_link.png" x="174" y="10" width="10" height="18" visible="true"/>
+            <sprite name="Slot7" image="images/icons/materia_slot.png" x="200" y="10" width="18" height="18" visible="true"/>
+            <sprite name="Slot8" image="images/icons/materia_slot.png" x="220" y="10" width="18" height="18" visible="true"/>
+            <sprite name="Link4" image="images/icons/materia_slot_link.png" x="214" y="10" width="10" height="18" visible="true"/>
+        </widget>
+        <widget name="SlotsEmpty" x="0" y="94" width="260" height="60" visible="false">
+            <prototype name="Window" />
+        </widget>
+    </widget>
+</screen>

BIN
data/data/screens/images/barret.png


BIN
data/data/screens/images/border_b.png


BIN
data/data/screens/images/border_bl.png


BIN
data/data/screens/images/border_br.png


BIN
data/data/screens/images/border_l.png


BIN
data/data/screens/images/border_r.png


BIN
data/data/screens/images/border_t.png


BIN
data/data/screens/images/border_tl.png


BIN
data/data/screens/images/border_tr.png


BIN
data/data/screens/images/buster.tex


BIN
data/data/screens/images/button_circle.png


BIN
data/data/screens/images/button_cross.png


BIN
data/data/screens/images/button_square.png


BIN
data/data/screens/images/button_triangle.png


BIN
data/data/screens/images/cloud.png


BIN
data/data/screens/images/cursor.png


BIN
data/data/screens/images/menu_bar.png


BIN
data/data/screens/images/slash.png


BIN
data/data/screens/images/sword.png


BIN
data/data/screens/images/tifa.png


BIN
data/data/screens/images/yuffie.png


+ 22 - 122
data/data/screens/item_menu/item_menu.xml

@@ -1,11 +1,11 @@
-<screen name="ItemMenu" script="screens/item_menu/item_menu.lua" visible="false">
+<screen name="ItemMenu" script="scripts/menu/item_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="ItemMenuTopBar" x="30" y="5" width="310" height="24" visible="true">
             <prototype name="Window" />
             <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="6" y="6" width="24" height="17" visible="true">
+            <sprite name="Cursor" image="images/icons/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" />
@@ -22,88 +22,88 @@
         <widget name="ItemMenuCharacters" x="30" y="53" width="155" height="182" visible="true">
             <prototype name="Window" />
             <widget name="Character1" x="0" y="0" width="100%" height="55" visible="true">
-                <sprite name="Portrait" image="screens/images/cloud.png" x="10" y="12" width="48" height="48" visible="true" />
+                <sprite name="Portrait" image="images/other/choco.png" x="10" y="12" width="48" height="48" visible="true" />
                 <widget name="Data" x="66" y="14" width="100%" height="100%" visible="true">
                     <prototype name="MenuCharacterData" />
                 </widget>
             </widget>
             <widget name="Character2" x="0" y="55" width="100%" height="55" visible="true">
-                <sprite name="Portrait" image="screens/images/cloud.png" x="10" y="12" width="48" height="48" visible="true" />
+                <sprite name="Portrait" image="images/other/choco.png" x="10" y="12" width="48" height="48" visible="true" />
                 <widget name="Data" x="66" y="14" width="100%" height="100%" visible="true">
                     <prototype name="MenuCharacterData" />
                 </widget>
             </widget>
             <widget name="Character3" x="0" y="110" width="100%" height="55" visible="true">
-                <sprite name="Portrait" image="screens/images/cloud.png" x="10" y="12" width="48" height="48" visible="true" />
+                <sprite name="Portrait" image="images/other/choco.png" x="10" y="12" width="48" height="48" visible="true" />
                 <widget name="Data" x="66" y="14" width="100%" height="100%" visible="true">
                     <prototype name="MenuCharacterData" />
                 </widget>
             </widget>
-            <sprite name="Cursor" image="screens/images/cursor.png" x="-11" y="6" width="24" height="17" visible="true">
+            <sprite name="Cursor" image="images/icons/cursor.png" x="-11" y="6" width="24" height="17" visible="true">
                 <animation name="Position1" length="0" y="0:25" />
                 <animation name="Position2" length="0" y="0:80" />
                 <animation name="Position3" length="0" y="0:135" />
             </sprite>
             <widget name="CursorMultiple" x="-11" y="0" width="24" height="150" visible="false">
-                <sprite name="Cursor1" image="screens/images/cursor.png" x="0" y="25" width="24" height="17" visible="true"/>
-                <sprite name="Cursor2" image="screens/images/cursor.png" x="0" y="80" width="24" height="17" visible="true"/>
-                <sprite name="Cursor3" image="screens/images/cursor.png" x="0" y="135" width="24" height="17" visible="true"/>
+                <sprite name="Cursor1" image="images/icons/cursor.png" x="0" y="25" width="24" height="17" visible="true"/>
+                <sprite name="Cursor2" image="images/icons/cursor.png" x="0" y="80" width="24" height="17" visible="true"/>
+                <sprite name="Cursor3" image="images/icons/cursor.png" x="0" y="135" width="24" height="17" visible="true"/>
             </widget>
         </widget>
         <widget name="ItemList" x="185" y="53" width="155" height="182" visible="true">
             <prototype name="Window" />
 
-            <sprite name="Icon0" image="screens/images/item_item.png" x="8" y="5" width="13" height="15" visible="true" />
+            <sprite name="Icon0" image="images/icons/item_item.png" x="8" y="5" width="13" height="15" visible="true" />
             <text_area name="Name0" x="30" y="6" text_name="Placeholder" font="FFVIIFont" visible="true" />
             <text_area name="Colon0" x="130" y="6" text_name="Colon" font="FFVIIFont" visible="true" />
             <text_area name="Qty0" x="135" y="6" text_name="Placeholder" font="FFVIIFont" visible="true" />
 
-            <sprite name="Icon1" image="screens/images/item_item.png" x="8" y="22" width="13" height="15" visible="true" />
+            <sprite name="Icon1" image="images/icons/item_item.png" x="8" y="22" width="13" height="15" visible="true" />
             <text_area name="Name1" x="30" y="23" text_name="Placeholder" font="FFVIIFont" visible="true" />
             <text_area name="Colon1" x="130" y="23" text_name="Colon" font="FFVIIFont" visible="true" />
             <text_area name="Qty1" x="135" y="23" text_name="Placeholder" font="FFVIIFont" visible="true" />
 
-            <sprite name="Icon2" image="screens/images/item_item.png" x="8" y="39" width="13" height="15" visible="true" />
+            <sprite name="Icon2" image="images/icons/item_item.png" x="8" y="39" width="13" height="15" visible="true" />
             <text_area name="Name2" x="30" y="40" text_name="Placeholder" font="FFVIIFont" visible="true" />
             <text_area name="Colon2" x="130" y="40" text_name="Colon" font="FFVIIFont" visible="true" />
             <text_area name="Qty2" x="135" y="40" text_name="Placeholder" font="FFVIIFont" visible="true" />
 
-            <sprite name="Icon3" image="screens/images/item_item.png" x="8" y="56" width="13" height="15" visible="true" />
+            <sprite name="Icon3" image="images/icons/item_item.png" x="8" y="56" width="13" height="15" visible="true" />
             <text_area name="Name3" x="30" y="57" text_name="Placeholder" font="FFVIIFont" visible="true" />
             <text_area name="Colon3" x="130" y="57" text_name="Colon" font="FFVIIFont" visible="true" />
             <text_area name="Qty3" x="135" y="57" text_name="Placeholder" font="FFVIIFont" visible="true" />
 
-            <sprite name="Icon4" image="screens/images/item_item.png" x="8" y="73" width="13" height="15" visible="true" />
+            <sprite name="Icon4" image="images/icons/item_item.png" x="8" y="73" width="13" height="15" visible="true" />
             <text_area name="Name4" x="30" y="74" text_name="Placeholder" font="FFVIIFont" visible="true" />
             <text_area name="Colon4" x="130" y="74" text_name="Colon" font="FFVIIFont" visible="true" />
             <text_area name="Qty4" x="135" y="74" text_name="Placeholder" font="FFVIIFont" visible="true" />
 
-            <sprite name="Icon5" image="screens/images/item_item.png" x="8" y="90" width="13" height="15" visible="true" />
+            <sprite name="Icon5" image="images/icons/item_item.png" x="8" y="90" width="13" height="15" visible="true" />
             <text_area name="Name5" x="30" y="91" text_name="Placeholder" font="FFVIIFont" visible="true" />
             <text_area name="Colon5" x="130" y="91" text_name="Colon" font="FFVIIFont" visible="true" />
             <text_area name="Qty5" x="135" y="91" text_name="Placeholder" font="FFVIIFont" visible="true" />
 
-            <sprite name="Icon6" image="screens/images/item_item.png" x="8" y="107" width="13" height="15" visible="true" />
+            <sprite name="Icon6" image="images/icons/item_item.png" x="8" y="107" width="13" height="15" visible="true" />
             <text_area name="Name6" x="30" y="108" text_name="Placeholder" font="FFVIIFont" visible="true" />
             <text_area name="Colon6" x="130" y="108" text_name="Colon" font="FFVIIFont" visible="true" />
             <text_area name="Qty6" x="135" y="108" text_name="Placeholder" font="FFVIIFont" visible="true" />
 
-            <sprite name="Icon7" image="screens/images/item_item.png" x="8" y="124" width="13" height="15" visible="true" />
+            <sprite name="Icon7" image="images/icons/item_item.png" x="8" y="124" width="13" height="15" visible="true" />
             <text_area name="Name7" x="30" y="125" text_name="Placeholder" font="FFVIIFont" visible="true" />
             <text_area name="Colon7" x="130" y="125" text_name="Colon" font="FFVIIFont" visible="true" />
             <text_area name="Qty7" x="135" y="125" text_name="Placeholder" font="FFVIIFont" visible="true" />
 
-            <sprite name="Icon8" image="screens/images/item_item.png" x="8" y="141" width="13" height="15" visible="true" />
+            <sprite name="Icon8" image="images/icons/item_item.png" x="8" y="141" width="13" height="15" visible="true" />
             <text_area name="Name8" x="30" y="142" text_name="Placeholder" font="FFVIIFont" visible="true" />
             <text_area name="Colon8" x="130" y="142" text_name="Colon" font="FFVIIFont" visible="true" />
             <text_area name="Qty8" x="135" y="142" text_name="Placeholder" font="FFVIIFont" visible="true" />
 
-            <sprite name="Icon9" image="screens/images/item_item.png" x="8" y="158" width="13" height="15" visible="true" />
+            <sprite name="Icon9" image="images/icons/item_item.png" x="8" y="158" width="13" height="15" visible="true" />
             <text_area name="Name9" x="30" y="159" text_name="Placeholder" font="FFVIIFont" visible="true" />
             <text_area name="Colon9" x="130" y="159" text_name="Colon" font="FFVIIFont" visible="true" />
             <text_area name="Qty9" x="135" y="159" text_name="Placeholder" 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="images/icons/cursor.png" x="-11" y="6" width="24" height="17" visible="true">
                 <animation name="Position1" length="0" y="0:6" />
                 <animation name="Position2" length="0" y="0:23" />
                 <animation name="Position3" length="0" y="0:40" />
@@ -128,7 +128,7 @@
             <text_area name="Order6" x="12" y="66" text_name="ItemMenuOrder6" font="FFVIIFont" visible="true" />
             <text_area name="Order7" x="12" y="78" text_name="ItemMenuOrder7" font="FFVIIFont" visible="true" />
             <text_area name="Order8" x="12" y="90" text_name="ItemMenuOrder8" font="FFVIIFont" visible="true" />
-            <sprite name="Cursor" image="screens/images/cursor.png" x="-12" y="6" width="24" height="17" visible="true">
+            <sprite name="Cursor" image="images/icons/cursor.png" x="-12" y="6" width="24" height="17" visible="true">
                 <animation name="Position1" length="0" y="0:6" />
                 <animation name="Position2" length="0" y="0:18" />
                 <animation name="Position3" length="0" y="0:30" />
@@ -162,7 +162,7 @@
             <text_area name="KeyItem8-1" x="185" y="142" text_name="Placeholder" font="FFVIIFont" visible="true" />
             <text_area name="KeyItem9-0" x="30" y="159" text_name="Placeholder" font="FFVIIFont" visible="true" />
             <text_area name="KeyItem9-1" x="185" y="159" text_name="Placeholder" 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="images/icons/cursor.png" x="-11" y="6" width="24" height="17" visible="true">
                 <animation name="Position0-0" length="0" x="0:0" y="0:6" />
                 <animation name="Position0-1" length="0" x="0:150" y="0:6" />
                 <animation name="Position1-0" length="0" x="0:0" y="0:23" />
@@ -185,105 +185,5 @@
                 <animation name="Position9-1" length="0" x="0:150" y="0:159" />
             </sprite>
         </widget>
-        <!--<widget name="Characters" x="0" 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" />
-
-            <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">
-                    <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" />
-            </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">
-                    <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" />
-            </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">
-                    <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" />
-            </widget>
-        </widget>
-
-        <widget name="Menu" x="278" y="5" width="86" 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" />
-            <text_area name="MateriaText" x="16" y="30" text_name="MainMenuMateria" font="FFVIIFont" visible="true" />
-            <text_area name="EquipText" x="16" y="42" text_name="MainMenuEquip" font="FFVIIFont" visible="true" />
-            <text_area name="StatusText" x="16" y="54" text_name="MainMenuStatus" font="FFVIIFont" visible="true" />
-            <text_area name="OrderText" x="16" y="66" text_name="MainMenuOrder" font="FFVIIFont" visible="true" />
-            <text_area name="LimitText" x="16" y="78" text_name="MainMenuLimit" font="FFVIIFont" visible="true" />
-            <text_area name="ConfigText" x="16" y="90" text_name="MainMenuConfig" font="FFVIIFont" visible="true" />
-            <text_area name="PHSText" x="16" y="102" text_name="MainMenuPHS" font="FFVIIFont" visible="true" />
-            <text_area name="SaveText" x="16" y="114" text_name="MainMenuSave" font="FFVIIFont" visible="true" />
-            <sprite name="Cursor" image="screens/images/cursor.png" x="-11" y="6" width="24" height="17" visible="true">
-                <animation name="Position1" length="0" y="0:6" />
-                <animation name="Position2" length="0" y="0:18" />
-                <animation name="Position3" length="0" y="0:30" />
-                <animation name="Position4" length="0" y="0:42" />
-                <animation name="Position5" length="0" y="0:54" />
-                <animation name="Position6" length="0" y="0:66" />
-                <animation name="Position7" length="0" y="0:78" />
-                <animation name="Position8" length="0" y="0:90" />
-                <animation name="Position9" length="0" y="0:102" />
-                <animation name="Position10" length="0" y="0:114" />
-            </sprite>
-            <animation name="Appear" length="0.3" y="0:405,0.3:5" />
-            <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">
-            <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" />
-        </widget>
-
-        <widget name="Location" x="184" 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" />
-            <animation name="Disappear" length="0.3" y="0:200,0.3:-136" />
-        </widget>-->
     </widget>
 </screen>

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

@@ -12,7 +12,7 @@
         <sprite name="HpLineShadow" x="18" y="32" width="60" 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" />
+        <sprite name="MpSlash" image="images/icons/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" />

+ 12 - 12
data/data/screens/main_menu/main_menu.xml

@@ -1,4 +1,4 @@
-<screen name="MainMenu" script="screens/main_menu/main_menu.lua" visible="false">
+<screen name="MainMenu" script="scripts/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="30" y="17" width="300" height="190" visible="true">
             <prototype name="Window" />
@@ -6,7 +6,7 @@
             <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">
+                <sprite name="Portrait" image="images/other/choco.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>
@@ -14,46 +14,46 @@
                     <prototype name="MenuCharacterData" />
                 </widget>
                 <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="NextLevelBar" image="images/icons/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" />
+                <sprite name="LimitLevelBar" image="images/icons/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" />
+                <sprite name="Portrait" image="images/other/choco.png" x="22" y="12" width="48" height="48" visible="true" />
                 <widget name="Data" x="80" y="14" width="100%" height="100%" visible="true">
                     <prototype name="MenuCharacterData" />
                 </widget>
                 <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="NextLevelBar" image="images/icons/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" />
+                <sprite name="LimitLevelBar" image="images/icons/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" />
+                <sprite name="Portrait" image="images/other/choco.png" x="22" y="12" width="48" height="48" visible="true" />
                 <widget name="Data" x="80" y="14" width="100%" height="100%" visible="true">
                     <prototype name="MenuCharacterData" />
                 </widget>
                 <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="NextLevelBar" image="images/icons/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" />
+                <sprite name="LimitLevelBar" image="images/icons/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">
+            <sprite name="Cursor" image="images/icons/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" />
@@ -72,7 +72,7 @@
             <text_area name="ConfigText" x="16" y="90" text_name="MainMenuConfig" font="FFVIIFont" visible="true" />
             <text_area name="PHSText" x="16" y="102" text_name="MainMenuPHS" font="FFVIIFont" visible="true" />
             <text_area name="SaveText" x="16" y="114" text_name="MainMenuSave" font="FFVIIFont" visible="true" />
-            <sprite name="Cursor" image="screens/images/cursor.png" x="-11" y="6" width="24" height="16" visible="true">
+            <sprite name="Cursor" image="images/icons/cursor.png" x="-11" y="6" width="24" height="16" visible="true">
                 <animation name="Position1" length="0" y="0:6" />
                 <animation name="Position2" length="0" y="0:18" />
                 <animation name="Position3" length="0" y="0:30" />

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

@@ -5,17 +5,17 @@
         <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="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" />
+        <sprite name="HpSlash" image="images/icons/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="HpLineCurrent" x="16" y="31" width="72" 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="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" />
+        <sprite name="MpSlash" image="images/icons/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="MpLineCurrent" x="16" y="41" width="72" 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>

+ 2 - 2
data/data/screens/pause_menu/pause_menu.xml

@@ -1,11 +1,11 @@
-<screen name="PauseMenu" script="screens/pause_menu/pause_menu.lua" visible="false">
+<screen name="PauseMenu" script="scripts/menu/pause_menu.lua" visible="false">
     <widget name="Menu" x="50%-195" y="50%-75" width="150" height="50" scale="3 3" visible="true">
         <prototype name="Window" />
         <text_area name="Header" x="50%" y="5" text_name="PauseMenuHeader" font="FFVIIFont" text_align="center" visible="true" />
         <text_area name="Text" x="50%" y="20" text_name="PauseMenuText" font="FFVIIFont" text_align="center" visible="true" />
         <text_area name="Yes" x="40" y="35" text_name="PauseMenuYes" font="FFVIIFont" visible="true" />
         <text_area name="No" x="90" y="35" text_name="PauseMenuNo" font="FFVIIFont" visible="true" />
-        <sprite name="Cursor" image="screens/images/cursor.png" x="15" y="35" width="24" height="16" visible="true">
+        <sprite name="Cursor" image="images/icons/cursor.png" x="15" y="35" width="24" height="16" visible="true">
             <animation name="Position1" length="0" x="0:15" />
             <animation name="Position2" length="0" x="0:65" />
         </sprite>

+ 9 - 9
data/data/screens/prototypes.xml

@@ -1,13 +1,13 @@
 <prototypes>
     <prototype name="Window">
-        <sprite name="Top" image="screens/images/border_t.png" x="8" y="0" width="100%-16" height="8" visible="true" />
-        <sprite name="Bottom" image="screens/images/border_b.png" x="8" y="100%-8" width="100%-16" height="8" visible="true" />
-        <sprite name="Left" image="screens/images/border_l.png" x="0" y="8" width="8" height="100%-16" visible="true" />
-        <sprite name="Right" image="screens/images/border_r.png" x="100%-8" y="8" width="8" height="100%-16" visible="true" />
-        <sprite name="TopLeft" image="screens/images/border_tl.png" x="0" y="0" width="8" height="8" visible="true" />
-        <sprite name="TopRight" image="screens/images/border_tr.png" x="100%-8" y="0" width="8" height="8" visible="true" />
-        <sprite name="BottomLeft" image="screens/images/border_bl.png" x="0" y="100%-8" width="8" height="8" visible="true" />
-        <sprite name="BottomRight" image="screens/images/border_br.png" x="100%-8" y="100%-8" width="8" height="8" visible="true" />
-        <sprite name="Center" x="3" y="3" width="100%-6" height="100%-6" colours="0 0 0.7,0 0 0.5,0 0 0.125,0 0 0.31" visible="true" />
+        <sprite name="Top" image="images/window/b_t.png" x="8" y="0" width="100%-16" height="8" visible="true" />
+        <sprite name="Bottom" image="images/window/b_b.png" x="8" y="100%-8" width="100%-16" height="8" visible="true" />
+        <sprite name="Left" image="images/window/b_l.png" x="0" y="8" width="8" height="100%-16" visible="true" />
+        <sprite name="Right" image="images/window/b_r.png" x="100%-8" y="8" width="8" height="100%-16" visible="true" />
+        <sprite name="TopLeft" image="images/window/c_tl.png" x="0" y="0" width="8" height="8" visible="true" />
+        <sprite name="TopRight" image="images/window/c_tr.png" x="100%-8" y="0" width="8" height="8" visible="true" />
+        <sprite name="BottomLeft" image="images/window/c_bl.png" x="0" y="100%-8" width="8" height="8" visible="true" />
+        <sprite name="BottomRight" image="images/window/c_br.png" x="100%-8" y="100%-8" width="8" height="8" visible="true" />
+        <sprite name="Center" x="3" y="2" width="100%-6" height="100%-5" colours="0 0 0.7,0 0 0.5,0 0 0.125,0 0 0.31" visible="true" />
     </prototype>
 </prototypes>

+ 1 - 1
data/data/scripts.xml

@@ -16,7 +16,7 @@
     <script file="scripts/field.lua" />
     <script file="scripts/battle.lua" />
     <script file="scripts/battle_ai.lua" />
-    <script file="screens/menu_helpers.lua" />
+    <script file="scripts/menu/menu_helpers.lua" />
 
     <!-- TODO: Debugging pourposes only -->
     <script file="scripts/debug_data.lua" />

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

@@ -8,6 +8,7 @@ Inventory.add_item(1, 4)
 Inventory.add_item(42, 3)
 Inventory.add_item(1, 4)
 Inventory.add_item(71, 4)
+Inventory.add_item(259, 2)
 Inventory.add_item(13, 2)
 Inventory.add_item(14, 4)
 Inventory.add_item(58, 3)

+ 0 - 0
data/data/screens/begin_menu/begin_menu.lua → data/data/scripts/menu/begin_menu.lua


+ 168 - 0
data/data/scripts/menu/equip_menu.lua

@@ -0,0 +1,168 @@
+if UiContainer == nil then UiContainer = {} end
+
+--- The item menu.
+UiContainer.EquipMenu = {
+
+    --- Current cursor position in the equip slots (1-3).
+    equip_position = 1,
+
+    --- Max cursor position in the equip slots.
+    equip_position_total = 3,
+
+    --- ID of the character the menu is open for.
+    char_id = -1,
+
+    --- The type of item currently being selected.
+    --
+    -- Inventory.TYPE.WEAPON, Inventory.TYPE.ARMOR, or Inventory.TYPE.ACCESSORY.
+    selecting_slot = 0,
+
+    --- Run when the menu is creaded.
+    --
+    -- It does nothing.
+    on_start = function(self)
+        return 0
+    end,
+
+    --- Handles button events.
+    --
+    -- For the current submenu, handles directional keys, enter and escape events.
+    -- @param button Pressed button string key. "Up", "Left", "Enter" and "Escape" are handled.
+    -- @param event Trigger event. Normally, "Press".
+    on_button = function(self, button, event)
+        if UiContainer.current_menu == "equip" then
+            if UiContainer.current_submenu == "" then
+                if button == "Escape" and event == "Press" then
+                    UiContainer.current_menu = "main"
+                    script:request_end_sync(Script.UI, "EquipMenu", "hide", 0)
+                elseif button == "Down" then
+                    self.equip_position = self.equip_position + 1
+                    if self.equip_position > self.equip_position_total then
+                        self.equip_position = 1
+                    end
+                    ui_manager:get_widget("EquipMenu.Container.Character.Cursor"):set_default_animation("Position" .. self.equip_position)
+                    self.populate_details(self, false)
+                elseif button == "Up" then
+                    self.equip_position = self.equip_position - 1
+                    if self.equip_position < 1 then
+                        self.equip_position = self.equip_position_total
+                    end
+                    ui_manager:get_widget("EquipMenu.Container.Character.Cursor"):set_default_animation("Position" .. self.equip_position)
+                    self.populate_details(self, false)
+                elseif button == "Enter" then
+                    if self.equip_position == 1 then
+                        self.selecting_slot = Inventory.TYPE.WEAPON
+                    elseif self.bar_position == 2 then
+                        self.selecting_slot = Inventory.TYPE.ARMOR
+                    elseif self.bar_position == 3 then
+                        self.selecting_slot = Inventory.TYPE.ACCESSORY
+                    end
+                    self.submenu_select(self)
+                else
+                    return 0
+                end
+            end
+        end
+        return 0
+    end,
+
+    --- Opens the equip menu.
+    --
+    -- Populates and updates displayed data before opening.
+    show = function(self)
+        self.char_id = UiContainer.current_character_id
+        ui_manager:get_widget("EquipMenu"):set_visible(true)
+        UiContainer.current_menu = "equip"
+        UiContainer.current_submenu = ""
+        self.equip_position = 1
+        UiContainer.populate_character_data("EquipMenu.Container.Character", Characters[self.char_id])
+        ui_manager:get_widget("EquipMenu.Container.Character.Portrait"):set_image("images/characters/" .. tostring(self.char_id) .. ".png")
+        -- TODO: Do something for chars 9 and 10
+        ui_manager:get_widget("EquipMenu.Container.Character.WpnLbl"):set_text(Game.Items[Characters[self.char_id].weapon.id].name)
+        ui_manager:get_widget("EquipMenu.Container.Character.ArmLbl"):set_text(Game.Items[Characters[self.char_id].armor.id].name)
+        if Characters[self.char_id].accessory == nil then
+            ui_manager:get_widget("EquipMenu.Container.Character.AccLbl"):set_text("")
+        else
+            ui_manager:get_widget("EquipMenu.Container.Character.AccLbl"):set_text(Game.Items[Characters[self.char_id].accessory].name)
+        end
+        self.populate_details(self, false)
+
+        --self.populate_stats(self)
+        return 0;
+    end,
+
+    --- Populated the details of the highlighted item.
+    --
+    -- @param from_list If true, data will be read from the item higlighted in the list on the
+    -- right. If false, data wil be red from the currently equipped items.
+    populate_details = function(self, from_list)
+        local type
+        local item
+        if (from_list == false) then
+            if self.equip_position == 1 then
+                type = Inventory.ITEM_TYPE.WEAPON
+                item = Game.Items[Characters[self.char_id].weapon.id]
+                ui_manager:get_widget("EquipMenu.Container.Help.Help"):set_text(Game.Items[Characters[self.char_id].weapon.id].description)
+            elseif self.equip_position == 2 then
+                type = Inventory.ITEM_TYPE.ARMOR
+                item = Game.Items[Characters[self.char_id].armor.id]
+                ui_manager:get_widget("EquipMenu.Container.Help.Help"):set_text(Game.Items[Characters[self.char_id].armor.id].description)
+            elseif self.equip_position == 3 then
+                type = Inventory.ITEM_TYPE.ACCESSORY
+                item = Game.Items[Characters[self.char_id].accessory]
+            elseif self.equip_position == 3 and Characters[self.char_id].accessory ~= nil then
+                ui_manager:get_widget("EquipMenu.Container.Help.Help"):set_text(Game.Items[Characters[self.char_id].accessory].description)
+            end
+            -- Show description
+            if item ~= nil then
+                ui_manager:get_widget("EquipMenu.Container.Help.Help"):set_text(item.description)
+            else
+                ui_manager:get_widget("EquipMenu.Container.Help.Help"):set_text("")
+            end
+            -- If accessory, hide all details and return
+            if type == Inventory.ITEM_TYPE.ACCESSORY then
+                ui_manager:get_widget("EquipMenu.Container.SlotsEmpty"):set_visible(true)
+                return 0
+            end
+            ui_manager:get_widget("EquipMenu.Container.SlotsEmpty"):set_visible(false)
+            ui_manager:get_widget("EquipMenu.Container.Slots.Growth1"):set_visible(false)
+            ui_manager:get_widget("EquipMenu.Container.Slots.Growth2"):set_visible(false)
+            ui_manager:get_widget("EquipMenu.Container.Slots.Growth3"):set_visible(false)
+            if item.growth >= 1 and item.growth <= 3 then
+                ui_manager:get_widget("EquipMenu.Container.Slots.Growth" .. item.growth):set_visible(true)
+            else
+                ui_manager:get_widget("EquipMenu.Container.Slots.Growth1"):set_visible(true)
+            end
+            for s = 1, 8 do
+                if #(item.slots) < s then
+                    ui_manager:get_widget("EquipMenu.Container.Slots.Slot" .. tostring(s)):set_visible(false)
+                else
+                    ui_manager:get_widget("EquipMenu.Container.Slots.Slot" .. tostring(s)):set_visible(true)
+                    if item.growth == 0 then
+                        ui_manager:get_widget("EquipMenu.Container.Slots.Slot" .. tostring(s)):set_image("images/icons/materia_slot_no_growth.png")
+                    else
+                        ui_manager:get_widget("EquipMenu.Container.Slots.Slot" .. tostring(s)):set_image("images/icons/materia_slot.png")
+                    end
+                end
+                if s % 2 ~= 0 then
+                    -- At every odd slot, if there is a next slot and its linked, show linker.
+                    if #(item.slots) > s  and item.slots[s] == 1 then
+                        ui_manager:get_widget("EquipMenu.Container.Slots.Link" .. tostring(math.floor(s / 2) + 1)):set_visible(true)
+                    else
+                        ui_manager:get_widget("EquipMenu.Container.Slots.Link" .. tostring(math.floor(s / 2) + 1)):set_visible(false)
+                    end
+                end
+            end
+        elseif from_list == true then
+            --TODO: Implement
+        end
+    end,
+
+    --- Hides the item menu and goes back to the main menu.
+    hide = function(self)
+        ui_manager:get_widget("EquipMenu"):set_visible(false)
+        UiContainer.current_menu = "main"
+        UiContainer.current_submenu = ""
+        return 0;
+    end,
+}

+ 21 - 0
data/data/screens/item_menu/item_menu.lua → data/data/scripts/menu/item_menu.lua

@@ -366,6 +366,7 @@ UiContainer.ItemMenu = {
             if FFVII.Party[c] ~= nil then
                 self.char_position_total = self.char_position_total + 1
                 UiContainer.populate_character_data("ItemMenu.Container.ItemMenuCharacters.Character" .. tostring(c), Characters[FFVII.Party[c]])
+                ui_manager:get_widget("ItemMenu.Container.ItemMenuCharacters.Character" .. tostring(c) .. ".Portrait"):set_image("images/characters/" .. tostring(FFVII.Party[c]) .. ".png")
             else
                 UiContainer.populate_character_data("ItemMenu.Container.ItemMenuCharacters.Character" .. tostring(c), nil)
             end
@@ -873,6 +874,7 @@ UiContainer.ItemMenu = {
                 w_qty:set_visible(false)
             else
                 local useable = Game.Items[Inventory[inventory_index].item].menu
+                local type = Game.Items[Inventory[inventory_index].item].type
                 -- TODO: Get icon.
                 w_icon:set_visible(true)
                 w_name:set_visible(true)
@@ -888,6 +890,25 @@ UiContainer.ItemMenu = {
                     w_colon:set_colour(0.6, 0.6, 0.6)
                     w_qty:set_colour(0.6, 0.6, 0.6)
                 end
+                -- Item icon
+                if type == Inventory.ITEM_TYPE.ITEM then
+                    w_icon:set_image("images/icons/item_item.png")
+                elseif type == Inventory.ITEM_TYPE.ARMOR then
+                    w_icon:set_image("images/icons/item_armor.png")
+                elseif type == Inventory.ITEM_TYPE.ACCESSORY then
+                    w_icon:set_image("images/icons/item_accessory.png")
+                elseif type == Inventory.ITEM_TYPE.WEAPON then
+                    local users = Game.Items[Inventory[inventory_index].item].users
+                    for _, v in ipairs(users) do
+                        print(Game.Items[Inventory[inventory_index].item].name .. " Users " .. tostring(v))
+                        if v >= 0 and v <= 8 then
+                            w_icon:set_image("images/icons/item_weapon_" .. v .. ".png")
+                            break;
+                        end
+                    end
+
+                end
+
                 w_name:set_text(Game.Items[Inventory[inventory_index].item].name)
                 w_qty:set_text(tostring(Inventory[inventory_index].quantity))
                 w_colon:set_text(":") -- Refresh text to apply colour.

+ 2 - 1
data/data/screens/main_menu/main_menu.lua → data/data/scripts/menu/main_menu.lua

@@ -93,7 +93,8 @@ UiContainer.MainMenu = {
                     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)
+                        UiContainer.current_character_id = FFVII.Party[self.character_position]
+                        script:request_end_sync(Script.UI, "EquipMenu", "show", 0)
                     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

+ 2 - 1
data/data/screens/menu_helpers.lua → data/data/scripts/menu/menu_helpers.lua

@@ -46,7 +46,8 @@ UiContainer.populate_character_data = function(widget, character)
 
     -- Calculate the HP and MP bar.
     local max_hp_width= ui_manager:get_widget(widget .. ".Data.HpLine"):get_width()
-    local hp_width = character.stats.hp.current * max_hp_width / character.stats.hp.base
+    local hp_width = math.floor(character.stats.hp.current * max_hp_width / character.stats.hp.base)
+    print ("HP width: " .. tostring(hp_width) .. " MAX: " .. tostring(max_hp_width))
     ui_manager:get_widget(widget .. ".Data.HpLineCurrent"):set_width(hp_width)
     local max_mp_width= ui_manager:get_widget(widget .. ".Data.MpLine"):get_width()
     local mp_width = character.stats.mp.current * max_mp_width / character.stats.mp.base

+ 0 - 0
data/data/screens/pause_menu/pause_menu.lua → data/data/scripts/menu/pause_menu.lua


+ 47 - 9
data/data/texts/english/menu.xml

@@ -1,4 +1,8 @@
 <texts>
+    <text name="Placeholder">#</text>
+
+    <text name="Colon">:</text>
+
     <text name="BeginMenuNewGame">NEW GAME</text>
     <text name="BeginMenu1">DEBUG: Battle map</text>
     <text name="BeginMenu2">DEBUG: Quick map</text>
@@ -12,7 +16,7 @@
     <text name="PauseMenuNo">No</text>
 
     <text name="MainMenuGil">Gil</text>
-    <text name="MainMenuGilAmount">     12005</text>
+    <text name="MainMenuGilAmount">123456789</text>
     <text name="MainMenuTime">Time</text>
     <text name="MainMenuHours"> 3</text>
     <text name="MainMenuMinutes">34</text>
@@ -32,18 +36,52 @@
     <text name="MainMenuPHS">PHS</text>
     <text name="MainMenuSave">Save</text>
 
-    <text name="CharacterDataName">Akari</text>
+    <text name="ItemMenuItem">Item</text>
+    <text name="ItemMenuUse">Use</text>
+    <text name="ItemMenuOrder">Order</text>
+    <text name="ItemMenuKey">Key Items</text>
+    <text name="ItemMenuStatus">Status</text>
+    <text name="ItemMenuOrder">Order</text>
+    <text name="ItemMenuLimit">Limit</text>
+    <text name="ItemMenuConfig">Config</text>
+    <text name="ItemMenuPHS">PHS</text>
+    <text name="MainMenuSave">Save</text>
+    <text name="ItemMenuOrder1">Custom</text>
+    <text name="ItemMenuOrder2">Field</text>
+    <text name="ItemMenuOrder3">Battle</text>
+    <text name="ItemMenuOrder4">Throw</text>
+    <text name="ItemMenuOrder5">Type</text>
+    <text name="ItemMenuOrder6">Name</text>
+    <text name="ItemMenuOrder7">Most</text>
+    <text name="ItemMenuOrder8">Least</text>
+
+    <text name="EquipMenuTitle">Equip</text>
+    <text name="EquipMenuSlots"> Slots:</text>
+    <text name="EquipMenuGrowth">Growth:</text>
+    <text name="EquipMenuGrowth1">Normal</text>
+    <text name="EquipMenuGrowth2">Double</text>
+    <text name="EquipMenuGrowth3">Triple</text>
+    <text name="EquipMenuAtk">        Attack:</text>
+    <text name="EquipMenuAcc">      Accuracy:</text>
+    <text name="EquipMenuDef">       Defense:</text>
+    <text name="EquipMenuEva">       Evasion:</text>
+    <text name="EquipMenuMAtk"> Magic attack:</text>
+    <text name="EquipMenuMDef">Magic defense:</text>
+    <text name="EquipMenuMEva">Magic evasion:</text>
+
+
+    <text name="CharacterDataName">#Name#</text>
     <text name="CharacterDataLv">LV</text>
-    <text name="CharacterDataLvNumber">29</text>
+    <text name="CharacterDataLvNumber"> 0</text>
     <text name="CharacterDataHp">HP</text>
-    <text name="CharacterDataHpCurrent"> 184</text>
-    <text name="CharacterDataHpMax">1260</text>
+    <text name="CharacterDataHpCurrent">1234</text>
+    <text name="CharacterDataHpMax">4567</text>
     <text name="CharacterDataMp">MP</text>
-    <text name="CharacterDataMpCurrent"> 220</text>
-    <text name="CharacterDataMpMax"> 220</text>
+    <text name="CharacterDataMpCurrent"> 123</text>
+    <text name="CharacterDataMpMax"> 456</text>
     <text name="CharacterDataFury">Fury</text>
     <text name="CharacterDataSadness">Sadness</text>
-    <text name="CharacterDataNextLevel">next level</text>
-    <text name="CharacterDataLimitLevel">Limit level</text>
+    <text name="CharacterDataNextLevel">Next Lv.</text>
+    <text name="CharacterDataLimitLevel">Limit Lv.</text>
     <text name="CharacterDataLimitLevelNumber">3</text>
 </texts>