-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
811 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule YRpp
updated
20 files
+18 −0 | CCToolTip.h | |
+8 −2 | CellClass.h | |
+38 −0 | CheckListClass.h | |
+42 −0 | ColorListClass.h | |
+41 −0 | ControlClass.h | |
+51 −0 | DropListClass.h | |
+57 −0 | EditClass.h | |
+95 −0 | GadgetClass.h | |
+49 −0 | GaugeClass.h | |
+30 −0 | GeneralDefinitions.h | |
+22 −114 | LinkClass.h | |
+66 −0 | ListClass.h | |
+123 −0 | Matrix3D.h | |
+69 −0 | ShapeButtonClass.h | |
+48 −0 | SliderClass.h | |
+1 −31 | Surface.h | |
+80 −0 | ThemeClass.h | |
+40 −0 | ToggleClass.h | |
+83 −0 | ToolTipManager.h | |
+41 −0 | TriColorGaugeClass.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
#include "Body.h" | ||
#include <Phobos.h> | ||
#include <Helpers/Macro.h> | ||
#include <Utilities/TemplateDef.h> | ||
#include <AnimClass.h> | ||
#include <HouseTypeClass.h> | ||
#include <HouseClass.h> | ||
#include <ScenarioClass.h> | ||
|
||
template<> const DWORD Extension<AnimTypeClass>::Canary = 0xEEEEEEEE; | ||
AnimTypeExt::ExtContainer AnimTypeExt::ExtMap; | ||
|
||
void AnimTypeExt::ExtData::LoadFromINIFile(CCINIClass* pINI) | ||
{ | ||
const char* pID = this->OwnerObject()->ID; | ||
|
||
INI_EX exINI(pINI); | ||
|
||
this->Palette.LoadFromINI(pINI, pID, "CustomPalette"); | ||
} | ||
|
||
// ============================= | ||
// container | ||
|
||
AnimTypeExt::ExtContainer::ExtContainer() : Container("AnimTypeClass") { } | ||
|
||
AnimTypeExt::ExtContainer::~ExtContainer() = default; | ||
|
||
// ============================= | ||
// load / save | ||
|
||
template <typename T> | ||
void AnimTypeExt::ExtData::Serialize(T & Stm) | ||
{ | ||
Stm | ||
.Process(this->Palette); | ||
} | ||
|
||
void AnimTypeExt::ExtData::LoadFromStream(PhobosStreamReader & Stm) | ||
{ | ||
Extension<AnimTypeClass>::LoadFromStream(Stm); | ||
this->Serialize(Stm); | ||
} | ||
|
||
void AnimTypeExt::ExtData::SaveToStream(PhobosStreamWriter & Stm) | ||
{ | ||
Extension<AnimTypeClass>::SaveToStream(Stm); | ||
this->Serialize(Stm); | ||
} | ||
|
||
// ============================= | ||
// container hooks | ||
|
||
DEFINE_HOOK(0x42784B, AnimTypeClass_CTOR, 0x5) | ||
{ | ||
GET(AnimTypeClass*, pItem, EAX); | ||
|
||
AnimTypeExt::ExtMap.FindOrAllocate(pItem); | ||
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x428EA8, AnimTypeClass_SDDTOR, 0x5) | ||
{ | ||
GET(AnimTypeClass*, pItem, ECX); | ||
|
||
AnimTypeExt::ExtMap.Remove(pItem); | ||
return 0; | ||
} | ||
|
||
DEFINE_HOOK_AGAIN(0x428970, AnimTypeClass_SaveLoad_Prefix, 0x8) | ||
DEFINE_HOOK(0x428800, AnimTypeClass_SaveLoad_Prefix, 0xA) | ||
{ | ||
GET_STACK(AnimTypeClass*, pItem, 0x4); | ||
GET_STACK(IStream*, pStm, 0x8); | ||
|
||
AnimTypeExt::ExtMap.PrepareStream(pItem, pStm); | ||
|
||
return 0; | ||
} | ||
|
||
DEFINE_HOOK_AGAIN(0x42892C, AnimTypeClass_Load_Suffix, 0x6) | ||
DEFINE_HOOK(0x428958, AnimTypeClass_Load_Suffix, 0x6) | ||
{ | ||
AnimTypeExt::ExtMap.LoadStatic(); | ||
return 0; | ||
} | ||
|
||
DEFINE_HOOK(0x42898A, AnimTypeClass_Save_Suffix, 0x3) | ||
{ | ||
AnimTypeExt::ExtMap.SaveStatic(); | ||
return 0; | ||
} | ||
|
||
DEFINE_HOOK_AGAIN(0x4287E9, AnimTypeClass_LoadFromINI, 0xA) | ||
DEFINE_HOOK(0x4287DC, AnimTypeClass_LoadFromINI, 0xA) | ||
{ | ||
GET(AnimTypeClass*, pItem, ESI); | ||
GET_STACK(CCINIClass*, pINI, 0xBC); | ||
|
||
AnimTypeExt::ExtMap.LoadFromINI(pItem, pINI); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#pragma once | ||
|
||
#include <AnimTypeClass.h> | ||
|
||
#include <Utilities/Container.h> | ||
#include <Utilities/Enum.h> | ||
#include <Utilities/Constructs.h> | ||
#include <Utilities/Template.h> | ||
|
||
class AnimClass; | ||
|
||
class AnimTypeExt | ||
{ | ||
public: | ||
using base_type = AnimTypeClass; | ||
|
||
class ExtData final : public Extension<AnimTypeClass> | ||
{ | ||
public: | ||
CustomPalette Palette; | ||
|
||
ExtData(AnimTypeClass* OwnerObject) : Extension<AnimTypeClass>(OwnerObject), | ||
Palette(CustomPalette::PaletteMode::Temperate) | ||
{ } | ||
|
||
virtual ~ExtData() = default; | ||
|
||
virtual void LoadFromINIFile(CCINIClass* pINI) override; | ||
|
||
virtual void InvalidatePointer(void* ptr, bool bRemoved) override { } | ||
|
||
virtual void LoadFromStream(PhobosStreamReader& Stm) override; | ||
virtual void SaveToStream(PhobosStreamWriter& Stm) override; | ||
|
||
private: | ||
template <typename T> | ||
void Serialize(T& Stm); | ||
}; | ||
|
||
class ExtContainer final : public Container<AnimTypeExt> | ||
{ | ||
public: | ||
ExtContainer(); | ||
~ExtContainer(); | ||
}; | ||
|
||
static ExtContainer ExtMap; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.