SaveTool: finish most of the M.A.S.S. viewer.

Some parts are very unfinished, but do work.
This commit is contained in:
Guillaume Jacquemin 2021-12-02 19:23:28 +01:00
parent fe0db983ce
commit c6de9c1940
5 changed files with 1382 additions and 242 deletions

View file

@ -126,11 +126,13 @@ add_executable(MassBuilderSaveTool WIN32
MassManager/MassManager.cpp
Mass/Mass.h
Mass/Mass.cpp
Maps/Accessories.h
Maps/ArmourSets.h
Maps/ArmourSlots.h
Maps/LastMissionId.h
Maps/StoryProgress.h
Maps/StyleNames.h
Maps/WeaponTypes.h
ToastQueue/ToastQueue.h
ToastQueue/ToastQueue.cpp
FontAwesome/IconsFontAwesome5.h

74
src/Maps/Accessories.h Normal file
View file

@ -0,0 +1,74 @@
#pragma once
// MassBuilderSaveTool
// Copyright (C) 2021 Guillaume Jacquemin
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program 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.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <map>
#include <Magnum/Types.h>
using namespace Magnum;
static const std::map<Int, const char*> accessories {
// Primitives
{1, "Cube (S)"},
{2, "Pentagon (S)"},
{3, "Hexagon (S)"},
{4, "Cylinder (S)"},
{5, "Sphere (S)"},
{6, "TriPyramid (S)"},
{7, "SquPyramid (S)"},
{8, "PenPyramid (S)"},
{9, "HexPyramid (S)"},
{10, "Cone (S)"},
{11, "SquStick (S)"},
{12, "PenStick (S)"},
{13, "HexStick (S)"},
{14, "CycStick (S)"},
{15, "Capsule (S)"},
{16, "Decal Pad 01 (S)"},
{17, "Decal Pad 02 (S)"},
{18, "Decal Pad 03 (S)"},
{19, "Decal Pad 04 (S)"},
{20, "Decal Pad 05 (S)"},
{51, "SquBevel (S)"},
{52, "TriBevel (S)"},
{53, "PenBevel (S)"},
{54, "HexBevel (S)"},
{55, "CycBevel (S)"},
{56, "RecBevel (S)"},
{57, "DaiBevel (S)"},
{58, "MonBevel (S)"},
{59, "CofBevel (S)"},
{60, "JevBevel (S)"},
{61, "SquEmboss (S)"},
{62, "TriEmboss (S)"},
{63, "PenEmboss (S)"},
{64, "HexEmboss (S)"},
{65, "CycEmboss (S)"},
{66, "RecEmboss (S)"},
{67, "DaiEmboss (S)"},
{68, "MonEmboss (S)"},
{69, "CofEmboss (S)"},
{70, "JevEmboss (S)"},
// Armours
// Components
// Connectors
};

29
src/Maps/WeaponTypes.h Normal file
View file

@ -0,0 +1,29 @@
#pragma once
// MassBuilderSaveTool
// Copyright (C) 2021 Guillaume Jacquemin
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program 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.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <string>
#include <unordered_map>
static const std::unordered_map<std::string, const char*> weapon_types{
{"enuWeaponTypes::NewEnumerator0", "Melee weapon"},
{"enuWeaponTypes::NewEnumerator5", "Shield"},
{"enuWeaponTypes::NewEnumerator1", "Bullet shooter"},
{"enuWeaponTypes::NewEnumerator2", "Energy shooter"},
{"enuWeaponTypes::NewEnumerator3", "Bullet launcher"},
{"enuWeaponTypes::NewEnumerator4", "Energy launcher"},
};

View file

@ -112,8 +112,25 @@ class SaveTool: public Platform::Sdl2Application, public efsw::FileWatchListener
void drawMassViewer();
void drawFrameInfo();
void drawJointSliders();
void drawFramePaint();
void drawCustomStyles(Containers::ArrayView<CustomStyle> styles);
void drawFrameStyles();
void drawEyeColourPicker();
void drawCustomFrameStyles();
void drawArmour();
void drawCustomArmourStyles();
void drawWeapons();
void drawWeaponEditor(Weapon& weapon);
void drawGlobalStyles();
void drawTuning();
void drawDecalEditor(Decal& decal);
void drawAccessoryEditor(Accessory& accessory, Containers::ArrayView<CustomStyle> style_view);
auto getStyleName(Int id, Containers::ArrayView<CustomStyle> view) -> const char*;
enum DCSResult {
DCS_Fail,
DCS_ResetStyle,
DCS_Save
};
auto drawCustomStyle(CustomStyle& style) -> DCSResult;
void drawAbout();
void drawGameState();

File diff suppressed because it is too large Load diff