Compare commits
No commits in common. "be06c2d552bd290bfa3a6f3269922a5172bcd435" and "dd9dcdb5f6e7d4d784eb99ce05f0b5991bb23765" have entirely different histories.
be06c2d552
...
dd9dcdb5f6
14 changed files with 70 additions and 215 deletions
|
@ -129,7 +129,6 @@ add_executable(MassBuilderSaveTool WIN32
|
|||
MassManager/MassManager.cpp
|
||||
Mass/Accessory.h
|
||||
Mass/ArmourPart.h
|
||||
Mass/BulletLauncherAttachment.h
|
||||
Mass/CustomStyle.h
|
||||
Mass/Decal.h
|
||||
Mass/Joints.h
|
||||
|
@ -146,8 +145,6 @@ add_executable(MassBuilderSaveTool WIN32
|
|||
Maps/Accessories.h
|
||||
Maps/ArmourSets.h
|
||||
Maps/ArmourSlots.hpp
|
||||
Maps/BulletLauncherAttachmentStyles.hpp
|
||||
Maps/BulletLauncherSockets.hpp
|
||||
Maps/DamageTypes.hpp
|
||||
Maps/EffectColourModes.hpp
|
||||
Maps/LastMissionId.h
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
// MassBuilderSaveTool
|
||||
// Copyright (C) 2021-2022 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/>.
|
||||
|
||||
#ifdef c
|
||||
c(NotFound, "NotARealValue"_s)
|
||||
c(ActiveOne, "enuBLAttachmentStyle::NewEnumerator0"_s)
|
||||
c(ActiveOnePerSlot, "enuBLAttachmentStyle::NewEnumerator1"_s)
|
||||
c(AllEquipped, "enuBLAttachmentStyle::NewEnumerator2"_s)
|
||||
#endif
|
|
@ -1,24 +0,0 @@
|
|||
// MassBuilderSaveTool
|
||||
// Copyright (C) 2021-2022 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/>.
|
||||
|
||||
#ifdef c
|
||||
c(Auto, "None"_s)
|
||||
c(Shoulders, "Shoulder"_s)
|
||||
c(Body, "Body"_s)
|
||||
c(Backpack, "Backpack"_s)
|
||||
c(Hip, "Hip"_s)
|
||||
c(LowerLegs, "LowerLeg"_s)
|
||||
#endif
|
|
@ -28,9 +28,44 @@ using namespace Corrade;
|
|||
using namespace Magnum;
|
||||
|
||||
enum class ArmourSlot {
|
||||
#define c(enumerator, enumstr, name) enumerator,
|
||||
#include "../Maps/ArmourSlots.hpp"
|
||||
#undef c
|
||||
Face = 0,
|
||||
UpperHead = 1,
|
||||
LowerHead = 2,
|
||||
Neck = 3,
|
||||
UpperBody = 4,
|
||||
MiddleBody = 5,
|
||||
LowerBody = 6,
|
||||
FrontWaist = 7,
|
||||
LeftFrontSkirt = 8,
|
||||
RightFrontSkirt = 9,
|
||||
LeftSideSkirt = 10,
|
||||
RightSideSkirt = 11,
|
||||
LeftBackSkirt = 12,
|
||||
RightBackSkirt = 13,
|
||||
BackWaist = 14,
|
||||
LeftShoulder = 15,
|
||||
RightShoulder = 16,
|
||||
LeftUpperArm = 17,
|
||||
RightUpperArm = 18,
|
||||
LeftElbow = 19,
|
||||
RightElbow = 20,
|
||||
LeftLowerArm = 21,
|
||||
RightLowerArm = 22,
|
||||
Backpack = 23,
|
||||
LeftHand = 24,
|
||||
RightHand = 25,
|
||||
LeftUpperLeg = 26,
|
||||
RightUpperLeg = 27,
|
||||
LeftKnee = 28,
|
||||
RightKnee = 29,
|
||||
LeftLowerLeg = 30,
|
||||
RightLowerLeg = 31,
|
||||
LeftAnkle = 32,
|
||||
RightAnkle = 33,
|
||||
LeftHeel = 34,
|
||||
RightHeel = 35,
|
||||
LeftFoot = 36,
|
||||
RightFoot = 37,
|
||||
};
|
||||
|
||||
struct ArmourPart {
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
// MassBuilderSaveTool
|
||||
// Copyright (C) 2021-2022 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 <Corrade/Containers/String.h>
|
||||
|
||||
#include <Magnum/Magnum.h>
|
||||
#include <Magnum/Math/Vector3.h>
|
||||
|
||||
using namespace Corrade;
|
||||
using namespace Magnum;
|
||||
|
||||
enum class BulletLauncherAttachmentStyle {
|
||||
#define c(enumerator, enumstr) enumerator,
|
||||
#include "../Maps/BulletLauncherAttachmentStyles.hpp"
|
||||
#undef c
|
||||
};
|
||||
|
||||
enum class BulletLauncherSocket {
|
||||
#define c(enumerator, enumstr) enumerator,
|
||||
#include "../Maps/BulletLauncherSockets.hpp"
|
||||
#undef c
|
||||
};
|
||||
|
||||
struct BulletLauncherAttachment {
|
||||
BulletLauncherSocket socket = BulletLauncherSocket::Auto;
|
||||
Vector3 relativeLocation;
|
||||
Vector3 offsetLocation;
|
||||
Vector3 relativeRotation;
|
||||
Vector3 offsetRotation;
|
||||
Vector3 relativeScale;
|
||||
};
|
|
@ -98,13 +98,13 @@ void Mass::refreshValues() {
|
|||
}
|
||||
}
|
||||
|
||||
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s);
|
||||
auto unit_data = _mass->at<GenericStructProperty>("UnitData");
|
||||
if(!unit_data) {
|
||||
_state = State::Invalid;
|
||||
return;
|
||||
}
|
||||
|
||||
auto name_prop = unit_data->at<StringProperty>("Name_45_A037C5D54E53456407BDF091344529BB"_s);
|
||||
auto name_prop = unit_data->at<StringProperty>("Name_45_A037C5D54E53456407BDF091344529BB");
|
||||
|
||||
if(!name_prop) {
|
||||
_name = Containers::NullOpt;
|
||||
|
@ -139,11 +139,6 @@ void Mass::refreshValues() {
|
|||
return;
|
||||
}
|
||||
|
||||
getBulletLauncherAttachments();
|
||||
if(_state == State::Invalid) {
|
||||
return;
|
||||
}
|
||||
|
||||
getArmourCustomStyles();
|
||||
if(_state == State::Invalid) {
|
||||
return;
|
||||
|
@ -189,7 +184,7 @@ void Mass::refreshValues() {
|
|||
return;
|
||||
}
|
||||
|
||||
auto account_prop = _mass->at<StringProperty>("Account"_s);
|
||||
auto account_prop = _mass->at<StringProperty>("Account");
|
||||
if(!account_prop) {
|
||||
_state = State::Invalid;
|
||||
return;
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <Magnum/Math/Vector3.h>
|
||||
|
||||
#include "Joints.h"
|
||||
#include "BulletLauncherAttachment.h"
|
||||
#include "CustomStyle.h"
|
||||
#include "Decal.h"
|
||||
#include "Accessory.h"
|
||||
|
@ -93,11 +92,6 @@ class Mass {
|
|||
void getArmourParts();
|
||||
auto writeArmourPart(ArmourSlot slot) -> bool;
|
||||
|
||||
auto bulletLauncherAttachmentStyle() -> BulletLauncherAttachmentStyle&;
|
||||
auto bulletLauncherAttachments() -> Containers::ArrayView<BulletLauncherAttachment>;
|
||||
void getBulletLauncherAttachments();
|
||||
auto writeBulletLauncherAttachments() -> bool;
|
||||
|
||||
auto armourCustomStyles() -> Containers::ArrayView<CustomStyle>;
|
||||
void getArmourCustomStyles();
|
||||
auto writeArmourCustomStyle(UnsignedLong index) -> bool;
|
||||
|
@ -182,8 +176,6 @@ class Mass {
|
|||
struct {
|
||||
Containers::StaticArray<38, ArmourPart> parts;
|
||||
Containers::StaticArray<16, CustomStyle> customStyles;
|
||||
BulletLauncherAttachmentStyle blAttachmentStyle = BulletLauncherAttachmentStyle::NotFound;
|
||||
Containers::StaticArray<4, BulletLauncherAttachment> blAttachment;
|
||||
} _armour;
|
||||
|
||||
struct {
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#include "../UESaveFile/Types/GenericStructProperty.h"
|
||||
#include "../UESaveFile/Types/IntProperty.h"
|
||||
#include "../UESaveFile/Types/StringProperty.h"
|
||||
#include "../UESaveFile/Types/VectorStructProperty.h"
|
||||
|
||||
#include "Mass.h"
|
||||
|
||||
|
@ -163,83 +162,6 @@ auto Mass::writeArmourPart(ArmourSlot slot) -> bool {
|
|||
return true;
|
||||
}
|
||||
|
||||
auto Mass::bulletLauncherAttachmentStyle() -> BulletLauncherAttachmentStyle& {
|
||||
return _armour.blAttachmentStyle;
|
||||
}
|
||||
|
||||
auto Mass::bulletLauncherAttachments() -> Containers::ArrayView<BulletLauncherAttachment> {
|
||||
return _armour.blAttachment;
|
||||
}
|
||||
|
||||
void Mass::getBulletLauncherAttachments() {
|
||||
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s);
|
||||
if(!unit_data) {
|
||||
_state = State::Invalid;
|
||||
return;
|
||||
}
|
||||
|
||||
auto attach_style_prop = _mass->at<ByteProperty>("WeaponBLAttachmentStyle_65_5943FCE8406F18D2C3F69285EB23A699"_s);
|
||||
auto attach_array = _mass->at<ArrayProperty>("WeaponBLAttachment_61_442D08F547510A4CEE1501BBAF297BA0"_s);
|
||||
|
||||
if(!attach_style_prop && !attach_array) {
|
||||
_armour.blAttachmentStyle = BulletLauncherAttachmentStyle::NotFound;
|
||||
return;
|
||||
}
|
||||
|
||||
if(attach_style_prop && !attach_array) {
|
||||
_armour.blAttachmentStyle = BulletLauncherAttachmentStyle::NotFound;
|
||||
_state = State::Invalid;
|
||||
return;
|
||||
}
|
||||
|
||||
if(attach_array->items.size() != _weapons.bulletLaunchers.size() &&
|
||||
attach_array->items.size() != _armour.blAttachment.size())
|
||||
{
|
||||
for(UnsignedInt i = 0; i < attach_array->items.size(); i++) {
|
||||
auto attachment_prop = attach_array->at<GenericStructProperty>(i);
|
||||
auto& attachment = _armour.blAttachment[i];
|
||||
|
||||
Containers::StringView socket = attachment_prop->at<StringProperty>("Socket_9_B9DBF30D4A1F0032A2BE2F8B342B35A9"_s)->value;
|
||||
#define c(enumerator, strenum) if(socket == (strenum)) { attachment.socket = BulletLauncherSocket::enumerator; } else
|
||||
#include "../Maps/BulletLauncherSockets.hpp"
|
||||
#undef c
|
||||
{
|
||||
Utility::Error{} << "Invalid BL attachment socket.";
|
||||
_state = State::Invalid;
|
||||
return;
|
||||
}
|
||||
|
||||
auto rel_loc_prop = attachment_prop->at<VectorStructProperty>("RelativeLocation_10_2F6E75DF4C40622658340E9A22D38B02"_s);
|
||||
attachment.relativeLocation = Vector3{rel_loc_prop->x, rel_loc_prop->y, rel_loc_prop->z};
|
||||
auto off_loc_prop = attachment_prop->at<VectorStructProperty>("OffsetLocation_11_F42B3DA3436948FF85752DB33722382F"_s);
|
||||
attachment.offsetLocation = Vector3{off_loc_prop->x, off_loc_prop->y, off_loc_prop->z};
|
||||
auto rel_rot_prop = attachment_prop->at<VectorStructProperty>("RelativeRotation_12_578140464621245132CFF2A2AD85E735"_s);
|
||||
attachment.relativeRotation = Vector3{rel_rot_prop->x, rel_rot_prop->y, rel_rot_prop->z};
|
||||
auto off_rot_prop = attachment_prop->at<VectorStructProperty>("OffsetRotation_13_B5980BCD47905D842D1490A1A520B064"_s);
|
||||
attachment.offsetRotation = Vector3{off_rot_prop->x, off_rot_prop->y, off_rot_prop->z};
|
||||
auto rel_scale_prop = attachment_prop->at<VectorStructProperty>("RelativeScale_16_37BC80EF42699F79533F7AA7B3094E38"_s);
|
||||
attachment.relativeScale = Vector3{rel_scale_prop->x, rel_scale_prop->y, rel_scale_prop->z};
|
||||
}
|
||||
}
|
||||
|
||||
if(attach_style_prop) {
|
||||
Containers::StringView attach_style = attach_style_prop->enumValue;
|
||||
#define c(enumerator, strenum) if(attach_style == (strenum)) { _armour.blAttachmentStyle = BulletLauncherAttachmentStyle::enumerator; } else
|
||||
#include "../Maps/BulletLauncherAttachmentStyles.hpp"
|
||||
#undef c
|
||||
{
|
||||
Utility::Error{} << "Unknown BL attachment style enumerator.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
_armour.blAttachmentStyle = BulletLauncherAttachmentStyle::ActiveOne;
|
||||
}
|
||||
}
|
||||
|
||||
auto Mass::writeBulletLauncherAttachments() -> bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto Mass::armourCustomStyles() -> Containers::ArrayView<CustomStyle> {
|
||||
return _armour.customStyles;
|
||||
}
|
||||
|
|
|
@ -29,19 +29,28 @@
|
|||
using namespace Corrade;
|
||||
using namespace Magnum;
|
||||
|
||||
#define c(enumerator, ...) enumerator,
|
||||
enum class WeaponType {
|
||||
#include "../Maps/WeaponTypes.hpp"
|
||||
Melee = 0,
|
||||
Shield = 5,
|
||||
BulletShooter = 1,
|
||||
EnergyShooter = 2,
|
||||
BulletLauncher = 3,
|
||||
EnergyLauncher = 4,
|
||||
};
|
||||
|
||||
enum class DamageType {
|
||||
#include "../Maps/DamageTypes.hpp"
|
||||
Physical = 0,
|
||||
Piercing = 1,
|
||||
Plasma = 5,
|
||||
Heat = 2,
|
||||
Freeze = 3,
|
||||
Shock = 4,
|
||||
};
|
||||
|
||||
enum class EffectColourMode {
|
||||
#include "../Maps/EffectColourModes.hpp"
|
||||
Default = 0,
|
||||
Custom = 1,
|
||||
};
|
||||
#undef c
|
||||
|
||||
struct Weapon {
|
||||
Weapon() = default;
|
||||
|
|
|
@ -185,27 +185,22 @@ void MassManager::refreshStagedMasses() {
|
|||
auto file_list = Utility::Path::list(_stagingAreaDirectory, ListFlag::SkipSpecial|ListFlag::SkipDirectories|ListFlag::SkipDotAndDotDot);
|
||||
|
||||
if(!file_list) {
|
||||
Utility::Error{} << _stagingAreaDirectory << "couldn't be opened";
|
||||
_lastError = _stagingAreaDirectory + " couldn't be opened"_s;
|
||||
return;
|
||||
}
|
||||
|
||||
auto iter = std::remove_if(file_list->begin(), file_list->end(), [](Containers::StringView file){
|
||||
return !file.hasSuffix(".sav"_s);
|
||||
return file.hasSuffix(".sav"_s);
|
||||
});
|
||||
|
||||
auto list_view = file_list->except(file_list->end() - iter);
|
||||
|
||||
Utility::Debug{} << "Scanning for staged M.A.S.S.es...";
|
||||
for(Containers::StringView file : list_view) {
|
||||
auto name = Mass::getNameFromFile(Utility::Path::join(_stagingAreaDirectory, file));
|
||||
|
||||
if(name) {
|
||||
Utility::Debug{} << "Found staged M.A.S.S.:" << *name;
|
||||
_stagedMasses[file] = *name;
|
||||
}
|
||||
else {
|
||||
Utility::Warning{} << "Skipped:" << file;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -375,11 +375,6 @@ void SaveTool::updateCheckEvent(SDL_Event& event) {
|
|||
}
|
||||
|
||||
void SaveTool::fileUpdateEvent(SDL_Event& event) {
|
||||
if(event.user.code == StagedUpdate) {
|
||||
_massManager->refreshStagedMasses();
|
||||
return;
|
||||
}
|
||||
|
||||
Containers::String filename{static_cast<char*>(event.user.data1), std::strlen(static_cast<char*>(event.user.data1)), nullptr};
|
||||
Containers::String old_filename;
|
||||
|
||||
|
@ -449,6 +444,9 @@ void SaveTool::fileUpdateEvent(SDL_Event& event) {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case StagedUpdate:
|
||||
_massManager->refreshStagedMasses();
|
||||
break;
|
||||
default:
|
||||
_queue.addToast(Toast::Type::Warning, "Unknown file action type"_s);
|
||||
}
|
||||
|
|
|
@ -161,13 +161,15 @@ class SaveTool: public Platform::Sdl2Application, public efsw::FileWatchListener
|
|||
auto drawUnsafeWidget(Functor func, Args... args) -> bool {
|
||||
GameState game_state = _gameState; // Copying the value to reduce the risk of a data race.
|
||||
if(!_unsafeMode && game_state != GameState::NotRunning) {
|
||||
ImGui::BeginDisabled();
|
||||
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.5f);
|
||||
}
|
||||
|
||||
bool result = func(std::forward<Args>(args)...);
|
||||
|
||||
if(!_unsafeMode && game_state != GameState::NotRunning) {
|
||||
ImGui::EndDisabled();
|
||||
ImGui::PopItemFlag();
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -150,7 +150,8 @@ auto SaveTool::drawRenamePopup(Containers::ArrayView<char> name_view) -> bool {
|
|||
!(len >= 6 && len <= 32) ||
|
||||
!(name_view[0] != ' ' && name_view[len - 1] != ' '))
|
||||
{
|
||||
ImGui::BeginDisabled();
|
||||
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.5f);
|
||||
}
|
||||
|
||||
if(ImGui::Button("Apply")) {
|
||||
|
@ -162,7 +163,8 @@ auto SaveTool::drawRenamePopup(Containers::ArrayView<char> name_view) -> bool {
|
|||
!(len >= 6 && len <= 32) ||
|
||||
!(name_view[0] != ' ' && name_view[len - 1] != ' '))
|
||||
{
|
||||
ImGui::EndDisabled();
|
||||
ImGui::PopItemFlag();
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
|
||||
ImGui::EndPopup();
|
||||
|
|
|
@ -117,7 +117,7 @@ void SaveTool::drawMassViewer() {
|
|||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
if(ImGui::BeginTabItem("Armour")) {
|
||||
if(ImGui::BeginTabItem("Armour parts")) {
|
||||
drawArmour();
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ void SaveTool::drawMassViewer() {
|
|||
ImGui::EndTabItem();
|
||||
}
|
||||
|
||||
if(ImGui::BeginTabItem("Weapons")) {
|
||||
if(ImGui::BeginTabItem("Weapons (WIP)")) {
|
||||
drawWeapons();
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue