Skip to content

Commit

Permalink
feat: patch 7 compatible (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbarrossales authored Oct 15, 2024
1 parent 7ca24b6 commit 88b11dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 39 deletions.
1 change: 1 addition & 0 deletions Lampray/Filesystem/lampTrack.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//
// Created by charles on 10/10/23.
//
#include <algorithm>
#include <filesystem>
#include "lampFS.h"
std::string Lamp::Core::FS::lampTrack::getHash(std::filesystem::path filePath) {
Expand Down
26 changes: 4 additions & 22 deletions Lampray/Parse/lampParse.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,8 @@ namespace Lamp::Core::Parse{
return false;
}

pugi::xml_node moduleNode = doc.select_node("//node[@id='ModOrder']").node();
pugi::xml_node moduleNode = doc.select_node("//node[@id='Mods']").node();
pugi::xml_node childrenNode = moduleNode.child("children");
pugi::xml_node newNode = childrenNode.append_child("node");
newNode.append_attribute("id") = "Module";
pugi::xml_node attributes = newNode.append_child("attribute");
attributes.append_attribute("id") = "UUID";
attributes.append_attribute("value") = UUID.c_str();
attributes.append_attribute("type") = "FixedString";

pugi::xml_node modsNode = doc.select_node("//node[@id='Mods']").node();
childrenNode = modsNode.child("children");

pugi::xml_node newShortDescNode = childrenNode.append_child("node");
newShortDescNode.append_attribute("id") = "ModuleShortDesc";
Expand All @@ -132,7 +123,7 @@ namespace Lamp::Core::Parse{

pugi::xml_node uuidAttrib = newShortDescNode.append_child("attribute");
uuidAttrib.append_attribute("id") = "UUID";
uuidAttrib.append_attribute("type") = "FixedString";
uuidAttrib.append_attribute("type") = "guid";
uuidAttrib.append_attribute("value") = UUID.c_str();


Expand Down Expand Up @@ -331,17 +322,8 @@ namespace Lamp::Core::Parse{

std::string UUID = mod["UUID"];

pugi::xml_node moduleNode = doc.select_node("//node[@id='ModOrder']").node();
pugi::xml_node moduleNode = doc.select_node("//node[@id='Mods']").node();
pugi::xml_node childrenNode = moduleNode.child("children");
pugi::xml_node newNode = childrenNode.append_child("node");
newNode.append_attribute("id") = "Module";
pugi::xml_node attributes = newNode.append_child("attribute");
attributes.append_attribute("id") = "UUID";
attributes.append_attribute("value") = UUID.c_str();
attributes.append_attribute("type") = "FixedString";

pugi::xml_node modsNode = doc.select_node("//node[@id='Mods']").node();
childrenNode = modsNode.child("children");

pugi::xml_node newShortDescNode = childrenNode.append_child("node");
newShortDescNode.append_attribute("id") = "ModuleShortDesc";
Expand All @@ -363,7 +345,7 @@ namespace Lamp::Core::Parse{

pugi::xml_node uuidAttrib = newShortDescNode.append_child("attribute");
uuidAttrib.append_attribute("id") = "UUID";
uuidAttrib.append_attribute("type") = "FixedString";
uuidAttrib.append_attribute("type") = "guid";
uuidAttrib.append_attribute("value") = UUID.c_str();


Expand Down
23 changes: 6 additions & 17 deletions game-data/BG3/BG3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ Lamp::Game::lampReturn Lamp::Game::BG3::preCleanUp() {
// Create the version node
pugi::xml_node version = save.append_child("version");
version.append_attribute("major").set_value(4);
version.append_attribute("minor").set_value(2);
version.append_attribute("revision").set_value(0);
version.append_attribute("build").set_value(100);
version.append_attribute("minor").set_value(7);
version.append_attribute("revision").set_value(1);
version.append_attribute("build").set_value(3);

// Create the region node
pugi::xml_node region = save.append_child("region");
Expand All @@ -159,27 +159,16 @@ Lamp::Game::lampReturn Lamp::Game::BG3::preCleanUp() {
// Create the children node
pugi::xml_node children = node.append_child("children");

// Create the ModOrder node
pugi::xml_node modOrder = children.append_child("node");
modOrder.append_attribute("id").set_value("ModOrder");

// Create the children node for ModOrder (empty in your example)
pugi::xml_node modOrderChildren = modOrder.append_child("children");

// Create the Mods node
pugi::xml_node mods = children.append_child("node");
mods.append_attribute("id").set_value("Mods");

// Create the children node for Mods (empty in your example)
pugi::xml_node modsChildren = mods.append_child("children");





Lamp::Core::lampControl::getInstance().deplopmentTracker.first = 4;
Core::Base::lampLog::getInstance().log("Cleaning modsettings.lsx", Core::Base::lampLog::warningLevel::LOG);
pugi::xml_node modOrderNode = doc.select_node("//node[@id='ModOrder']").node();
pugi::xml_node modOrderNode = doc.select_node("//node[@id='Mods']").node();
pugi::xml_node modsNode = doc.select_node("//node[@id='Mods']").node();

if (modOrderNode) {
Expand All @@ -190,7 +179,7 @@ Lamp::Game::lampReturn Lamp::Game::BG3::preCleanUp() {
modOrderNode.append_child("children");
}
} else {
return {-1, "ModOrder section not found."};
return {-1, "Mods section not found."};
}
if (modsNode) {
pugi::xml_node childrenNode = modsNode.child("children");
Expand Down Expand Up @@ -227,7 +216,7 @@ Lamp::Game::lampReturn Lamp::Game::BG3::preCleanUp() {

pugi::xml_node uuidAttrib = newShortDescNode.append_child("attribute");
uuidAttrib.append_attribute("id") = "UUID";
uuidAttrib.append_attribute("type") = "FixedString";
uuidAttrib.append_attribute("type") = "guid";
uuidAttrib.append_attribute("value") = "28ac9ce2-2aba-8cda-b3b5-6e922f71b6b8";


Expand Down

0 comments on commit 88b11dd

Please sign in to comment.