id
int64
0
877k
file_name
stringlengths
3
109
file_path
stringlengths
13
185
content
stringlengths
31
9.38M
size
int64
31
9.38M
language
stringclasses
1 value
extension
stringclasses
11 values
total_lines
int64
1
340k
avg_line_length
float64
2.18
149k
max_line_length
int64
7
2.22M
alphanum_fraction
float64
0
1
repo_name
stringlengths
6
66
repo_stars
int64
94
47.3k
repo_forks
int64
0
12k
repo_open_issues
int64
0
3.4k
repo_license
stringclasses
11 values
repo_extraction_date
stringclasses
197 values
exact_duplicates_redpajama
bool
2 classes
near_duplicates_redpajama
bool
2 classes
exact_duplicates_githubcode
bool
2 classes
exact_duplicates_stackv2
bool
1 class
exact_duplicates_stackv1
bool
2 classes
near_duplicates_githubcode
bool
2 classes
near_duplicates_stackv1
bool
2 classes
near_duplicates_stackv2
bool
1 class
1,542,223
menubase.h
VladimirMakeev_D2ModdingToolset/mss32/include/menubase.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MENUBASE_H #define MENUBASE_H #include "imagepointlist.h" #include "interffullscreen.h" #include "mqpoint.h" #include "smartptr.h" #include "taskmanagerholder.h" #include "uievent.h" #include <cstddef> namespace game { struct CDialogInterf; struct CMenuPhase; struct CSpinButtonInterf; struct String; struct CPictureInterf; struct CMenuBaseData { CMenuPhase* menuPhase; CDialogInterf* menuDialog; UiEvent uiEvent; SmartPtr<IMqImage2> transitionAnimation; CMqPoint animationCenter; }; assert_size(CMenuBaseData, 48); /** Base class for all menus. */ struct CMenuBase : public CInterfFullScreen { CMenuBaseData* menuBaseData; }; assert_size(CMenuBase, 12); assert_offset(CMenuBase, menuBaseData, 8); namespace CMenuBaseApi { struct Api { /** * Initializes CMenuBase object, sets vftable. * @param[in] thisptr pointer to existing CMenuBase object. * @param a1 meaning unknown. * @returns thisptr. */ using Constructor = CMenuBase*(__thiscall*)(CMenuBase* thisptr, CMenuPhase* menuPhase); Constructor constructor; using Destructor = void(__thiscall*)(CMenuBase* thisptr); Destructor destructor; /** Creates ui elements of specified dialog to be used in menu. */ using CreateMenu = int(__thiscall*)(CMenuBase* thisptr, const char* dialogName); CreateMenu createMenu; /** Returns CDialogInterf object. */ using GetDialogInterface = CDialogInterf*(__thiscall*)(CMenuBase* thisptr); GetDialogInterface getDialogInterface; /** Returns back to main menu and clears network logic. */ using ButtonCallback = void(__thiscall*)(CMenuBase* thisptr); ButtonCallback buttonBackCallback; /** * Creates functor for buttons of CMenuBase and its childs. * Reused from CMenuNewSkirmish. */ using CreateButtonFunctor = SmartPointer*(__stdcall*)(SmartPointer* functor, int a2, CMenuBase* menu, const ButtonCallback* callback); CreateButtonFunctor createButtonFunctor; using ListBoxDisplayCallback = void(__thiscall*)(CMenuBase* thisptr, ImagePointList* contents, const CMqRect* lineArea, int index, bool selected); using CreateListBoxDisplayFunctor = SmartPointer*(__stdcall*)(SmartPointer* functor, int a2, CMenuBase* menu, ListBoxDisplayCallback* callback); CreateListBoxDisplayFunctor createListBoxDisplayFunctor; struct ListBoxDisplayTextCallback { using Callback = void(__thiscall*)(CMenuBase* thisptr, String* string, bool, int selectedIndex); Callback callback; int unknown; }; /** * Creates functor for list box with text display. * Reused from CMenuNewSkirmish. * @param[in] functor pointer to existing functor to initialize. * @param a2 meaning unknown. * @param[in] menu * @param[in] pointer to list box display text callback. * @returns initialized functor. */ using CreateListBoxDisplayTextFunctor = SmartPointer*(__stdcall*)(SmartPointer* functor, int a2, CMenuBase* menu, const ListBoxDisplayTextCallback* callback); CreateListBoxDisplayTextFunctor createListBoxDisplayTextFunctor; /** Callback function signature for list box. */ using ListBoxCallback = void(__thiscall*)(CMenuBase* thisptr, int selectedIndex); ListBoxCallback listBoxCallback; /** * Creates functor for list box. * Reused from CMenuNewSkirmish. * @param[in] functor pointer to existing functor to initialize. * @param a2 meaning unknown. * @param[in] menu * @param[in] pointer to list box callback. * @returns initialized functor. */ using CreateListBoxFunctor = SmartPointer*(__stdcall*)(SmartPointer* functor, int a2, CMenuBase* menu, const ListBoxCallback* callback); CreateListBoxFunctor createListBoxFunctor; using SpinButtonCallback = void(__thiscall*)(CMenuBase* thisptr, CSpinButtonInterf* spinButton); /** * Creates functor for spin buttons of CMenuBase and its childs. * Reused from CMenuLobbyHost. */ using CreateSpinButtonFunctor = SmartPointer*(__stdcall*)(SmartPointer* functor, int a2, CMenuBase* menu, const SpinButtonCallback* callback); CreateSpinButtonFunctor createSpinButtonFunctor; struct PictureCallback { using Callback = void(__thiscall*)(CMenuBase* thisptr, std::uint32_t mouseButton, CPictureInterf* picture); Callback callback; int unknown; }; /** * Creates functor for picture that will handle mouse press events. * Reused from CStratInterf. We don't care if it is direct child of CInterface or not. */ using CreatePictureFunctor = SmartPointer*(__stdcall*)(SmartPointer* functor, int a2, CMenuBase* menu, const PictureCallback* callback); CreatePictureFunctor createPictureFunctor; }; Api& get(); const CInterfaceVftable* vftable(); } // namespace CMenuBaseApi namespace editor { struct CMenuBase : game::CInterfFullScreen { game::ITaskManagerHolder taskManagerHolder; int unknown12; int unknown16; // constructor argument, probably CMenuPhase* }; assert_size(CMenuBase, 20); assert_offset(CMenuBase, unknown16, 16); } // namespace editor } // namespace game #endif // MENUBASE_H
7,475
C++
.h
174
31.028736
100
0.600523
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,224
spellcat.h
VladimirMakeev_D2ModdingToolset/mss32/include/spellcat.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef SPELLCAT_H #define SPELLCAT_H #include "categories.h" namespace game { struct LSpellCategoryTable : public CEnumConstantTable<SpellId> { }; struct LSpellCategory : public Category<SpellId> { }; } // namespace game #endif // SPELLCAT_H
1,062
C++
.h
28
36.071429
72
0.768257
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,225
aigiveitemsaction.h
VladimirMakeev_D2ModdingToolset/mss32/include/aigiveitemsaction.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef AIGIVEITEMSACTION_H #define AIGIVEITEMSACTION_H #include "aimovestackaction.h" namespace game { struct CAiStackGeneric; struct CAiGiveItemsAction : CAiMoveStackAction { int unknown; CAiStackGeneric* stack; }; assert_size(CAiGiveItemsAction, 92); namespace CAiGiveItemsActionApi { struct Vftable { const IAiTacticActionVftable* action; const IAiReactionVftable* reaction; }; const Vftable& vftable(); } // namespace CAiGiveItemsActionApi } // namespace game #endif // AIGIVEITEMSACTION_H
1,336
C++
.h
39
32.102564
72
0.782879
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,226
strategicspell.h
VladimirMakeev_D2ModdingToolset/mss32/include/strategicspell.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef STRATEGICSPELL_H #define STRATEGICSPELL_H #include "aispellcat.h" #include "currency.h" #include "groundcat.h" #include "idvector.h" #include "midobject.h" #include "spellcat.h" #include "textandid.h" namespace game { struct LAttackSource; struct TStrategicSpellData { LSpellCategory spellCategory; LAiSpellCategory aiSpellCategory; TextAndId name; TextAndId description; TextAndId effectDescription; int level; Bank castingCost; Bank buyCost; CMidgardID unitId; CMidgardID modifierId; int restoreMovePoints; int area; int damageQty; LAttackSource* damageSource; int healQty; LGroundCategory groundCategory; bool changeGround; char padding[3]; IdVector wards; }; assert_size(TStrategicSpellData, 136); /** Holds information read from GSpells.dbf. */ struct TStrategicSpell : public IMidObject { TStrategicSpellData* data; }; assert_size(TStrategicSpell, 12); } // namespace game #endif // STRATEGICSPELL_H
1,816
C++
.h
60
27.483333
72
0.76575
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,227
texturehandle.h
VladimirMakeev_D2ModdingToolset/mss32/include/texturehandle.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef TEXTUREHANDLE_H #define TEXTUREHANDLE_H #include "d2assert.h" #include "mqpoint.h" #include <cstdint> namespace game { /** Assumption: texture handle. */ struct TextureHandle { CMqPoint textureSize; std::uint32_t* indexPtr; /**< Used as a key for search in CRendererImpl::textureSurfaceMap. */ int* refCount; }; assert_size(TextureHandle, 16); } // namespace game #endif // TEXTUREHANDLE_H
1,229
C++
.h
34
34.088235
98
0.757576
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,228
netcustomplayerclient.h
VladimirMakeev_D2ModdingToolset/mss32/include/netcustomplayerclient.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef NETCUSTOMPLAYERCLIENT_H #define NETCUSTOMPLAYERCLIENT_H #include "mqnetplayerclient.h" #include "netcustomplayer.h" #include <NatPunchthroughClient.h> #include <list> #include <slikenet/types.h> #include <utility> namespace hooks { struct CNetCustomPlayerClient; class PlayerClientCallbacks : public NetworkPeerCallbacks { public: PlayerClientCallbacks(CNetCustomPlayerClient* playerClient) : playerClient{playerClient} { } virtual ~PlayerClientCallbacks() = default; void onPacketReceived(DefaultMessageIDTypes type, SLNet::RakPeerInterface* peer, const SLNet::Packet* packet) override; private: CNetCustomPlayerClient* playerClient; }; struct CNetCustomPlayerClient : public game::IMqNetPlayerClient { CNetCustomPlayerClient(CNetCustomSession* session, game::IMqNetSystem* netSystem, game::IMqNetReception* netReception, const char* name, NetworkPeer::PeerPtr&& peer, std::uint32_t netId, const SLNet::SystemAddress& serverAddress, std::uint32_t serverId); ~CNetCustomPlayerClient() = default; auto getPeer() { return player.getPeer(); } void setupPacketCallbacks(); using NetMessagePtr = std::unique_ptr<unsigned char[]>; using IdMessagePair = std::pair<std::uint32_t, NetMessagePtr>; std::list<IdMessagePair> messages; CNetCustomPlayer player; PlayerClientCallbacks callbacks; SLNet::NatPunchthroughClient natClient; SLNet::SystemAddress serverAddress; std::uint32_t serverId; }; CNetCustomPlayerClient* createCustomPlayerClient(CNetCustomSession* session, const char* name); game::IMqNetPlayerClient* createCustomPlayerClient(CNetCustomSession* session, game::IMqNetSystem* netSystem, game::IMqNetReception* netReception, const char* name); CNetCustomPlayerClient* createCustomHostPlayerClient(CNetCustomSession* session, const char* name); } // namespace hooks #endif // NETCUSTOMPLAYERCLIENT_H
3,126
C++
.h
74
34.189189
99
0.688098
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,229
editor.h
VladimirMakeev_D2ModdingToolset/mss32/include/editor.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef EDITOR_H #define EDITOR_H namespace game { struct CMidgardID; struct IMidgardObjectMap; struct CMidPlayer; struct LRaceCategory; struct LSubRaceCategory; struct TRaceType; struct CCapital; struct CVisitorAddPlayer; struct String; /** * Returns player id depending on RAD_CASTER radio button selection in DLG_EFFECT_CASTMAP dialog. */ using RadioButtonIndexToPlayerId = CMidgardID*(__stdcall*)(CMidgardID* playerId, IMidgardObjectMap* objectMap, int index); /** Searches for player by race category, returns nullptr if player could not be found. */ using FindPlayerByRaceCategory = CMidPlayer*(__stdcall*)(const LRaceCategory* raceCategory, IMidgardObjectMap* objectMap); /** Returns true if tiles are suitable for site or ruin. */ using CanPlace = bool(__stdcall*)(int, int, int); /** Returns number of CMidStack objects on map. */ using CountStacksOnMap = int(__stdcall*)(IMidgardObjectMap* objectMap); /** Returns sub race category that corresponds to specified race category. */ using GetSubRaceByRace = const LSubRaceCategory*(__stdcall*)(const LRaceCategory* raceCategory); using IsRaceCategoryPlayable = bool(__stdcall*)(const LRaceCategory* raceCategory); /** Changes terrain of tiles under the specified capital city. */ using ChangeCapitalTerrain = bool(__stdcall*)(const TRaceType* raceType, const CCapital* capital, IMidgardObjectMap* objectMap, CVisitorAddPlayer* visitor); /** * Returns object name and position description string by id. * Used to describe objects used by event effects. */ using GetObjectNamePos = String*(__stdcall*)(String* description, const IMidgardObjectMap* objectMap, const CMidgardID* objectId); /** Scenario Editor functions that can be hooked. */ struct EditorFunctions { RadioButtonIndexToPlayerId radioButtonIndexToPlayerId; FindPlayerByRaceCategory findPlayerByRaceCategory; CanPlace canPlaceSite; CanPlace canPlaceRuin; CountStacksOnMap countStacksOnMap; GetSubRaceByRace getSubRaceByRace; IsRaceCategoryPlayable isRaceCategoryPlayable; ChangeCapitalTerrain changeCapitalTerrain; GetObjectNamePos getObjectNamePos; }; extern EditorFunctions editorFunctions; } // namespace game #endif // EDITOR_H
3,421
C++
.h
74
38.797297
97
0.701381
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,230
intset.h
VladimirMakeev_D2ModdingToolset/mss32/include/intset.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef INTSET_H #define INTSET_H #include "d2pair.h" #include "d2set.h" namespace game { using IntSet = Set<int>; using IntSetNode = SetNode<int>; using IntSetIterator = SetIterator<int>; namespace IntSetApi { struct Api { /** Performs list initialization. */ using Constructor = IntSet*(__thiscall*)(IntSet* thisptr); Constructor constructor; /** Frees memory allocated for list. */ using Destructor = void(__thiscall*)(IntSet* thisptr); Destructor destructor; /** Clears list contents. */ using Clear = void(__thiscall*)(IntSet* thisptr); Clear clear; /** Inserts new element to the list. */ using Insert = Pair<IntSetIterator, bool>*(__thiscall*)(IntSet* thisptr, Pair<IntSetIterator, bool>* result, const int* value); Insert insert; /** Removes existing element from list. */ using Erase = void(__thiscall*)(IntSet* thisptr, const int* value); Erase erase; }; Api& get(); } // namespace IntSetApi } // namespace game #endif // INTSET_H
1,947
C++
.h
51
33.039216
95
0.681722
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,231
batbigface.h
VladimirMakeev_D2ModdingToolset/mss32/include/batbigface.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef BATBIGFACE_H #define BATBIGFACE_H #include "battlemsgdata.h" #include "d2map.h" #include "image2text.h" #include "mqimage2.h" #include "mqrect.h" #include "smartptr.h" namespace game { struct IMidgardObjectMap; struct CBatImagesLoader; struct CBatBigFaceUnitData { CMidgardID unitImplId; bool showItems; char padding[3]; SmartPtr<CImage2Text> textImage; CMidgardID itemIds[2]; /** Might contain additional members. */ }; struct CBatBigFaceUnitImplData { SmartPtr<IMqImage2> faceImage; /** Might contain additional members. */ }; struct CBatBigFaceItemData { SmartPtr<IMqImage2> itemImage; /** Might contain additional members. */ }; struct CBatBigFaceData { IMidgardObjectMap* objectMap; bool flippedBattle; char padding[3]; CBatImagesLoader* imagesLoader; CMqPoint itemBgndImagePos; SmartPointer itemBgndImage; CMqRect bigFaceImgArea; CMqRect bigFaceTextArea; CMqRect itemImgAreas[2]; int unknown; BattleMsgData battleMsgData; CMidgardID unitId; Map<CMidgardID, CBatBigFaceUnitData> unitData; // Key is unit id Map<CMidgardID, CBatBigFaceUnitImplData> unitImplData; // Key is unit impl id Map<CMidgardID, CBatBigFaceItemData> itemData; // Key is item id bool unknown2; char padding2[3]; char unknown3[4]; }; assert_size(CBatBigFaceData, 4112); struct CBatBigFace : public IMqImage2 { CBatBigFaceData* data; }; assert_size(CBatBigFace, 8); namespace BatBigFaceApi { struct Api { using SetUnitId = void(__thiscall*)(CBatBigFace* thisptr, const CMidgardID* unitId); SetUnitId setUnitId; using SetUnknown = void(__thiscall*)(CBatBigFace* thisptr, bool a2); SetUnknown setUnknown; using Update = void(__thiscall*)(CBatBigFace* thisptr, const BattleMsgData* battleMsgData); Update update; using UnitDataMapErase = void(__thiscall*)(Map<CMidgardID, CBatBigFaceUnitData>* thisptr, MapIterator<CMidgardID, CBatBigFaceUnitData> pos); UnitDataMapErase unitDataMapErase; using UnitDataMapAccess = CBatBigFaceUnitData*( __thiscall*)(Map<CMidgardID, CBatBigFaceUnitData>* thisptr, const CMidgardID* key); UnitDataMapAccess unitDataMapAccess; using UnitImplDataMapAccess = CBatBigFaceUnitImplData*( __thiscall*)(Map<CMidgardID, CBatBigFaceUnitImplData>* thisptr, const CMidgardID* key); UnitImplDataMapAccess unitImplDataMapAccess; using ItemDataMapAccess = CBatBigFaceItemData*( __thiscall*)(Map<CMidgardID, CBatBigFaceItemData>* thisptr, const CMidgardID* key); ItemDataMapAccess itemDataMapAccess; }; Api& get(); } // namespace BatBigFaceApi } // namespace game #endif // BATBIGFACE_H
3,577
C++
.h
101
31.613861
97
0.750072
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,232
attacksourcecat.h
VladimirMakeev_D2ModdingToolset/mss32/include/attacksourcecat.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ATTACKSOURCECAT_H #define ATTACKSOURCECAT_H #include "categories.h" namespace game { struct LAttackSourceTable : public CEnumConstantTable<AttackSourceId> { }; struct LAttackSource : public Category<AttackSourceId> { }; namespace AttackSourceCategories { struct Categories { LAttackSource* weapon; LAttackSource* mind; LAttackSource* life; LAttackSource* death; LAttackSource* fire; LAttackSource* water; LAttackSource* air; LAttackSource* earth; }; Categories& get(); /** Returns address of LAttackSource::vftable used in game. */ const void* vftable(); } // namespace AttackSourceCategories namespace LAttackSourceTableApi { using Api = CategoryTableApi::Api<LAttackSourceTable, LAttackSource>; Api& get(); /** Returns address of LAttackSourceTable::vftable used in game. */ const void* vftable(); } // namespace LAttackSourceTableApi } // namespace game #endif // ATTACKSOURCECAT_H
1,754
C++
.h
50
32.76
72
0.774155
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,233
netdplayservice.h
VladimirMakeev_D2ModdingToolset/mss32/include/netdplayservice.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef NETDPLAYSERVICE_H #define NETDPLAYSERVICE_H #include "mqnetservice.h" #define WIN32_LEAN_AND_MEAN #include <Windows.h> #include <cstdint> struct IDirectPlay4; namespace game { struct CLogFile; /** DirectPlay implementation of net service. */ struct CNetDPlayService : public IMqNetService { IDirectPlay4* directPlay; int unknown2; CLogFile* log; LPCRITICAL_SECTION criticalSection; char unknown4[36]; std::uint32_t sessionCount; int unknown5; }; assert_size(CNetDPlayService, 64); } // namespace game #endif // NETDPLAYSERVICE_H
1,386
C++
.h
41
31.487805
72
0.767964
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,234
capitalraceset.h
VladimirMakeev_D2ModdingToolset/mss32/include/capitalraceset.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef CAPITALRACESET_H #define CAPITALRACESET_H #include "capitaldatlist.h" #include "d2set.h" #include "racecategory.h" namespace game { struct CapitalRaceRecord { LRaceCategory race; CapitalDatList* list; }; assert_size(CapitalRaceRecord, 16); using CapitalRaceSet = Set<CapitalRaceRecord>; struct CapitalRaceSetIterator { char unknown[16]; }; namespace CapitalRaceSetApi { struct Api { using Constructor = CapitalRaceSet*(__thiscall*)(CapitalRaceSet* thisptr); Constructor constructor; using Add = CapitalRaceSetIterator*(__thiscall*)(CapitalRaceSetIterator* thisptr, CapitalRaceSetIterator* iterator, const LRaceCategory* race, CapitalDatList** list); Add add; }; Api& get(); } // namespace CapitalRaceSetApi } // namespace game #endif // CAPITALRACESET_H
1,775
C++
.h
50
30.14
86
0.704267
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,235
middropsource.h
VladimirMakeev_D2ModdingToolset/mss32/include/middropsource.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MIDDROPSOURCE_H #define MIDDROPSOURCE_H #include "cursorhandle.h" namespace game { struct IMidDropSourceVftable; struct IMidDropSource { IMidDropSourceVftable* vftable; }; struct IMidDropSourceVftable { using Destructor = void(__thiscall*)(IMidDropSource* thisptr, char flags); Destructor destructor; using GetCursorHandle = SmartPtr<CursorHandle>*(__thiscall*)(IMidDropSource* thisptr, bool dragDropAllowed, SmartPtr<CursorHandle>* cursorHandle); GetCursorHandle getCursorHandle; void* method2; void* method3; using IsPointOverButton = bool(__thiscall*)(IMidDropSource* thisptr, const CMqPoint* point); IsPointOverButton isPointOverButton; using ResetToggleButton = bool(__thiscall*)(IMidDropSource* thisptr, int a2); ResetToggleButton resetToggleButton; void* method6; using Method7 = int(__thiscall*)(IMidDropSource* thisptr); Method7 method7; void* method8; using Method9 = int(__thiscall*)(IMidDropSource* thisptr, bool buttonPressed); Method9 method9; }; assert_vftable_size(IMidDropSourceVftable, 10); } // namespace game #endif // MIDDROPSOURCE_H
2,058
C++
.h
52
34.730769
96
0.732026
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,236
custommodifiers.h
VladimirMakeev_D2ModdingToolset/mss32/include/custommodifiers.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef CUSTOMMODIFIERS_H #define CUSTOMMODIFIERS_H #include "midgardid.h" #include "modifgroup.h" #include <list> #include <unordered_map> namespace hooks { static const char customModifGroupName[] = "L_CUSTOM"; static const char scriptColumnName[] = "SCRIPT"; using NativeModifiers = std::list<game::CMidgardID>; struct CustomModifiers { game::LModifGroup group; using NativeMap = std::unordered_map<int, NativeModifiers>; NativeMap native; }; void initializeCustomModifiers(); CustomModifiers& getCustomModifiers(); NativeModifiers getNativeModifiers(const game::CMidgardID& unitImplId); } // namespace hooks #endif // CUSTOMMODIFIERS_H
1,475
C++
.h
39
35.820513
72
0.778401
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,237
menuflashwait.h
VladimirMakeev_D2ModdingToolset/mss32/include/menuflashwait.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MENUFLASHWAIT_H #define MENUFLASHWAIT_H #include "popupdialoginterf.h" namespace game { struct CMenuFlashWait : public CPopupDialogInterf { }; assert_size(CMenuFlashWait, 16); namespace CMenuFlashWaitApi { struct Api { using Constructor = CMenuFlashWait*(__thiscall*)(CMenuFlashWait* thisptr); Constructor constructor; }; Api& get(); } // namespace CMenuFlashWaitApi } // namespace game #endif // MENUFLASHWAIT_H
1,252
C++
.h
35
33.742857
78
0.772803
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,238
leaderunitdescriptor.h
VladimirMakeev_D2ModdingToolset/mss32/include/leaderunitdescriptor.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef LEADERUNITDESCRIPTOR_H #define LEADERUNITDESCRIPTOR_H #include "attackclasscat.h" #include "attackreachcat.h" #include "attacksourcecat.h" #include "d2list.h" #include "d2string.h" #include "encunitdescriptor.h" #include "leaderabilitycat.h" #include "midgardid.h" #include "racecategory.h" namespace game { struct CLeaderUnitDescriptorData { String name; LRaceCategory raceCategory; CMidgardID globalUnitImplId; int level; int leadership; int currentXp; int xp; int nbBattle; int hpMax; int armor; int attackId; LAttackClass attackClass; String attackName; int attackPower; int unknown; int attackDamage; LAttackSource attackSource; int attackInitiative; LAttackReach attackReach; String attack2Name; int attack2Power; CMidgardID attack2Id; bool attacksTwice; char padding[3]; int movement; int scout; int unknown2; bool unknown3; char padding2[3]; List<LAttackSource> attackSourceImmunities; List<LAttackClass> attackClassImmunities; List<LAttackSource> attackSourceWards; List<LAttackClass> attackClassWards; List<LLeaderAbility> leaderAbilities; List<CMidgardID> modifiers; List<Category<int>> unknown4; int unknown5; }; assert_size(CLeaderUnitDescriptorData, 292); /** Used by CViewExportedLeaderInterf. */ struct CLeaderUnitDescriptor : public IEncUnitDescriptor { CLeaderUnitDescriptorData data; }; assert_size(CLeaderUnitDescriptor, 296); } // namespace game #endif // LEADERUNITDESCRIPTOR_H
2,382
C++
.h
79
26.898734
72
0.765475
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,239
notifyplayerlist.h
VladimirMakeev_D2ModdingToolset/mss32/include/notifyplayerlist.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef NOTIFYPLAYERLIST_H #define NOTIFYPLAYERLIST_H #include "d2assert.h" namespace game { struct INotifyPlayerListVftable; struct INotifyPlayerList { INotifyPlayerListVftable* vftable; }; struct INotifyPlayerListVftable { using Destructor = void(__thiscall*)(INotifyPlayerList* thisptr, char flags); Destructor destructor; void* method1; }; assert_vftable_size(INotifyPlayerListVftable, 2); } // namespace game #endif // NOTIFYPLAYERLIST_H
1,281
C++
.h
36
33.388889
81
0.778138
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,240
customattackhooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/customattackhooks.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef CUSTOMATTACKHOOKS_H #define CUSTOMATTACKHOOKS_H #include "idlist.h" #include "targetset.h" namespace game { struct LAttackClass; struct LAttackClassTable; struct LAttackSource; struct LAttackSourceTable; struct LAttackReach; struct LAttackReachTable; struct LImmuneCat; struct CMidUnit; struct CMidStack; struct CAttackImpl; struct CAttackData; struct IUsSoldier; struct CDBTable; struct GlobalData; struct IAttack; struct IBatAttack; struct IMidgardObjectMap; struct BattleMsgData; struct CMidgardID; struct CMidUnitGroup; struct IItem; struct CMqPoint; enum class BattleAction : int; } // namespace game namespace hooks { extern game::LAttackClass customAttackClass; game::LAttackClassTable* __fastcall attackClassTableCtorHooked(game::LAttackClassTable* thisptr, int /*%edx*/, const char* globalsFolderPath, void* codeBaseEnvProxy); game::LAttackSourceTable* __fastcall attackSourceTableCtorHooked(game::LAttackSourceTable* thisptr, int /*%edx*/, const char* globalsFolderPath, void* codeBaseEnvProxy); game::LAttackReachTable* __fastcall attackReachTableCtorHooked(game::LAttackReachTable* thisptr, int /*%edx*/, const char* globalsFolderPath, void* codeBaseEnvProxy); game::CAttackImpl* __fastcall attackImplCtorHooked(game::CAttackImpl* thisptr, int /*%edx*/, const game::CDBTable* dbTable, const game::GlobalData** globalData); game::CAttackImpl* __fastcall attackImplCtor2Hooked(game::CAttackImpl* thisptr, int /*%edx*/, const game::CAttackData* data); void __fastcall attackImplGetDataHooked(game::CAttackImpl* thisptr, int /*%edx*/, game::CAttackData* value); game::IBatAttack* __stdcall createBatAttackHooked(game::IMidgardObjectMap* objectMap, game::BattleMsgData* battleMsgData, const game::CMidgardID* id1, const game::CMidgardID* id2, int attackNumber, const game::LAttackClass* attackClass, bool a7); std::uint32_t __stdcall getAttackClassWardFlagPositionHooked(const game::LAttackClass* attackClass); const char* __stdcall attackClassToStringHooked(const game::LAttackClass* attackClass); void __stdcall getUnitAttackSourceImmunitiesHooked(const game::LImmuneCat* immuneCat, const game::CMidUnit* unit, game::List<game::LAttackSource>* value); void __stdcall getSoldierAttackSourceImmunitiesHooked(const game::IUsSoldier* soldier, bool alwaysImmune, game::List<game::LAttackSource>* value); double __stdcall getSoldierImmunityAiRatingHooked(const game::IUsSoldier* soldier); double __stdcall getAttackClassAiRatingHooked(const game::IUsSoldier* soldier, bool a2); double __stdcall getAttackReachAiRatingHooked(const game::IUsSoldier* soldier, int targetCount); std::uint32_t __stdcall getAttackSourceWardFlagPositionHooked( const game::LAttackSource* attackSource); bool __fastcall isUnitAttackSourceWardRemovedHooked(game::BattleMsgData* thisptr, int /*%edx*/, const game::CMidgardID* unitId, const game::LAttackSource* attackSource); void __fastcall removeUnitAttackSourceWardHooked(game::BattleMsgData* thisptr, int /*%edx*/, const game::CMidgardID* unitId, const game::LAttackSource* attackSource); void __stdcall addUnitToBattleMsgDataHooked(const game::IMidgardObjectMap* objectMap, const game::CMidUnitGroup* group, const game::CMidgardID* unitId, char attackerFlags, game::BattleMsgData* battleMsgData); void __stdcall getTargetsToAttackHooked(game::IdList* value, const game::IMidgardObjectMap* objectMap, const game::IAttack* attack, const game::IBatAttack* batAttack, const game::LAttackReach* attackReach, const game::BattleMsgData* battleMsgData, game::BattleAction action, const game::CMidgardID* targetUnitId); void __stdcall fillTargetsListHooked(const game::IMidgardObjectMap* objectMap, const game::BattleMsgData* battleMsgData, const game::IBatAttack* batAttack, const game::CMidgardID* unitId, const game::CMidgardID* attackUnitOrItemId, bool targetAllies, game::TargetSet* value, bool checkAltAttack); void __stdcall fillEmptyTargetsListHooked(const game::IMidgardObjectMap* objectMap, const game::BattleMsgData* battleMsgData, const game::IBatAttack* batAttack, const game::CMidgardID* unitId, const game::CMidgardID* attackUnitOrItemId, bool targetAllies, game::TargetSet* value); bool __stdcall isGroupSuitableForAiNobleMisfitHooked(const game::IMidgardObjectMap* objectMap, const game::CMidUnitGroup* group); bool __stdcall isUnitSuitableForAiNobleDuelHooked(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* unitId); bool __stdcall findAttackTargetHooked(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* unitOrItemId, const game::IAttack* attack, const game::CMidUnitGroup* targetGroup, const game::TargetSet* targets, const game::BattleMsgData* battleMsgData, game::CMidgardID* value); bool __stdcall findDoppelgangerAttackTargetHooked(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* unitId, const game::BattleMsgData* battleMsgData, const game::CMidUnitGroup* targetGroup, const game::TargetSet* targets, game::CMidgardID* value); bool __stdcall findDamageAttackTargetWithNonAllReachHooked(const game::IMidgardObjectMap* objectMap, const game::IAttack* attack, int damage, const game::CMidUnitGroup* targetGroup, const game::TargetSet* targets, const game::BattleMsgData* battleMsgData, game::CMidgardID* value); bool __stdcall isAttackBetterThanItemUsageHooked(const game::IItem* item, const game::IUsSoldier* soldier, const game::CMidgardID* unitImplId); game::CMidgardID* __stdcall getSummonUnitImplIdByAttackHooked(game::CMidgardID* summonImplId, const game::CMidgardID* attackId, int position, bool smallUnit); bool __stdcall isSmallMeleeFighterHooked(const game::IUsSoldier* soldier); bool __stdcall cAiHireUnitEvalHooked(const game::IMidgardObjectMap* objectMap, const game::CMidUnitGroup* group); double __stdcall getMeleeUnitToHireAiRatingHooked(const game::CMidgardID* unitImplId, bool a2, bool a3); int __stdcall computeTargetUnitAiPriorityHooked(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* unitId, const game::BattleMsgData* battleMsgData, int attackerDamage); bool __fastcall midStackInitializeHooked(game::CMidStack* thisptr, int /*%edx*/, const game::IMidgardObjectMap* objectMap, const game::CMidgardID* leaderId, const game::CMidgardID* ownerId, const game::CMidgardID* subraceId, const game::CMqPoint* position); } // namespace hooks #endif // CUSTOMATTACKHOOKS_H
11,601
C++
.h
177
39.129944
100
0.504964
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,241
menuloadskirmishmultihooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/menuloadskirmishmultihooks.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MENULOADSKIRMISHMULTIHOOKS_H #define MENULOADSKIRMISHMULTIHOOKS_H namespace game { struct CMenuLoad; } namespace hooks { void __fastcall menuLoadSkirmishMultiLoadScenarioHooked(game::CMenuLoad* thisptr, int /*%edx*/); void __fastcall menuLoadSkirmishMultiCreateHostPlayerHooked(game::CMenuLoad* thisptr, int /*%edx*/); } // namespace hooks #endif // MENULOADSKIRMISHMULTIHOOKS_H
1,206
C++
.h
28
41.214286
100
0.782237
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,242
scenariodata.h
VladimirMakeev_D2ModdingToolset/mss32/include/scenariodata.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef SCENARIODATA_H #define SCENARIODATA_H #include "d2list.h" #include "d2string.h" #include "difficultylevel.h" #include "midgardid.h" #include "racecategory.h" #include <cstddef> namespace game { using RaceCategoryList = List<LRaceCategory>; /** * Holds brief information about scenario file registered in game. * Upon creating one of the base menu classes game checks all * scenario files in 'Exports' folder, verifies their headers * and registers them using this structure. */ struct ScenarioData { String filePath; /**< Full path to scenario file. */ String author; bool official; char padding[3]; CMidgardID scenarioFileId; String description; String name; int mapSize; LDifficultyLevel difficulty; int turnNumber; CMidgardID campaignId; RaceCategoryList races; LRaceCategory race; int unknown2; }; assert_size(ScenarioData, 128); namespace ScenarioDataApi { struct Api { /** Creates empty ScenarioData. */ using Constructor = ScenarioData*(__thiscall*)(ScenarioData* thisptr); Constructor constructor; /** Frees memory allocated for ScenarioData fields. */ using Destructor = void*(__thiscall*)(ScenarioData* thisptr); Destructor destructor; /** Performs a deep copy of other into thisptr. */ using CopyConstructor = ScenarioData*(__thiscall*)(ScenarioData* thisptr, const ScenarioData* other); CopyConstructor copyConstructor; }; Api& get(); } // namespace ScenarioDataApi } // namespace game #endif // SCENARIODATA_H
2,409
C++
.h
70
30.8
82
0.736774
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,243
idlistutils.h
VladimirMakeev_D2ModdingToolset/mss32/include/idlistutils.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef IDLISTUTILS_H #define IDLISTUTILS_H #include "idlist.h" namespace hooks { bool removeIdFromList(game::IdList& list, const game::CMidgardID* id); bool addUniqueIdToList(game::IdList& list, const game::CMidgardID* id); } // namespace hooks #endif // IDLISTUTILS_H
1,089
C++
.h
26
40
72
0.767266
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,244
menunewmap.h
VladimirMakeev_D2ModdingToolset/mss32/include/menunewmap.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MENUNEWMAP_H #define MENUNEWMAP_H #include "menubaseeditor.h" #include "midgardid.h" #include "racelist.h" namespace game { struct CDialogInterf; struct String; namespace editor { enum class NewMapStatus : int { NotNamed, /**< The quest has not been named, X001TA0020. */ AlreadyExists, /**< This name already exists, X001TA0018. */ InvalidScenarioInfo, /**< Invalid or missing scenario info, X001TA0000. */ NoPlayableRaces, /**< At least one race is required to build a quest, X001TA0019. */ TooManyRaces, /**< Too many races selected, X160TA0006. */ Ok, }; struct CMenuNewMapData { CDialogInterf* dialogInterf; char* scenarioName; CMidgardID scenarioFileId; int unknown; Vector<int> mapSizes; Vector<int> unknown2; }; assert_size(CMenuNewMapData, 48); /** Represents DLG_NEW_MAP from ScenEdit.dlg. */ struct CMenuNewMap : public CMenuBase { CMenuNewMapData* data; }; assert_size(CMenuNewMap, 24); namespace CMenuNewMapApi { struct Api { /** Converts user input in menu to scenario creation settings. */ using GetCreationSettings = void(__stdcall*)(CDialogInterf* dialog, String* scenarioName, int* mapSize, RaceCategoryList* races, const CMenuNewMapData* data); GetCreationSettings getCreationSettings; /** Checks map creation settings correctness. */ using CheckCreationSettings = NewMapStatus(__stdcall*)(const String* scenarioName, const int* mapSize, const RaceCategoryList* races, void* a4); CheckCreationSettings checkCreationSettings; }; Api& get(); } // namespace CMenuNewMapApi } // namespace editor } // namespace game #endif // MENUNEWMAP_H
2,868
C++
.h
74
31.22973
92
0.648542
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,245
itempotionboost.h
VladimirMakeev_D2ModdingToolset/mss32/include/itempotionboost.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ITEMPOTIONBOOST_H #define ITEMPOTIONBOOST_H #include "itembase.h" #include "itemexpotionboost.h" #include <cstddef> namespace game { /** Base class for all boost potions. */ struct CItemPotionBoost : public IItemExPotionBoost , public CItemBase { CMidgardID modPotionId; }; assert_size(CItemPotionBoost, 20); assert_offset(CItemPotionBoost, CItemPotionBoost::IItemExPotionBoost::vftable, 0); assert_offset(CItemPotionBoost, CItemPotionBoost::CItemBase::vftable, 4); assert_offset(CItemPotionBoost, modPotionId, 16); } // namespace game #endif // ITEMPOTIONBOOST_H
1,403
C++
.h
37
35.945946
82
0.779249
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,246
batattackusetalisman.h
VladimirMakeev_D2ModdingToolset/mss32/include/batattackusetalisman.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef BATATTACKUSETALISMAN_H #define BATATTACKUSETALISMAN_H #include "batattackitem.h" namespace game { struct CBatAttackUseTalisman : CBatAttackItem { CMidgardID unitId; }; assert_size(CBatAttackUseTalisman, 16); } // namespace game #endif // BATATTACKUSETALISMAN_H
1,093
C++
.h
29
35.724138
72
0.777673
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,247
effectinterf.h
VladimirMakeev_D2ModdingToolset/mss32/include/effectinterf.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef EFFECTINTERF_H #define EFFECTINTERF_H #include "popupinterf.h" #include "smartptr.h" namespace game { struct CMidEvEffect; struct CMidgardID; struct LEventEffectCategory; struct IMidgardObjectMap; struct String; namespace editor { struct CEffectInterfHandler; struct CEffectInterfData { CEffectInterfHandler* interfHandler; int unknown; }; assert_size(CEffectInterfData, 8); /** Base class for all event effects popup windows. */ struct CEffectInterf : public CPopupInterf { CEffectInterfData* data; }; assert_size(CEffectInterf, 28); struct CEffectInterfVftable : public CInterfaceVftable { using SetEventEffect = bool(__thiscall*)(CEffectInterf* thisptr, CMidEvEffect* eventEffect); SetEventEffect setEventEffect; }; assert_vftable_size(CEffectInterfVftable, 35); namespace CEffectInterfApi { struct Api { using Constructor = CEffectInterf*(__thiscall*)(CEffectInterf* thisptr, const char* dialogName, ITask* task); Constructor constructor; /** Creates effect interface from specified category. */ using CreateFromCategory = CEffectInterf*(__stdcall*)(ITask* task, void* unknown, const CMidgardID* eventId, const LEventEffectCategory* category); CreateFromCategory createFromCategory; using GetObjectMap = IMidgardObjectMap*(__thiscall*)(void* thisptr); GetObjectMap getObjectMap; struct ButtonCallback { using Callback = void(__thiscall*)(CEffectInterf* thisptr); Callback callback; int unknown; }; using CreateButtonFunctor = SmartPointer*(__stdcall*)(SmartPointer* functor, int a2, CEffectInterf* effectInterf, ButtonCallback* callback); CreateButtonFunctor createButtonFunctor; struct ListBoxDisplayCallback { using Callback = void(__thiscall*)(CEffectInterf* thisptr, String* string, bool, int selectedIndex); Callback callback; int unknown; }; using CreateListBoxDisplayFunctor = SmartPointer*(__stdcall*)(SmartPointer* functor, int a2, CEffectInterf* effectInterf, ListBoxDisplayCallback* callback); CreateListBoxDisplayFunctor createListBoxDisplayFunctor; }; Api& get(); } // namespace CEffectInterfApi } // namespace editor } // namespace game #endif // EFFECTINTERF_H
3,841
C++
.h
94
29.670213
100
0.613276
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,248
item.h
VladimirMakeev_D2ModdingToolset/mss32/include/item.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ITEM_H #define ITEM_H #include "d2assert.h" namespace game { struct IItemVftable; struct LItemCategory; struct Bank; struct CMidgardID; struct IItemExtension; struct GlobalData; /** Interface for all items read from GItem.dbf. */ struct IItem { IItemVftable* vftable; }; struct IItemVftable { void* destructor; /** Returns corresponding item category. */ using GetCategory = const LItemCategory*(__thiscall*)(const IItem* thisptr); GetCategory getCategory; using GetCString = const char*(__thiscall*)(const IItem* thisptr); GetCString getName; GetCString getDescription; /** Returns item cost. */ using GetValue = const Bank*(__thiscall*)(const IItem* thisptr); GetValue getValue; using GetUnitId = const CMidgardID*(__thiscall*)(const IItem* thisptr); GetUnitId getUnitId; /** Functions just like IUsUnit::Cast. However, all items implementations simply return * extension interface offset, so it is not clear why this is used instead of dynamic_cast. */ using Cast = IItemExtension*(__thiscall*)(const IItem* thisptr, const char* rawTypeName); Cast cast; /** Validates item data like modEquipId and attackId. * Throws exceptions like "ItemEquipment: Invalid modifier..." if invalid. */ using Validate = void(__thiscall*)(const IItem* thisptr, const GlobalData** globalData); Validate validate; }; assert_vftable_size(IItemVftable, 8); } // namespace game #endif // ITEM_H
2,305
C++
.h
61
34.688525
95
0.743383
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,249
aistrategic.h
VladimirMakeev_D2ModdingToolset/mss32/include/aistrategic.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef AISTRATEGIC_H #define AISTRATEGIC_H #include "aistate.h" #include "currency.h" #include "d2set.h" #include "idlist.h" namespace game { struct IAiStratInternalVftable; struct IMidgardObjectMap; struct CMidServerLogicData; struct CAiBlockingStacks; struct CAiLog; struct AiLogicUnknown; struct IAiStratPlayer; struct CAiReactionStrat; struct IAiStratInternal { IAiStratInternalVftable* vftable; }; struct CAiStrategicData { IMidgardObjectMap* objectMap; CMidgardID* playerId; Bank bank; Bank bank2; Set<void*> set; }; assert_size(CAiStrategicData, 60); struct CAiStrategicData2 { IdList list; IMidgardObjectMap* objectMap; }; assert_size(CAiStrategicData2, 20); struct CAiStrategic : public IAiState , public IAiStratInternal { IMidgardObjectMap* objectMap; CMidgardID playerId; CMidServerLogicData* serverLogic; CAiBlockingStacks* blockingStats; CAiLog* aiLog; AiLogicUnknown* logicUnknown; IAiStratPlayer* aiStratPlayer; CAiStrategicData* data; CAiReactionStrat* reactionStrat; List<void*> list; CAiStrategicData2* data2; bool unknown; char padding[3]; int unknown2; int unknown3; IdList list2; bool unknown4; char padding2[3]; int unknown5; int unknown6; IdList list3; bool unknown7; char padding3[3]; int unknown8; int unknown9; IdList* list4; }; assert_size(CAiStrategic, 136); } // namespace game #endif // AISTRATEGIC_H
2,302
C++
.h
86
23.744186
72
0.761689
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,250
imagedatadescriptor.h
VladimirMakeev_D2ModdingToolset/mss32/include/imagedatadescriptor.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef IMAGEDATADESCRIPTOR_H #define IMAGEDATADESCRIPTOR_H #include "d2assert.h" #include "d2string.h" #include "mqpoint.h" #include "smartptr.h" namespace game { struct ImageDataDescriptor { String imageFilepath; CMqPoint imageSize; void* processedImage; SmartPointer ptr; }; assert_size(ImageDataDescriptor, 36); } // namespace game #endif // IMAGEDATADESCRIPTOR_H
1,204
C++
.h
35
32.257143
72
0.771084
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,251
mainview2hooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/mainview2hooks.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MAINVIEW2HOOKS_H #define MAINVIEW2HOOKS_H namespace game { struct CMainView2; } namespace hooks { void __fastcall mainView2ShowIsoDialogHooked(game::CMainView2* thisptr, int /*%edx*/); } #endif // MAINVIEW2HOOKS_H
1,040
C++
.h
27
36.666667
86
0.770606
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,252
button.h
VladimirMakeev_D2ModdingToolset/mss32/include/button.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef BUTTON_H #define BUTTON_H #include "d2list.h" #include "d2string.h" #include "functordispatch0.h" #include "interface.h" #include "smartptr.h" #include "uievent.h" namespace game { struct CDialogInterf; struct CButtonInterfVftable; struct IMqImage2; struct Tooltip; enum class ButtonState : int { Normal, Hovered, Clicked, Disabled }; struct CButtonInterfData { int childIndex; bool enabled; char padding[3]; SmartPtr<CBFunctorDispatch0> onClickedFunctor; List<char> hotkeys; UiEvent timerEvent; int autorepeatTimeoutMs; IMqImage2* normalStateImage; IMqImage2* hoveredStateImage; IMqImage2* clickedStateImage; IMqImage2* disabledStateImage; bool pressed; char padding2[3]; UiEvent buttonKeyEvent; unsigned int buttonKeyEventId; int unknown5; bool hotkeyPressed; char padding3[3]; String hotkeysString; SmartPtr<Tooltip> tooltip; int unknown11; }; assert_size(CButtonInterfData, 144); /** Button ui element. */ struct CButtonInterf : public CInterfaceT<CButtonInterfVftable> { CButtonInterfData* buttonData; }; assert_size(CButtonInterf, 12); struct CButtonInterfVftable : public CInterfaceVftable { using SetFunctor = void(__thiscall*)(CButtonInterf* thisptr, SmartPointer* functor); SetFunctor setOnClickedFunctor; using ChangeHotkey = void(__thiscall*)(CButtonInterf* thisptr, char key); ChangeHotkey addHotkey; ChangeHotkey removeHotkey; using GetHotkeyCount = std::uint32_t(__thiscall*)(const CButtonInterf* thisptr); GetHotkeyCount getHotkeyCount; /** Actual return type unknown. */ using GetHotkey = void*(__thiscall*)(CButtonInterf* thisptr, std::uint32_t* index); GetHotkey getHotkey; /** Sets image for specified button state. */ using SetImage = void(__thiscall*)(CButtonInterf* thisptr, IMqImage2* image, ButtonState state); SetImage setImage; /** Enables or disables the button. */ using SetEnabled = void(__thiscall*)(CButtonInterf* thisptr, bool value); SetEnabled setEnabled; /** Returns true if button is enabled. */ using IsEnabled = bool(__thiscall*)(const CButtonInterf* thisptr); IsEnabled isEnabled; using SetAutorepeatTimeout = void(__thiscall*)(CButtonInterf* thisptr, int timeoutMs); SetAutorepeatTimeout setAutorepeatTimeout; using GetAutorepeatTimeout = int(__thiscall*)(const CButtonInterf* thisptr); GetAutorepeatTimeout getAutorepeatTimeout; using OnAutorepeat = void(__thiscall*)(CButtonInterf* thisptr); OnAutorepeat onAutorepeat; }; assert_vftable_size(CButtonInterfVftable, 45); assert_offset(CButtonInterfVftable, setEnabled, 160); namespace CButtonInterfApi { struct Api { /** * Assigns functor with callback to a button. * Searches for button element by its and dialog names. * Callback will be called each time the button is pressed, if not disabled. * @param[in] dialog used for button search. * @param[in] buttonName button to assign functor to. * @param[in] dialogName dialog (menu) where to search for button. * @param[in] functor pointer to existing functor initialized with callback. * @returns button found with callback set or nullptr if not found. */ using AssignFunctor = CButtonInterf*(__stdcall*)(CDialogInterf* dialog, const char* buttonName, const char* dialogName, SmartPointer* functor, int hotkey); AssignFunctor assignFunctor; }; Api& get(); } // namespace CButtonInterfApi } // namespace game #endif // BUTTON_H
4,588
C++
.h
123
32.097561
100
0.717215
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,253
batattackshatter.h
VladimirMakeev_D2ModdingToolset/mss32/include/batattackshatter.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef BATATTACKSHATTER_H #define BATATTACKSHATTER_H #include "batattack.h" #include "midgardid.h" namespace game { struct IAttack; /** * Breaks armor. * Theurgist unit of Elven Alliance uses this attack. */ struct CBatAttackShatter : public CBatAttackBase { CMidgardID unitId1; CMidgardID unitId2; int attackNumber; /**< 1 if this is a unit's primary attack, 2 for secondary. */ IAttack* attack; int unknown2; int unknown3; int unknown4; }; assert_size(CBatAttackShatter, 32); namespace CBatAttackShatterApi { IBatAttackVftable* vftable(); } // namespace CBatAttackShatterApi } // namespace game #endif // BATATTACKSHATTER_H
1,481
C++
.h
44
31.318182
84
0.762973
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,254
attackmodified.h
VladimirMakeev_D2ModdingToolset/mss32/include/attackmodified.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ATTACKMODIFIED_H #define ATTACKMODIFIED_H #include "attack.h" namespace game { struct CAttackModifiedData; struct CAttackModified : public IAttack { CAttackModifiedData* data; }; assert_size(CAttackModified, 12); struct CAttackModifiedData { IAttack* prev; int initiative; int power; int qtyDamage; int attackDrain; }; assert_size(CAttackModifiedData, 20); namespace CAttackModifiedApi { struct Api { using Constructor = CAttackModified*(__thiscall*)(CAttackModified* thisptr); Constructor constructor; using CopyConstructor = CAttackModified*(__thiscall*)(CAttackModified* thisptr, const CAttackModified* src); CopyConstructor copyConstructor; using Wrap = void(__thiscall*)(CAttackModified* thisptr, const IAttack* attack); Wrap wrap; }; Api& get(); const IAttackVftable* vftable(); } // namespace CAttackModifiedApi } // namespace game #endif // ATTACKMODIFIED_H
1,809
C++
.h
53
30.490566
86
0.744106
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,255
midmsgboxbuttonhandlerstd.h
VladimirMakeev_D2ModdingToolset/mss32/include/midmsgboxbuttonhandlerstd.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MIDMSGBOXBUTTONHANDLERSTD_H #define MIDMSGBOXBUTTONHANDLERSTD_H #include "midmsgboxbuttonhandler.h" namespace game { /** * Standard message box button handler. * Assumption: does nothing. */ struct CMidMsgBoxButtonHandlerStd : public CMidMsgBoxButtonHandler { }; namespace CMidMsgBoxButtonHandlerStdApi { CMidMsgBoxButtonHandlerVftable* vftable(); } } // namespace game #endif // MIDMSGBOXBUTTONHANDLERSTD_H
1,240
C++
.h
33
35.69697
72
0.787145
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,256
categorylist.h
VladimirMakeev_D2ModdingToolset/mss32/include/categorylist.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef CATEGORYLIST_H #define CATEGORYLIST_H #include "categories.h" #include "d2list.h" namespace game { using CategoryList = List<Category<int>>; using CategoryListNode = ListNode<Category<int>>; namespace CategoryListApi { struct Api { using Constructor = CategoryList*(__thiscall*)(CategoryList* thisptr); Constructor constructor; using Clear = void(__thiscall*)(CategoryList* thisptr); Clear clear; using FreeNode = void(__thiscall*)(CategoryList* thisptr, CategoryListNode* node); FreeNode freeNode; }; Api& get(); } // namespace CategoryListApi } // namespace game #endif // CATEGORYLIST_H
1,447
C++
.h
39
34.74359
86
0.760745
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,257
aigiveitemsactionhooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/aigiveitemsactionhooks.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef AIGIVEITEMSACTIONHOOKS_H #define AIGIVEITEMSACTIONHOOKS_H namespace game { struct IMidgardObjectMap; struct CMidServerLogicData; struct IAiTacticInternal; struct CAiGiveItemsAction; } // namespace game namespace hooks { void __fastcall aiGiveItemsActionExecuteHooked(game::CAiGiveItemsAction* thisptr, int /*%edx*/, game::IMidgardObjectMap* objectMap, game::CMidServerLogicData* serverLogicData, game::IAiTacticInternal* tacticInternal); } // namespace hooks #endif // AIGIVEITEMSACTIONHOOKS_H
1,509
C++
.h
34
37.176471
90
0.69435
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,258
utils.h
VladimirMakeev_D2ModdingToolset/mss32/include/utils.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef UTILS_H #define UTILS_H #include "dynamiccast.h" #include "midgardid.h" #include "midscenvariables.h" #include <filesystem> #include <functional> #include <string> namespace game { struct CMidMsgBoxButtonHandler; struct IMidgardObjectMap; struct UiEvent; struct CInterface; } // namespace game namespace hooks { std::string trimSpaces(const std::string& str); /** Returns full path to the game folder. */ const std::filesystem::path& gameFolder(); /** Returns full path to the globals folder. */ const std::filesystem::path& globalsFolder(); /** Returns full path to the scripts folder. */ const std::filesystem::path& scriptsFolder(); /** Returns full path to the modifier scripts folder. */ const std::filesystem::path& modifiersFolder(); /** Returns full path to the scenario generator templates folder. */ const std::filesystem::path& templatesFolder(); /** Returns full path to the exports folder. */ const std::filesystem::path& exportsFolder(); /** Returns full path to the executable that is currently running. */ const std::filesystem::path& exePath(); /** Returns id as string. */ std::string idToString(const game::CMidgardID* id, bool lowercase = false); /** Returns interface text by specified id string. */ std::string getInterfaceText(const char* textIdString); /** Returns interface text. Default value is used when textIdString is empty. */ std::string getInterfaceText(const char* textIdString, const char* def); /** Returns global text by specified id. */ const char* getGlobalText(const game::CMidgardID& textId); const char* getGlobalText(const std::string& textIdString); /** Tries to replace first occurence of 'keyword' in 'str' with 'replacement'. */ bool replace(std::string& str, const std::string& keyword, const std::string& replacement); /** Returns random number from range [min : max]. */ int getRandomNumber(int min, int max); std::string readFile(const std::filesystem::path& file); /** * Shows file open dialog in specified directory and reads selected file. * @returns false in case of error or when selection is canceled by user. */ bool readUserSelectedFile(std::string& contents, const char* filter, const char* directory = nullptr); void showInterface(game::CInterface* interf); void hideInterface(game::CInterface* interf); /** Shows native in-game message box with specified text. */ void showMessageBox(const std::string& message, game::CMidMsgBoxButtonHandler* buttonHandler = nullptr, bool showCancel = false); /** Shows windows style message box that does not depend on game rendering and resources. */ void showErrorMessageBox(const std::string& message); void createTimerEvent(game::UiEvent* timerEvent, void* userData, void* callback, std::uint32_t timeoutMs); /** * Registers message with specified name and creates message event. * @returns registered message id associated with event. */ std::uint32_t createMessageEvent(game::UiEvent* messageEvent, void* userData, void* callback, const char* messageName); /** Computes MD5 hash of files in specified folder. */ bool computeHash(const std::filesystem::path& folder, std::string& hash); /** Executes function for each scenario object with specified id type. */ void forEachScenarioObject(game::IMidgardObjectMap* objectMap, game::IdType idType, const std::function<void(const game::IMidScenarioObject*)>& func); template <typename T> static inline void replaceRttiInfo(game::RttiInfo<T>& dst, const T* src, bool copyVftable = true) { dst.locator = *reinterpret_cast<const game::CompleteObjectLocator**>( reinterpret_cast<std::uintptr_t>(src) - sizeof(game::CompleteObjectLocator*)); if (copyVftable) { std::memcpy(&dst.vftable, src, sizeof(T)); } } } // namespace hooks #endif // UTILS_H
4,886
C++
.h
106
41.386792
97
0.716572
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,259
interftexthooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/interftexthooks.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef INTERFTEXTHOOKS_H #define INTERFTEXTHOOKS_H #include "idlist.h" namespace game { struct String; struct LAttackSource; struct IEncUnitDescriptor; struct CDialogInterf; } // namespace game namespace hooks { void __stdcall generateAttackDescriptionHooked(game::IEncUnitDescriptor* descriptor, game::CDialogInterf* dialog, int boostDamageLevel, int lowerDamageLevel, int lowerInitiativeLevel, const game::IdList* editorModifiers, int damageMax); game::String* __stdcall getAttackSourceTextHooked(game::String* value, const game::LAttackSource* attackSource); void __stdcall appendAttackSourceTextHooked(const game::LAttackSource* attackSource, game::String* value, bool* valueIsNotEmpty); } // namespace hooks #endif // INTERFTEXTHOOKS_H
1,984
C++
.h
42
35.619048
91
0.62597
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,260
midpopupinterf.h
VladimirMakeev_D2ModdingToolset/mss32/include/midpopupinterf.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MIDPOPUPINTERF_H #define MIDPOPUPINTERF_H #include "popupinterf.h" namespace game { struct CPhaseGame; struct CMidPopupInterf : public CPopupInterf { CPhaseGame* phaseGame; void* unknown2; }; assert_size(CMidPopupInterf, 32); } // namespace game #endif // MIDPOPUPINTERF_H
1,109
C++
.h
31
33.709677
72
0.770093
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,261
netdplayplayerclient.h
VladimirMakeev_D2ModdingToolset/mss32/include/netdplayplayerclient.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef NETDPLAYPLAYERCLIENT_H #define NETDPLAYPLAYERCLIENT_H #include "mqnetplayerclient.h" namespace game { struct CNetDPlayPlayer; /** Network player client implementation for DirectPlay. */ struct CNetDPlayPlayerClient : public IMqNetPlayerClient { CNetDPlayPlayer* player; bool host; char padding[3]; }; assert_size(CNetDPlayPlayerClient, 12); } // namespace game #endif // NETDPLAYPLAYERCLIENT_H
1,234
C++
.h
33
35.272727
72
0.777033
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,262
unitgroup.h
VladimirMakeev_D2ModdingToolset/mss32/include/unitgroup.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef UNITGROUP_H #define UNITGROUP_H namespace game { struct IUnitGroup { void* vftable; }; } // namespace game #endif // UNITGROUP_H
958
C++
.h
27
33.518519
72
0.760259
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,263
landmark.h
VladimirMakeev_D2ModdingToolset/mss32/include/landmark.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef LANDMARK_H #define LANDMARK_H #include "landmarkcat.h" #include "midgardid.h" #include "midobject.h" #include "mqpoint.h" #include "textandid.h" namespace game { struct TLandmarkData { CMqPoint size; bool mountain; char padding[3]; LLandmarkCategory category; TextAndId name; TextAndId description; }; assert_size(TLandmarkData, 40); /** Holds landmark information read from GLmark.dbf. */ struct TLandmark : public IMidObject { TLandmarkData* data; }; assert_size(TLandmark, 12); } // namespace game #endif // LANDMARK_H
1,379
C++
.h
44
29.113636
72
0.759427
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,264
midgardid.h
VladimirMakeev_D2ModdingToolset/mss32/include/midgardid.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MIDGARDID_H #define MIDGARDID_H #include "d2assert.h" namespace game { enum class IdCategory : int { Global = 0, /**< Global entities, mainly from dbf files in globals game folder. */ Campaign, /**< Campaign related entities. */ Scenario, /**< Scenario entities and objects. */ External, /**< User interface messages, text, etc. */ Invalid }; enum class IdType : int { Empty = 0, /**< Type of empty id 'g000000000' when converted from string. * Can not be used to construct id from parts. */ ApplicationText, /**< 'TA', entries of TApp.dbf and TAppEdit.dbf. */ Building, /**< 'BB', entries of Gbuild.dbf. */ Race, /**< 'RR' */ Lord, /**< 'LR' */ Spell, /**< 'SS' */ UnitGlobal, /**< 'UU', units implementations, entries of Gunits.dbf. */ UnitGenerated, /**< 'UG', runtime-generated units implementations. */ UnitModifier, /**< 'UM' */ Attack, /**< 'AA' */ TextGlobal, /**< 'TG', entries of Tglobal.dbf. */ LandmarkGlobal, /**< 'MG', entries of GLmark.dbf. */ ItemGlobal, /**< 'IG', entries of GItem.dbf. */ NobleAction, /**< 'NA', entries of Gaction.dbf. */ DynamicUpgrade, /**< 'DU' */ DynamicAttack, /**< 'DA', runtime-generated implementations of unit's primary attacks */ DynamicAltAttack, /**< 'AL', runtime-generated implementations of unit's alternative attacks */ DynamicAttack2, /**< 'DC', runtime-generated implementations of unit's secondary attacks */ DynamicAltAttack2, /**< 'AC', runtime-generated implementations of unit's alternative secondary attacks */ CampaignFile, /**< 'CC' */ CW, /**< TODO: figure out what is this */ CO, /**< TODO: figure out what is this */ Plan, /**< 'PN' */ ObjectCount, /**< 'OB', number of objects in scenario file. */ ScenarioFile, /**< 'SC' */ Map, /**< 'MP' */ MapBlock, /**< 'MB' */ ScenarioInfo, /**< 'IF' */ SpellEffects, /**< 'ET' */ Fortification, /**< 'FT', capitals and villages. */ Player, /**< 'PL' */ PlayerKnownSpells, /**< 'KS' */ Fog, /**< 'FG' */ PlayerBuildings, /**< 'PB' */ Road, /**< 'RA' */ Stack, /**< 'KC' */ Unit, /**< 'UN' */ Landmark, /**< 'MM' */ Item, /**< 'IM' */ Bag, /**< 'BG' */ Site, /**< 'SI' */ Ruin, /**< 'RU' */ Tomb, /**< 'TB' */ Rod, /**< 'RD' */ Crystal, /**< 'CR' */ Diplomacy, /**< 'DP' */ SpellCast, /**< 'ST' */ Location, /**< 'LO' */ StackTemplate, /**< 'TM' */ Event, /**< 'EV' */ StackDestroyed, /**< 'SD' */ TalismanCharges, /**< 'TC' */ MT, /**< TODO: figure out what is this */ Mountains, /**< 'ML' */ SubRace, /**< 'SR' */ SubRaceType, /**< 'BR', entries of GSubRace.dbf. */ QuestLog, /**< 'QL' */ TurnSummary, /**< 'TS' */ ScenarioVariable, /**< 'SV' */ Invalid, }; /** * Represents entity identifier in game. * Used in game logic as integer and stored as 10-characters string * in game databases and scenario files. * Id string examples: "S143MB0c08", "G000UU3001". * Both identifier representations contains 4 logical parts: * - IdCategory * - Category index * - IdType * - Type index * Example of id string "S143MB0c08" split into logical parts: * - 'S' - IdCategory (Scenario) * - '143' - Category index (scenario with index 143, values are decimal) * - 'MB' - IdType (Identifier describes map block entity) * - '0c08' - Type index (0x0c08, map block y and x coordinates on map) */ struct CMidgardID { int value; }; assert_size(CMidgardID, 4); static constexpr bool operator==(const CMidgardID& first, const CMidgardID& second) { return first.value == second.value; } static constexpr bool operator!=(const CMidgardID& first, const CMidgardID& second) { return !(first == second); } static constexpr bool operator<(const CMidgardID& first, const CMidgardID& second) { return first.value < second.value; } extern const CMidgardID invalidId; extern const CMidgardID emptyId; namespace CMidgardIDApi { struct Api { /** * Returns category part from id. * Same as @code{.cpp}id->value >> 30;@endcode * @returns IdCategory::Invalid in case of invalid id. */ using GetCategory = IdCategory(__thiscall*)(const CMidgardID* id); GetCategory getCategory; /** * Returns category index part from id. * Same as @code{.cpp}(id->value >> 22) & 0xff;@endcode * @returns invalid index of 256 in case of invalid id. */ using GetCategoryIndex = int(__thiscall*)(const CMidgardID* id); GetCategoryIndex getCategoryIndex; /** * Returns type part from id. * Same as @code{.cpp}(id->value >> 16) & 0x3f;@endcode * @returns IdType::Invalid in case of invalid id. */ using GetType = IdType(__thiscall*)(const CMidgardID* id); GetType getType; /** * Returns type index part from id. * Same as @code{.cpp}id->value & 0xffff;@endcode * @returns invalid index value of 0x10000 in case of invalid id. */ using GetTypeIndex = int(__thiscall*)(const CMidgardID* id); GetTypeIndex getTypeIndex; /** * Converts id value to 10 characters length string. * Creates "INVALID-ID" string in case of error. */ using ToString = char*(__thiscall*)(const CMidgardID* id, char* string); ToString toString; /** * Converts string to id value. * Creates invalid id value of 0x3f0000 in case of error. */ using FromString = CMidgardID*(__thiscall*)(CMidgardID* id, const char* string); FromString fromString; /** * Creates id value from its parts. * @returns invalid id value in case of invalid parts. */ using FromParts = CMidgardID*(__stdcall*)(CMidgardID* id, IdCategory category, int categoryIndex, IdType type, int typeIndex); FromParts fromParts; /** Returns true if string can be converted to valid id. */ using IsIdStringValid = bool(__stdcall*)(const char* string); IsIdStringValid isIdStringValid; /** * Checks if 'other' is a special id for summoning units in battle. * 'other' id can be a valid unit id or special id like "G000004e2n", * where n is a position in group for upcoming summon. * Sets 'id' to emptyId if 'other' is a valid unit id, otherwise copies 'other' into 'id'. * @param[inout] id id to store result. * @param[in] other id to check. * @returns pointer to 'id'. */ using IsSummonUnitId = CMidgardID*(__thiscall*)(CMidgardID* id, const CMidgardID* other); IsSummonUnitId isSummonUnitId; /** * Creates special id for summoning units in battle from specified position in group. * 'id' isn't changed if position is not in valid range [0 : 5]. * @param[inout] id to store result. * @param position unit position in group. */ using SummonUnitIdFromPosition = void(__thiscall*)(CMidgardID* id, int position); SummonUnitIdFromPosition summonUnitIdFromPosition; /** * Returns position from special id for summoning units in battle. * Does not check if unit special or not. * Same as @code{.cpp}getTypeIndex(id) - 0x4e20;@endcode */ using SummonUnitIdToPosition = int(__thiscall*)(const CMidgardID* id); SummonUnitIdToPosition summonUnitIdToPosition; /** Creates a new id from the specified id and type. */ using ChangeType = CMidgardID*(__stdcall*)(CMidgardID* id, const CMidgardID* src, IdType newType); ChangeType changeType; /** Checks if all parts of the id are correct and copies it to value. Otherwise, returns the * invalidId. */ using ValidateId = CMidgardID*(__stdcall*)(CMidgardID* value, CMidgardID id); ValidateId validateId; using IdTypeToString = bool(__stdcall*)(const char** result, IdType* idType); IdTypeToString idTypeToString; }; Api& get(); } // namespace CMidgardIDApi } // namespace game #endif // MIDGARDID_H
9,567
C++
.h
230
35.926087
100
0.599119
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,265
imageptrvector.h
VladimirMakeev_D2ModdingToolset/mss32/include/imageptrvector.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef IMAGEPTRVECTOR_H #define IMAGEPTRVECTOR_H #include "d2assert.h" #include "d2vector.h" #include "smartptr.h" namespace game { struct IMqImage2; using ImagePtr = SmartPtr<IMqImage2>; using ImagePtrVector = Vector<ImagePtr>; assert_size(ImagePtrVector, 16); namespace ImagePtrVectorApi { struct Api { using Destructor = void(__thiscall*)(ImagePtrVector* thisptr); Destructor destructor; using Reserve = void(__thiscall*)(ImagePtrVector* thisptr, unsigned int count); Reserve reserve; using PushBack = void*(__thiscall*)(ImagePtrVector* thisptr, const ImagePtr* value); PushBack pushBack; }; Api& get(); } // namespace ImagePtrVectorApi } // namespace game #endif // IMAGEPTRVECTOR_H
1,539
C++
.h
42
34.333333
88
0.765341
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,266
isostillbackground.h
VladimirMakeev_D2ModdingToolset/mss32/include/isostillbackground.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ISOSTILLBACKGROUND_H #define ISOSTILLBACKGROUND_H #include "d2assert.h" namespace game { struct IIsoStillBackgroundVftable; struct SurfaceDecompressData; struct IIsoStillBackground { IIsoStillBackgroundVftable* vftable; }; assert_size(IIsoStillBackground, 4); struct IIsoStillBackgroundVftable { using Destructor = void(__thiscall*)(IIsoStillBackground* thisptr, char flags); Destructor destructor; using Draw = void(__thiscall*)(IIsoStillBackground* thisptr, SurfaceDecompressData* surfaceDecompress); Draw draw; }; assert_vftable_size(IIsoStillBackgroundVftable, 2); struct CIsoStillBackground : public IIsoStillBackground { void*** imageData; }; assert_size(CIsoStillBackground, 8); } // namespace game #endif // ISOSTILLBACKGROUND_H
1,629
C++
.h
45
33.222222
83
0.770847
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,267
managestkinterfhooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/managestkinterfhooks.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MANAGESTKINTERFHOOKS_H #define MANAGESTKINTERFHOOKS_H namespace game { struct CManageStkInterf; struct IMidScenarioObject; } // namespace game namespace hooks { void __fastcall manageStkInterfOnObjectChangedHooked(game::CManageStkInterf* thisptr, int /*%edx*/, game::IMidScenarioObject* obj); } // namespace hooks #endif // MANAGESTKINTERFHOOKS_H
1,280
C++
.h
30
37.366667
85
0.716238
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,268
mqnetplayerserver.h
VladimirMakeev_D2ModdingToolset/mss32/include/mqnetplayerserver.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MQNETPLAYERSERVER_H #define MQNETPLAYERSERVER_H #include "mqnetplayer.h" namespace game { struct IMqNetPlayerServerVftable; /** Interface for network server. */ struct IMqNetPlayerServer : public IMqNetPlayerT<IMqNetPlayerServerVftable> { }; struct IMqNetPlayerServerVftable : public IMqNetPlayerVftable { /** * Destroys remote player with specified id. * CNetDPlayPlayerServer calls IDirectPlay4::DestroyPlayer here. */ using DestroyPlayer = bool(__thiscall*)(IMqNetPlayerServer* thisptr, int playerId); DestroyPlayer destroyPlayer; /** Set maximum client players allowed in session. */ using SetMaxPlayers = bool(__thiscall*)(IMqNetPlayerServer* thisptr, int maxPlayers); SetMaxPlayers setMaxPlayers; /** Allows or disables new client players joining session. */ using SetAllowJoin = bool(__thiscall*)(IMqNetPlayerServer* thisptr, bool allowJoin); SetAllowJoin setAllowJoin; }; assert_vftable_size(IMqNetPlayerServerVftable, 12); } // namespace game #endif // MQNETPLAYERSERVER_H
1,864
C++
.h
44
39.568182
89
0.771697
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,269
dialoginterf.h
VladimirMakeev_D2ModdingToolset/mss32/include/dialoginterf.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef DIALOGINTERFACE_H #define DIALOGINTERFACE_H #include "d2map.h" #include "interface.h" #include <cstddef> namespace game { struct CButtonInterf; struct CListBoxInterf; struct CTextBoxInterf; struct CPictureInterf; struct CRadioButtonInterf; struct CToggleButton; struct CSpinButtonInterf; struct CEditBoxInterf; struct CScrollBarInterf; struct CMidAutoDlgLog; struct IMqImage2; struct CDialogInterfData { char dialogName[48]; SmartPtr<CMidAutoDlgLog> log; Map<char[48] /* control name */, int /* child index */> childControls; IMqImage2* background; CMqRect area; }; assert_size(CDialogInterfData, 104); /** * Holds ui elements created from AutoDialog script. * Represents DIALOG from Interf.dlg or ScenEdit.dlg files. */ struct CDialogInterf : public CInterface { CDialogInterfData* data; }; assert_size(CDialogInterf, 12); assert_offset(CDialogInterf, data, 8); namespace CDialogInterfApi { struct Api { /** Searches for ui element with specific name, returns nullptr if not found. */ using FindControl = CInterface*(__thiscall*)(CDialogInterf* thisptr, const char* controlName); FindControl findControl; template <typename T> using FindUiElement = T*(__stdcall*)(CDialogInterf* thisptr, const char* controlName); /** Searches for button ui element with specific name, returns nullptr if not found. */ FindUiElement<CButtonInterf> findButton; /** Searches for list box ui element with specific name, returns nullptr if not found. */ FindUiElement<CListBoxInterf> findListBox; /** Searches for text box ui element with specific name, returns nullptr if not found. */ FindUiElement<CTextBoxInterf> findTextBox; /** Searches for picture ui element with specific name, returns nullptr if not found. */ FindUiElement<CPictureInterf> findPicture; /** Searches for radio button ui element with specific name, returns nullptr if not found. */ FindUiElement<CRadioButtonInterf> findRadioButton; /** Searches for toggle button ui element with specific name, returns nullptr if not found. */ FindUiElement<CToggleButton> findToggleButton; /** Searches for spin button ui element with specific name, returns nullptr if not found. */ FindUiElement<CSpinButtonInterf> findSpinButton; /** Searches for edit box ui element with specific name, returns nullptr if not found. */ FindUiElement<CEditBoxInterf> findEditBox; /** * Searches for scroll bar ui element with specific name, returns nullptr if not found. * This function exists only in Scenario Editor. */ FindUiElement<CScrollBarInterf> findScrollBar; /** * Shows hidden ui element with specified name. * @returns false if ui element was not found or could not be shown */ using ShowControl = bool(__stdcall*)(CDialogInterf* dialog, const char* dialogName, const char* controlName); ShowControl showControl; /** * Hides ui element with specified name. * @returns false in case ui element could not be hidden. */ using HideControl = bool(__thiscall*)(CDialogInterf* thisptr, const char* controlName); HideControl hideControl; }; Api& get(); } // namespace CDialogInterfApi } // namespace game #endif // DIALOGINTERFACE_H
4,177
C++
.h
102
36.882353
98
0.743393
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,270
fonts.h
VladimirMakeev_D2ModdingToolset/mss32/include/fonts.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef FONTS_H #define FONTS_H #include "d2list.h" #include "d2pair.h" #include "d2string.h" #include "smartptr.h" namespace game { /** Holds bitmap data and metrics of a single font symbol. */ struct FontSymbol { std::uint32_t width; std::uint32_t height; int unknown; std::uint32_t rowLength; char* bitmapData; }; assert_size(FontSymbol, 20); struct FontData { char* name; int height; int lineSpacing; int unknown2; FontSymbol* symbols[256]; }; assert_size(FontData, 1040); /** Holds data and metrics of an entire font. */ struct Font { FontData* data; }; assert_size(Font, 4); /** Holds information about loaded font. */ struct FontInfo { String name; String path; SmartPtr<Font> font; int valid; }; assert_size(FontInfo, 44); using FontInfoList = List<FontInfo>; using FontListPtrPair = Pair<Font*, SmartPtr<FontInfoList>>; assert_size(FontListPtrPair, 12); namespace FontListPtrPairApi { struct Api { using LoadFromFile = FontListPtrPair*(__stdcall*)(FontListPtrPair* pair, const char* directory, const char* filename); LoadFromFile loadFromFile; using IsLoaded = bool(__thiscall*)(const FontListPtrPair* thisptr); IsLoaded isLoaded; using DefaultCtor = FontListPtrPair*(__thiscall*)(FontListPtrPair* thisptr); DefaultCtor defaultCtor; using Destructor = void(__thiscall*)(FontListPtrPair* thisptr); Destructor destructor; using CopyConstructor = FontListPtrPair*(__thiscall*)(FontListPtrPair* thisptr, const FontListPtrPair* other); CopyConstructor copyConstructor; }; Api& get(); } // namespace FontListPtrPairApi struct FontCacheData { FontListPtrPair small; FontListPtrPair normal; FontListPtrPair medium; FontListPtrPair large; FontListPtrPair veryLarge; FontListPtrPair mediumBold; FontListPtrPair menu; }; assert_size(FontCacheData, 84); /** Holds loaded fonts. */ struct FontCache { FontCacheData* data; }; assert_size(FontCache, 4); using FontCachePtr = SmartPtr<FontCache>; namespace FontCacheApi { struct Api { using LoadFontFiles = bool(__stdcall*)(const char* interfFolder); LoadFontFiles loadFontFiles; using DataConstructor = FontCacheData*(__thiscall*)(FontCacheData* thisptr); DataConstructor dataConstructor; using DataDestructor = void(__thiscall*)(FontCacheData* thisptr); DataDestructor dataDestructor; using SmartPtrSetData = void(__thiscall*)(FontCachePtr* thisptr, FontCache* data); SmartPtrSetData smartPtrSetData; FontCachePtr* fontCache; }; Api& get(); } // namespace FontCacheApi } // namespace game #endif // FONTS_H
3,634
C++
.h
116
26.991379
88
0.718553
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,271
midcondplayertype.h
VladimirMakeev_D2ModdingToolset/mss32/include/midcondplayertype.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MIDCONDPLAYERTYPE_H #define MIDCONDPLAYERTYPE_H namespace game { struct CMidEvCondition; struct String; struct IMidgardObjectMap; struct LEventCondCategory; struct ITask; struct CMidgardID; struct ITestCondition; struct CDialogInterf; namespace editor { struct CCondInterf; } } // namespace game namespace hooks { game::CMidEvCondition* createMidCondPlayerType(); void __stdcall midCondPlayerTypeGetInfoString(game::String* info, const game::IMidgardObjectMap* objectMap, const game::CMidEvCondition* eventCondition); game::editor::CCondInterf* createCondPlayerTypeInterf(game::ITask* task, void* a2, const game::CMidgardID* eventId); game::ITestCondition* createTestPlayerType(game::CMidEvCondition* eventCondition); bool checkPlayerTypeConditionValid(game::CDialogInterf* dialog, const game::IMidgardObjectMap* objectMap, const game::CMidgardID* eventId); } // namespace hooks #endif // MIDCONDPLAYERTYPE_H
2,011
C++
.h
47
35.425532
91
0.695184
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,272
fortification.h
VladimirMakeev_D2ModdingToolset/mss32/include/fortification.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef FORTIFICATION_H #define FORTIFICATION_H #include "aipriority.h" #include "idlist.h" #include "mapelement.h" #include "midinventory.h" #include "midscenarioobject.h" #include "midunitgroup.h" #include "stringandid.h" #include <cstddef> namespace game { struct LFortCategory; struct CMidStreamFile; struct CMidUnitGroupFortification : public CMidUnitGroup { }; /** Base class for capitals and villages (cities). */ struct CFortification : public IMidScenarioObject { IMapElement mapElement; IAiPriority aiPriority; StringAndId name; StringAndId description; CMidUnitGroupFortification group; CMidInventory inventory; CMidgardID ownerId; CMidgardID subraceId; CMidgardID stackId; }; assert_offset(CFortification, aiPriority, 28); assert_offset(CFortification, name, 36); assert_offset(CFortification, description, 48); assert_offset(CFortification, group, 60); assert_offset(CFortification, inventory, 112); struct CFortificationVftable : public IMidScenarioObjectVftable { using GetCategory = const LFortCategory*(__thiscall*)(const CFortification* thisptr); GetCategory getCategory; using GetCString = const char*(__thiscall*)(CFortification* thisptr); GetCString getName; GetCString getDescription; /** Returns daily hp regeneration value. */ using GetRegen = int*(__thiscall*)(const CFortification* thisptr, int* regen, const IMidgardObjectMap* objectMap); GetRegen getRegen; using GetInt = int(__thiscall*)(const CFortification* thisptr, const IMidgardObjectMap* objectMap); GetInt getMaxUnitsInGarrison; GetInt getTier; /** Adds protection modifier ids to the list. */ using GetProtection = void(__thiscall*)(CFortification* thisptr, const IMidgardObjectMap* objectMap, IdList* list); GetProtection getProtection; using SetCString = bool(__thiscall*)(CFortification* thisptr, int a2, int a3, const char* value); SetCString setName; SetCString setDescription; using StreamVillageData = void(__thiscall*)(CFortification* thisptr, int a2, CMidStreamFile** stream); StreamVillageData streamVillageData; /** Changes fortification owner and subrace. */ using SetOwner = bool(__thiscall*)(CFortification* thisptr, const CMidgardID* ownerId, const CMidgardID* subraceId); SetOwner setOwner; }; assert_vftable_size(CFortificationVftable, 15); } // namespace game #endif // FORTIFICATION_H
3,744
C++
.h
91
32.912088
89
0.669051
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,273
mqtexturer2.h
VladimirMakeev_D2ModdingToolset/mss32/include/mqtexturer2.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MQTEXTURER2_H #define MQTEXTURER2_H #include "d2assert.h" #include <cstdint> #include <windows.h> namespace game { struct IMqTexturer2Vftable; struct TextureHandle; struct IMqTexture; struct CMqPoint; /** Statistics are shown in CMqFps window. */ struct TexturerStatistics { int unknown; /**< Number of elements in CRendererImpl::data40IntPair.first. */ int surface; int bytes; int video; }; assert_size(TexturerStatistics, 16); struct IMqTexturer2 { IMqTexturer2Vftable* vftable; }; // Virtual table does not contain destructor struct IMqTexturer2Vftable { using SetBool = bool(__thiscall*)(IMqTexturer2* thisptr, bool value); SetBool setUnknown; /** * Setting related to low-end videocards (from game era). * Called when player sets 'High quality translucency effects' in options menu * or 'HighAlpha' in Disciple.ini to low. */ SetBool setLowAlpha; /** * Meaning assumed. * Adds texture handle and checks there is no palette entries associated with specified key. */ using AddTextureCheckPalette = TextureHandle*(__thiscall*)(IMqTexturer2* thisptr, TextureHandle* textureHandle, IMqTexture* texture, CMqPoint* size, std::uint32_t paletteKey, std::uint32_t hint, std::uint16_t opacity); AddTextureCheckPalette addTextureCheckPalette; /** * Meaning assumed. * Adds texture handle. Called from constructor of CMqImage2Surface16, for example. */ using AddTexture = TextureHandle*(__thiscall*)(IMqTexturer2* thisptr, TextureHandle* textureHandle, IMqTexture* texture, const CMqPoint* size, std::uint32_t hint, std::uint16_t opacity); AddTexture addTexture; /** * Meaning assumed. * Removes texture handle. Called from destructor of CMqImage2Surface16, for example. */ using RemoveTexture = void(__thiscall*)(IMqTexturer2* thisptr, TextureHandle* textureHandle); RemoveTexture removeTexture; /** Returns texture by specified handle. */ using GetTexture = IMqTexture*(__thiscall*)(IMqTexturer2* thisptr, int a2); GetTexture getTexture; /** * Checks and restores all lost surfaces found by specified handle, * then forces redraw of IMqTextures found by key from handle. * Same underlying logic is called from IMqRenderer2::method3. */ using Method6 = void(__thiscall*)(IMqTexturer2* thisptr, int a2); Method6 method6; using GetColorBitMask = void(__thiscall*)(IMqTexturer2* thisptr, std::uint32_t* red, std::uint32_t* green, std::uint32_t* blue, std::uint32_t* alpha); GetColorBitMask getColorBitMask; /** * Adds palette entries with specified key. * Generates unique key if provided key is 0. */ using AddPaletteEntries = std::uint32_t(__thiscall*)(IMqTexturer2* thisptr, std::uint32_t key, const PALETTEENTRY* entries); AddPaletteEntries addPaletteEntries; /** * Fills array with 256 palette entries found by specified key. * @returns true if entries were found. */ using GetPaletteEntries = bool(__thiscall*)(const IMqTexturer2* thisptr, std::uint32_t key, PALETTEENTRY* paletteEntries); GetPaletteEntries getPaletteEntries; /** * Removes palette entries by specified key. * Removes palette if there is no textures that uses it. * @returns true if entries were removed. */ using RemovePalette = bool(__thiscall*)(IMqTexturer2* thisptr, std::uint32_t key); RemovePalette removePalette; /** * Clears texture cache. * Called from CMidgardOnKeyPressed when pressing Ctrl+E. */ using ClearTextureCache = int(__thiscall*)(IMqTexturer2* thisptr); ClearTextureCache clearTextureCache; /** Returns current texturer statistics. */ using GetTexturerStats = void(__thiscall*)(const IMqTexturer2* thisptr, TexturerStatistics* texturerStats); GetTexturerStats getTexturerStats; using Method13 = void(__thiscall*)(IMqTexturer2* thisptr, void* a2, void* a3); Method13 method13; }; assert_vftable_size(IMqTexturer2Vftable, 14); } // namespace game #endif // MQTEXTURER2_H
5,994
C++
.h
136
32.5
97
0.60312
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,274
usunitextension.h
VladimirMakeev_D2ModdingToolset/mss32/include/usunitextension.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef USUNITEXTENSION_H #define USUNITEXTENSION_H namespace game { struct IUsUnitExtensionVftable; template <typename T = IUsUnitExtensionVftable> struct IUsUnitExtensionT { const T* vftable; }; struct IUsUnitExtension : public IUsUnitExtensionT<> { }; struct IUsUnitExtensionVftable { using Destructor = void(__thiscall*)(IUsUnitExtension* thisptr, char flags); Destructor destructor; }; } // namespace game #endif // USUNITEXTENSION_H
1,271
C++
.h
36
33.277778
80
0.776691
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,275
functordispatch2.h
VladimirMakeev_D2ModdingToolset/mss32/include/functordispatch2.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef FUNCTORDISPATCH2_H #define FUNCTORDISPATCH2_H #include "d2assert.h" namespace game { template <typename T, typename U> struct CBFunctorDispatch2Vftable; template <typename T, typename U> struct CBFunctorDispatch2 { CBFunctorDispatch2Vftable<T, U>* vftable; }; template <typename T, typename U> struct CBFunctorDispatch2Vftable { /** Calls functor-specific callback function, passing it T and U as a parameters. */ using RunCallback = void(__thiscall*)(CBFunctorDispatch2<T, U>* thisptr, T value, U value2); RunCallback runCallback; }; using AssertCBFunctorDispatch2VftableSize = CBFunctorDispatch2Vftable<void*, void*>; assert_vftable_size(AssertCBFunctorDispatch2VftableSize, 1); template <typename T, typename U, typename Ret> struct CBFunctorDispatch2wRetVftable; template <typename T, typename U, typename Ret> struct CBFunctorDispatch2wRet { CBFunctorDispatch2wRetVftable<T, U, Ret>* vftable; }; template <typename T, typename U, typename Ret> struct CBFunctorDispatch2wRetVftable { /** Calls functor-specific callback function, passing it T and U as a parameters. */ using RunCallback = Ret(__thiscall*)(CBFunctorDispatch2wRet<T, U, Ret>* thisptr, T value, U value2); RunCallback runCallback; }; } // namespace game #endif // FUNCTORDISPATCH2_H
2,197
C++
.h
56
35.678571
96
0.751527
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,276
menuphase.h
VladimirMakeev_D2ModdingToolset/mss32/include/menuphase.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MENUPHASE_H #define MENUPHASE_H #include "catalogvalidate.h" #include "difficultylevel.h" #include "midgardid.h" #include "mqnetsystem.h" #include "racelist.h" #include "smartptr.h" #include <cstddef> #define WIN32_LEAN_AND_MEAN #include <Windows.h> namespace game { struct CMidgard; struct CInterface; struct CInterfManagerImpl; struct ScenarioDataArrayWrapped; struct IMqImage2; struct CMenuBase; struct CMenuPhaseData { CMidgard* midgard; CInterface* currentMenu; SmartPtr<CInterfManagerImpl> interfManager; int transitionNumber; ScenarioDataArrayWrapped* scenarios; SmartPtr<IMqImage2> transitionAnimation; int maxPlayers; bool networkGame; bool host; bool useGameSpy; char padding2; RaceCategoryList races; LRaceCategory race; LDifficultyLevel difficultyLevel; char* scenarioFilePath; CMidgardID scenarioFileId; CMidgardID campaignId; char* scenarioName; char* scenarioDescription; int suggestedLevel; bool unknown8; char padding[3]; HANDLE scenarioFileHandle; int unknown10; }; assert_size(CMenuPhaseData, 116); assert_offset(CMenuPhaseData, races, 40); assert_offset(CMenuPhaseData, scenarioFileId, 84); struct CMenuPhase : public IMqNetSystem , public ICatalogValidate { CMenuPhaseData* data; }; assert_size(CMenuPhase, 12); assert_offset(CMenuPhase, CMenuPhase::IMqNetSystem::vftable, 0); assert_offset(CMenuPhase, CMenuPhase::ICatalogValidate::vftable, 4); namespace CMenuPhaseApi { struct Api { using Constructor = CMenuPhase*(__thiscall*)(CMenuPhase* thisptr, int a2, int a3); Constructor constructor; /** Sets menu transition index, implements menu screen transitions logic. */ using SetTransition = void(__thiscall*)(CMenuPhase* thisptr, int transition); SetTransition setTransition; using CreateMenuCallback = CMenuBase*(__stdcall*)(CMenuPhase* menuPhase); /** * Performs transition between two menu screens. * @param[inout] transition pointer to store transition index. * @param[in] interfManager manager to hide and show menu screens. * @param[in] nextMenu used to store next menu pointer after transition to it. * @param[in] animation transition animation. * @param nextTransition index of next menu screen. * @param[in] animationName animation name to show during transition, optional. * @param[in] callback callbacks that creates new menu object. */ using DoTransition = void(__stdcall*)(CMenuPhase* menuPhase, int* transition, SmartPtr<CInterfManagerImpl>* interfManager, CInterface** nextMenu, SmartPtr<IMqImage2>* animation, int nextTransition, const char* animationName, CreateMenuCallback** callback); DoTransition doTransition; using ShowFullScreenAnimation = void(__stdcall*)(CMenuPhase* menuPhase, int* transition, SmartPtr<CInterfManagerImpl>* interfManager, CInterface** currentMenu, int nextTransition, const char* animationName); ShowFullScreenAnimation showFullScreenAnimation; using SwitchToMenu = void(__thiscall*)(CMenuPhase* thisptr); using ShowTransition = void(__thiscall*)(CMenuPhase* thisptr, int nextTransition); // 21 SwitchToMenu switchToMain; // 0 ShowTransition transitionFromMain; // 22 SwitchToMenu switchToSingle; // 1 ShowTransition transitionFromSingle; // 2 ShowTransition transitionFromProto; // 3 ShowTransition transitionFromHotseat; // 26 SwitchToMenu switchToRaceCampaign; // 5 ShowTransition transitionGodToLord; // 29 SwitchToMenu switchToCustomCampaign; // 8 ShowTransition transitionNewQuestToGod; // 27 SwitchToMenu switchToNewSkirmish; // 6 SwitchToMenu switchTo15Or28; // 28 SwitchToMenu switchToRaceSkirmish; // 7 reuses 5 // 31 SwitchToMenu switchToLord; // 33 SwitchToMenu switchToLoadSkirmish; // 34 SwitchToMenu switchToLoadCampaign; // 32 SwitchToMenu switchToLoadCustomCampaign; // 17 SwitchToMenu switchIntroToMain; // 18 ShowTransition transitionToCredits; // 19 reuses 17 // 23 SwitchToMenu switchToProtocol; // 25 SwitchToMenu switchToMulti; // 4 ShowTransition transitionFromMulti; // 24 SwitchToMenu switchToHotseat; // 9 SwitchToMenu switchToNewSkirmishHotseat; // 10 SwitchToMenu switchToLoadSkirmishHotseat; // 30 SwitchToMenu transitionFromNewSkirmishHotseat; // 14 SwitchToMenu switchToHotseatLobby; // 11 SwitchToMenu switchToSession; // 15 SwitchToMenu switchToLobbyHostJoin; // 16 SwitchToMenu switchToWait; using SetString = void(__thiscall*)(CMenuPhase* thisptr, const char* string); SetString setScenarioFilePath; using SetCampaignId = void(__thiscall*)(CMenuPhase* thisptr, const CMidgardID* campaignId); SetCampaignId setCampaignId; SetString setScenarioName; SetString setScenarioDescription; }; Api& get(); IMqNetSystemVftable* vftable(); } // namespace CMenuPhaseApi } // namespace game #endif // MENUPHASE_H
6,483
C++
.h
186
28.05914
97
0.689732
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,277
drainlevelhooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/drainlevelhooks.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef DRAINLEVELHOOKS_H #define DRAINLEVELHOOKS_H namespace game { struct CBatAttackDrainLevel; struct IMidgardObjectMap; struct BattleMsgData; struct CMidgardID; struct BattleAttackInfo; } // namespace game namespace hooks { void __fastcall drainLevelAttackOnHitHooked(game::CBatAttackDrainLevel* thisptr, int /*%edx*/, game::IMidgardObjectMap* objectMap, game::BattleMsgData* battleMsgData, game::CMidgardID* targetUnitId, game::BattleAttackInfo** attackInfo); } // namespace hooks #endif // DRAINLEVELHOOKS_H
1,553
C++
.h
36
35.388889
81
0.676373
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,278
attackdescriptor.h
VladimirMakeev_D2ModdingToolset/mss32/include/attackdescriptor.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ATTACKDESCRIPTOR_H #define ATTACKDESCRIPTOR_H #include "customattacks.h" #include "idlist.h" namespace game { struct IEncUnitDescriptor; struct IAttack; struct LAttackClass; struct LAttackSource; struct LAttackReach; } // namespace game namespace utils { /** * Note that in terms of descriptions 'Alternative' attack means Doppelganger / TransformSelf. * Despite that in internal game structure (like Gattacks / IUsSoldier) those attack are primary, * having normal attack as alternative. */ enum class AttackType : int { Primary, Secondary, Alternative, }; struct AttackDescriptorData { bool empty; std::string name; game::AttackClassId classId; game::AttackSourceId sourceId; game::AttackReachId reachId; int damage; int drain; int heal; int power; int initiative; int level; bool infinite; bool critHit; hooks::CustomAttackData custom; }; class AttackDescriptor { public: AttackDescriptor(game::IEncUnitDescriptor* descriptor, AttackType type, bool global, int boostDamageLevel = 0, int lowerDamageLevel = 0, int lowerInitiativeLevel = 0, const game::IdList* modifiers = nullptr, int damageMax = INT_MAX); bool empty() const; std::string name() const; game::AttackClassId classId() const; game::AttackSourceId sourceId() const; game::AttackReachId reachId() const; int damage() const; int drain() const; int heal() const; bool hasPower() const; int power() const; int initiative() const; int level() const; int boost() const; int lower() const; int lowerIni() const; bool hasInfinite() const; bool infinite() const; bool critHit() const; std::uint8_t critDamage() const; std::uint8_t critPower() const; std::uint8_t damageRatio() const; bool damageRatioPerTarget() const; bool damageSplit() const; const hooks::CustomAttackData& custom() const; private: AttackDescriptorData data; }; } // namespace utils #endif // ATTACKDESCRIPTOR_H
2,992
C++
.h
98
25.94898
97
0.703781
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,279
itemvaluable.h
VladimirMakeev_D2ModdingToolset/mss32/include/itemvaluable.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ITEMVALUABLE_H #define ITEMVALUABLE_H #include "itembase.h" namespace game { struct CItemValuable : public CItemBase { }; assert_size(CItemValuable, 12); } // namespace game #endif // ITEMVALUABLE_H
1,026
C++
.h
27
36.111111
72
0.767137
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,280
menunewskirmish.h
VladimirMakeev_D2ModdingToolset/mss32/include/menunewskirmish.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MENUNEWSKIRMISH_H #define MENUNEWSKIRMISH_H #include "menubase.h" #include "smartptr.h" namespace game { struct String; struct CMenuPhase; /** Represents base class for different skirmish menus. */ struct CMenuNewSkirmish : public CMenuBase { }; namespace CMenuNewSkirmishApi { struct Api { /** * Initializes CMenuNewSkirmish object, creates menu based on dialogName. * Creates menu ui elements and assigns functors and hotkeys to them. * @param[in] thisptr pointer to existing CMenuNewSkirmish object. * @param[in] menuPhase menu phase object. * @param[in] dialogName name of dialog to create menu and ui elements from. * @returns thisptr. */ using Constructor = CMenuNewSkirmish*(__thiscall*)(CMenuNewSkirmish* thisptr, CMenuPhase* menuPhase, const char* dialogName); Constructor constructor; CMenuBaseApi::Api::ButtonCallback loadScenarioCallback; /** * Updates scenario related ui elements in menu. * @param unknown pointer returned from sub_6804ae(). * @param dialog * @param selectedIndex index of currently selected list box item to update ui according to. */ using UpdateScenarioUi = void(__stdcall*)(void* unknown, CDialogInterf* dialog, int selectedIndex); UpdateScenarioUi updateScenarioUi; }; Api& get(); struct Vftable { void* unknown[38]; }; Vftable* vftable(); } // namespace CMenuNewSkirmishApi } // namespace game #endif // MENUNEWSKIRMISH_H
2,488
C++
.h
64
32.78125
96
0.690743
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,281
dynamiccast.h
VladimirMakeev_D2ModdingToolset/mss32/include/dynamiccast.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef DYNAMICCAST_H #define DYNAMICCAST_H #include <cstdint> namespace game { /** * RTTI type descriptor structure used in game. * Must be aligned on 8 byte boundary. * @see http://www.openrce.org/articles/full_view/21 for additional info. */ struct alignas(8) TypeDescriptor { const void* vftable; /**< Vtable of type_info class. */ void* spare; /**< Used to keep the demangled name returned by type_info::name(). */ // Nonstandard extension: zero-sized array in struct/union #pragma warning(suppress : 4200) char name[0]; /**< Mangled type name. */ }; struct PMD { int mdisp; /**< Member displacement. */ int pdisp; /**< Vbtable displacement. */ int vdisp; /**< Displacement inside vbtable. */ }; struct BaseClassDescriptor { TypeDescriptor* typeDescriptor; /**< Type descriptor of the class. */ /** Number of nested classes following in the Base Class Array. */ std::uint32_t numContainedBases; PMD where; /**< Pointer-to-member displacement info. */ std::uint32_t attributes; /**< Flags, usually 0. */ }; struct BaseClassArray { // Nonstandard extension: zero-sized array in struct/union #pragma warning(suppress : 4200) BaseClassDescriptor* baseClasses[]; }; /** Describes inheritance hierarchy of a class. */ struct ClassHierarchyDescriptor { std::uint32_t signature; std::uint32_t attributes; std::uint32_t numBaseClasses; /**< Number of elements in baseClassArray. */ BaseClassArray* baseClassArray; }; /** * RTTI complete object locator structure used in game. * Allows compiler to find the location of the complete object from a specific vftable pointer. * Pointer to this structure can be found in memory just before class vftable. * @see http://www.openrce.org/articles/full_view/23 for additional info. */ struct CompleteObjectLocator { std::uint32_t signature; std::uint32_t offset; /**< Offset of this vftable in complete class. */ std::uint32_t cdOffset; /**< Constructor displacement offset. */ TypeDescriptor* typeDescriptor; /**< type_info* of the complete class. */ ClassHierarchyDescriptor* classDescriptor; /**< Describes inheritance hierarchy. */ }; template <typename T> struct RttiInfo { const CompleteObjectLocator* locator; T vftable; }; namespace RttiApi { struct Api { /** * Runtime implementation of dynamic_cast operator used in game. * @param[in] ptr pointer to a polymorphic object. * @param vfDelta offset of virtual function pointer in object. * @param[in] srcType static type of object pointed to by the ptr. * @dstType[in] intended result of a cast. * @isReference true if input is a reference. * @returns pointer to object of type dstType or NULL. */ using DynamicCast = void*(__cdecl*)(const void* ptr, int vfDelta, const TypeDescriptor* srcType, const TypeDescriptor* dstType, int isReference); DynamicCast dynamicCast; using TypeInfoRawName = const char*(__thiscall*)(const TypeDescriptor* thisptr); TypeInfoRawName* typeInfoRawName; using TypeInfoInequalityOperator = int(__thiscall*)(const TypeDescriptor* thisptr, const TypeDescriptor* other); TypeInfoInequalityOperator* typeInfoInequalityOperator; using TypeIdOperator = const TypeDescriptor*(__cdecl*)(const void* ptr); TypeIdOperator* typeIdOperator; }; Api& get(); struct Rtti { TypeDescriptor* IMidScenarioObjectType; TypeDescriptor* CMidPlayerType; TypeDescriptor* CPlayerBuildingsType; TypeDescriptor* TBuildingTypeType; TypeDescriptor* TBuildingUnitUpgTypeType; TypeDescriptor* CMidStackType; TypeDescriptor* CUmModifierType; TypeDescriptor* CUmUnitType; TypeDescriptor* CNetMsgType; TypeDescriptor* CCommandMsgType; TypeDescriptor* CStackBattleActionMsgType; TypeDescriptor* CCmdBattleStartMsgType; TypeDescriptor* CCmdBattleChooseActionMsgType; TypeDescriptor* CCmdBattleResultMsgType; TypeDescriptor* CCmdBattleEndMsgType; TypeDescriptor* CCommandMsgTempl_8_1_Type; // CCmdBattleStartMsg TypeDescriptor* CCommandMsgTempl_9_0_Type; // CCmdBattleChooseActionMsg TypeDescriptor* CCommandMsgTempl_10_0_Type; // CCmdBattleResultMsg TypeDescriptor* CCommandMsgTempl_11_2_Type; // CCmdBattleEndMsg TypeDescriptor* CMidgardMapType; TypeDescriptor* IAttackType; TypeDescriptor* CAttackImplType; TypeDescriptor* CAttackModifiedType; TypeDescriptor* IItemType; TypeDescriptor* CItemBattleType; TypeDescriptor* IUsSoldierType; TypeDescriptor* TUsSoldierImplType; TypeDescriptor* IBatAttackType; TypeDescriptor* CBatAttackTransformSelfType; TypeDescriptor* CMidLocationType; TypeDescriptor* TUsRacialSoldierType; TypeDescriptor* IUsStackLeaderType; TypeDescriptor* IUsUnitType; TypeDescriptor* IEncUnitDescriptorType; TypeDescriptor* CMidUnitDescriptorType; TypeDescriptor* CUmAttackType; TypeDescriptor* CUnitTypeDescriptorType; TypeDescriptor* CLeaderUnitDescriptorType; TypeDescriptor* CBatAttackUseOrbType; TypeDescriptor* CBatAttackUseTalismanType; TypeDescriptor* CItemEquipmentType; TypeDescriptor* CUmStackType; TypeDescriptor* CFortificationType; TypeDescriptor* IMidObjectType; TypeDescriptor* IUsNobleType; TypeDescriptor* IUsSummonType; TypeDescriptor* IItemExPotionBoostType; }; const Rtti& rtti(); } // namespace RttiApi } // namespace game #endif // DYNAMICCAST_H
6,565
C++
.h
164
35.25
96
0.728641
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,282
mqthread.h
VladimirMakeev_D2ModdingToolset/mss32/include/mqthread.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MQTHREAD_H #define MQTHREAD_H #include "d2map.h" #include "functordispatch0.h" #include "functordispatch2.h" #include "smartptr.h" #define WIN32_LEAN_AND_MEAN #include <Windows.h> #include <cstddef> #include <cstdint> namespace game { using ThreadMessageIdCallbackPair = Pair<std::uint32_t /* message id */, SmartPtr<CBFunctorDispatch2<std::uint32_t, long>>>; struct CMqThreadData { HANDLE windowHandle; Map<std::uint32_t /* timer id */, SmartPtr<CBFunctorDispatch0>> timerCallbacks; std::uint32_t freeTimerId; Map<std::uint32_t /* callback id */, ThreadMessageIdCallbackPair> messageCallbacks; std::uint32_t freeMessageCallbackId; MapIterator<std::uint32_t /* callback id */, ThreadMessageIdCallbackPair> msgCallbackIterator; HANDLE threadHandle; std::uint32_t threadId; HANDLE eventHandle; std::uint32_t timeoutMs; }; assert_size(CMqThreadData, 96); assert_offset(CMqThreadData, freeTimerId, 32); assert_offset(CMqThreadData, threadHandle, 80); struct CMqThreadVftable; /** Thread wrapper used in game. */ struct CMqThread { CMqThreadVftable* vftable; CMqThreadData* data; }; struct CMqThreadVftable { using Destructor = void(__thiscall*)(CMqThread* thisptr, char flags); Destructor destructor; /** * Called before entering message processing loop. * @returns true if initial setup successfully completed. */ using Start = bool(__thiscall*)(CMqThread* thisptr); Start start; /** Called after message processing loop is finished. */ using Stop = void(__thiscall*)(CMqThread* thisptr); Stop stop; /** * Implements thread logic. * Calls start, runs processing loop, calls stop before exiting. * Before start, creates timer callback that will call update. * @returns true if start returned true. */ using RunThread = bool(__thiscall*)(CMqThread* thisptr); RunThread runThread; /** Called at a constant rate specified by CMqThread::timeoutMs. */ using Update = void(__thiscall*)(CMqThread* thisptr); Update update; }; assert_vftable_size(CMqThreadVftable, 5); } // namespace game #endif // MQTHREAD_H
3,021
C++
.h
82
33.170732
98
0.731691
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,283
loginaccountinterf.h
VladimirMakeev_D2ModdingToolset/mss32/include/loginaccountinterf.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef LOGINACCOUNTINTERF_H #define LOGINACCOUNTINTERF_H namespace hooks { void showLoginAccountDialog(); } #endif // LOGINACCOUNTINTERF_H
957
C++
.h
24
37.958333
72
0.773707
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,284
nativeiteminfo.h
VladimirMakeev_D2ModdingToolset/mss32/include/nativeiteminfo.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef NATIVEITEMINFO_H #define NATIVEITEMINFO_H #include "iteminfo.h" #include "rsgid.h" namespace hooks { class NativeItemInfo final : public rsg::ItemInfo { public: NativeItemInfo(const rsg::CMidgardID& itemId, int value, rsg::ItemType itemType) : itemId{itemId} , value{value} , itemType{itemType} { } ~NativeItemInfo() override = default; const rsg::CMidgardID& getItemId() const override { return itemId; } rsg::ItemType getItemType() const override { return itemType; } int getValue() const override { return value; } private: rsg::CMidgardID itemId; int value{}; rsg::ItemType itemType{rsg::ItemType::Valuable}; }; } // namespace hooks #endif // NATIVEITEMINFO_H
1,603
C++
.h
51
27.764706
84
0.720311
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,285
commandmsg.h
VladimirMakeev_D2ModdingToolset/mss32/include/commandmsg.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef COMMANDMSG_H #define COMMANDMSG_H #include "idlist.h" #include "netmsg.h" namespace game { /** Network command messages identifiers. */ enum class CommandMsgId : int { EraseObject = 0, UpdateObject = 1, MoveStack = 2, StackVisit = 3, StackDestroyed = 4, StackAppear = 5, StackIllusion = 6, StackAction = 7, BattleStart = 8, BattleChooseAction = 9, BattleResult = 10, BattleEnd = 11, NobleAction = 12, NobleActionCancel = 13, NobleResult = 14, ProposeTrade = 15, TradeAccept = 16, ProposeAlliance = 17, AcceptAlliance = 18, BreakAlliance = 19, GiveGold = 20, BeginTurn = 21, TurnInfo = 22, EndTurn = 23, BreakRod = 24, DropRod = 25, CastSpell = 26, TerrainChange = 27, MapChange = 28, RemoveLandmark = 29, OccupyCity = 30, CityGrow = 31, LootRuin = 32, PickupBag = 33, OpenBag = 34, CloseBag = 35, DiscoverSpy = 36, GameSaved = 37, ScenarioEnd = 38, // 39 ? CreateStack = 40, ChangeOwner = 41, ChangeOrder = 42, GiveSpell = 43, GiveItem = 44, ChangeObjective = 45, ChangeFog = 46, ChatMessage = 47, Popup = 48, RemoveRiot = 49, UpgradeLeader = 50, // 51 ? CaptureCapital = 52, CaptureResources = 53, QueueCommands = 54, UnpauseAi = 55, Eem = 56, TurnSummary = 57, ExportLeader = 58, ChangeLandmark = 59, ProposeExchangeMap = 60, AcceptExchangeMap = 61, }; struct CCommandMsgVftable; struct IMidgardObjectMap; struct CCommandMsg : public CNetMsgT<CCommandMsgVftable> { CMidgardID playerId; int unknown; IdList* ids; }; assert_size(CCommandMsg, 16); enum class CommandMsgParam : int { Value0, Value1, Value2, }; template <CommandMsgId ID, CommandMsgParam P> struct CCommandMsgTempl : public CCommandMsg { }; struct CCommandMsgVftable : public CNetMsgVftable { using GetId = CommandMsgId(__thiscall*)(CCommandMsg* thisptr); GetId getId; using GetParam = CommandMsgParam(__thiscall*)(CCommandMsg* thisptr); GetParam getParam; /** Returns true if command can be ignored by current player. */ using CanIgnore = bool(__thiscall*)(const CCommandMsg* thisptr, const IMidgardObjectMap* objectMap, const IdList* playerIds, const CMidgardID* currentPlayerId); CanIgnore canIgnore; }; assert_vftable_size(CCommandMsgVftable, 5); namespace CCommandMsgApi { struct Api { using Destructor = void(__thiscall*)(CCommandMsg* thisptr); Destructor destructor; }; Api& get(); } // namespace CCommandMsgApi } // namespace game #endif // COMMANDMSG_H
3,594
C++
.h
131
22.89313
75
0.680894
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,286
usstackleaderimpl.h
VladimirMakeev_D2ModdingToolset/mss32/include/usstackleaderimpl.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef USSTACKLEADERIMPL_H #define USSTACKLEADERIMPL_H #include "groundcat.h" #include "leaderabilitycat.h" #include "midgardid.h" #include "mq_c_s.h" #include "textandid.h" #include "usstackleader.h" namespace game { /** Holds leader specific data read from GUnits.dbf. */ struct TUsStackLeaderImplData { CMidgardID unitId; /**< UNIT_ID */ int movement; /**< MOVE */ int scout; /**< SCOUT */ int leadership; /**< LEADERSHIP */ int negotiate; /**< NEGOTIATE */ bool fastRetreat; char padding[3]; TextAndId abilityText; /**< ABIL_TXT */ mq_c_s<LGroundCategory> moveBonuses; mq_c_s<LLeaderAbility> abililies; }; assert_size(TUsStackLeaderImplData, 72); struct TUsStackLeaderImplVftable : public IUsStackLeaderVftable { /** Checks that stack leader data is correct. */ using Link = void(__thiscall*)(const IUsStackLeader* thisptr, const GlobalData** globalData); Link link; }; assert_vftable_size(TUsStackLeaderImplVftable, 11); /** Implementation of stack leader interface. */ struct TUsStackLeaderImpl : public IUsStackLeaderT<TUsStackLeaderImplVftable> { TUsStackLeaderImplData* data; }; } // namespace game #endif // USSTACKLEADERIMPL_H
2,037
C++
.h
56
33.892857
97
0.74277
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,287
batattackuseorb.h
VladimirMakeev_D2ModdingToolset/mss32/include/batattackuseorb.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef BATATTACKUSEORB_H #define BATATTACKUSEORB_H #include "batattackitem.h" namespace game { struct CBatAttackUseOrb : CBatAttackItem { CMidgardID unitId; }; assert_size(CBatAttackUseOrb, 16); } // namespace game #endif // BATATTACKUSEORB_H
1,068
C++
.h
29
34.862069
72
0.772287
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,288
enclayoutstack.h
VladimirMakeev_D2ModdingToolset/mss32/include/enclayoutstack.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ENCLAYOUTSTACK_H #define ENCLAYOUTSTACK_H #include "enclayout.h" #include "midgardid.h" namespace game { struct CEncLayoutStackData; struct IMidgardObjectMap; struct CMidStack; struct IMqImage2; struct CEncLayoutStack : public IEncLayout { CEncLayoutStackData* data; }; assert_size(CEncLayoutStack, 16); // Similar to GroupAdapterUnitData struct CEncLayoutStackGroupData { bool unknown; bool unknown1; bool boostApplied[6]; bool lowerApplied[6]; bool potionApplied[6]; bool canLevelUp[6]; bool hasHighLevel[6]; int highLevel[6]; }; assert_size(CEncLayoutStackGroupData, 56); struct CEncLayoutStackData { IMidgardObjectMap* objectMap; CMidgardID stackId; CMidgardID playerId; SmartPointer functor; IMqImage2* spellBoostIcon; IMqImage2* spellLowerIcon; IMqImage2* potionBoostIcon; IMqImage2* upgrageIcon; IMqImage2* highLevelIcons[3]; CMqRect imgLowerArea; CMqRect imgBoostArea; CEncLayoutStackGroupData group; CMqRect unitTxtAreas[6]; CMqRect unitImgAreas[6]; }; assert_size(CEncLayoutStackData, 328); namespace CEncLayoutStackApi { struct Api { using Update = void(__thiscall*)(CEncLayoutStack* thisptr, const IMidgardObjectMap* objectMap, const CMidStack* stack, CDialogInterf* dialog); Update update; }; Api& get(); IEncLayoutVftable* vftable(); } // namespace CEncLayoutStackApi } // namespace game #endif // ENCLAYOUTSTACK_H
2,378
C++
.h
77
26.701299
72
0.737303
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,289
rendererimpl.h
VladimirMakeev_D2ModdingToolset/mss32/include/rendererimpl.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef RENDERERIMPL_H #define RENDERERIMPL_H #include "d2assert.h" #include "d2map.h" #include "mqanimator2.h" #include "mqdisplay2.h" #include "mqrenderer2.h" #include "mqtexturer2.h" #include "rendertypes.h" #include "uievent.h" namespace game { struct CRendererImplDisplayVftable; struct IMqRasterizerFactory; struct IMqRasterizer; struct CUIManager; struct CLogFile; struct Animations; struct CRendererImpl : public IMqDisplay2T<CRendererImplDisplayVftable> , public IMqRenderer2 , public IMqTexturer2 , public IMqAnimator2 { IMqRasterizerFactory* rasterizerFactory; IMqRasterizer* rasterizer; SmartPtr<CUIManager> uiManager; UiEvent destroyEvent; int batchNumber; int unknown4; LARGE_INTEGER perfFrequency; LARGE_INTEGER perfCounter; float fps; RECT windowClientArea; RenderQueue* renderQueue; bool renderingInProcess; char padding[3]; RenderData40SetIntPair** data40IntPair; Map<std::uint32_t /* RenderData22::paletteKey */, PaletteEntryPair>** paletteEntryMap; Map<std::uint32_t /* *TextureHandle::indexPtr */, TextureSurface>** textureSurfaceMap; char unknown8; char padding2[3]; int unknown9; Animations* animations; RenderStatistics renderStats; SmartPointer ptr; CLogFile* logFile; }; assert_size(CRendererImpl, 176); assert_offset(CRendererImpl, CRendererImpl::IMqRenderer2::vftable, 4); assert_offset(CRendererImpl, CRendererImpl::IMqTexturer2::vftable, 8); assert_offset(CRendererImpl, CRendererImpl::IMqAnimator2::vftable, 12); assert_offset(CRendererImpl, rasterizer, 20); assert_offset(CRendererImpl, fps, 80); assert_offset(CRendererImpl, data40IntPair, 108); struct CRendererImplDisplayVftable : public IMqDisplay2Vftable { using Destructor = void(__thiscall*)(CRendererImpl* thisptr, char flags); Destructor destructor; }; assert_vftable_size(CRendererImplDisplayVftable, 12); namespace CRendererImplApi { IMqRenderer2Vftable* vftable(); } } // namespace game #endif // RENDERERIMPL_H
2,847
C++
.h
83
31.542169
90
0.780443
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,290
itembase.h
VladimirMakeev_D2ModdingToolset/mss32/include/itembase.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ITEMBASE_H #define ITEMBASE_H #include "currency.h" #include "item.h" #include "midgardid.h" #include "textandid.h" namespace game { struct CItemBaseData { TextAndId name; TextAndId description; Bank value; CMidgardID unitId; }; assert_size(CItemBaseData, 32); /** Base class for all items read from GItem.dbf. */ struct CItemBase : public IItem { CMidgardID itemId; CItemBaseData* data; }; assert_size(CItemBase, 12); } // namespace game #endif // ITEMBASE_H
1,313
C++
.h
42
29.071429
72
0.755943
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,291
listbox.h
VladimirMakeev_D2ModdingToolset/mss32/include/listbox.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef LISTBOX_H #define LISTBOX_H #include "functordispatch1.h" #include "interface.h" #include "mqpoint.h" #include "smartptr.h" #include <cstddef> namespace game { struct CDialogInterf; struct CImage2TextBackground; struct CListBoxInterfData; /** * List box ui element. * Represents LBOX and TLBOX from Interf.dlg or ScenEdit.dlg files. */ struct CListBoxInterf : public CInterface { CListBoxInterfData* listBoxData; /** Assumption: interface for list box elements rendering. */ struct LBDisplay { const void* vftable; }; }; assert_size(CListBoxInterf, 12); assert_offset(CListBoxInterf, listBoxData, 8); struct CListBoxInterfData { int unknown; int unknown2; int unknown3; int unknown4; int unknown5; CListBoxInterf::LBDisplay* display; SmartPointer ptr; SmartPointer ptr2; int unknown7; int unknown8; int selectedElement; int elementsTotal; int unknown13[10]; Vector<int> childIndices; SmartPtr<CBFunctorDispatch1<int>> onSelectionConfirmed; SmartPtr<CBFunctorDispatch1<int>> onRightMouseButtonPressed; SmartPointer ptr5; CImage2TextBackground* image2TextBgnd; CMqPoint bgndImagePos; }; assert_size(CListBoxInterfData, 148); struct CListBoxDisplayTextData { char unknown[48]; }; assert_size(CListBoxDisplayTextData, 48); /** Assumption: implements rendering for list box containing text elements. */ struct CListBoxDisplayText : public CListBoxInterf::LBDisplay { CListBoxDisplayTextData* data; }; assert_size(CListBoxDisplayText, 8); namespace CListBoxInterfApi { struct Api { /** * Assigns functor with callback to a list box. * Searches for list box element by its and dialog names. * Callback will be called each time when list box selection changes. * @param[in] dialog used for list box search. * @param[in] buttonName list box to assign functor to. * @param[in] dialogName dialog (menu) where to search for list box. * @param[in] functor pointer to existing functor initialized with callback. * @returns list box found with callback set or nullptr if not found. */ using AssignFunctor = CListBoxInterf*(__stdcall*)(CDialogInterf* dialog, const char* listBoxName, const char* dialogName, SmartPointer* functor); AssignFunctor assignFunctor; /** * Assigns functor with callback to a list box display text element. * Searches for list box element by its and dialog names. * Callback will be called each time when list box selection changes. * @param[in] dialog used for list box search. * @param[in] buttonName list box to assign functor to. * @param[in] dialogName dialog (menu) where to search for list box. * @param[in] functor pointer to existing functor initialized with callback. * @param addTextShortenedMark if true, adds '[...]' to shortened list box text elements. * @returns list box found with callback set or nullptr if not found. */ using AssignDisplayTextFunctor = CListBoxInterf*(__stdcall*)(CDialogInterf* dialog, const char* listBoxName, const char* dialogName, SmartPointer* functor, bool addTextShortenedMark); AssignDisplayTextFunctor assignDisplayTextFunctor; /** * Assigns functor with callback to a list box display surface element. * Searches for list box element by its and dialog names. * Callback will be called each time when list box selection changes. * @param[in] dialog used for list box search. * @param[in] buttonName list box to assign functor to. * @param[in] dialogName dialog (menu) where to search for list box. * @param[in] functor pointer to existing functor initialized with callback. * @returns list box found with callback set or nullptr if not found. */ using AssignDisplaySurfaceFunctor = CListBoxInterf*(__stdcall*)(CDialogInterf* dialog, const char* listBoxName, const char* dialogName, SmartPointer* functor); AssignDisplaySurfaceFunctor assignDisplaySurfaceFunctor; /** * Initializes list box with specified number of elements. * @param[in] thisptr list box to initialize. * @param elementsTotal max number of elements to show in list box. * @returns unknown. */ using SetElementsTotal = bool(__thiscall*)(CListBoxInterf* thisptr, int elementsTotal); SetElementsTotal setElementsTotal; /** * Assumption: returns index of currently selected list box element. * Called many times in game code, actual types and meaning unknown. */ using SelectedIndex = int(__thiscall*)(CListBoxInterf* thisptr); SelectedIndex selectedIndex; using SetSelectedIndex = void(__thiscall*)(CListBoxInterf* thisptr, int selectedIndex); SetSelectedIndex setSelectedIndex; }; Api& get(); } // namespace CListBoxInterfApi } // namespace game #endif // LISTBOX_H
6,320
C++
.h
149
34.503356
93
0.672686
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,292
middroptarget.h
VladimirMakeev_D2ModdingToolset/mss32/include/middroptarget.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MIDDROPTARGET_H #define MIDDROPTARGET_H namespace game { struct IMidDropTargetVftable; struct IMidDropTarget { IMidDropTargetVftable* vftable; }; } // namespace game #endif // MIDDROPTARGET_H
1,022
C++
.h
28
34.535714
72
0.773279
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,293
aitacticaction.h
VladimirMakeev_D2ModdingToolset/mss32/include/aitacticaction.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef AITACTICACTION_H #define AITACTICACTION_H #include "d2assert.h" namespace game { struct CMqPoint; struct CMidgardID; struct IMidgardObjectMap; struct CMidServerLogicData; struct IAiTacticInternal; struct IAiTacticActionVftable; struct IAiTacticAction { IAiTacticActionVftable* vftable; }; struct IAiTacticActionVftable { using Destructor = void(__thiscall*)(IAiTacticAction* thisptr, char flags); Destructor destructor; using GetUnknown = int(__thiscall*)(const IAiTacticAction* thisptr); GetUnknown getUnknown; using GetStackId = const CMidgardID*(__thiscall*)(const IAiTacticAction* thisptr); GetStackId getStackId; using GetTargetId = const CMidgardID*(__thiscall*)(const IAiTacticAction* thisptr); GetTargetId getTargetId; using GetTargetPosition = const CMqPoint*(__thiscall*)(const IAiTacticAction* thisptr); GetTargetPosition getTargetPosition; void* methods[2]; using Execute = void(__thiscall*)(IAiTacticAction* thisptr, IMidgardObjectMap* objectMap, CMidServerLogicData* serverLogicData, IAiTacticInternal* tacticInternal); Execute execute; void* method8; }; assert_vftable_size(IAiTacticActionVftable, 9); } // namespace game #endif // AITACTICACTION_H
2,175
C++
.h
55
34.781818
91
0.740494
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,294
custommodifierfunctions.h
VladimirMakeev_D2ModdingToolset/mss32/include/custommodifierfunctions.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef CUSTOMMODIFIERFUNCTIONS_H #define CUSTOMMODIFIERFUNCTIONS_H #include <lua.hpp> #include <optional> #include <sol/sol.hpp> #include <string> namespace hooks { struct CustomModifierFunctions { CustomModifierFunctions(const std::string& scriptFileName); std::optional<sol::environment> environment; std::optional<sol::function> onModifiersChanged; std::optional<sol::function> canApplyToUnit; std::optional<sol::function> canApplyToUnitType; std::optional<sol::function> canApplyAsLowerSpell; std::optional<sol::function> canApplyAsBoostSpell; std::optional<sol::function> getModifierDisplay; std::optional<sol::function> getModifierDescTxt; std::optional<sol::function> getModifierIconName; std::optional<sol::function> getNameTxt; std::optional<sol::function> getDescTxt; std::optional<sol::function> getHitPoint; std::optional<sol::function> getArmor; std::optional<sol::function> getDeathAnim; std::optional<sol::function> getRegen; std::optional<sol::function> getXpNext; std::optional<sol::function> getXpKilled; std::optional<sol::function> getImmuneToAttack; std::optional<sol::function> getImmuneToSource; std::optional<sol::function> getAtckTwice; std::optional<sol::function> getEnrollCost; std::optional<sol::function> getReviveCost; std::optional<sol::function> getHealCost; std::optional<sol::function> getTrainingCost; std::optional<sol::function> getMovement; std::optional<sol::function> hasMovementBonus; std::optional<sol::function> getScout; std::optional<sol::function> getLeadership; std::optional<sol::function> getNegotiate; std::optional<sol::function> hasAbility; std::optional<sol::function> getFastRetreat; std::optional<sol::function> getLowerCost; std::optional<sol::function> getAttackId; std::optional<sol::function> getAttack2Id; std::optional<sol::function> getAltAttackId; std::optional<sol::function> getAttackReach; std::optional<sol::function> getAttackInitiative; std::optional<sol::function> getAttackNameTxt; std::optional<sol::function> getAttack2NameTxt; std::optional<sol::function> getAttackDescTxt; std::optional<sol::function> getAttack2DescTxt; std::optional<sol::function> getAttackDamRatio; std::optional<sol::function> getAttack2DamRatio; std::optional<sol::function> getAttackDrRepeat; std::optional<sol::function> getAttack2DrRepeat; std::optional<sol::function> getAttackDrSplit; std::optional<sol::function> getAttack2DrSplit; std::optional<sol::function> getAttackCritDamage; std::optional<sol::function> getAttack2CritDamage; std::optional<sol::function> getAttackCritPower; std::optional<sol::function> getAttack2CritPower; std::optional<sol::function> getAttackClass; std::optional<sol::function> getAttack2Class; std::optional<sol::function> getAttackSource; std::optional<sol::function> getAttack2Source; std::optional<sol::function> getAttackPower; std::optional<sol::function> getAttack2Power; std::optional<sol::function> getAttackDamage; std::optional<sol::function> getAttack2Damage; std::optional<sol::function> getAttackHeal; std::optional<sol::function> getAttack2Heal; std::optional<sol::function> getAttackDrain; std::optional<sol::function> getAttack2Drain; std::optional<sol::function> getAttackLevel; std::optional<sol::function> getAttack2Level; std::optional<sol::function> getAttackInfinite; std::optional<sol::function> getAttack2Infinite; std::optional<sol::function> getAttackCritHit; std::optional<sol::function> getAttack2CritHit; std::optional<sol::function> getAttackWards; std::optional<sol::function> getAttack2Wards; }; } // namespace hooks #endif // CUSTOMMODIFIERFUNCTIONS_H
4,677
C++
.h
102
41.794118
72
0.759632
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,295
midgardobjectmap.h
VladimirMakeev_D2ModdingToolset/mss32/include/midgardobjectmap.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MIDGARDOBJECTMAP_H #define MIDGARDOBJECTMAP_H #include "midgardid.h" #include "smartptr.h" namespace game { struct IMidgardObjectMapVftable; struct IMidScenarioObject; struct IMidgardObjectMap { struct IteratorVftable; struct Iterator { IteratorVftable* vftable; }; struct IteratorVftable { using Destructor = void(__thiscall*)(Iterator* thisptr, char flags); Destructor destructor; /** Returns true if iterator reached end. */ using End = bool(__thiscall*)(Iterator* thisptr, Iterator* endIterator); End end; /** Returns id of the object that the iterator is currently pointing. */ using GetObjectId = CMidgardID*(__thiscall*)(Iterator* thisptr); GetObjectId getObjectId; /** Advances iterator so it starts pointing to the next object or end. */ using Advance = void(__thiscall*)(Iterator* thisptr); Advance advance; }; const IMidgardObjectMapVftable* vftable; }; assert_vftable_size(IMidgardObjectMap::IteratorVftable, 4); using IteratorPtr = SmartPtr<IMidgardObjectMap::Iterator>; struct IMidgardObjectMapVftable { using Destructor = void(__thiscall*)(IMidgardObjectMap* thisptr, char flags); Destructor destructor; /** Returns scenario id. */ using GetId = const CMidgardID*(__thiscall*)(const IMidgardObjectMap* thisptr); GetId getId; /** Returns total number of objects in scenario. */ using GetObjectsTotal = int(__thiscall*)(const IMidgardObjectMap* thisptr); GetObjectsTotal getObjectsTotal; using GetIterator = IteratorPtr*(__thiscall*)(IMidgardObjectMap* thisptr, IteratorPtr* iterator); /** Returns an iterator to the first record. */ GetIterator begin; /** Returns an iterator to the record following the last one. */ GetIterator end; /** * Finds scenario object by its id. * Returns nullptr if object could not be found. */ using FindScenarioObjectById = IMidScenarioObject*(__thiscall*)(const IMidgardObjectMap* thisptr, const CMidgardID* id); FindScenarioObjectById findScenarioObjectById; /** * Finds scenario object by its id and adds it to change list. * Returns nullptr if object could not be found. */ using FindScenarioObjectByIdForChange = IMidScenarioObject*(__thiscall*)(IMidgardObjectMap* thisptr, const CMidgardID* id); FindScenarioObjectByIdForChange findScenarioObjectByIdForChange; /** * Finds scenario object by its id and adds it to erase list. * Deletes object record locally. * Returns true if object was deleted. */ using DeleteScenarioObjectById = bool(__thiscall*)(IMidgardObjectMap* thisptr, const CMidgardID id); DeleteScenarioObjectById deleteScenarioObjectById; /** * Adds scenario object to the map. * Updates list of added objects. * Returns true if object was added. */ using InsertObject = bool(__thiscall*)(IMidgardObjectMap* thisptr, const IMidScenarioObject* object); InsertObject insertObject; using CreateScenarioId = void(__thiscall*)(IMidgardObjectMap* thisptr, CMidgardID* scenarioId, IdType type); /** * Creates id with IdCategory::Scenario and specified type. * Increments free type index for specified IdType. */ CreateScenarioId createScenarioIdIncFreeIndex; /** Creates id with IdCategory::Scenario and specified type. */ CreateScenarioId createScenarioId; /** Sets free type index for specified IdType. */ using SetFreeTypeIndex = void(__thiscall*)(IMidgardObjectMap* thisptr, IdType type, int freeTypeIndex); SetFreeTypeIndex setFreeTypeIndex; void* unknown; }; assert_vftable_size(IMidgardObjectMapVftable, 13); } // namespace game #endif // MIDGARDOBJECTMAP_H
4,974
C++
.h
116
35.422414
97
0.683862
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,296
batviewerutils.h
VladimirMakeev_D2ModdingToolset/mss32/include/batviewerutils.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef BATVIEWERUTILS_H #define BATVIEWERUTILS_H namespace game { struct CBatViewerUtils { struct CAnimCounter { void* vftable; void* data; }; }; } // namespace game #endif // BATVIEWERUTILS_H
1,039
C++
.h
31
30.903226
72
0.747757
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,297
netmsgmapentry.h
VladimirMakeev_D2ModdingToolset/mss32/include/netmsgmapentry.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef NETMSGMAPENTRY_H #define NETMSGMAPENTRY_H #include "d2assert.h" #include <cstdint> namespace game { struct NetMessageHeader; struct CNetMsg; struct CNetMsgMapEntryVftable; struct CMenusAnsInfoMsg; struct CGameVersionMsg; template <typename T> struct CNetMsgMapEntryT { T* vftable; }; /** Base class for net message map entries. */ struct CNetMsgMapEntry : public CNetMsgMapEntryT<CNetMsgMapEntryVftable> { }; struct CNetMsgMapEntryVftable { using Destructor = void(__thiscall*)(CNetMsgMapEntry* thisptr, char flags); Destructor destructor; /** Returns CNetMsg raw name. */ using GetName = const char*(__thiscall*)(const CNetMsgMapEntry* thisptr); GetName getName; /** Serializes message from header, runs callback. */ using Process = bool(__thiscall*)(CNetMsgMapEntry* thisptr, NetMessageHeader* header, std::uint32_t idFrom, std::uint32_t playerNetId); Process process; }; struct CNetMsgMapEntry_memberVftable; /** * Net message map entry. * Runs callback upon receiving net message of specific type. * Actual class uses templates for specifying messages and callbacks. */ struct CNetMsgMapEntry_member : public CNetMsgMapEntryT<CNetMsgMapEntry_memberVftable> { void* data; bool(__thiscall* callback)(void* thisptr, CNetMsg* netMessage, std::uint32_t idFrom); }; assert_size(CNetMsgMapEntry_member, 12); struct CNetMsgMapEntry_memberVftable : public CNetMsgMapEntryVftable { /** * Runs callback with CNetMsg being cast to appropriate type. * Ignores playerNetId parameter. */ using RunCallback = bool(__thiscall*)(CNetMsgMapEntry_member* thisptr, CNetMsg* netMessage, std::uint32_t idFrom, std::uint32_t playerNetId); RunCallback runCallback; }; struct CNetMsgMapEntryWReceiver_memberVftable; /** * Net message map entry that passes receiver player net id to callback. * Runs callback upon receiving net message of specific type. * Actual class uses templates for specifying messages and callbacks. */ struct CNetMsgMapEntryWReceiver_member : public CNetMsgMapEntryT<CNetMsgMapEntryWReceiver_memberVftable> { void* data; bool(__thiscall* callback)(void* thisptr, CNetMsg* netMessage, std::uint32_t idFrom, std::uint32_t playerNetId); int unknown; }; assert_size(CNetMsgMapEntryWReceiver_member, 16); struct CNetMsgMapEntryWReceiver_memberVftable : public CNetMsgMapEntryVftable { using RunCallback = bool(__thiscall*)(CNetMsgMapEntry_member* thisptr, CNetMsg* netMessage, std::uint32_t idFrom, std::uint32_t playerNetId); RunCallback runCallback; }; namespace CNetMsgMapEntryApi { struct Api { template <typename T> using EntryCallback = bool(__thiscall*)(void* thisptr, const T* message, std::uint32_t idFrom); using MenusAnsInfoCallback = EntryCallback<CMenusAnsInfoMsg>; using GameVersionCallback = EntryCallback<CGameVersionMsg>; template <typename T> using AllocateEntry = CNetMsgMapEntry*(__stdcall*)(void* userData, T callback); AllocateEntry<MenusAnsInfoCallback> allocateMenusAnsInfoEntry; AllocateEntry<GameVersionCallback> allocateGameVersionEntry; }; Api& get(); } // namespace CNetMsgMapEntryApi } // namespace game #endif // NETMSGMAPENTRY_H
4,497
C++
.h
115
32.565217
99
0.697888
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,298
enclayoutunit.h
VladimirMakeev_D2ModdingToolset/mss32/include/enclayoutunit.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ENCLAYOUTUNIT_H #define ENCLAYOUTUNIT_H #include "d2string.h" #include "d2vector.h" #include "enclayout.h" #include "imagepointlist.h" #include "midgardid.h" namespace game { struct IMidgardObjectMap; struct IEncUnitDescriptor; struct CEncParamBase; struct IMqImage2; struct CEncLayoutUnitData { CMidgardID unitId; const IMidgardObjectMap* objectMap; int boostDamageLevel; int lowerDamageLevel; int lowerInitiativeLevel; bool unknown4; char padding[3]; int shatteredArmor; /** Unshatterable armor. Non-zero only during combat. */ int fortificationArmor; Vector<SmartPtr<IMqImage2>> leaderAbilityIcons; Vector<String> leaderAbilityTexts; IEncUnitDescriptor* unitDescriptor; }; assert_size(CEncLayoutUnitData, 68); struct CEncLayoutUnit : public IEncLayout { CEncLayoutUnitData* data; }; assert_size(CEncLayoutUnit, 16); namespace CEncLayoutUnitApi { struct Api { using Constructor = CEncLayoutUnit*(__thiscall*)(CEncLayoutUnit* thisptr, const IMidgardObjectMap* objectMap, CInterface* parent, const CMqRect* area, const CMidgardID* unitId, const CEncParamBase* encParam, const CMidgardID* playerId); Constructor constructor; using Constructor2 = CEncLayoutUnit*(__thiscall*)(CEncLayoutUnit* thisptr, IEncUnitDescriptor* descriptor, CInterface* parent, const CMqRect* area, const CEncParamBase* encParam); Constructor2 constructor2; using DataConstructor = CEncLayoutUnitData*(__thiscall*)(CEncLayoutUnitData* thisptr); DataConstructor dataConstructor; using DataDestructor = void(__thiscall*)(CEncLayoutUnitData* thisptr); DataDestructor dataDestructor; using Initialize = void(__thiscall*)(CEncLayoutUnit* thisptr, const CEncParamBase* encParam); Initialize initialize; using Update = void(__thiscall*)(CEncLayoutUnit* thisptr); Update update; using ListBoxDisplayCallback = void(__thiscall*)(const CEncLayoutUnit* thisptr, ImagePointList* contents, const CMqRect* lineArea, unsigned int index, bool selected); using CreateListBoxDisplayFunctor = SmartPointer*(__stdcall*)(SmartPointer* functor, int a2, CEncLayoutUnit* layout, ListBoxDisplayCallback* callback); CreateListBoxDisplayFunctor createListBoxDisplayFunctor; }; Api& get(); IEncLayoutVftable* vftable(); } // namespace CEncLayoutUnitApi } // namespace game #endif // ENCLAYOUTUNIT_H
4,146
C++
.h
93
31.763441
100
0.60382
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,299
customattacks.h
VladimirMakeev_D2ModdingToolset/mss32/include/customattacks.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef CUSTOMATTACKS_H #define CUSTOMATTACKS_H #include "attackreachcat.h" #include "attacksourcecat.h" #include "midgardid.h" #include <map> #include <string> #include <vector> namespace hooks { static const char damageRatioColumnName[] = "DAM_RATIO"; static const char damageRatioPerTargetColumnName[] = "DR_REPEAT"; static const char damageSplitColumnName[] = "DAM_SPLIT"; static const char critDamageColumnName[] = "CRIT_DAM"; static const char critPowerColumnName[] = "CRIT_POWER"; struct CustomAttackData { std::uint8_t damageRatio; bool damageRatioPerTarget; bool damageSplit; std::uint8_t critDamage; std::uint8_t critPower; }; struct CustomAttackSource { game::LAttackSource source; std::string text; std::string nameId; double immunityAiRating; std::uint32_t wardFlagPosition; }; using CustomAttackSources = std::vector<CustomAttackSource>; struct CustomAttackReach { game::LAttackReach reach; std::string text; std::string reachTxt; std::string targetsTxt; std::string selectionScript; std::string attackScript; bool markAttackTargets; bool melee; std::uint32_t maxTargets; }; using CustomAttackReaches = std::vector<CustomAttackReach>; using CustomAttackDamageRatios = std::map<game::CMidgardID, double>; struct CustomAttacks { CustomAttackSources sources; CustomAttackReaches reaches; std::map<game::CMidgardID, CustomAttackDamageRatios> damageRatios; // Mapped by attack id std::vector<game::CMidgardID> targets; struct { game::CMidgardID unitId; std::uint32_t turnCount; bool used; } freeTransformSelf; bool damageRatiosEnabled; bool critSettingsEnabled; }; void initializeCustomAttacks(); CustomAttacks& getCustomAttacks(); } // namespace hooks #endif // CUSTOMATTACKS_H
2,651
C++
.h
82
29.292683
93
0.761644
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,300
widgetinterf.h
VladimirMakeev_D2ModdingToolset/mss32/include/widgetinterf.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef WIDGETINTERF_H #define WIDGETINTERF_H #include "d2list.h" #include "functordispatch1.h" #include "functordispatch2.h" #include "functordispatch3.h" #include "functordispatch4.h" #include "interface.h" #include "uievent.h" namespace game { struct CWidgetInterf; struct IMqImage2; enum class WidgetMouseState : std::uint32_t { MouseOver = 1, MouseLeftDown = 2, MouseRightDown = 4, MouseBtnPressed = 8, }; struct WidgetState { CMqPoint mousePosition; WidgetMouseState mouseState; bool mouseOver; bool wasPressed; char padding[2]; }; assert_size(WidgetState, 16); struct WidgetImage { SmartPtr<IMqImage2> image; CMqPoint offset; int unknown; }; assert_size(WidgetImage, 20); using WidgetMouseMoveFunctor = CBFunctorDispatch3<CWidgetInterf*, const CMqPoint*, unsigned int>; using WidgetMousePressFunctor = CBFunctorDispatch2<CWidgetInterf*, const CMqPoint*>; using WidgetLeftUpFunctor = CBFunctorDispatch4<CWidgetInterf*, const CMqPoint*, bool, bool>; struct CWidgetInterfData { List<WidgetImage> images; SmartPtr<WidgetMouseMoveFunctor> mouseMoveFunctor; SmartPtr<WidgetMousePressFunctor> mouseLeftDownFunctor; SmartPtr<WidgetMousePressFunctor> mouseRightDownFunctor; SmartPtr<WidgetLeftUpFunctor> mouseLeftUpFunctor; SmartPtr<WidgetMousePressFunctor> mouseRightUpFunctor; SmartPtr<CBFunctorDispatch1<CWidgetInterf*>> mouseDblClickFunctor; std::uint32_t mouseClickTime; bool mouseOver; bool mousePressed; bool mouseLeftUp; bool mouseRightUp; UiEvent mouseMoveEvent; UiEvent mouseLeftDownEvent; UiEvent mouseRightDownEvent; UiEvent mouseLeftUpEvent; UiEvent mouseRightUpEvent; UiEvent mouseDblClickEvent; std::uint32_t mouseMoveMsgId; std::uint32_t mouseLeftDownMsgId; std::uint32_t mouseRightDownMsgId; std::uint32_t mouseLeftUpMsgId; std::uint32_t mouseRightUpMsgId; std::uint32_t mouseDblClickMsgId; WidgetState* state; }; assert_size(CWidgetInterfData, 244); struct CWidgetInterf : public CInterface { CWidgetInterfData* data; }; assert_size(CWidgetInterf, 12); } // namespace game #endif // WIDGETINTERF_H
2,994
C++
.h
92
29.532609
97
0.782398
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,301
unitbranchcat.h
VladimirMakeev_D2ModdingToolset/mss32/include/unitbranchcat.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef UNITBRANCHCAT_H #define UNITBRANCHCAT_H #include "categories.h" #include "categoryids.h" namespace game { struct LUnitBranchTable : public CEnumConstantTable<UnitBranchId> { }; struct LUnitBranch : public Category<UnitBranchId> { }; namespace UnitBranchCategories { struct Categories { LUnitBranch* fighter; LUnitBranch* archer; LUnitBranch* mage; LUnitBranch* special; LUnitBranch* sideshow; }; Categories& get(); /** Returns address of LUnitBranch::vftable used in game. */ const void* vftable(); } // namespace UnitBranchCategories } // namespace game #endif // UNITBRANCHCAT_H
1,433
C++
.h
42
31.952381
72
0.769398
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,302
scenariotemplates.h
VladimirMakeev_D2ModdingToolset/mss32/include/scenariotemplates.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef SCENARIOTEMPLATES_H #define SCENARIOTEMPLATES_H #include "maptemplate.h" namespace hooks { /** Cached info about random scenario generator template. */ struct ScenarioTemplate { ScenarioTemplate(std::string&& filename, rsg::MapTemplateSettings&& settings) : filename{std::move(filename)} , settings{std::move(settings)} { } std::string filename; rsg::MapTemplateSettings settings; }; using ScenarioTemplates = std::vector<ScenarioTemplate>; /** Tries to load templates for random scenario generator. */ bool loadScenarioTemplates(); /** Frees previously loaded random scenario generator templates data. */ void freeScenarioTemplates(); const ScenarioTemplates& getScenarioTemplates(); } // namespace hooks #endif // SCENARIOTEMPLATES_H
1,599
C++
.h
40
37.475
81
0.767442
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,303
itempotionboosttemp.h
VladimirMakeev_D2ModdingToolset/mss32/include/itempotionboosttemp.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ITEMPOTIONBOOSTTEMP_H #define ITEMPOTIONBOOSTTEMP_H #include "itempotionboost.h" namespace game { /** Represents temporary (single day) boost potion. */ struct CItemPotionBoostTemp : public CItemPotionBoost { }; assert_size(CItemPotionBoostTemp, 20); } // namespace game #endif // ITEMPOTIONBOOSTTEMP_H
1,130
C++
.h
28
38.5
72
0.775342
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,304
unitmodifier.h
VladimirMakeev_D2ModdingToolset/mss32/include/unitmodifier.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef UNITMODIFIER_H #define UNITMODIFIER_H #include "midobject.h" #include "modifgroup.h" namespace game { struct TUnitModifierData; struct TUnitModifierVftable; struct GlobalData; struct CDBTable; struct IUsUnit; struct LUnitCategory; struct CUmModifier; /** * Serves as single modifier factory. Id holds an id of modifier that this factory produces. * Reads modifier from DBF, then holds it as global instance and redirects all the calls to it. * Provides access to the global instance in cases where modifier is used globally (city armor * bonus, some spell effects, etc.) or to check if it can be applied. * Uses CUmModifier::Copy to create new instances to be applied to individual units. */ struct TUnitModifier : IMidObjectT<TUnitModifierVftable> { TUnitModifierData* data; }; assert_size(TUnitModifier, 12); struct TUnitModifierData { LModifGroup group; CUmModifier* modifier; }; assert_size(TUnitModifierData, 16); struct TUnitModifierVftable : IMidObjectVftable { using CanApplyWithLeadership = bool(__thiscall*)(const TUnitModifier* thisptr, const int* leadership); CanApplyWithLeadership canApplyWithLeadership; using CanApplyToUnit = bool(__thiscall*)(const TUnitModifier* thisptr, const IUsUnit* unit); CanApplyToUnit canApplyToUnit; using CanApplyToUnitCategory = bool(__thiscall*)(const TUnitModifier* thisptr, const LUnitCategory* unitCategory); CanApplyToUnitCategory canApplyToUnitCategory; using CreateModifier = CUmModifier*(__thiscall*)(const TUnitModifier* thisptr); CreateModifier createModifier; }; assert_vftable_size(TUnitModifierVftable, 5); namespace TUnitModifierApi { struct Api { using Constructor = TUnitModifier*(__thiscall*)(TUnitModifier* thisptr, const CDBTable* dbTable, const char* globalsFolderPath, void* codeBaseEnvProxy, const GlobalData** globalData); Constructor constructor; }; Api& get(); const TUnitModifierVftable* vftable(); } // namespace TUnitModifierApi } // namespace game #endif // UNITMODIFIER_H
3,159
C++
.h
77
34.714286
96
0.709993
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,305
idvector.h
VladimirMakeev_D2ModdingToolset/mss32/include/idvector.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef IDVECTOR_H #define IDVECTOR_H #include "d2vector.h" #include "midgardid.h" namespace game { using IdVector = Vector<CMidgardID>; namespace IdVectorApi { struct Api { using Destructor = void(__thiscall*)(IdVector* thisptr); Destructor destructor; using PushBack = void(__thiscall*)(IdVector* thisptr, const CMidgardID* id); PushBack pushBack; using Reserve = void(__thiscall*)(IdVector* thisptr, unsigned int count); Reserve reserve; using Copy = void(__thiscall*)(IdVector* thisptr, const CMidgardID* begin, const CMidgardID* end); Copy copy; }; Api& get(); } // namespace IdVectorApi } // namespace game #endif // IDVECTOR_H
1,561
C++
.h
42
33.02381
80
0.715139
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,306
musichooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/musichooks.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef MUSICHOOKS_H #define MUSICHOOKS_H namespace game { struct CMidMusic; struct LRaceCategory; } // namespace game namespace hooks { void __fastcall playBattleTrackHooked(game::CMidMusic* thisptr, int /*%edx*/); void __fastcall playCapitalTrackHooked(game::CMidMusic* thisptr, int /*%edx*/, const game::LRaceCategory* raceCategory); } // namespace hooks #endif // MUSICHOOKS_H
1,278
C++
.h
31
36.935484
80
0.721774
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,307
difficultylevel.h
VladimirMakeev_D2ModdingToolset/mss32/include/difficultylevel.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef DIFFICULTYLEVEL_H #define DIFFICULTYLEVEL_H #include "categories.h" #include "categoryids.h" namespace game { struct LDifficultyLevelTable : public CEnumConstantTable<DifficultyLevelId> { }; struct LDifficultyLevel : public Category<DifficultyLevelId> { }; namespace DifficultyLevelCategories { struct Categories { LDifficultyLevel* easy; LDifficultyLevel* average; LDifficultyLevel* hard; LDifficultyLevel* veryHard; }; Categories& get(); } // namespace DifficultyLevelCategories } // namespace game #endif // DIFFICULTYLEVEL_H
1,376
C++
.h
39
33.153846
75
0.782051
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,308
displayd3d.h
VladimirMakeev_D2ModdingToolset/mss32/include/displayd3d.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef DISPLAYD3D_H #define DISPLAYD3D_H #include "d2string.h" #include "displaysettings.h" #include "mqpoint.h" #include "mqrasterizer.h" #include "smartptr.h" #include <ddraw.h> struct IDirect3DDevice7; namespace game { struct CLogFile; struct D3dDeviceInfo { String devInfo; bool canRenderWindowed; bool drawPrimitives2ExtSupported; bool squareOnlyTextures; bool pow2TexturesRequired; bool nonLocalVideoMem; bool pageLockRequired; char padding[2]; GUID deviceGuid; SmartPtr<GUID> driverGuid; }; assert_size(D3dDeviceInfo, 48); struct CDisplayD3DData { IDirect3DDevice7* device; IDirectDrawSurface7* surface; IDirectDrawSurface7* attachedSurface; int colorKeyedTexturesSupported; DDPIXELFORMAT pixelFormat; bool alwaysFalse; char padding[3]; CMqPoint maxTextureSize; D3dDeviceInfo deviceInfo; DisplaySettings displaySettings; bool isFullscreen; char padding2[3]; int refreshRate; CMqPoint screenSurfaceSize; bool unknown7; bool unknown8; char padding3[2]; CMqPoint areaSize; CMqPoint areaStart; CMqPoint position; IDirectDrawSurface7* anotherSurface; CMqPoint displaySize; bool scalingSupported; char padding4[3]; HWND windowHandle; IDirectDrawSurface7* surface1152; IDirectDrawSurface7* pixelFormatSurface; bool unknown4; bool unknown4_1; char padding5[2]; float vertexZ; int counter; CLogFile* logFile; int unknown5; }; assert_size(CDisplayD3DData, 212); struct CDisplayD3D : public IMqRasterizer { CDisplayD3DData* data; }; assert_size(CDisplayD3D, 8); namespace CDisplayD3DApi { struct Api { using DrawPrimitive = void(__thiscall*)(CDisplayD3D* thisptr, IDirectDrawSurface7* surface, const CMqPoint* a3, const CMqPoint* position, const CMqPoint* areaSize, const CMqPoint* screenSurfaceSize, std::int16_t opacity); DrawPrimitive drawPrimitive; using SwapBuffers = void(__thiscall*)(CDisplayD3D* thisptr); SwapBuffers swapBuffers; using AlphaBlend = void(__thiscall*)(CDisplayD3D* thisptr, IDirectDrawSurface7* surface, const CMqPoint* a3, const CMqPoint* dstPosition, const CMqPoint* areaSize, int opacity); AlphaBlend alphaBlend; }; Api& get(); } // namespace CDisplayD3DApi } // namespace game #endif // DISPLAYD3D_H
3,630
C++
.h
111
25.306306
78
0.665047
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,309
restrictions.h
VladimirMakeev_D2ModdingToolset/mss32/include/restrictions.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef RESTRICTIONS_H #define RESTRICTIONS_H #include <cstdint> namespace game { template <typename T> struct Restriction { T min; T max; }; /** Determines a number of unit over-levels to display colored swords on top of its icon. */ typedef std::uint32_t UnitHighLevels[3]; /** Addresses of global variables representing game restrictions. */ struct GameRestrictions { Restriction<int>* spellLevel; Restriction<int>* unitTier; Restriction<int>* attackDamage; Restriction<int>* unitArmor; Restriction<int>* unitHp; Restriction<int>* stackScoutRange; Restriction<int>* stackMovement; Restriction<int>* stackLeadership; Restriction<int>* attackInitiative; Restriction<int>* attackPower; Restriction<int>* leaderLevel; int* unitMaxLevel; std::uint32_t* fighterExplorerLeaderBonusMaxDamage; std::uint8_t* criticalHitDamage; std::uint8_t* mageLeaderAttackPowerReduction; UnitHighLevels* unitHighLevels; // No dedicated game variable for this, see implementation of CDBTableApi::readHeal // Note that the default minimum of 1 is reduced to 0 due to optional healing added for Bestow // Wards (see attackImplCtorHooked) Restriction<int> attackHeal; // No dedicated game variable for this, see implementation of DBReadRegenFieldWithBoundsCheck // (Akella 0x5A7EB0) Restriction<int> unitRegen; // No dedicated game variable for this, see implementation of DBReadPercentFieldWithBoundsCheck // (Akella 0x596A86) Restriction<int> percentValue; }; GameRestrictions& gameRestrictions(); } // namespace game #endif // RESTRICTIONS_H
2,454
C++
.h
63
35.746032
99
0.763125
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,310
usglobal.h
VladimirMakeev_D2ModdingToolset/mss32/include/usglobal.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef USGLOBAL_H #define USGLOBAL_H #include "usunitextension.h" namespace game { struct IUsGlobal : public IUsUnitExtension { }; } // namespace game #endif // USGLOBAL_H
991
C++
.h
26
36.230769
72
0.765381
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,311
subracetype.h
VladimirMakeev_D2ModdingToolset/mss32/include/subracetype.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef SUBRACETYPE_H #define SUBRACETYPE_H #include "midobject.h" #include "subracecat.h" #include "textandid.h" namespace game { struct TSubRaceTypeVftable; struct TSubRaceTypeData; /** Holds subrace information read from GSubRace.dbf. */ struct TSubRaceType : public IMidObjectT<TSubRaceTypeVftable> { TSubRaceTypeData* data; }; assert_size(TSubRaceType, 12); struct TRaceTypeVftable : public IMidObjectVftable { /** Assumption: can be Validate method, similar to TRaceType::Validate. */ void* method1; }; assert_vftable_size(TRaceTypeVftable, 2); struct TSubRaceTypeData { LSubRaceCategory category; TextAndId name; }; assert_size(TSubRaceTypeData, 20); } // namespace game #endif // SUBRACETYPE_H
1,547
C++
.h
46
31.565217
78
0.775688
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,312
battlemsgdatahooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/battlemsgdatahooks.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef BATTLEMSGDATAHOOKS_H #define BATTLEMSGDATAHOOKS_H #include "d2pair.h" #include "d2set.h" namespace game { struct CMidgardID; struct BattleMsgData; struct IMidgardObjectMap; using TargetSet = Set<int>; using GroupIdTargetsPair = Pair<CMidgardID, TargetSet>; enum class BattleAction : int; } // namespace game namespace hooks { game::BattleMsgData* __fastcall battleMsgDataCtorHooked(game::BattleMsgData* thisptr, int /*%edx*/); game::BattleMsgData* __fastcall battleMsgDataCopyCtorHooked(game::BattleMsgData* thisptr, int /*%edx*/, const game::BattleMsgData* src); game::BattleMsgData* __fastcall battleMsgDataCopyAssignHooked(game::BattleMsgData* thisptr, int /*%edx*/, const game::BattleMsgData* src); game::BattleMsgData* __fastcall battleMsgDataCopyHooked(game::BattleMsgData* thisptr, int /*%edx*/, const game::BattleMsgData* src); void __fastcall battleMsgDataDtorHooked(game::BattleMsgData* thisptr, int /*%edx*/); void __fastcall removeUnitInfoHooked(game::BattleMsgData* thisptr, int /*%edx*/, const game::CMidgardID* unitId); void __stdcall updateBattleActionsHooked(const game::IMidgardObjectMap* objectMap, const game::BattleMsgData* battleMsgData, const game::CMidgardID* unitId, game::Set<game::BattleAction>* actions, game::GroupIdTargetsPair* attackTargets, game::GroupIdTargetsPair* item1Targets, game::GroupIdTargetsPair* item2Targets); void __fastcall beforeBattleRoundHooked(game::BattleMsgData* thisptr, int /*%edx*/); } // namespace hooks #endif // BATTLEMSGDATAHOOKS_H
3,004
C++
.h
55
40.727273
100
0.608933
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,313
itemtravelitem.h
VladimirMakeev_D2ModdingToolset/mss32/include/itemtravelitem.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ITEMTRAVELITEM_H #define ITEMTRAVELITEM_H #include "itemequipment.h" namespace game { struct CItemTravelItem : public CItemEquipment { }; assert_size(CItemTravelItem, 24); } // namespace game #endif // ITEMTRAVELITEM_H
1,046
C++
.h
27
36.851852
72
0.771739
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,314
scenedit.h
VladimirMakeev_D2ModdingToolset/mss32/include/scenedit.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef SCENEDIT_H #define SCENEDIT_H #include "d2assert.h" #include "smartptr.h" #include <cstddef> namespace game { struct CMidgardScenarioMap; struct GameSettings; struct GameImageDataWrapper; struct CAutoDialog; struct CInterfManagerImpl; struct CMqFps; struct CScenEditDataUnknownData { int unknown; int unknown2; CMidgardScenarioMap* scenarioMap; int unknown3; int unknown4; int unknown5; }; assert_size(CScenEditDataUnknownData, 24); struct CScenEditDataUnknown { CScenEditDataUnknownData* data; }; assert_size(CScenEditDataUnknown, 4); struct CScenEditData { bool initialized; char padding[3]; GameSettings** gameSettings; GameImageDataWrapper* interfImages; CAutoDialog* autoDialog; char unknown[8]; CScenEditDataUnknown* unknown2; int unknown3; void* cityNames; void* ruinNames; void* merchantNames; void* trainerNames; void* mercCampNames; void* mageNames; void* rndUnits; void* rndItems; SmartPtr<CInterfManagerImpl> interfManager; char unknown4[1028]; CMqFps* fps; bool showFullSystemInfo; char padding2[3]; }; assert_size(CScenEditData, 1108); assert_offset(CScenEditData, unknown2, 24); assert_offset(CScenEditData, interfManager, 64); struct CScenEdit { CScenEditData* data; }; assert_size(CScenEdit, 4); namespace CScenEditApi { struct Api { using Instance = CScenEdit*(__cdecl*)(); Instance instance; }; Api& get(); } // namespace CScenEditApi } // namespace game #endif // SCENEDIT_H
2,358
C++
.h
87
24.275862
72
0.762539
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,315
usracialsoldier.h
VladimirMakeev_D2ModdingToolset/mss32/include/usracialsoldier.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef USRACIALSOLDIER_H #define USRACIALSOLDIER_H #include "usglobal.h" #include "ussoldierimpl.h" #include "usunitextension.h" #include "usunitimpl.h" #include <cstddef> namespace game { struct IUsRacialSoldierVftable; struct IUsRacialSoldier : public IUsUnitExtensionT<IUsRacialSoldierVftable> { }; struct IUsRacialSoldierVftable : public IUsUnitExtensionVftable { using GetId = const CMidgardID*(__thiscall*)(const IUsRacialSoldier* thisptr); GetId getPrevUnitImplId; GetId getUpgradeBuildingId; GetId getEnrollBuildingId; }; assert_vftable_size(IUsRacialSoldierVftable, 4); /** Holds soldier specific data read from GUnits.dbf. */ struct TUsRacialSoldierData { int xpNext; /**< XP_NEXT */ CMidgardID prevUnitImplId; /**< PREV_ID */ CMidgardID upgradeBuildingId; /**< UPGRADE_B */ CMidgardID enrollBuildingId; /**< ENROLL_B */ }; assert_size(TUsRacialSoldierData, 16); /** * Represents soldier unit template. * Soldier unit in scenario is represented by CMidUnit * which accesses soldier template data via CMidUnit::unitImpl pointer. * Soldier units are hired in cities and can be upgraded depending on buildings in capital. * They are ordinary units in groups. */ struct TUsRacialSoldier : public IUsRacialSoldier , public IUsGlobal , public TUsUnitImpl , public TUsSoldierImpl { TUsRacialSoldierData* data; }; assert_size(TUsRacialSoldier, 40); assert_offset(TUsRacialSoldier, TUsRacialSoldier::IUsRacialSoldier::vftable, 0); assert_offset(TUsRacialSoldier, TUsRacialSoldier::IUsGlobal::vftable, 4); assert_offset(TUsRacialSoldier, TUsRacialSoldier::TUsUnitImpl::vftable, 8); assert_offset(TUsRacialSoldier, TUsRacialSoldier::TUsSoldierImpl::vftable, 28); assert_offset(TUsRacialSoldier, data, 36); } // namespace game #endif // USRACIALSOLDIER_H
2,661
C++
.h
69
36.275362
91
0.775795
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,316
aistate.h
VladimirMakeev_D2ModdingToolset/mss32/include/aistate.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef AISTATE_H #define AISTATE_H #include "d2assert.h" namespace game { struct IAiStateVftable; struct IAiState { IAiStateVftable* vftable; }; struct IAiStateVftable { using Destructor = void(__thiscall*)(IAiState* thisptr, char flags); Destructor destructor; void* methods[9]; }; assert_vftable_size(IAiStateVftable, 10); } // namespace game #endif // AISTATE_H
1,204
C++
.h
36
31.25
72
0.761658
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,317
aistratplayer.h
VladimirMakeev_D2ModdingToolset/mss32/include/aistratplayer.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2022 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef AISTRATPLAYER_H #define AISTRATPLAYER_H #include "d2assert.h" namespace game { struct IAiStratPlayerVftable; struct IAiStratPlayer { IAiStratPlayerVftable* vftable; }; struct IAiStratPlayerVftable { using Destructor = void(__thiscall*)(IAiStratPlayer* thisptr, char flags); Destructor destructor; void* methods[2]; }; assert_vftable_size(IAiStratPlayerVftable, 3); } // namespace game #endif // AISTRATPLAYER_H
1,257
C++
.h
36
32.722222
78
0.772089
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,318
taskbase.h
VladimirMakeev_D2ModdingToolset/mss32/include/taskbase.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef TASKBASE_H #define TASKBASE_H #include "freetask.h" namespace game::editor { struct CTaskBaseData { char unknown[8]; }; assert_size(CTaskBaseData, 8); struct CTaskBase : public CFreeTask { CTaskBaseData* taskBaseData; }; } // namespace game::editor #endif // TASKBASE_H
1,106
C++
.h
33
31.515152
72
0.762441
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,319
functordispatch3.h
VladimirMakeev_D2ModdingToolset/mss32/include/functordispatch3.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef FUNCTORDISPATCH3_H #define FUNCTORDISPATCH3_H namespace game { template <typename T, typename U, typename V> struct CBFunctorDispatch3Vftable; template <typename T, typename U, typename V> struct CBFunctorDispatch3 { CBFunctorDispatch3Vftable<T, U, V>* vftable; }; template <typename T, typename U, typename V> struct CBFunctorDispatch3Vftable { /** Calls functor-specific callback function, passing it T, U and V as a parameters. */ using RunCallback = void(__thiscall*)(CBFunctorDispatch3<T, U, V>* thisptr, T value, U value2, V value3); RunCallback runCallback; }; } // namespace game #endif // FUNCTORDISPATCH3_H
1,586
C++
.h
40
34.5
91
0.705653
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,320
globaldata.h
VladimirMakeev_D2ModdingToolset/mss32/include/globaldata.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2020 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef GLOBALDATA_H #define GLOBALDATA_H #include "d2list.h" #include "d2map.h" #include "d2pair.h" #include "midgardid.h" #include "mq_c_s.h" #include "smartptr.h" #include <cstddef> namespace game { struct LAttackClassTable; struct LAttackSourceTable; struct LAttackReachTable; struct LUnitBranchTable; struct LUnitCategoryTable; struct LBuildingCategoryTable; struct LGroundCategoryTable; struct LDifficultyLevelTable; struct LItemCategoryTable; struct LLordCategoryTable; struct LModifierElementTable; struct LOrderCategoryTable; struct LRaceCategoryTable; struct LSubRaceCategoryTable; struct LResourceTypeTable; struct LSiteCategoryTable; struct LSpellCategoryTable; struct LTerrainCategoryTable; struct LLeaderAbilityTable; struct LLeaderCategoryTable; struct LAiSpellCategoryTable; struct LModifGroupTable; struct LAttitudesCategoryTable; struct LAiMsgCategoryTable; struct LNobleActionCatTable; struct LImmuneCatTable; struct LFortCategoryTable; struct LEventCondCategoryTable; struct LEventEffectCategoryTable; struct LLandmarkCategoryTable; struct LDeathAnimCategoryTable; struct TBuildingType; struct TRaceType; struct TSubRaceType; struct TLordType; struct TStrategicSpell; struct TUsUnitImpl; struct TUnitModifier; struct CAttackImpl; struct TLandmark; struct TItemTypeList; struct GlobalVariables; struct CUnitGenerator; struct CItemBase; struct CDynUpgrade; struct CTileVariation; using RacesMap = mq_c_s<Pair<CMidgardID, TRaceType*>>; using DynUpgradeList = List<SmartPtr<CDynUpgrade>>; using TextMap = mq_c_s<Pair<CMidgardID, char*>>; using AttackMap = mq_c_s<Pair<CMidgardID, CAttackImpl*>>; using BuildingMap = mq_c_s<Pair<CMidgardID, TBuildingType*>>; struct GlobalUnits { mq_c_s<Pair<CMidgardID, TUsUnitImpl*>>* map; /** Used to calculate typeIndex offset for ids of generated instances. */ Map<CMidgardID, std::uint32_t> indexMap; /** Only counts items read from GUnits.dbf, thus excluding generated instances. */ std::uint32_t baseCount; }; assert_size(GlobalUnits, 36); /** Holds global game information. */ struct GlobalData { TextMap* texts; LAttackClassTable* attackClasses; LAttackSourceTable* attackSources; LAttackReachTable* attackReaches; LUnitBranchTable* unitBranches; LUnitCategoryTable* unitCategories; LBuildingCategoryTable* buildingCategories; LGroundCategoryTable* groundCategories; LDifficultyLevelTable* difficultyLevels; LItemCategoryTable* itemCategories; LLordCategoryTable* lordCategories; LModifierElementTable* modifierElements; LOrderCategoryTable* orderCategories; LRaceCategoryTable* raceCategories; LSubRaceCategoryTable* subRaceCategories; LResourceTypeTable* resourceTypes; LSiteCategoryTable* siteCategories; LSpellCategoryTable* spellCategories; LTerrainCategoryTable* terrainCategories; LLeaderAbilityTable* leaderAbilities; LLeaderCategoryTable* leaderCategories; LAiSpellCategoryTable* aiSpellCategories; LModifGroupTable* modifGroups; LAttitudesCategoryTable* attitudesCategories; LAiMsgCategoryTable* aiMsgCategories; LNobleActionCatTable* nobleActionCategories; LImmuneCatTable* immuneCategories; LFortCategoryTable* fortCategories; LEventCondCategoryTable* eventCondCategories; LEventEffectCategoryTable* eventEffectCategories; LLandmarkCategoryTable* landmarkCategories; LDeathAnimCategoryTable* deathAnimCategories; BuildingMap** buildings; RacesMap** races; mq_c_s<Pair<CMidgardID, TSubRaceType*>>* subRaces; mq_c_s<Pair<CMidgardID, TLordType*>>* lords; mq_c_s<Pair<CMidgardID, TStrategicSpell*>>** spells; GlobalUnits* units; mq_c_s<Pair<CMidgardID, TUnitModifier*>>* modifiers; AttackMap* attacks; mq_c_s<Pair<CMidgardID, TLandmark*>>** landmarks; TItemTypeList* itemTypes; int* actions; int* transf; DynUpgradeList* dynUpgrade; CTileVariation* tileVariation; int* aiAttitudes; int* aiMessages; GlobalVariables** globalVariables; CUnitGenerator* unitGenerator; int initialized; }; assert_size(GlobalData, 204); assert_offset(GlobalData, dynUpgrade, 176); namespace GlobalDataApi { struct Api { using GetGlobalData = GlobalData**(__cdecl*)(); GetGlobalData getGlobalData; /** Searches an entity by its id. */ using FindById = void*(__thiscall*)(const void* entityCollection, const CMidgardID* id); FindById findById; using FindItemById = const CItemBase*(__thiscall*)(TItemTypeList* thisptr, const CMidgardID* id); FindItemById findItemById; using FindDynUpgradeById = const CDynUpgrade*(__thiscall*)(DynUpgradeList* thisptr, const CMidgardID* id); FindDynUpgradeById findDynUpgradeById; /** Searches a text from Tglobal.dbf by its id. Returns empty string if not found. */ using FindTextById = const char*(__thiscall*)(const TextMap* thisptr, const CMidgardID* id); FindTextById findTextById; }; Api& get(); } // namespace GlobalDataApi } // namespace game #endif // GLOBALDATA_H
5,972
C++
.h
167
32.203593
96
0.782541
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,321
itemextension.h
VladimirMakeev_D2ModdingToolset/mss32/include/itemextension.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2023 Stanislav Egorov. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef ITEMEXTENSION_H #define ITEMEXTENSION_H namespace game { struct IItemExtensionVftable; template <typename T = IItemExtensionVftable> struct IItemExtensionT { const T* vftable; }; struct IItemExtension : public IItemExtensionT<> { }; assert_size(IItemExtension, 4); struct IItemExtensionVftable { using Destructor = void(__thiscall*)(IItemExtension* thisptr, char flags); Destructor destructor; }; assert_vftable_size(IItemExtensionVftable, 1); } // namespace game #endif // ITEMEXTENSION_H
1,333
C++
.h
38
33.052632
78
0.776654
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false
1,542,322
usleader.h
VladimirMakeev_D2ModdingToolset/mss32/include/usleader.h
/* * This file is part of the modding toolset for Disciples 2. * (https://github.com/VladimirMakeev/D2ModdingToolset) * Copyright (C) 2021 Vladimir Makeev. * * 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 <http://www.gnu.org/licenses/>. */ #ifndef USLEADER_H #define USLEADER_H #include "usunitextension.h" namespace game { struct Bank; struct CMidgardID; struct LLeaderCategory; struct GlobalData; struct IUsLeaderVftable; /** Leader interface. */ struct IUsLeader : public IUsUnitExtensionT<IUsLeaderVftable> { }; struct IUsLeaderVftable : public IUsUnitExtensionVftable { using GetCategory = const LLeaderCategory*(__thiscall*)(const IUsLeader* thisptr); GetCategory getCategory; using GetPrevUnitImplId = const CMidgardID*(__thiscall*)(const IUsLeader* thisptr); GetPrevUnitImplId getPrevUnitImplId; using GetEnrollCost = const Bank*(__thiscall*)(const IUsLeader* thisptr); GetEnrollCost getEnrollCost; /** Checks that leader data is correct. */ using Link = void(__thiscall*)(const IUsLeader* thisptr, const GlobalData** globalData); Link link; }; assert_vftable_size(IUsLeaderVftable, 5); } // namespace game #endif // USLEADER_H
1,756
C++
.h
45
36.577778
92
0.770453
VladimirMakeev/D2ModdingToolset
32
13
15
GPL-3.0
9/20/2024, 10:45:25 PM (Europe/Amsterdam)
false
false
false
false
false
false
false
false