From dfd0d56ab0c50f819c0afc5911480550c3f48263 Mon Sep 17 00:00:00 2001 From: William JCM Date: Fri, 25 Nov 2022 16:25:56 +0100 Subject: [PATCH] Profile,SaveTool: add support for T6 materials. --- src/Profile/Profile.cpp | 54 ++++++++++++++++++++++++--- src/Profile/Profile.h | 26 ++++++++++--- src/Profile/ResourceIDs.h | 16 +++++--- src/SaveTool/SaveTool_MainManager.cpp | 16 ++++++-- 4 files changed, 92 insertions(+), 20 deletions(-) diff --git a/src/Profile/Profile.cpp b/src/Profile/Profile.cpp index 4e62fdc..03da3e5 100644 --- a/src/Profile/Profile.cpp +++ b/src/Profile/Profile.cpp @@ -126,29 +126,33 @@ void Profile::refreshValues() { _lastMissionId = prop ? prop->value : 0; LOG_INFO("Getting the materials."); - _verseSteel = getResource(PROFILE_MATERIAL, VerseSteel); - _undinium = getResource(PROFILE_MATERIAL, Undinium); - _necriumAlloy = getResource(PROFILE_MATERIAL, NecriumAlloy); - _lunarite = getResource(PROFILE_MATERIAL, Lunarite); - _asterite = getResource(PROFILE_MATERIAL, Asterite); + _verseSteel = getResource(PROFILE_MATERIAL, VerseSteel); + _undinium = getResource(PROFILE_MATERIAL, Undinium); + _necriumAlloy = getResource(PROFILE_MATERIAL, NecriumAlloy); + _lunarite = getResource(PROFILE_MATERIAL, Lunarite); + _asterite = getResource(PROFILE_MATERIAL, Asterite); + _halliteFragma = getResource(PROFILE_MATERIAL, HalliteFragma); _ednil = getResource(PROFILE_MATERIAL, Ednil); _nuflalt = getResource(PROFILE_MATERIAL, Nuflalt); _aurelene = getResource(PROFILE_MATERIAL, Aurelene); _soldus = getResource(PROFILE_MATERIAL, Soldus); _synthesisedN = getResource(PROFILE_MATERIAL, SynthesisedN); + _nanoc = getResource(PROFILE_MATERIAL, Nanoc); _alcarbonite = getResource(PROFILE_MATERIAL, Alcarbonite); _keriphene = getResource(PROFILE_MATERIAL, Keriphene); _nitinolCM = getResource(PROFILE_MATERIAL, NitinolCM); _quarkium = getResource(PROFILE_MATERIAL, Quarkium); _alterene = getResource(PROFILE_MATERIAL, Alterene); + _cosmium = getResource(PROFILE_MATERIAL, Cosmium); _mixedComposition = getResource(PROFILE_QUARK_DATA, MixedComposition); _voidResidue = getResource(PROFILE_QUARK_DATA, VoidResidue); _muscularConstruction = getResource(PROFILE_QUARK_DATA, MuscularConstruction); _mineralExoskeletology = getResource(PROFILE_QUARK_DATA, MineralExoskeletology); _carbonisedSkin = getResource(PROFILE_QUARK_DATA, CarbonisedSkin); + _isolatedVoidParticle = getResource(PROFILE_QUARK_DATA, IsolatedVoidParticle); _valid = true; } @@ -272,6 +276,16 @@ auto Profile::setAsterite(Int amount) -> bool { return setResource(PROFILE_MATERIAL, Asterite, amount); } +Int +Profile::halliteFragma() const { + return _halliteFragma; +} + +bool +Profile::setHalliteFragma(Int amount) { + return setResource(PROFILE_MATERIAL, HalliteFragma, amount); +} + auto Profile::ednil() const -> Int { return _ednil; } @@ -312,6 +326,16 @@ auto Profile::setSynthesisedN(Int amount) -> bool { return setResource(PROFILE_MATERIAL, SynthesisedN, amount); } +Int +Profile::nanoc() const { + return _nanoc; +} + +bool +Profile::setNanoc(Int amount) { + return setResource(PROFILE_MATERIAL, Nanoc, amount); +} + auto Profile::alcarbonite() const -> Int { return _alcarbonite; } @@ -352,6 +376,16 @@ auto Profile::setAlterene(Int amount) -> bool { return setResource(PROFILE_MATERIAL, Alterene, amount); } +Int +Profile::cosmium() const { + return _cosmium; +} + +bool +Profile::setCosmium(Int amount) { + return setResource(PROFILE_MATERIAL, Cosmium, amount); +} + auto Profile::mixedComposition() const -> Int { return _mixedComposition; } @@ -392,6 +426,16 @@ auto Profile::setCarbonisedSkin(Int amount) -> bool { return setResource(PROFILE_QUARK_DATA, CarbonisedSkin, amount); } +Int +Profile::isolatedVoidParticle() const { + return _isolatedVoidParticle; +} + +bool +Profile::setIsolatedVoidParticle(Int amount) { + return setResource(PROFILE_QUARK_DATA, IsolatedVoidParticle, amount); +} + auto Profile::getResource(Containers::StringView container, MaterialID id) -> Int { auto mats_prop = _profile.at(container); diff --git a/src/Profile/Profile.h b/src/Profile/Profile.h index 403a2db..eede0fd 100644 --- a/src/Profile/Profile.h +++ b/src/Profile/Profile.h @@ -78,6 +78,9 @@ class Profile { auto asterite() const -> Int; auto setAsterite(Int amount) -> bool; + Int halliteFragma() const; + bool setHalliteFragma(Int amount); + auto ednil() const -> Int; auto setEdnil(Int amount) -> bool; @@ -93,6 +96,9 @@ class Profile { auto synthesisedN() const -> Int; auto setSynthesisedN(Int amount) -> bool; + Int nanoc() const; + bool setNanoc(Int amount); + auto alcarbonite() const -> Int; auto setAlcarbonite(Int amount) -> bool; @@ -108,6 +114,9 @@ class Profile { auto alterene() const -> Int; auto setAlterene(Int amount) -> bool; + Int cosmium() const; + bool setCosmium(Int amount); + auto mixedComposition() const -> Int; auto setMixedComposition(Int amount) -> bool; @@ -123,6 +132,9 @@ class Profile { auto carbonisedSkin() const -> Int; auto setCarbonisedSkin(Int amount) -> bool; + Int isolatedVoidParticle() const; + bool setIsolatedVoidParticle(Int amount); + private: auto getResource(Containers::StringView container, MaterialID id) -> Int; auto setResource(Containers::StringView container, MaterialID id, Int amount) -> bool; @@ -139,29 +151,33 @@ class Profile { Int _storyProgress = 0; Int _lastMissionId = 0; - Int _verseSteel = 0; - Int _undinium = 0; - Int _necriumAlloy = 0; - Int _lunarite = 0; - Int _asterite = 0; + Int _verseSteel = 0; + Int _undinium = 0; + Int _necriumAlloy = 0; + Int _lunarite = 0; + Int _asterite = 0; + Int _halliteFragma = 0; Int _ednil = 0; Int _nuflalt = 0; Int _aurelene = 0; Int _soldus = 0; Int _synthesisedN = 0; + Int _nanoc = 0; Int _alcarbonite = 0; Int _keriphene = 0; Int _nitinolCM = 0; Int _quarkium = 0; Int _alterene = 0; + Int _cosmium = 0; Int _mixedComposition = 0; Int _voidResidue = 0; Int _muscularConstruction = 0; Int _mineralExoskeletology = 0; Int _carbonisedSkin = 0; + Int _isolatedVoidParticle = 0; Containers::String _account; diff --git a/src/Profile/ResourceIDs.h b/src/Profile/ResourceIDs.h index d122e23..3b03d11 100644 --- a/src/Profile/ResourceIDs.h +++ b/src/Profile/ResourceIDs.h @@ -21,27 +21,31 @@ using namespace Magnum; enum MaterialID : Int { - VerseSteel = 0xC3500, - Undinium = 0xC3501, - NecriumAlloy = 0xC3502, - Lunarite = 0xC3503, - Asterite = 0xC3504, + VerseSteel = 0xC3500, + Undinium = 0xC3501, + NecriumAlloy = 0xC3502, + Lunarite = 0xC3503, + Asterite = 0xC3504, + HalliteFragma = 0xC3505, Ednil = 0xC350A, Nuflalt = 0xC350B, Aurelene = 0xC350C, Soldus = 0xC350D, SynthesisedN = 0xC350E, + Nanoc = 0xC350F, Alcarbonite = 0xC3514, Keriphene = 0xC3515, NitinolCM = 0xC3516, Quarkium = 0xC3517, Alterene = 0xC3518, + Cosmium = 0xC3519, MixedComposition = 0xDBBA0, VoidResidue = 0xDBBA1, MuscularConstruction = 0xDBBA2, MineralExoskeletology = 0xDBBA3, - CarbonisedSkin = 0xDBBA4 + CarbonisedSkin = 0xDBBA4, + IsolatedVoidParticle = 0xDBBA5, }; diff --git a/src/SaveTool/SaveTool_MainManager.cpp b/src/SaveTool/SaveTool_MainManager.cpp index ad9d053..2f0d1c7 100644 --- a/src/SaveTool/SaveTool_MainManager.cpp +++ b/src/SaveTool/SaveTool_MainManager.cpp @@ -309,7 +309,9 @@ void SaveTool::drawResearchInventory() { drawMaterialRow("Asterite", 5, [this]{ return _currentProfile->asterite(); }, [this](Int amount){ return _currentProfile->setAsterite(amount); }); - drawUnavailableMaterialRow("Hallite fragma", 6); + drawMaterialRow("Hallite fragma", 6, + [this]{ return _currentProfile->halliteFragma(); }, + [this](Int amount){ return _currentProfile->setHalliteFragma(amount); }); drawUnavailableMaterialRow("Unnoctinium", 7); ImGui::TableNextRow(ImGuiTableRowFlags_Headers); @@ -331,7 +333,9 @@ void SaveTool::drawResearchInventory() { drawMaterialRow("Synthesized N", 5, [this]{ return _currentProfile->synthesisedN(); }, [this](Int amount){ return _currentProfile->setSynthesisedN(amount); }); - drawUnavailableMaterialRow("Nanoc", 6); + drawMaterialRow("Nanoc", 6, + [this]{ return _currentProfile->nanoc(); }, + [this](Int amount){ return _currentProfile->setNanoc(amount); }); drawUnavailableMaterialRow("Abyssillite", 7); ImGui::TableNextRow(ImGuiTableRowFlags_Headers); @@ -353,7 +357,9 @@ void SaveTool::drawResearchInventory() { drawMaterialRow("Alterene", 5, [this]{ return _currentProfile->alterene(); }, [this](Int amount){ return _currentProfile->setAlterene(amount); }); - drawUnavailableMaterialRow("Cosmium", 6); + drawMaterialRow("Cosmium", 6, + [this]{ return _currentProfile->cosmium(); }, + [this](Int amount){ return _currentProfile->setCosmium(amount); }); drawUnavailableMaterialRow("Purified quarkium", 7); ImGui::TableNextRow(ImGuiTableRowFlags_Headers); @@ -375,7 +381,9 @@ void SaveTool::drawResearchInventory() { drawMaterialRow("Carbonized skin", 5, [this]{ return _currentProfile->carbonisedSkin(); }, [this](Int amount){ return _currentProfile->setCarbonisedSkin(amount); }); - drawUnavailableMaterialRow("Isolated void particle", 6); + drawMaterialRow("Isolated void particle", 6, + [this]{ return _currentProfile->isolatedVoidParticle(); }, + [this](Int amount){ return _currentProfile->setIsolatedVoidParticle(amount); }); drawUnavailableMaterialRow("Weaponised physiology", 7); ImGui::EndTable();