Some patches and structureddata stuff.
This commit is contained in:
@ -44,6 +44,7 @@ namespace Components
|
||||
Loader::Register(new AssetHandler());
|
||||
Loader::Register(new Localization());
|
||||
Loader::Register(new MusicalTalent());
|
||||
Loader::Register(new StructuredData());
|
||||
Loader::Register(new ConnectProtocol());
|
||||
}
|
||||
|
||||
|
@ -57,4 +57,5 @@ namespace Components
|
||||
#include "Modules\AssetHandler.hpp"
|
||||
#include "Modules\Localization.hpp"
|
||||
#include "Modules\MusicalTalent.hpp"
|
||||
#include "Modules\StructuredData.hpp"
|
||||
#include "Modules\ConnectProtocol.hpp"
|
||||
|
@ -71,6 +71,7 @@ namespace Components
|
||||
|
||||
// Don't delete config files if corrupted
|
||||
Utils::Hook::Set<BYTE>(0x47DCB3, 0xEB);
|
||||
Utils::Hook::Set<BYTE>(0x4402B6, 0);
|
||||
|
||||
// hopefully allow alt-tab during game, used at least in alt-enter handling
|
||||
Utils::Hook::Set<DWORD>(0x45ACE0, 0xC301B0);
|
||||
|
32
src/Components/Modules/StructuredData.cpp
Normal file
32
src/Components/Modules/StructuredData.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
#include "STDInclude.hpp"
|
||||
|
||||
namespace Components
|
||||
{
|
||||
void StructuredData::DumpDataDef(Game::structuredDataDef_t* dataDef)
|
||||
{
|
||||
if (!dataDef || !dataDef->data) return;
|
||||
|
||||
json11::Json definition =
|
||||
json11::Json::object
|
||||
{
|
||||
{ "version", dataDef->data->version },
|
||||
//{ "enums", [ 0 ] },
|
||||
};
|
||||
|
||||
Utils::WriteFile(Utils::VA("raw/%s.json", dataDef->name), definition.dump());
|
||||
}
|
||||
|
||||
StructuredData::StructuredData()
|
||||
{
|
||||
Command::Add("dumpDataDef", [] (Command::Params params)
|
||||
{
|
||||
if (params.Length() < 2) return;
|
||||
StructuredData::DumpDataDef(Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_STRUCTUREDDATADEF, params[1]).structuredData);
|
||||
});
|
||||
}
|
||||
|
||||
StructuredData::~StructuredData()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
13
src/Components/Modules/StructuredData.hpp
Normal file
13
src/Components/Modules/StructuredData.hpp
Normal file
@ -0,0 +1,13 @@
|
||||
namespace Components
|
||||
{
|
||||
class StructuredData : public Component
|
||||
{
|
||||
public:
|
||||
StructuredData();
|
||||
~StructuredData();
|
||||
const char* GetName() { return "StructuredData"; };
|
||||
|
||||
private:
|
||||
static void DumpDataDef(Game::structuredDataDef_t* dataDef);
|
||||
};
|
||||
}
|
@ -222,13 +222,12 @@ namespace Components
|
||||
FileSystem::DeleteFile("demos", info.Name + ".dm_13.json");
|
||||
|
||||
// Reset our ui_demo_* dvars here, because the theater menu needs it.
|
||||
// Resetting them has no use, as they don't have any default value!
|
||||
Command::Execute("reset ui_demo_mapname", true);
|
||||
Command::Execute("reset ui_demo_mapname_localized", true);
|
||||
Command::Execute("reset ui_demo_gametype", true);
|
||||
Command::Execute("reset ui_demo_author", true);
|
||||
Command::Execute("reset ui_demo_length", true);
|
||||
Command::Execute("reset ui_demo_date", true);
|
||||
Dvar::Var("ui_demo_mapname").Set("");
|
||||
Dvar::Var("ui_demo_mapname_localized").Set("");
|
||||
Dvar::Var("ui_demo_gametype").Set("");
|
||||
Dvar::Var("ui_demo_length").Set("");
|
||||
Dvar::Var("ui_demo_author").Set("");
|
||||
Dvar::Var("ui_demo_date").Set("");
|
||||
|
||||
// Reload demos
|
||||
Theatre::LoadDemos();
|
||||
|
Reference in New Issue
Block a user