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,423
mqpresentationmanager.h
VladimirMakeev_D2ModdingToolset/mss32/include/mqpresentationmanager.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 MQPRESENTATIONMANAGER_H #define MQPRESENTATIONMANAGER_H #include "d2list.h" #include "d2pair.h" #include "uievent.h" namespace game { struct CRendererImpl; struct CLogFile; struct IMqRenderer2; struct CMqPresentationManagerData; struct CMqPresentationManager { struct IPresentationVftable; struct IPresentation { IPresentationVftable* vftable; }; CMqPresentationManagerData* data; }; assert_size(CMqPresentationManager, 4); using PresentationMgrPtr = SmartPtr<CMqPresentationManager>; struct CMqPresentationManagerData { UiEvent updateEvent; UiEvent visibilityEvent; CRendererImpl* renderer; /** * Assumption: presentations are drawn from highest layer value to lowest. * Thus CMqFps with layer -1 is drawn above all. */ List<Pair<CMqPresentationManager::IPresentation*, int /* layer */>> presentationList; bool renderingFrame; bool unknown17; char padding[2]; CLogFile* logFile; }; assert_size(CMqPresentationManagerData, 76); struct CMqPresentationManager::IPresentationVftable { using Destructor = void(__thiscall*)(CMqPresentationManager::IPresentation* thisptr, char flags); Destructor destructor; using Draw = void(__thiscall*)(CMqPresentationManager::IPresentation* thisptr, IMqRenderer2* renderer); Draw draw; }; assert_vftable_size(CMqPresentationManager::IPresentationVftable, 2); namespace CMqPresentationManagerApi { struct Api { /** Returns CMqPresentationManager instance using smart pointer. */ using GetPresentationManager = PresentationMgrPtr*(__stdcall*)(PresentationMgrPtr* manager); GetPresentationManager getPresentationManager; /** Sets or resets smart pointer holding CMqPresentationManager instance. */ using PresentationMgrPtrSetData = void(__thiscall*)(PresentationMgrPtr* thisptr, CMqPresentationManager* data); PresentationMgrPtrSetData presentationMgrPtrSetData; }; Api& get(); } // namespace CMqPresentationManagerApi } // namespace game #endif // MQPRESENTATIONMANAGER_H
2,994
C++
.h
80
32.8125
96
0.748358
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,424
textboxinterf.h
VladimirMakeev_D2ModdingToolset/mss32/include/textboxinterf.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 TEXTBOXINTERFACE_H #define TEXTBOXINTERFACE_H #include "d2string.h" #include "interface.h" #include "mqpoint.h" namespace game { struct CImage2Text; struct CTextBoxInterfData { int widgetChildIndex; CImage2Text* image2Text; CMqPoint pos; int unknown; String text; int unknown2; int unknown3; String format; SmartPointer ptr; void* unknown4; void* unknown5; }; assert_size(CTextBoxInterfData, 76); /** * Text ui element. * Represents TEXT from Interf.dlg or ScenEdit.dlg files. */ struct CTextBoxInterf : public CInterface { CTextBoxInterfData* data; }; assert_size(CTextBoxInterf, 12); namespace CTextBoxInterfApi { struct Api { using SetString = void(__thiscall*)(CTextBoxInterf* thisptr, const char* value); SetString setString; }; Api& get(); } // namespace CTextBoxInterfApi } // namespace game #endif // TEXTBOXINTERFACE_H
1,722
C++
.h
59
26.661017
84
0.758035
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,425
batviewer2dengine.h
VladimirMakeev_D2ModdingToolset/mss32/include/batviewer2dengine.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 BATVIEWER2DENGINE_H #define BATVIEWER2DENGINE_H namespace game { struct CBatViewer2DEngine; struct IMqImage2; struct CMqPoint; namespace BatViewer2DEngineApi { struct Api { using ClearTargetMarks = void(__thiscall*)(CBatViewer2DEngine* thisptr); ClearTargetMarks clearTargetMarks; using DrawTargetMark = void(__thiscall*)(CBatViewer2DEngine* thisptr, IMqImage2* image, CMqPoint* imagePosition, bool isUnitOnTheLeft, int unitPosition); DrawTargetMark drawTargetMark; }; Api& get(); } // namespace BatViewer2DEngineApi } // namespace game #endif // BATVIEWER2DENGINE_H
1,594
C++
.h
40
33.275
76
0.693653
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,426
aitacticactionsimple.h
VladimirMakeev_D2ModdingToolset/mss32/include/aitacticactionsimple.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 AITACTICACTIONSIMPLE_H #define AITACTICACTIONSIMPLE_H #include "aireactionnull.h" #include "aitacticaction.h" #include "d2assert.h" #include "midgardid.h" #include "mqpoint.h" namespace game { struct CAiTacticActionSimple : IAiTacticAction , CAiReactionNull { CMidgardID stackId; CMidgardID targetId; CMqPoint targetPosition; }; assert_size(CAiTacticActionSimple, 24); } // namespace game #endif // AITACTICACTIONSIMPLE_H
1,270
C++
.h
37
32.135135
72
0.774878
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,427
editboxinterf.h
VladimirMakeev_D2ModdingToolset/mss32/include/editboxinterf.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 EDITBOXINTERF_H #define EDITBOXINTERF_H #include "d2string.h" #include "interface.h" #include "mqpoint.h" namespace game { struct CEditBoxFocus; struct CImage2Fill; struct CImage2TextBackground; struct CDialogInterf; enum class EditFilter : int { NoFilter, /**< Any input allowed. */ TextOnly, /**< Only text characters, punctuation marks are not allowed. */ AlphaNum, /**< Text, digits, punctuation marks, some special characters. */ DigitsOnly, /**< Only digits. */ AlphaNumNoSlash, /**< Text, digits, some punctuation marks. '\', '/' not allowed. */ NamesDot, /**< Same as EditFilter::Names, but allows punctuation marks. */ Names, /**< Only characters suitable for Windows file names. */ }; struct EditBoxData { EditFilter filter; SmartPointer ptr; int maxInputLength; /**< Allowed range is [1 : 4096]. */ String formatString; String inputString; int editCursorPos; bool allowEnter; char padding[3]; }; struct CEditBoxInterfData { SmartPtr<CEditBoxFocus> editBoxFocus; int textBoxChildIndex; int unknown2; EditBoxData editBoxData; CImage2Fill* image2Fill; char unknown[12]; CImage2TextBackground* background; CMqPoint bgndImagePos; }; assert_size(CEditBoxInterfData, 100); /** * Edit box ui element. * Represents EDIT from Interf.dlg or ScenEdit.dlg files. */ struct CEditBoxInterf : public CInterface { CEditBoxInterfData* data; }; assert_size(CEditBoxInterf, 12); namespace CEditBoxInterfApi { struct Api { /** * Searches for specified edit box and sets its filter and max input length. * @returns found edit box. */ using SetFilterAndLength = CEditBoxInterf*(__stdcall*)(CDialogInterf* dialog, const char* controlName, const char* dialogName, EditFilter filter, int inputLength); SetFilterAndLength setFilterAndLength; /** * Sets max input length of edit box. * Updates edit box state after changing length. */ using SetInputLength = void(__thiscall*)(CEditBoxInterf* thisptr, int length); SetInputLength setInputLength; using SetString = void(__thiscall*)(CEditBoxInterf* thisptr, const char* string); SetString setString; using Update = void(__thiscall*)(CEditBoxInterf* thisptr); Update update; /** Meaning and name are assumed*/ using UpdateFocus = void(__thiscall*)(CEditBoxFocus* thisptr); UpdateFocus updateFocus; using IsCharValid = bool(__thiscall*)(const EditBoxData* thisptr, char ch); IsCharValid isCharValid; }; Api& get(); } // namespace CEditBoxInterfApi } // namespace game #endif // EDITBOXINTERF_H
3,732
C++
.h
103
30.737864
88
0.681264
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,428
middragdropinterf.h
VladimirMakeev_D2ModdingToolset/mss32/include/middragdropinterf.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 MIDDRAGDROPINTERF_H #define MIDDRAGDROPINTERF_H #include "draganddropinterf.h" #include <cstddef> namespace game { struct CPhaseGame; struct CDialogInterf; struct CMidDragDropInterf : public CDragAndDropInterf { CPhaseGame* phaseGame; }; assert_offset(CMidDragDropInterf, phaseGame, 24); } // namespace game #endif // MIDDRAGDROPINTERF_H
1,170
C++
.h
32
34.65625
72
0.781416
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,429
batattackitem.h
VladimirMakeev_D2ModdingToolset/mss32/include/batattackitem.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 BATATTACKITEM_H #define BATATTACKITEM_H #include "batattack.h" #include "midgardid.h" namespace game { struct CBatAttackItem : IBatAttack { IBatAttack* batAttack; // Actual attack to be performed CMidgardID itemId; }; assert_size(CBatAttackItem, 12); } // namespace game #endif // BATATTACKITEM_H
1,133
C++
.h
31
34.516129
72
0.767123
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,430
midgardmsgbox.h
VladimirMakeev_D2ModdingToolset/mss32/include/midgardmsgbox.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 MIDGARDMSGBOX_H #define MIDGARDMSGBOX_H #include "popupdialoginterf.h" #include "uievent.h" namespace game { struct CMidMsgBoxButtonHandler; struct CMidMsgBoxActHandler; struct CMidgardMsgBoxData { CDialogInterf* dialog; UiEvent updateEvent; int unknown; void* userData; bool confirmButtonOnly; char padding[3]; CMidMsgBoxButtonHandler* buttonHandler; CMidMsgBoxActHandler* actHandler; }; assert_size(CMidgardMsgBoxData, 48); /** * Message box ui element. * By default, represents DLG_MESSAGE_BOX from Interf.dlg. */ struct CMidgardMsgBox : public CPopupDialogInterf { CMidgardMsgBoxData* data; }; assert_size(CMidgardMsgBox, 20); assert_offset(CMidgardMsgBox, data, 16); namespace CMidgardMsgBoxApi { struct Api { /** * Creates message box. * @param[in] thisptr message box to initialize. * @param[in] message text to show. * @param showCancelButton if set to 1, creates message box with cancel button. * @param[in] buttonHandler handler logic to execute upon message box closing. * Handler object destroyed and its memory freed in message box destructor. * @param[in] actHandler action handler logic. Used in Scenario Editor for map import/export. * @param dialogName name of the custom dialog ui element to show instead of default, * or nullptr. Default dialog is 'DLG_MESSAGE_BOX' from Interf.dlg. */ using Constructor = CMidgardMsgBox*(__thiscall*)(CMidgardMsgBox* thisptr, const char* message, int showCancelButton, CMidMsgBoxButtonHandler* buttonHandler, CMidMsgBoxActHandler* actHandler, const char* dialogName); Constructor constructor; }; Api& get(); } // namespace CMidgardMsgBoxApi } // namespace game #endif // MIDGARDMSGBOX_H
2,840
C++
.h
73
32.465753
97
0.691609
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,431
exchangeinterf.h
VladimirMakeev_D2ModdingToolset/mss32/include/exchangeinterf.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 EXHANGEINTERF_H #define EXHANGEINTERF_H #include "middatacache.h" #include "middragdropinterf.h" #include "smartptr.h" #include <cstddef> namespace game { struct CExchangeInterfData { CMidgardID stackLeftSideId; int unknown; int unknown2; CMidgardID stackRightSideId; char unknown3[168]; }; assert_size(CExchangeInterfData, 184); /** * Shows window of exchange between two stacks. * Represents DLG_EXCHANGE from Interf.dlg. */ struct CExchangeInterf : public CMidDataCache2::INotify { CMidDragDropInterf dragDropInterf; CExchangeInterfData* data; }; assert_size(CExchangeInterf, 36); assert_offset(CExchangeInterf, data, 32); namespace CExchangeInterfApi { struct Api { using Constructor = CExchangeInterf*(__thiscall*)(CExchangeInterf* thisptr, void* taskOpenInterf, CPhaseGame* phaseGame, CMidgardID* stackLeftSide, CMidgardID* stackRightSide); Constructor constructor; struct ButtonCallback { using Callback = void(__thiscall*)(CExchangeInterf* thisptr); Callback callback; int unknown; }; using CreateButtonFunctor = SmartPointer*(__stdcall*)(SmartPointer* functor, int a2, CExchangeInterf* exchangeInterf, ButtonCallback* callback); CreateButtonFunctor createButtonFunctor; }; Api& get(); struct Vftable { const CMidDataCache2::INotifyVftable* notify; const CInterfaceVftable* dragDropInterf; const ITaskManagerHolderVftable* taskManagerHolder; const IMidDropManagerVftable* dropManager; }; Vftable& vftable(); } // namespace CExchangeInterfApi } // namespace game #endif // EXHANGEINTERF_H
2,822
C++
.h
78
28.474359
90
0.6652
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,432
image2text.h
VladimirMakeev_D2ModdingToolset/mss32/include/image2text.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 IMAGE2TEXT_H #define IMAGE2TEXT_H #include "d2string.h" #include "mqimage2surface16.h" #include "mqrect.h" namespace game { /** Renders text string as an image. */ struct CImage2Text : public CMqImage2Surface16 { String text; CMqPoint textPosition; /**< Top-left position where text starts inside of textArea. */ bool unk3; char pad[3]; CMqRect textArea; }; assert_size(CImage2Text, 88); namespace CImage2TextApi { struct Api { using Constructor = CImage2Text*(__thiscall*)(CImage2Text* thisptr, int width, int height); Constructor constructor; using SetText = void(__thiscall*)(CImage2Text* thisptr, const char* text); SetText setText; }; Api& get(); } // namespace CImage2TextApi } // namespace game #endif // IMAGE2TEXT_H
1,593
C++
.h
46
32.217391
95
0.751792
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,433
taskspell.h
VladimirMakeev_D2ModdingToolset/mss32/include/taskspell.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 TASKSPELL_H #define TASKSPELL_H #include "canselect.h" #include "isocbscroll.h" #include "midgardid.h" #include "spellcat.h" #include "tasktilehighlight.h" namespace game { struct CPhaseGame; struct TStrategicSpell; struct CursorHandle; struct CInterface; struct IMqImage2; struct ObjectSelectionData; struct CTaskSpellData { CPhaseGame* phaseGame; CMidgardID spellId; LSpellCategory spellCategory; TStrategicSpell* spell; ObjectSelectionData* objectSelection; SmartPtr<CursorHandle> castInvalidCursor; SmartPtr<CursorHandle> castValidCursor; SmartPtr<CInterfManagerImpl> interfManager; CInterface* messageBox; CMqPoint mapPosition; int unknown; SmartPtr<IMqImage2> spellAreaFogAllowedImage; SmartPtr<IMqImage2> spellAreaFogNotAllowedImage; SmartPtr<IMqImage2> spellAreaImage; }; assert_size(CTaskSpellData, 92); /** Base class for spell cast target selection logic. */ struct CTaskSpell : public CTaskTileHighlight , public ICanSelect , public IIsoCBScroll { CTaskSpellData* data; }; assert_size(CTaskSpell, 32); struct CTaskSpellVftable : public ITaskVftable { /** * Checks if spell can be cast on specified map position. * Returns one of the status codes. */ using CanCast = int(__thiscall*)(const CTaskSpell* thisptr, const CMqPoint* mapPosition); CanCast canCast; /** Sends CSpellCastMsg to server to perform spellcast. */ using CastSpell = void(__thiscall*)(const CTaskSpell* thisptr, const CMqPoint* mapPosition); CastSpell castSpell; }; assert_vftable_size(CTaskSpellVftable, 8); } // namespace game #endif // TASKSPELL_H
2,474
C++
.h
74
30.527027
96
0.770423
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,434
wdb.h
VladimirMakeev_D2ModdingToolset/mss32/include/wdb.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 WDB_H #define WDB_H #include "d2assert.h" #include "d2pair.h" #include "mq_c_s.h" #include "quickstring.h" #include <cstdint> namespace game { struct MQDBFile; using WdbNameIdPair = Pair<quick_string<16u>, std::uint32_t>; using WdbNamesArray = mq_c_s<WdbNameIdPair>; struct WdbData { MQDBFile** mqdb; WdbNamesArray namesArray; }; assert_size(WdbData, 24); /** Stores information of .wdb file. */ struct Wdb { WdbData* data; }; assert_size(Wdb, 4); } // namespace game #endif // WDB_H
1,327
C++
.h
43
28.930233
72
0.750982
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,435
gameimages.h
VladimirMakeev_D2ModdingToolset/mss32/include/gameimages.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 GAMEIMAGES_H #define GAMEIMAGES_H #include "d2assert.h" #include "mqdb.h" #include "smartptr.h" #include "stringintlist.h" namespace game { struct CLogFile; struct IMqImage2; struct LRaceCategory; struct CMidgardID; struct IMidgardObjectMap; struct MQDBDataWrapper; struct GameImageDataWrapper; /** Stores game images information read from .ff files. */ struct GameImages { CLogFile* log; GameImageDataWrapper* thief; GameImageDataWrapper* lords; MQDBDataWrapper* ground; MQDBDataWrapper* grBorder; MQDBRecordMap** groundTiles; MQDBRecordMap** borderImages; MQDBDataWrapper* faces; GameImageDataWrapper* batUnits; GameImageDataWrapper* batItems; GameImageDataWrapper* battle; GameImageDataWrapper* isoCursr; GameImageDataWrapper* isoSpell; GameImageDataWrapper* isoTerrn; GameImageDataWrapper* isoCmon; GameImageDataWrapper* isoAnim; GameImageDataWrapper* isoStill; GameImageDataWrapper* isoUnit; GameImageDataWrapper* events; GameImageDataWrapper* city; GameImageDataWrapper* iconSpel; GameImageDataWrapper* iconBld; GameImageDataWrapper* iconItem; GameImageDataWrapper* icons; bool animatedIso; char padding[3]; }; assert_size(GameImages, 100); using GameImagesPtr = SmartPtr<GameImages*>; namespace GameImagesApi { struct Api { using GetGameImages = GameImagesPtr*(__stdcall*)(GameImagesPtr* images); GetGameImages getGameImages; using GetImage = IMqImage2*(__stdcall*)(const void* storage, const char* imageName, int a3, bool randomStartingFrame, CLogFile* log); GetImage getImage; using CreateOrFreeGameImages = void(__thiscall*)(GameImagesPtr* thisptr, GameImages** data); CreateOrFreeGameImages createOrFreeGameImages; /** Searches storage for specific image names and stores them in list. */ using GetImageNames = void(__stdcall*)(List<String>* imageNames, const void* storage, const char* imageName, int a4, int a5); GetImageNames getImageNames; /** Returns race logo image name(s) for specified race category. */ using GetRaceLogoImageName = void(__stdcall*)(List<String>* imageNames, void* storage, const LRaceCategory* race); GetRaceLogoImageName getRaceLogoImageName; /** Returns race flag image to show near village entry when its controlled by specified race. */ using GetFlagImage = IMqImage2*(__stdcall*)(const LRaceCategory* race); GetFlagImage getFlagImage; /** Returns objective circle image with specified size. */ using GetObjectiveImage = IMqImage2*(__stdcall*)(int objectSize); GetObjectiveImage getObjectiveImage; /** Returns village riot image. */ using GetRiotImage = IMqImage2*(__cdecl*)(); GetRiotImage getRiotImage; /** Populates list with city image names and animation flag pairs. */ using GetCityImageNames = void(__stdcall*)(StringIntList* list, const void* isoCmon, const void* isoImg, const char* cityImageName, size_t nameLength, size_t nameLength2); GetCityImageNames getCityImageNames; /** Returns village image depending on tier, shadow and animation settings. */ using GetVillageImage = IMqImage2*(__stdcall*)(char villageTier, bool animatedIso, bool shadow); GetVillageImage getVillageImage; /** * Returns city lagre preview image names. * Large preview images are used in CCityStackInterf. */ using GetCityPreviewLargeImageNames = void(__stdcall*)(List<String>* imageNames, const void* cityFF, const LRaceCategory* race, int cityTier); GetCityPreviewLargeImageNames getCityPreviewLargeImageNames; /** * Returns city icon image names. * City icon images are shown in CStratInterf when selecting a city. */ using GetCityIconImageNames = void(__stdcall*)(List<String>* imageNames, const void* iconsFF, const CMidgardID* fortificationId, const IMidgardObjectMap* objectMap); GetCityIconImageNames getCityIconImageNames; /** Returns icon image from Icons.ff by its name. */ using GetIconImageByName = IMqImage2**(__stdcall*)(IMqImage2** value, const char* name); GetIconImageByName getIconImageByName; /** Returns unit portrait from Events.ff. */ using GetUnitIcon = IMqImage2*(__stdcall*)(const CMidgardID* unitImplId); GetUnitIcon getUnitIcon; }; Api& get(); } // namespace GameImagesApi } // namespace game #endif // GAMEIMAGES_H
6,220
C++
.h
138
34.318841
100
0.636559
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,436
task.h
VladimirMakeev_D2ModdingToolset/mss32/include/task.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 TASK_H #define TASK_H #include "d2assert.h" #include "smartptr.h" #include <cstdint> namespace game { struct ITaskVftable; struct CMqPoint; struct CursorHandle; struct CTaskManager; struct ITask { ITaskVftable* vftable; }; struct ITaskVftable { using Destructor = void(__thiscall*)(ITask* thisptr, char flags); Destructor destructor; /** Called from CFullScreenInterf::onMouseMove. */ using OnMouseMove = bool(__thiscall*)(ITask* thisptr, const CMqPoint* mousePosition); OnMouseMove onMouseMove; /** Called from CFullScreenInterf::handleMouse. */ using HandleMouse = bool(__thiscall*)(ITask* thisptr, std::uint32_t mouseButton, const CMqPoint* mousePosition); HandleMouse handleMouse; /** Called from CFullScreenInterf::handleKeyboard. */ using HandleKeyboard = bool(__thiscall*)(ITask* thisptr, int key, int a3); HandleKeyboard handleKeyboard; /** Called from CFullScreenInterf::getCursorAtPoint. */ using GetCursorAtPoint = void(__thiscall*)(ITask* thisptr, SmartPtr<CursorHandle>* cursorPtr, const CMqPoint* point); GetCursorAtPoint getCursorAtPoint; using GetTaskManager = CTaskManager*(__thiscall*)(const ITask* thisptr); GetTaskManager getTaskManager; }; assert_vftable_size(ITaskVftable, 6); } // namespace game #endif // TASK_H
2,316
C++
.h
58
34.155172
89
0.699198
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,437
midgardstream.h
VladimirMakeev_D2ModdingToolset/mss32/include/midgardstream.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 MIDGARDSTREAM_H #define MIDGARDSTREAM_H #include "d2assert.h" namespace game { struct IMidgardStreamVftable; struct IMidgardStreamEnv; struct CMidgardID; struct Bank; struct StringAndId; /** * Interface for various stream classes. * Child classes are used to read and write scenario objects from files (CMidStreamFile), * dbf tables (CMidStreamDB) and network (CMidStreamNet). */ struct IMidgardStream { IMidgardStreamVftable* vftable; }; struct IMidgardStreamVftable { using Destructor = void(__thiscall*)(IMidgardStream* thisptr, char flags); Destructor destructor; /** Returns pointer to underlying IMidgardStreamEnv object. */ using GetStreamEnv = IMidgardStreamEnv*(__thiscall*)(IMidgardStream* thisptr); GetStreamEnv getStreamEnv; using GetBool = bool(__thiscall*)(IMidgardStream* thisptr); /** * Returns true if stream opened for writing. * In write mode stream writes existing scenario objects data. */ GetBool writeMode; /** * Returns true if stream opened for reading. * In read mode stream reads data into scenario objects. */ GetBool readMode; /** Returns error message string. */ using GetError = const char*(__thiscall*)(IMidgardStream* thisptr); GetError getError; /** Sets error message. */ using SetError = void(__thiscall*)(IMidgardStream* thisptr, const char* message); SetError setError; using CheckRecord = void(__thiscall*)(IMidgardStream* thisptr); /** * Tries to enter record. * Throws an exception if already in a record. */ CheckRecord enterRecord; /** * Tries to leave record. * Throws an exception if stream is not in a record. */ CheckRecord leaveRecord; /** Returns true if data with specified name could be read from stream. */ using HasValue = bool(__thiscall*)(IMidgardStream* thisptr, const char* name); HasValue hasValue; template <typename T> using StreamData = void(__thiscall*)(IMidgardStream* thisptr, const char* name, T* data); /** Streams arrays of characters. */ StreamData<char> streamString; /** Streams 4 byte integer value. */ StreamData<int> streamInt; /** Streams byte value. */ StreamData<unsigned char> streamByte; /** Streams boolean value */ StreamData<bool> streamBool; /** * Streams array of bytes. * @param[in] thisptr pointer to stream object. * @param[in] name name of the array to stream. * @param[inout] data pointer to array of bytes to stream. * @param[inout] byteCount number of bytes to stream. */ using StreamBinary = void(__thiscall*)(IMidgardStream* thisptr, const char* name, unsigned char* data, int* byteCount); StreamBinary streamBinary; /** Streams identifier. */ StreamData<CMidgardID> streamId; /** Streams ingame currency. */ StreamData<Bank> streamCurrency; /** Streams text. */ using StreamText = void(__thiscall*)(IMidgardStream* thisptr, const char* name, StringAndId* data, int unknown); StreamText streamText; }; assert_vftable_size(IMidgardStreamVftable, 17); } // namespace game #endif // MIDGARDSTREAM_H
4,262
C++
.h
110
32.554545
93
0.67871
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,438
gameutils.h
VladimirMakeev_D2ModdingToolset/mss32/include/gameutils.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 GAMEUTILS_H #define GAMEUTILS_H namespace game { struct CMidgardID; struct CMidUnitGroup; struct IMidgardObjectMap; struct BattleMsgData; struct CScenarioInfo; struct CMidPlayer; struct CMidScenVariables; struct CMidgardPlan; struct CMidgardMap; struct CMidgardMapBlock; struct CMidStack; struct CMidRuin; struct CFortification; struct LRaceCategory; struct LTerrainCategory; struct CMidRod; struct CMidInventory; struct CMidDiplomacy; struct CMidgardMapFog; struct TBuildingType; struct CPlayerBuildings; } // namespace game namespace hooks { bool isGreaterPickRandomIfEqual(int first, int second); /** * Picks object map that corresponds to the calling thread (client vs server). * Object map can be unavailable while in a loading state. * The game has such map available, while editor keeps it unavailable while loading. * The only known case so far, is that game/editor calls IUsSoldier::getHitPoint * while it loads units from scenario stream thus while the map is just being loaded. * This triggers CCustomModifier "getHitPoint" script that can try to access the map. */ const game::IMidgardObjectMap* getObjectMap(); game::CMidUnitGroup* getGroup(game::IMidgardObjectMap* objectMap, const game::CMidgardID* groupId, bool forChange); /** Analogue of GetStackFortRuinGroup that is absent in Scenario Editor. */ const game::CMidUnitGroup* getGroup(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* groupId); const game::CMidUnitGroup* getAllyOrEnemyGroup(const game::IMidgardObjectMap* objectMap, const game::BattleMsgData* battleMsgData, const game::CMidgardID* unitId, bool ally); const game::CScenarioInfo* getScenarioInfo(const game::IMidgardObjectMap* objectMap); const game::CMidPlayer* getPlayer(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* playerId); const game::CMidPlayer* getPlayer(const game::IMidgardObjectMap* objectMap, const game::BattleMsgData* battleMsgData, const game::CMidgardID* unitId); const game::CMidPlayer* getPlayerByUnitId(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* unitId); const game::CMidgardID getPlayerIdByUnitId(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* unitId); const game::CMidScenVariables* getScenarioVariables(const game::IMidgardObjectMap* objectMap); const game::CMidgardPlan* getMidgardPlan(const game::IMidgardObjectMap* objectMap); const game::CMidgardMap* getMidgardMap(const game::IMidgardObjectMap* objectMap); const game::CMidgardMapBlock* getMidgardMapBlock(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* mapId, int mapSize, int x, int y); const game::LTerrainCategory* getTerrainCategory(const game::LRaceCategory* raceCategory); game::CMidStack* getStack(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* stackId); game::CMidStack* getStack(const game::IMidgardObjectMap* objectMap, const game::BattleMsgData* battleMsgData, const game::CMidgardID* unitId); const game::CMidStack* getStackByUnitId(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* unitId); game::CFortification* getFort(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* fortId); game::CFortification* getFort(const game::IMidgardObjectMap* objectMap, const game::BattleMsgData* battleMsgData, const game::CMidgardID* unitId); const game::CFortification* getFortByUnitId(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* unitId); game::CMidRuin* getRuin(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* ruinId); game::CMidRuin* getRuin(const game::IMidgardObjectMap* objectMap, const game::BattleMsgData* battleMsgData, const game::CMidgardID* unitId); const game::CMidRuin* getRuinByUnitId(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* unitId); game::CMidRod* getRod(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* rodId); int getGroupXpKilled(const game::IMidgardObjectMap* objectMap, const game::CMidUnitGroup* group); game::CMidInventory* getInventory(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* groupId); bool canGroupGainXp(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* groupId); int getWeaponMasterBonusXpPercent(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* groupId); int getEasyDifficultyBonusXpPercent(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* playerId); int getAiBonusXpPercent(const game::IMidgardObjectMap* objectMap); const game::TBuildingType* getBuilding(const game::CMidgardID* buildingId); int getBuildingLevel(const game::CMidgardID* buildingId); int getBuildingLevel(const game::TBuildingType* building); const game::CPlayerBuildings* getPlayerBuildings(const game::IMidgardObjectMap* objectMap, const game::CMidPlayer* player); bool playerHasBuilding(const game::IMidgardObjectMap* objectMap, const game::CMidPlayer* player, const game::CMidgardID* buildingId); bool playerHasSiblingUnitBuilding(const game::IMidgardObjectMap* objectMap, const game::CMidPlayer* player, const game::TBuildingType* building); bool lordHasBuilding(const game::CMidgardID* lordId, const game::CMidgardID* buildingId); bool isBuildingBuildable(const game::IMidgardObjectMap* objectMap, const game::CMidgardID* playerId, const game::CMidgardID* buildingId); const game::CMidDiplomacy* getDiplomacy(const game::IMidgardObjectMap* objectMap); const game::CMidgardMapFog* getFog(const game::IMidgardObjectMap* objectMap, const game::CMidPlayer* player); } // namespace hooks #endif // GAMEUTILS_H
7,707
C++
.h
133
46.571429
98
0.681456
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,439
menunewskirmishhooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/menunewskirmishhooks.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 MENUNEWSKIRMISHHOOKS_H #define MENUNEWSKIRMISHHOOKS_H namespace game { struct CMenuBase; } // namespace game namespace hooks { void __fastcall menuNewSkirmishLoadScenarioCallbackHooked(game::CMenuBase* thisptr, int /*%edx*/); } // namespace hooks #endif // MENUNEWSKIRMISHHOOKS_H
1,106
C++
.h
27
39.111111
98
0.775396
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,440
intvector.h
VladimirMakeev_D2ModdingToolset/mss32/include/intvector.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 INTVECTOR_H #define INTVECTOR_H #include "d2vector.h" namespace game { using IntVector = Vector<int>; namespace IntVectorApi { struct Api { using Destructor = void(__thiscall*)(IntVector* thisptr); Destructor destructor; using Reserve = void(__thiscall*)(IntVector* thisptr, unsigned int count); Reserve reserve; using PushBack = void(__thiscall*)(IntVector* thisptr, int* value); PushBack pushBack; }; Api& get(); } // namespace IntVectorApi } // namespace game #endif // INTVECTOR_H
1,342
C++
.h
37
33.837838
78
0.75174
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,441
batattackdrainoverflow.h
VladimirMakeev_D2ModdingToolset/mss32/include/batattackdrainoverflow.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 BATATTACKDRAINOVERFLOW_H #define BATATTACKDRAINOVERFLOW_H #include "batattack.h" #include "d2map.h" #include "midgardid.h" namespace game { struct IAttack; struct IMidgardObjectMap; struct CMidUnit; /** Represents vampiric attacks that can heal allies. */ struct CBatAttackDrainOverflow : public CBatAttackBase { CMidgardID unitId; CMidgardID id2; int attackNumber; IAttack* attack; }; assert_size(CBatAttackDrainOverflow, 20); /** Maps unit id to heal amount. */ using DrainOverflowHealData = Map<CMidgardID, int>; using DrainOverflowHealIterator = MapIterator<CMidgardID, int>; namespace CBatAttackDrainOverflowApi { struct Api { /** Initializes heal data structure. */ using HealDataConstructor = DrainOverflowHealData*(__thiscall*)(DrainOverflowHealData* thisptr); HealDataConstructor healDataCtor; /** Cleans up heal data structure. */ using HealDataDestructor = void(__thiscall*)(DrainOverflowHealData* thisptr); HealDataDestructor healDataDtor; /** * Computes heal for units in specified group from drain overflow. * @param[inout] healData pointer to structure to store heal info. * @param[in] objectMap map to search units. * @param[in] groupId id of group to heal. * @param[in] attackerUnitId id of unit performing drain overflow attack. It will be excluded * from computation. * @param drainOverflow drain overflow value that will be converted to heal. * @returns number of units that can be healed, or zero. */ using ComputeDrainOverflowGroupHeal = int(__stdcall*)(DrainOverflowHealData* healData, const IMidgardObjectMap* objectMap, const CMidgardID* groupId, const CMidgardID* attackerUnitId, int drainOverflow); ComputeDrainOverflowGroupHeal computeDrainOverflowGroupHeal; /** Returns true if unit is not at full health with respect to drain overflow. */ using IsUnitNotAtFullHp = bool(__stdcall*)(const IMidgardObjectMap* objectMap, const CMidgardID* unitId, DrainOverflowHealData* healData); IsUnitNotAtFullHp isUnitNotAtFullHp; /** Updates heal for specified unit according to drain overflow and single unit heal amount. */ using UpdateUnitHealFromDrainOverflow = int(__stdcall*)(DrainOverflowHealData* healData, const CMidUnit* unit, int healAmount); UpdateUnitHealFromDrainOverflow updateUnitHealFromDrainOverflow; }; Api& get(); IBatAttackVftable* vftable(); } // namespace CBatAttackDrainOverflowApi } // namespace game #endif // BATATTACKDRAINOVERFLOW_H
3,781
C++
.h
80
38.7375
100
0.682867
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,442
2denginemap.h
VladimirMakeev_D2ModdingToolset/mss32/include/2denginemap.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 C2DENGINEMAP_H #define C2DENGINEMAP_H #include "d2assert.h" namespace game { struct C2DEngineMapVftable; struct IMqImage2; struct CMqPoint; struct C2DEngineMap { C2DEngineMapVftable* vftable; }; struct C2DEngineMapVftable { using Destructor = void(__thiscall*)(C2DEngineMap* thisptr, char flags); Destructor destructor; /** Returns image by specified element index or nullptr if no image found. */ using GetImage = IMqImage2*(__thiscall*)(C2DEngineMap* thisptr, int elementIndex); GetImage getImage; /** * Adds specified image with selected position as map element. * @param isoLayerPositionHash hash value computed as: * @code{.cpp}isoLayer + ((position->x + position->y + (isoLayer >> 9 << 8)) << 9);@endcode * @returns element index corresponding to the added element or -1 if element was not added. */ using AddMapElement = int(__thiscall*)(C2DEngineMap* thisptr, const CMqPoint* position, int isoLayerPositionHash, IMqImage2* image); AddMapElement addMapElement; /** * Removes map element with specified element index. * @returns true if element was found and removed. */ using RemoveMapElement = bool(__thiscall*)(C2DEngineMap* thisptr, int elementIndex); RemoveMapElement removeMapElement; /** * Changes map element with specified element index by replacing its hash and position. * @returns true if element was changed. */ using ChangeMapElement = bool(__thiscall*)(C2DEngineMap* thisptr, int elementIndex, int isoLayerPositionHash, const CMqPoint* position); ChangeMapElement changeMapElement; /** * Removes all map elements with specified hash value. * Calls RemoveMapElement on each found element. */ using RemoveElements = void(__thiscall*)(C2DEngineMap* thisptr, int isoLayerPositionHash); RemoveElements removeElements; /** Clears all map elements. */ using Clear = void(__thiscall*)(C2DEngineMap* thisptr); Clear clear; }; assert_vftable_size(C2DEngineMapVftable, 7); } // namespace game #endif // C2DENGINEMAP_H
3,187
C++
.h
75
35.413333
96
0.678398
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,443
midunitext.h
VladimirMakeev_D2ModdingToolset/mss32/include/midunitext.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 MIDUNITEXT_H #define MIDUNITEXT_H #include "middropsourceext.h" namespace game { struct IMidUnitExt : public IMidDropSourceExt { }; } // namespace game #endif // MIDUNITEXT_H
1,001
C++
.h
26
36.615385
72
0.767802
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,444
gamesettings.h
VladimirMakeev_D2ModdingToolset/mss32/include/gamesettings.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 GAMESETTINGS_H #define GAMESETTINGS_H #include "d2string.h" namespace game { /** Holds settings read from 'Disciple.ini' file. */ struct GameSettings { bool settingsCorrect; char padding[3]; String gameFolder; String interfFolder; String imagesFolder; String imageDataFolder; String scensFolder; String globalsFolder; String videoFolder; String soundsFolder; String musicFolder; String customMusicFolder; String soundsPFolder; String musicPFolder; String campaignFolder; String exportsFolder; String saveGameFolder; String briefingFolder; String scenDataFolder; String globalsFolder2; String musicFolder2; String imageDataFolder2; String briefingFolder2; bool fullscreenDisplayMode; bool random; bool displayErrors; bool showIntro; bool soundFx; bool musicOn; char padding2[2]; int fxVolume; int musicVolume; int acknoledgements; int playerSpeed; int opponentSpeed; int scrollSpeed; int battleSpeed; bool battleAnimations; bool confirmEndOfTurn; bool autoSave; bool smoothScroll; bool playIsoAnim; bool stackSmoothScroll; bool includeCampaign; bool scenEditDatabase; bool animatedIso; bool lowEndVideoCard; bool highAlpha; char padding3; int audioRegions; bool pauseAudioRegionsForAi; bool isoHighlight; bool defaultPathBattle; char padding4; int refreshRate; bool isoBirds; bool inversedPalMap; bool displayPathTurn; bool queueCommands; bool useD3d; bool forceD3dPow2; char padding5[2]; int displayWidth; int displayHeight; bool scrollInterfBorder; bool showInterfBorder; bool enableZoom; bool snapCursor; int bonusPoolBlocks; bool stickyEncy; char padding6[3]; int eventPopupDelay; int secondarySize; int mixAhead; int fragmentSize; bool flippedBattle; bool showTurnSummary; char unknown; char volumeLetter[2]; char padding7[3]; String defaultPlayerName; }; assert_size(GameSettings, 468); } // namespace game #endif // GAMESETTINGS_H
3,012
C++
.h
110
23
72
0.74225
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,445
eventeffects.h
VladimirMakeev_D2ModdingToolset/mss32/include/eventeffects.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 EVENTEFFECTS_H #define EVENTEFFECTS_H #include "d2set.h" #include "mideveffect.h" #include "ordercat.h" #include "stringandid.h" #include "terraincat.h" namespace game { /** Win or lose scenario. */ struct CMidEffectWin : public CMidEvEffect { bool win; char padding[3]; CMidgardID playerId; }; assert_size(CMidEffectWin, 32); /** Create new stack. */ struct CMidEffectCreateStack : public CMidEvEffect { CMidgardID stackTemplateId; CMidgardID locationId; }; assert_size(CMidEffectCreateStack, 32); /** Cast spell on triggerer. */ struct CMidEffectCastSpell : public CMidEvEffect { CMidgardID spellId; CMidgardID playerId; }; assert_size(CMidEffectCastSpell, 32); /** Cast spell at specific location. */ struct CMidEffectCastSpellMap : public CMidEvEffect { CMidgardID spellId; CMidgardID locationId; CMidgardID playerId; }; assert_size(CMidEffectCastSpellMap, 36); /** Change stack owner. */ struct CMidEffectChangeOwner : public CMidEvEffect { CMidgardID stackId; bool firstOnly; char padding[3]; CMidgardID playerId; bool playAnimation; char padding2[3]; }; assert_size(CMidEffectChangeOwner, 40); /** Change stack order. */ struct CMidEffectChangeOrder : public CMidEvEffect { CMidgardID stackId; bool firstOnly; char padding[3]; LOrderCategory order; CMidgardID orderTargetId; }; assert_size(CMidEffectChangeOrder, 48); /** Move stack next to triggerer. */ struct CMidEffectMoveBeside : public CMidEvEffect { CMidgardID stackId; }; assert_size(CMidEffectMoveBeside, 28); /** Go into battle. */ struct CMidEffectBattle : public CMidEvEffect { CMidgardID stackId; bool firstOnly; char padding[3]; }; assert_size(CMidEffectBattle, 32); /** Enable/disable another event. */ struct CMidEffectEnableEvent : public CMidEvEffect { CMidgardID targetEventId; bool enable; char padding[3]; }; assert_size(CMidEffectEnableEvent, 32); /** Give spell. */ struct CMidEffectGiveSpell : public CMidEvEffect { CMidgardID spellId; }; assert_size(CMidEffectGiveSpell, 28); enum GiveItemTarget : int { Triggerer, Capital, }; /** Give item. */ struct CMidEffectGiveItem : public CMidEvEffect { CMidgardID itemId; GiveItemTarget giveTo; }; assert_size(CMidEffectGiveItem, 32); /** Move stack to specific location. */ struct CMidEffectMove : public CMidEvEffect { CMidgardID stackTemplateId; CMidgardID locationId; bool moveTriggererStack; char padding[3]; }; assert_size(CMidEffectMove, 36); /** Ally two AI players. */ struct CMidEffectAlly : public CMidEvEffect { CMidgardID playerId1; CMidgardID playerId2; bool permanentAlliance; char padding[3]; }; assert_size(CMidEffectAlly, 36); /** Change player diplomacy meter. */ struct CMidEffectDiplomacy : public CMidEvEffect { CMidgardID playerId1; CMidgardID playerId2; int diplomacy; /**< Percentage based value [-100 : 100]. */ bool alwaysAtWar; char padding[3]; }; assert_size(CMidEffectDiplomacy, 40); enum class UnfogRadius : int { Radius1x1, Radius3x3, Radius5x5, Radius7x7, Radius9x9, Radius11x11, Radius13x13, Radius15x15, Radius17x17, Radius19x19, Radius21x21, Radius23x23, Radius25x25, Radius27x27, Radius29x29, Radius31x31, Radius33x33, Radius35x35, Radius37x37, Radius39x39, Radius41x41, Radius43x43, Radius45x45, Radius47x47, Radius49x49, }; /** Unfog or fog an area of the map. */ struct CMidEffectUnfog : public CMidEvEffect { Set<CMidgardID> players; CMidgardID locationId; bool unfog; char padding[3]; UnfogRadius radius; }; assert_size(CMidEffectUnfog, 64); /** Remove mountains around a location. */ struct CMidEffectMountain : public CMidEvEffect { CMidgardID locationId; }; assert_size(CMidEffectMountain, 28); /** Remove landmark. */ struct CMidEffectRmvLMark : public CMidEvEffect { CMidgardID landmarkId; bool playAnimation; char padding[3]; }; assert_size(CMidEffectRmvLMark, 32); /** Change landmark. */ struct CMidEffectChangeLandmark : public CMidEvEffect { CMidgardID landmarkId; CMidgardID landmarkTypeId; }; assert_size(CMidEffectChangeLandmark, 32); /** Change terrain. */ struct CMidEffectChangeTerrain : public CMidEvEffect { CMidgardID locationId; LTerrainCategory terrain; int areaSize; }; assert_size(CMidEffectChangeTerrain, 44); /** Change scenario objective text. */ struct CMidEffectObjective : public CMidEvEffect { StringAndId objective; }; assert_size(CMidEffectObjective, 36); enum class PopupShowMode : int { ShowTriggerer, ShowAll, ShowAffectedOnly, }; /** Display popup message. */ struct CMidEffectPopup : public CMidEvEffect { StringAndId popupText; char* music; char* sound; char* image; char* image2; bool leftSide; char padding[3]; PopupShowMode showMode; bool unknown; char padding2[3]; }; assert_size(CMidEffectPopup, 64); /** Destroy item. */ struct CMidEffectDestroyItem : public CMidEvEffect { CMidgardID itemId; bool onlyTriggerer; char padding[3]; }; assert_size(CMidEffectDestroyItem, 32); /** Remove stack. */ struct CMidEffectRemoveStack : public CMidEvEffect { CMidgardID stackId; bool firstOnly; char padding[3]; }; assert_size(CMidEffectRemoveStack, 32); enum class ModifyVariableOperation : int { Add, Subtract, Multiply, Divide, Replace, }; /** Modify variable. */ struct CMidEffectModifyVariable : public CMidEvEffect { ModifyVariableOperation operation; int value; int variableId; }; assert_size(CMidEffectModifyVariable, 36); } // namespace game #endif // EVENTEFFECTS_H
6,603
C++
.h
273
21.260073
72
0.75259
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,446
sounds.h
VladimirMakeev_D2ModdingToolset/mss32/include/sounds.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 SOUNDS_H #define SOUNDS_H #include "d2string.h" #include "smartptr.h" namespace game { struct CWavStore; struct Wdb; struct CLogFile; struct SoundsData { String string; SmartPtr<CWavStore> wavStore; SmartPtr<Wdb> wdb; CLogFile* logFile; int unknown10; int unknown11; }; assert_size(SoundsData, 44); struct Sounds { SoundsData* data; }; assert_size(Sounds, 4); } // namespace game #endif // SOUNDS_H
1,257
C++
.h
43
26.953488
72
0.754983
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,447
midgard.h
VladimirMakeev_D2ModdingToolset/mss32/include/midgard.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 MIDGARD_H #define MIDGARD_H #include "d2list.h" #include "d2pair.h" #include "midgardid.h" #include "mqanimation.h" #include "mqnettraffic.h" #include "smartptr.h" #include "uievent.h" #include <cstddef> #include <cstdint> namespace game { struct IMqNetService; struct IMqNetSession; struct CMidClient; struct CMidServer; struct GameSettings; struct CMenuPhase; struct CAutoDialog; struct CUIManager; struct CInterfManagerImpl; struct CMqFps; struct CInterface; struct IMqNetPlayerClient; struct IMqNetSystem; struct CMidgardMsgBox; struct NetMsgCallbacks; struct CNetMsg; struct GameImageDataWrapper; struct MQDBDataWrapper; using NetClientPtrIdPair = Pair<SmartPtr<IMqNetPlayerClient>, CMidgardID>; struct PlayerClientNode { std::uint32_t netId; /**< Client network identifier, not related to CMidgardID. */ NetClientPtrIdPair clientIdPair; }; struct CMidgardData { char unknown[4]; IMqNetService* netService; IMqNetSession* netSession; void* directPlayLobbySession; List<PlayerClientNode> clients; NetClientPtrIdPair* netPlayerClientPtr; /**< Points inside of the node from clients list. */ NetMsgCallbacks* netCallbacks; CMidClient* client; CMidServer* server; bool multiplayerGame; /**< It can be network or hotseat game. Check hotseat flag to be sure. */ bool hotseatGame; /**< Multiplayer game on the same computer. */ bool host; /**< True if computer hosts the game, server. */ bool lobbySessionExists; void* midStart; CMenuPhase* menuPhase; GameSettings** settings; GameImageDataWrapper* interfImages; CAutoDialog* autoDialog; MQDBDataWrapper* menuAnimations; GameImageDataWrapper* menuImages; SmartPtr<CUIManager> uiManager; char unknown12[4]; std::uint32_t startMenuMessageId; UiEvent startMenuEvent; std::uint32_t netMessageId; UiEvent netMessageEvent; SmartPtr<CInterfManagerImpl> interfManager; UiEvent closeEvent; bool gameIsRunning; // Meaning assumed char padding[3]; CMidgardMsgBox* closeGameMsgBox; CInterface* waitInterface; char unknown16[52]; CMqFps* fps; bool showFullSystemInfo; char padding2[3]; }; assert_size(CMidgardData, 252); assert_offset(CMidgardData, client, 40); assert_offset(CMidgardData, host, 50); assert_offset(CMidgardData, settings, 60); assert_offset(CMidgardData, closeEvent, 156); assert_offset(CMidgardData, fps, 244); struct CMidgard : public IMqNetTraffic , public IMqAnimation { CMidgardData* data; }; assert_size(CMidgard, 12); assert_offset(CMidgard, CMidgard::IMqNetTraffic::vftable, 0); assert_offset(CMidgard, CMidgard::IMqAnimation::vftable, 4); assert_offset(CMidgard, data, 8); namespace CMidgardApi { struct Api { using Instance = CMidgard*(__cdecl*)(); Instance instance; /** Sets specified net system to all local instances of net player clients. */ using SetClientsNetProxy = void(__thiscall*)(CMidgard* thisptr, IMqNetSystem* netSystem); SetClientsNetProxy setClientsNetProxy; /** Sets specified net service. */ using SetNetService = void(__thiscall*)(CMidgard* thisptr, IMqNetService* service, bool multiplayer, bool hotseat); SetNetService setNetService; /** * Creates IMqNetPlayerClient with specified name. * Created player is added to CMidgardData::clients list. * @returns netId of created player. */ using CreateNetClient = std::uint32_t(__thiscall*)(CMidgard* thisptr, const char* playerName, bool updateIniFile); CreateNetClient createNetClient; /** * Sends game specific net message to server. * Uses CMidgardData::netPlayerClientPtr to send message; * @returns true if message was successfully sent. */ using SendNetMsgToServer = bool(__thiscall*)(CMidgard* thisptr, const CNetMsg* message); SendNetMsgToServer sendNetMsgToServer; }; Api& get(); } // namespace CMidgardApi } // namespace game #endif // MIDGARD_H
5,042
C++
.h
144
30.270833
99
0.722837
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,448
unitinfolist.h
VladimirMakeev_D2ModdingToolset/mss32/include/unitinfolist.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 UNITINFOLIST_H #define UNITINFOLIST_H #include "d2list.h" namespace game { struct UnitInfo; using UnitInfoList = List<UnitInfo>; using UnitInfoListNode = ListNode<UnitInfo>; using UnitInfoListIterator = ListIterator<UnitInfo>; namespace UnitInfoListApi { struct Api { using Constructor = UnitInfoList*(__thiscall*)(UnitInfoList* thisptr); Constructor constructor; using Destructor = void(__thiscall*)(UnitInfoList* thisptr); Destructor destructor; using Sort = void(__thiscall*)(UnitInfoList* thisptr); Sort sort; }; Api& get(); } // namespace UnitInfoListApi } // namespace game #endif // UNITINFOLIST_H
1,463
C++
.h
40
34.225
74
0.765957
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,449
netdplayplayer.h
VladimirMakeev_D2ModdingToolset/mss32/include/netdplayplayer.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 NETDPLAYPLAYER_H #define NETDPLAYPLAYER_H #include "d2list.h" #include "d2string.h" #include "mqnetplayer.h" #define WIN32_LEAN_AND_MEAN #include <Windows.h> namespace game { struct CNetDPlaySession; struct IMqNetSystem; struct IMqNetReception; /** DirectPlay implementation of network player. */ struct CNetDPlayPlayer : public IMqNetPlayer { IMqNetPlayer* parent; CNetDPlaySession* session; IMqNetSystem* netSystem; void* unknown2; IMqNetReception* netReception; HANDLE eventHandle; bool stopThread; char padding[3]; int directPlayId; String name; List<void*> messages; }; assert_size(CNetDPlayPlayer, 68); } // namespace game #endif // NETDPLAYPLAYER_H
1,528
C++
.h
47
30.042553
72
0.766463
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,450
midserverlogiccore.h
VladimirMakeev_D2ModdingToolset/mss32/include/midserverlogiccore.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 MIDSERVERLOGICCORE_H #define MIDSERVERLOGICCORE_H #include "d2list.h" #include "d2map.h" #include "d2string.h" #include "d2vector.h" #include "midgardid.h" #include "mqnettraffic.h" #include <cstddef> #include <cstdint> namespace game { struct CMidServer; struct IMidgardObjectMap; struct NetMsgEntryData; struct NetPlayerInfo; struct CMidServerLogicCoreData { CMidServer* server; bool multiplayerGame; bool hotseatGame; char padding[2]; int value3; /**< Always set to 3 in constructor. */ /** Passed to CGameVersionMsg. 40 in RotE, 20 in Guardians of the Light and Galleans Return. */ int gameVersion; NetMsgEntryData** netMsgEntryData; IMidgardObjectMap* objectMap; List<void*> list; int unknown4; std::uint32_t playerNetId; Vector<NetPlayerInfo>* players; int unknown6; Map<std::uint32_t /* netId */, String /* playerName */>* sessionPlayers; int startingGold; int startingMana; /** Determines whether expansion-only (RotE) fields of midgard objects should be serialized. * Namely, when this is true, the following additional fields are serialized: * - CMidPlayer::alwaysAi * - CMidStackTemplate::aiPriority * - CMidEffectUnfog::unfog * - CMidEffectDiplomacy::alwaysAtWar * - CMidEffectAlly::permanentAlliance * Also, when the flag is set, the special id 'G25500FFFF' is getting serialized at the start of * CRefreshInfo stream. */ bool isExpansionContent; char padding2[3]; }; assert_size(CMidServerLogicCoreData, 72); assert_offset(CMidServerLogicCoreData, list, 24); assert_offset(CMidServerLogicCoreData, players, 48); struct CMidServerLogicCore : public IMqNetTraffic { CMidServerLogicCoreData* coreData; }; } // namespace game #endif // MIDSERVERLOGICCORE_H
2,625
C++
.h
74
32.378378
100
0.75295
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,451
itemspecial.h
VladimirMakeev_D2ModdingToolset/mss32/include/itemspecial.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 ITEMSPECIAL_H #define ITEMSPECIAL_H #include "itembase.h" namespace game { struct CItemSpecial : public CItemBase { }; assert_size(CItemSpecial, 12); } // namespace game #endif // ITEMSPECIAL_H
1,021
C++
.h
27
35.925926
72
0.765957
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,452
pictureinterf.h
VladimirMakeev_D2ModdingToolset/mss32/include/pictureinterf.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 PICTUREINTERF_H #define PICTUREINTERF_H #include "functordispatch1.h" #include "functordispatch2.h" #include "interface.h" namespace game { struct IMqImage2; struct CMqPoint; struct CPictureInterf; struct CPictureInterfData { int widgetChildIndex; SmartPtr<CBFunctorDispatch2<std::uint32_t, CPictureInterf*>> onMouseButtonPressed; SmartPtr<CBFunctorDispatch1<CPictureInterf*>> onMouseDoubleClicked; }; assert_size(CPictureInterfData, 20); /** * Picture ui element. * Represents IMAGE from Interf.dlg or ScenEdit.dlg files. */ struct CPictureInterf : public CInterface { CPictureInterfData* data; }; assert_size(CPictureInterf, 12); namespace CPictureInterfApi { struct Api { /** * Sets specified image to be shown by picture ui element. * Passing nullptr hides image. */ using SetImage = void(__thiscall*)(CPictureInterf* thisptr, IMqImage2* image, const CMqPoint* offset); SetImage setImage; /** Assigns mouse button press functor. */ using AssignFunctor = void(__thiscall*)(CPictureInterf* thisptr, SmartPointer* functor); AssignFunctor assignFunctor; }; Api& get(); } // namespace CPictureInterfApi } // namespace game #endif // PICTUREINTERF_H
2,119
C++
.h
62
30.467742
92
0.738981
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,453
batattackuntransformeffect.h
VladimirMakeev_D2ModdingToolset/mss32/include/batattackuntransformeffect.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 BATATTACKUNTRANSFORMEFFECT_H #define BATATTACKUNTRANSFORMEFFECT_H #include "batattack.h" #include "midgardid.h" namespace game { struct CBatAttackUntransformEffect : public CBatAttackBase { CMidgardID unitId; }; assert_size(CBatAttackUntransformEffect, 8); namespace CBatAttackUntransformEffectApi { IBatAttackVftable* vftable(); } // namespace CBatAttackUntransformEffectApi } // namespace game #endif // BATATTACKUNTRANSFORMEFFECT_H
1,270
C++
.h
33
36.545455
72
0.792176
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,454
cursorimpl.h
VladimirMakeev_D2ModdingToolset/mss32/include/cursorimpl.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 CURSORIMPL_H #define CURSORIMPL_H #include "interfaddon.h" #include "interfcursor.h" #include "mqpresentationmanager.h" #include "smartptr.h" namespace game { struct CInterfManagerImpl; struct CUIManager; struct CursorHandle; struct CCursorImplData { CInterfManagerImpl* interfManager; SmartPtr<CMqPresentationManager> presentationMgr; SmartPtr<CUIManager> uiManager; SmartPtr<CursorHandle> cursorHandle; bool unknown; char padding[3]; }; assert_size(CCursorImplData, 32); struct CCursorImpl : public IInterfCursor , public IInterfAddOn , public CMqPresentationManager::IPresentation { CCursorImplData* data; }; assert_size(CCursorImpl, 16); } // namespace game #endif // CURSORIMPL_H
1,555
C++
.h
48
30
72
0.778223
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,455
itemwand.h
VladimirMakeev_D2ModdingToolset/mss32/include/itemwand.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 ITEMWAND_H #define ITEMWAND_H #include "itemspell.h" namespace game { struct CItemWand : public CItemSpell { Bank castingCost; }; assert_size(CItemWand, 32); } // namespace game #endif // ITEMWAND_H
1,030
C++
.h
29
33.551724
72
0.762575
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,456
factoryimagestill.h
VladimirMakeev_D2ModdingToolset/mss32/include/factoryimagestill.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 FACTORYIMAGESTILL_H #define FACTORYIMAGESTILL_H #include "imgfactory.h" namespace game { struct FactoryImage2; struct FactoryImageStill : public CImgFactory::Image { FactoryImage2* image; }; assert_size(FactoryImageStill, 8); } // namespace game #endif // FACTORYIMAGESTILL_H
1,108
C++
.h
30
34.966667
72
0.774766
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,457
playerlistentry.h
VladimirMakeev_D2ModdingToolset/mss32/include/playerlistentry.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 PLAYERLISTENTRY_H #define PLAYERLISTENTRY_H #include "d2assert.h" #include "racecategory.h" #include <cstdint> namespace game { struct PlayerListEntry { LRaceCategory playerRace; std::uint32_t playerNetId; char* playerName; bool playerServer; bool unknown; char padding[2]; }; assert_size(PlayerListEntry, 24); } // namespace game #endif // PLAYERLISTENTRY_H
1,210
C++
.h
36
31.277778
72
0.762639
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,458
midfreetask.h
VladimirMakeev_D2ModdingToolset/mss32/include/midfreetask.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 MIDFREETASK_H #define MIDFREETASK_H #include "midtask.h" namespace game { struct CInterfManagerImpl; struct CTaskManager; struct CMidFreeTask : public IMidTask { SmartPtr<CInterfManagerImpl> interfManager; CTaskManager* taskManager; }; assert_size(CMidFreeTask, 16); } // namespace game #endif // MIDFREETASK_H
1,147
C++
.h
32
33.8125
72
0.775068
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,459
itempotionheal.h
VladimirMakeev_D2ModdingToolset/mss32/include/itempotionheal.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 ITEMPOTIONHEAL_H #define ITEMPOTIONHEAL_H #include "itembase.h" #include "itemexpotionheal.h" #include <cstddef> namespace game { /** Represents healing potion. */ struct CItemPotionHeal : public IItemExPotionHeal , public CItemBase { int quantityHp; }; assert_size(CItemPotionHeal, 20); assert_offset(CItemPotionHeal, CItemPotionHeal::IItemExPotionHeal::vftable, 0); assert_offset(CItemPotionHeal, CItemPotionHeal::CItemBase::vftable, 4); assert_offset(CItemPotionHeal, quantityHp, 16); } // namespace game #endif // ITEMPOTIONHEAL_H
1,374
C++
.h
37
35.162162
79
0.776692
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,460
aistratplayerrace.h
VladimirMakeev_D2ModdingToolset/mss32/include/aistratplayerrace.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 AISTRATPLAYERRACE_H #define AISTRATPLAYERRACE_H #include "aistratplayer.h" namespace game { struct CAiStratPlayerRace : public IAiStratPlayer { }; } // namespace game #endif // AISTRATPLAYERRACE_H
1,023
C++
.h
26
37.461538
72
0.772957
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,461
buildingcat.h
VladimirMakeev_D2ModdingToolset/mss32/include/buildingcat.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 BUILDINGCAT_H #define BUILDINGCAT_H #include "categories.h" #include "categoryids.h" namespace game { struct LBuildingCategoryTable : public CEnumConstantTable<BuildingId> { }; struct LBuildingCategory : public Category<BuildingId> { }; namespace BuildingCategories { struct Categories { LBuildingCategory* guild; LBuildingCategory* heal; LBuildingCategory* magic; LBuildingCategory* unit; }; Categories& get(); /** Returns address of LBuildingCategory::vftable used in game. */ const void* vftable(); } // namespace BuildingCategories namespace LBuildingCategoryTableApi { using Api = CategoryTableApi::Api<LBuildingCategoryTable, LBuildingCategory>; Api& get(); /** Returns address of LBuildingCategoryTable::vftable used in game. */ const void* vftable(); } // namespace LBuildingCategoryTableApi } // namespace game #endif // BUILDINGCAT_H
1,697
C++
.h
47
34.042553
77
0.780772
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,462
transformotherhooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/transformotherhooks.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 TRANSFORMOTHERHOOKS_H #define TRANSFORMOTHERHOOKS_H namespace game { struct CBatAttackTransformOther; struct IMidgardObjectMap; struct BattleMsgData; struct CMidgardID; struct BattleAttackInfo; } // namespace game namespace hooks { void __fastcall transformOtherAttackOnHitHooked(game::CBatAttackTransformOther* thisptr, int /*%edx*/, game::IMidgardObjectMap* objectMap, game::BattleMsgData* battleMsgData, game::CMidgardID* targetUnitId, game::BattleAttackInfo** attackInfo); } // namespace hooks #endif // TRANSFORMOTHERHOOKS_H
1,597
C++
.h
36
36.055556
88
0.672669
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,463
midclientcore.h
VladimirMakeev_D2ModdingToolset/mss32/include/midclientcore.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 MIDCLIENTCORE_H #define MIDCLIENTCORE_H #include "mqnetsystem.h" namespace game { struct CMidgard; struct IMidgardObjectMap; struct CMidCommandQueue2; struct CoreCommandUpdate; struct CCommandCanIgnore; struct CMidHotseatManager; struct CMidClientCoreData { CMidgard* midgard; int unknown; IMidgardObjectMap* objectMap; int unknown3; CMidCommandQueue2* commandQueue; CoreCommandUpdate* coreCommandUpdate; CCommandCanIgnore* commandCanIgnore; CMidHotseatManager* hotseatManager; }; assert_size(CMidClientCoreData, 32); struct CMidClientCore : public IMqNetSystem { CMidClientCoreData* data; }; namespace CMidClientCoreApi { struct Api { using GetObjectMap = IMidgardObjectMap*(__thiscall*)(CMidClientCore* thisptr); GetObjectMap getObjectMap; }; Api& get(); } // namespace CMidClientCoreApi } // namespace game #endif // MIDCLIENTCORE_H
1,713
C++
.h
54
29.351852
82
0.787363
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,464
scriptutils.h
VladimirMakeev_D2ModdingToolset/mss32/include/scriptutils.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 SCRIPTUTILS_H #define SCRIPTUTILS_H #include "idvector.h" #include "idview.h" #include <vector> namespace hooks { std::vector<bindings::IdView> IdVectorToIds(const game::IdVector* src); void IdsToIdVector(const std::vector<bindings::IdView>& src, game::IdVector* dst); } // namespace hooks #endif // SCRIPTUTILS_H
1,141
C++
.h
28
38.928571
82
0.766034
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,465
d2assert.h
VladimirMakeev_D2ModdingToolset/mss32/include/d2assert.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 D2ASSERT_H #define D2ASSERT_H #include <cstddef> #define assert_size(type, size) \ static_assert(sizeof(type) == (size), \ "Size of " #type " structure must be exactly " #size " bytes") #define assert_vftable_size(vtable, count) \ static_assert(sizeof(vtable) == (count) * sizeof(void*), \ #vtable " must have exactly " #count " methods") #define assert_offset(type, field, offset) \ static_assert(offsetof(type, field) == (offset), \ #type "::" #field " offset must be " #offset " bytes") #endif // D2ASSERT_H
1,723
C++
.h
31
51.709677
100
0.568802
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,466
image2memory.h
VladimirMakeev_D2ModdingToolset/mss32/include/image2memory.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 IMAGE2MEMORY_H #define IMAGE2MEMORY_H #include "d2color.h" #include "mqimage2surface16.h" #include <vector> namespace hooks { /** Represents image in memory that does not depend on .ff files. */ struct CImage2Memory : public game::CMqImage2Surface16 { CImage2Memory(std::uint32_t width, std::uint32_t height); std::vector<game::Color> pixels; }; CImage2Memory* createImage2Memory(std::uint32_t width, std::uint32_t height); } // namespace hooks #endif // IMAGE2MEMORY_H
1,306
C++
.h
33
37.575758
77
0.764427
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,467
eventconditions.h
VladimirMakeev_D2ModdingToolset/mss32/include/eventconditions.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 EVENTCONDITIONS_H #define EVENTCONDITIONS_H #include "midevcondition.h" #include "midgardid.h" namespace game { /** Frequency (every n days). */ struct CMidCondFrequency : public CMidEvCondition { int frequency; /**< In days [1 : 500]. */ }; assert_size(CMidCondFrequency, 20); /** Entering a predefined zone. */ struct CMidCondLocation : public CMidEvCondition { CMidgardID locationId; }; assert_size(CMidCondLocation, 20); /** Entering a city. */ struct CMidCondEnterCity : public CMidEvCondition { CMidgardID cityId; }; assert_size(CMidCondEnterCity, 20); /** Owning a city. */ struct CMidCondOwnCity : public CMidEvCondition { CMidgardID cityId; }; assert_size(CMidCondOwnCity, 20); /** Destroying a stack. */ struct CMidCondKillStack : public CMidEvCondition { CMidgardID stackId; }; assert_size(CMidCondKillStack, 20); /** Owning an item. */ struct CMidCondOwnItem : public CMidEvCondition { CMidgardID itemId; }; assert_size(CMidCondOwnItem, 20); /** Specific leader owning an item. */ struct CMidCondLeaderOwnItem : public CMidEvCondition { CMidgardID stackId; CMidgardID itemId; }; assert_size(CMidCondLeaderOwnItem, 24); /** Diplomacy relations. */ struct CMidCondDiplomacy : public CMidEvCondition { CMidgardID playerId1; CMidgardID playerId2; int diplomacy; /**< Percentage based value [-100 : 100]. */ }; assert_size(CMidCondDiplomacy, 28); /** Being in alliance. */ struct CMidCondAlliance : public CMidEvCondition { CMidgardID playerId1; CMidgardID playerId2; }; assert_size(CMidCondAlliance, 24); /** Looting a ruin. */ struct CMidCondLootRuin : public CMidEvCondition { CMidgardID ruinId; }; assert_size(CMidCondLootRuin, 20); /** Transforming x% of the land. */ struct CMidCondTerraform : public CMidEvCondition { int percentLand; /**< Percentage based value [-100 : 100]. */ }; assert_size(CMidCondTerraform, 20); /** Visiting a site. */ struct CMidCondVisitSite : public CMidEvCondition { CMidgardID siteId; }; assert_size(CMidCondVisitSite, 20); /** Stack to location. */ struct CMidCondLeaderToZone : public CMidEvCondition { CMidgardID stackId; CMidgardID locationId; }; assert_size(CMidCondLeaderToZone, 24); /** Stack to city. */ struct CMidCondLeaderToCity : public CMidEvCondition { CMidgardID stackId; CMidgardID cityId; }; assert_size(CMidCondLeaderToCity, 24); /** Item to location. */ struct CMidCondItemToLocation : public CMidEvCondition { CMidgardID itemId; CMidgardID locationId; }; assert_size(CMidCondItemToLocation, 24); /** Stack existance. */ struct CMidCondStackExists : public CMidEvCondition { CMidgardID stackId; int existanceStatus; }; assert_size(CMidCondStackExists, 24); enum class CondVarComparison : int { IgnoreSecond, /**< Check if first variable is in range, ignore second. */ BothInRange, /**< Both variables must be in their respective ranges. */ AnyInRange, /**< First or second variable in their respective ranges. */ }; /** Variable is in range. */ struct CMidCondVarInRange : public CMidEvCondition { struct Variable { int id; /**< Scenario variable id, see ScenarioVariable::variableId. */ int min; int max; }; Variable variable1; Variable variable2; CondVarComparison comparison; }; assert_size(CMidCondVarInRange, 44); } // namespace game #endif // EVENTCONDITIONS_H
4,249
C++
.h
149
26.080537
79
0.754619
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,468
itemtypelist.h
VladimirMakeev_D2ModdingToolset/mss32/include/itemtypelist.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 ITEMTYPELIST_H #define ITEMTYPELIST_H #include "d2pair.h" #include "midgardid.h" #include "mq_c_s.h" namespace game { struct CItemBase; struct TItemTypeList { void* vftable; mq_c_s<Pair<CMidgardID, CItemBase*>>* data; }; assert_size(TItemTypeList, 8); } // namespace game #endif // ITEMTYPELIST_H
1,133
C++
.h
33
32.333333
72
0.759158
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,469
stringpairarrayptr.h
VladimirMakeev_D2ModdingToolset/mss32/include/stringpairarrayptr.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 STRINGPAIRARRAYPTR_H #define STRINGPAIRARRAYPTR_H #include "d2pair.h" #include "d2vector.h" #include "smartptr.h" namespace game { using StringPairArray = Vector<Pair<char[11], char[257]>>; using StringPairArrayPtr = SmartPtr<StringPairArray>; namespace StringPairArrayPtrApi { struct Api { using Constructor = StringPairArrayPtr*(__thiscall*)(StringPairArrayPtr* thisptr); Constructor constructor; using SetData = void(__thiscall*)(StringPairArrayPtr* thisptr, StringPairArray* data); SetData setData; }; Api& get(); } // namespace StringPairArrayPtrApi } // namespace game #endif // STRINGPAIRARRAYPTR_H
1,453
C++
.h
38
36.078947
90
0.772792
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,470
isoenginegroundhooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/isoenginegroundhooks.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 ISOENGINEGROUNDHOOKS_H #define ISOENGINEGROUNDHOOKS_H #include "isoengineground.h" namespace hooks { void __stdcall groundTextureDrawHooked(game::CIsoEngineGround::CGroundTexture* thisptr, game::SurfaceDecompressData* decompressData); void __fastcall isoEngineGroundRenderHooked(game::CIsoEngineGround* thisptr, int /*%edx*/, game::IMqRenderer2* renderer, const game::CMqPoint* position, const game::CMqRect* area); } // namespace hooks #endif // ISOENGINEGROUNDHOOKS_H
1,512
C++
.h
31
40.064516
87
0.671642
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,471
d2color.h
VladimirMakeev_D2ModdingToolset/mss32/include/d2color.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 D2COLOR_H #define D2COLOR_H #include "d2assert.h" #include <cstdint> namespace game { /** Representation of a color in game. */ struct Color { constexpr Color() = default; /** ABGR format. */ constexpr Color(std::uint32_t value) : value{value} { } constexpr Color(std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a = 0) : r{r} , g{g} , b{b} , a{a} { } union { struct { std::uint8_t r; std::uint8_t g; std::uint8_t b; std::uint8_t a; /**< Assumption, no use cases found yet. */ }; std::uint32_t value{}; }; }; assert_size(Color, 4); } // namespace game #endif // D2COLOR_H
1,571
C++
.h
52
25.673077
87
0.651857
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,472
aireactionnull.h
VladimirMakeev_D2ModdingToolset/mss32/include/aireactionnull.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 AIREACTIONNULL_H #define AIREACTIONNULL_H #include "aireaction.h" namespace game { struct CAiReactionNull : public IAiReaction { }; } // namespace game #endif // AIREACTIONNULL_H
1,005
C++
.h
26
36.769231
72
0.768756
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,473
groupareamanagement.h
VladimirMakeev_D2ModdingToolset/mss32/include/groupareamanagement.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 GROUPAREAMANAGEMENT_H #define GROUPAREAMANAGEMENT_H #include "d2vector.h" #include "mqrect.h" namespace game { struct CGroupAreaManagementVftable; struct CGroupAreaManagementData { Vector<CMqRect> unitAreas; CMqRect groupArea; int leftSide; }; assert_size(CGroupAreaManagementData, 36); struct CGroupAreaManagement { CGroupAreaManagementVftable* vftable; CGroupAreaManagementData* data; }; assert_size(CGroupAreaManagement, 8); struct CGroupAreaManagementVftable { using Destructor = void(__thiscall*)(CGroupAreaManagement* thisptr, char flags); Destructor destructor; /** Returns unit area index that contains specified point or -1. */ using GetAreaIndex = int(__thiscall*)(CGroupAreaManagement* thisptr, const CMqPoint* position); GetAreaIndex getAreaIndex; /** Returns unit area by unit index in group. */ using GetUnitArea = CMqRect*(__thiscall*)(CGroupAreaManagement* thisptr, CMqRect* unitArea, const int* index); GetUnitArea getUnitArea; using GetLeftSide = int(__thiscall*)(const CGroupAreaManagement* thisptr); GetLeftSide getLeftSide; }; assert_vftable_size(CGroupAreaManagementVftable, 4); } // namespace game #endif // GROUPAREAMANAGEMENT_H
2,140
C++
.h
55
34.563636
99
0.742029
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,474
d2vector.h
VladimirMakeev_D2ModdingToolset/mss32/include/d2vector.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 D2VECTOR_H #define D2VECTOR_H namespace game { /** Implementation of std::vector<T> in game. */ template <typename T, typename Allocator = void*> struct Vector { T* bgn; T* end; T* allocatedMemEnd; Allocator allocator; }; } // namespace game #endif // D2VECTOR_H
1,104
C++
.h
32
32.3125
72
0.747891
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,475
midsite.h
VladimirMakeev_D2ModdingToolset/mss32/include/midsite.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 MIDSITE_H #define MIDSITE_H #include "aipriority.h" #include "d2set.h" #include "mapelement.h" #include "midgardid.h" #include "midscenarioobject.h" #include "sitecategories.h" #include "stringandid.h" #include <cstddef> namespace game { /** Base class for site objects. */ struct CMidSite : public IMidScenarioObject { IMapElement mapElement; IAiPriority aiPriority; int imgIso; char imgIntf[9]; char padding[3]; StringAndId title; StringAndId description; CMidgardID unknownId; Set<CMidgardID> visitors; LSiteCategory siteCategory; }; assert_size(CMidSite, 120); assert_offset(CMidSite, mapElement, 8); assert_offset(CMidSite, title, 52); } // namespace game #endif // MIDSITE_H
1,548
C++
.h
48
29.916667
72
0.760214
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,476
autoptr.h
VladimirMakeev_D2ModdingToolset/mss32/include/autoptr.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 AUTOPTR_H #define AUTOPTR_H namespace game { struct IMidObject; template <typename T> struct AutoPtr { T* data; }; using MidObjectPtr = AutoPtr<IMidObject>; namespace AutoPtrApi { struct Api { /** * Replaces the held pointer. If the currently held pointer is not null - then its data gets * deleted. */ using Reset = void(__thiscall*)(MidObjectPtr* thisptr, IMidObject* data); Reset reset; }; Api& get(); } // namespace AutoPtrApi } // namespace game #endif // AUTOPTR_H
1,334
C++
.h
42
29.357143
96
0.74395
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,477
middropmanager.h
VladimirMakeev_D2ModdingToolset/mss32/include/middropmanager.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 MIDDROPMANAGER_H #define MIDDROPMANAGER_H #include "d2assert.h" namespace game { struct IMidDropManagerVftable; struct IMidDropSource; struct IMidDropManager { IMidDropManagerVftable* vftable; }; struct IMidDropManagerVftable { using Destructor = void(__thiscall*)(IMidDropManager* thisptr, char flags); Destructor destructor; using GetDropSource = IMidDropSource*(__thiscall*)(IMidDropManager* thisptr); GetDropSource getDropSource; using SetDropSource = void(__thiscall*)(IMidDropManager* thisptr, IMidDropSource* value, bool a3); SetDropSource setDropSource; void* method4; using ResetDropSource = void(__thiscall*)(IMidDropManager* thisptr); ResetDropSource resetDropSource; void* methods[9]; }; assert_vftable_size(IMidDropManagerVftable, 14); } // namespace game #endif // MIDDROPMANAGER_H
1,762
C++
.h
46
33.76087
81
0.735018
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,478
interfaddon.h
VladimirMakeev_D2ModdingToolset/mss32/include/interfaddon.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 INTERFADDON_H #define INTERFADDON_H #include "d2assert.h" namespace game { struct IInterfAddOnVftable; struct IInterfAddOn { IInterfAddOnVftable* vftable; }; struct IInterfAddOnVftable { using Destructor = void(__thiscall*)(IInterfAddOn* thisptr, char flags); Destructor destructor; void* method1; void* method2; void* method3; }; assert_vftable_size(IInterfAddOnVftable, 4); } // namespace game #endif // INTERFADDON_H
1,274
C++
.h
38
31.184211
76
0.76509
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,479
midserver.h
VladimirMakeev_D2ModdingToolset/mss32/include/midserver.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 MIDSERVER_H #define MIDSERVER_H #include "mqnetsystem.h" #include "mqthread.h" #include <cstddef> #include <cstdint> namespace game { struct IMqNetSession; struct IMqNetPlayerServer; struct CMidServerBuilderFull; struct CMidServerLogic; struct NetMsgCallbacks; struct NetMsgEntryData; struct CNetMsg; struct CMidServerData { IMqNetSession* netSession; IMqNetPlayerServer* netPlayerServer; NetMsgCallbacks** netCallbacks; NetMsgEntryData** netMsgEntryData; std::uint32_t serverMessageId; int unknown2; CMidServerBuilderFull* serverBuilder; CMidServerLogic* serverLogic; }; assert_size(CMidServerData, 32); struct CMidServer : public CMqThread , public IMqNetSystem { CMidServerData* data; }; assert_size(CMidServer, 16); assert_offset(CMidServer, CMidServer::CMqThread::vftable, 0); assert_offset(CMidServer, CMidServer::IMqNetSystem::vftable, 8); assert_offset(CMidServer, data, 12); namespace CMidServerApi { struct Api { using SendNetMsg = bool(__thiscall*)(const CMidServer* thisptr, const CNetMsg* netMsg, std::uint32_t playerNetId); SendNetMsg sendNetMsg; }; Api& get(); } // namespace CMidServerApi } // namespace game #endif // MIDSERVER_H
2,115
C++
.h
66
28.545455
72
0.749877
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,480
menuload.h
VladimirMakeev_D2ModdingToolset/mss32/include/menuload.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 MENULOAD_H #define MENULOAD_H #include "menubase.h" namespace game { /** Base class for all menus that loads previously saved game. */ struct CMenuLoad : public CMenuBase { }; namespace CMenuLoadApi { struct Api { using ButtonCallback = void(__thiscall*)(CMenuLoad* thisptr); /** Loads selected game save file. */ ButtonCallback buttonLoadCallback; /** Creates host player client and requests game version from server. */ using CreateHostPlayer = void(__thiscall*)(CMenuLoad* thisptr); CreateHostPlayer createHostPlayer; }; Api& get(); } // namespace CMenuLoadApi } // namespace game #endif // MENULOAD_H
1,460
C++
.h
39
35.102564
76
0.755319
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,481
condinterfhandler.h
VladimirMakeev_D2ModdingToolset/mss32/include/condinterfhandler.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 CONDINTERFHANDLER_H #define CONDINTERFHANDLER_H namespace game::editor { struct CCondInterfHandlerVftable; struct CCondInterfHandler { CCondInterfHandlerVftable* vftable; }; struct CCondInterfHandlerVftable { using Destructor = void(__thiscall*)(CCondInterfHandler* thisptr, char flags); Destructor destructor; using RunCallback = void(__thiscall*)(CCondInterfHandler* thisptr, bool); RunCallback runCallback; }; } // namespace game::editor #endif // CONDINTERFHANDLER_H
1,319
C++
.h
35
35.4
82
0.776646
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,482
menuphasehooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/menuphasehooks.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 MENUPHASEHOOKS_H #define MENUPHASEHOOKS_H namespace game { struct CMenuPhase; } namespace hooks { game::CMenuPhase* __fastcall menuPhaseCtorHooked(game::CMenuPhase* thisptr, int /*%edx*/, int a2, int a3); void __fastcall menuPhaseDtorHooked(game::CMenuPhase* thisptr, int /*%edx*/, char flags); void __fastcall menuPhaseSetTransitionHooked(game::CMenuPhase* thisptr, int /*%edx*/, int transition); } // namespace hooks #endif // MENUPHASEHOOKS_H
1,512
C++
.h
34
35.735294
89
0.645337
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,483
ussoldier.h
VladimirMakeev_D2ModdingToolset/mss32/include/ussoldier.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 USSOLDIER_H #define USSOLDIER_H #include "d2assert.h" #include "usunitextension.h" namespace game { struct CMidgardID; struct LSubRaceCategory; struct LUnitBranch; struct LDeathAnimCategory; struct IAttack; struct LImmuneCat; struct LAttackClass; struct LAttackSource; struct Bank; struct IUsSoldierVftable; struct IUsSoldier : public IUsUnitExtensionT<IUsSoldierVftable> { }; struct IUsSoldierVftable : public IUsUnitExtensionVftable { using GetCStr = const char*(__thiscall*)(const IUsSoldier* thisptr); GetCStr getName; GetCStr getDescription; using GetId = const CMidgardID*(__thiscall*)(const IUsSoldier* thisptr); GetId getRaceId; using GetSubrace = const LSubRaceCategory*(__thiscall*)(const IUsSoldier* thisptr); GetSubrace getSubrace; using GetBranch = const LUnitBranch*(__thiscall*)(const IUsSoldier* thisptr); GetBranch getBranch; using GetBool = bool(__thiscall*)(const IUsSoldier* thisptr); GetBool getSizeSmall; GetBool getSexM; using GetInt = int(__thiscall*)(const IUsSoldier* thisptr); GetInt getLevel; GetInt getHitPoints; using GetArmor = int*(__thiscall*)(const IUsSoldier* thisptr, int* armor); GetArmor getArmor; GetId getBaseUnitImplId; using GetDeathAnim = const LDeathAnimCategory*(__thiscall*)(const IUsSoldier* thisptr); GetDeathAnim getDeathAnim; using GetRegen = int*(__thiscall*)(const IUsSoldier* thisptr); GetRegen getRegen; GetInt getXpNext; GetInt getXpKilled; /** * Returns immune category for specified attack class. * @returns found immune category or not immune if not found. */ using GetImmuneByAttackClass = const LImmuneCat*(__thiscall*)(const IUsSoldier* thisptr, const LAttackClass* attackClass); GetImmuneByAttackClass getImmuneByAttackClass; /** * Returns immune category for specified attack source. * @returns found immune category or not immune if not found. */ using GetImmuneByAttackSource = const LImmuneCat*( __thiscall*)(const IUsSoldier* thisptr, const LAttackSource* attackSource); GetImmuneByAttackSource getImmuneByAttackSource; using GetAttackById = IAttack*(__thiscall*)(const IUsSoldier* thisptr); GetAttackById getAttackById; GetAttackById getSecondAttackById; GetBool getAttackTwice; using GetBank = const Bank*(__thiscall*)(const IUsSoldier* thisptr); GetBank getEnrollCost; GetBank getReviveCost; GetBank getHealCost; GetBank getTrainingCost; GetId getDynUpg1; using GetDynUpgLvl = int(__thiscall*)(const IUsSoldier* thisptr); GetDynUpgLvl getDynUpgLvl; GetId getDynUpg2; GetBool getWaterOnly; }; assert_vftable_size(IUsSoldierVftable, 29); } // namespace game #endif // USSOLDIER_H
3,677
C++
.h
93
35.032258
99
0.747117
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,484
isolayers.h
VladimirMakeev_D2ModdingToolset/mss32/include/isolayers.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 ISOLAYER_H #define ISOLAYER_H #include <cstdint> namespace game { struct CIsoLayer { std::uint32_t value; }; /** Addresses of iso layer values read from IIsoLay.dbf. */ struct IsoLayers { CIsoLayer* fog; /**< FOG */ CIsoLayer* fogBorder; /**< FOG_BORDER */ CIsoLayer* trees; /**< TREES */ CIsoLayer* mountains; /**< MOUNTAINS */ CIsoLayer* roads; /**< ROADS */ CIsoLayer* capitals; /**< CAPITALS */ CIsoLayer* villages; /**< VILLAGES */ CIsoLayer* riots; /**< RIOTS */ CIsoLayer* flags; /**< FLAGS */ CIsoLayer* shields; /**< SHIELDS */ CIsoLayer* stacks; /**< STACKS */ CIsoLayer* stacksShadow; /**< STACKS_SHADOW */ CIsoLayer* landmarks; /**< LANDMARKS */ CIsoLayer* lmarkGround; /**< LMARK_GROUND */ CIsoLayer* sites; /**< SITES */ CIsoLayer* bags; /**< BAGS */ CIsoLayer* tombs; /**< TOMBS */ CIsoLayer* ruins; /**< RUINS */ CIsoLayer* rods; /**< RODS */ CIsoLayer* crystals; /**< CRYSTALS */ CIsoLayer* locations; /**< LOCATIONS */ CIsoLayer* locationsTop; /**< LOCATIONS_TOP */ CIsoLayer* stackDeath; /**< STACK_DEATH */ CIsoLayer* stackCreate; /**< STACK_CREATE */ CIsoLayer* stackOwner; /**< STACK_OWNER */ CIsoLayer* spellsGround1; /**< SPELLS_GROUND1 */ CIsoLayer* spellsGround2; /**< SPELLS_GROUND2 */ CIsoLayer* spellsUnder1; /**< SPELLS_UNDER1 */ CIsoLayer* spellsUnder2; /**< SPELLS_UNDER2 */ CIsoLayer* spellsFront1; /**< SPELLS_FRONT1 */ CIsoLayer* spellsFront2; /**< SPELLS_FRONT2 */ CIsoLayer* spellsOver1; /**< SPELLS_OVER1 */ CIsoLayer* spellsOver2; /**< SPELLS_OVER2 */ CIsoLayer* spellsTop1; /**< SPELLS_TOP1 */ CIsoLayer* spellsTop2; /**< SPELLS_TOP2 */ CIsoLayer* mountainRemove; /**< MOUNTAIN_REMOVE */ CIsoLayer* symLocationSel; /**< SYM_LOCATION_SEL */ CIsoLayer* symStackSel; /**< SYM_STACK_SEL */ CIsoLayer* symStackBattle; /**< SYM_STACK_BATTLE */ CIsoLayer* symMovePath; /**< SYM_MOVE_PATH */ CIsoLayer* symObjective; /**< SYM_OBJECTIVE */ CIsoLayer* symShadow; /**< SYM_SHADOW */ CIsoLayer* symInvisible; /**< SYM_INVISIBLE */ CIsoLayer* symStackHighlite; /**< SYM_STACK_HIGHLITE */ CIsoLayer* symSpellArea; /**< SYM_SPELL_AREA */ CIsoLayer* symSpellFog; /**< SYM_SPELL_FOG */ CIsoLayer* grid; /**< GRID */ CIsoLayer* smoothScrolling; /**< SMOOTH_SCROLLING */ CIsoLayer* tileHighlight; /**< TILE_HIGHLIGHT */ CIsoLayer* cloudImage; /**< CLOUD_IMAGE */ CIsoLayer* cloudShadow; /**< CLOUD_SHADOW */ CIsoLayer* banners; /**< BANNERS */ }; IsoLayers& isoLayers(); } // namespace game #endif // ISOLAYER_H
3,808
C++
.h
85
41.011765
72
0.607268
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,485
soundsystemsample.h
VladimirMakeev_D2ModdingToolset/mss32/include/soundsystemsample.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 SOUNDSYSTEMSAMPLE_H #define SOUNDSYSTEMSAMPLE_H #include "d2pair.h" #include "d2vector.h" #include "smartptr.h" #include "uievent.h" #include <Windows.h> namespace game { struct CSoundSystemImpl; struct SoundSampleInfo { void* sampleHandle; /**< Miles sound system handle */ void* soundData; /**< Raw data from .wdb file */ int soundId; Pair<int /* volume */, int /* pan */> volumePan; SmartPointer functor; }; assert_size(SoundSampleInfo, 28); struct CSoundSystemSampleData { SmartPtr<CSoundSystemImpl> soundSystemImpl; std::uint32_t mqCbSampleMsgId; UiEvent sampleEvent; bool soundFx; char padding[3]; int fxVolume; SoundSampleInfo infos[10]; int infosCount; int freeId; Vector<char[12]> array; RTL_CRITICAL_SECTION criticalSection; }; assert_size(CSoundSystemSampleData, 372); struct CSoundSystemSample { CSoundSystemSampleData* data; }; assert_size(CSoundSystemSample, 4); } // namespace game #endif // SOUNDSYSTEMSAMPLE_H
1,830
C++
.h
58
28.87931
72
0.752841
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,486
displayhandlershooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/displayhandlershooks.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 DISPLAYHANDLERSHOOKS_H #define DISPLAYHANDLERSHOOKS_H #include "displayhandlers.h" namespace hooks { void __stdcall displayHandlerVillageHooked(game::ImageLayerList* list, const game::CMidVillage* village, const game::IMidgardObjectMap* objectMap, const game::CMidgardID* playerId, const game::IdSet* objectives, int a6, bool animatedIso); } #endif // DISPLAYHANDLERSHOOKS_H
1,459
C++
.h
31
37
84
0.642757
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,487
battleviewerinterf.h
VladimirMakeev_D2ModdingToolset/mss32/include/battleviewerinterf.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 BATTLEVIEWERINTERF_H #define BATTLEVIEWERINTERF_H #include "attackclasscat.h" #include "avoidflickerimage.h" #include "battlemsgdata.h" #include "batviewer.h" #include "batviewerutils.h" #include "d2map.h" #include "d2string.h" #include "d2vector.h" #include "draganddropinterf.h" #include "midgardid.h" #include "mqrect.h" #include "smartptr.h" #include "uievent.h" #include "unitpositionlist.h" #include "unitpositionmap.h" #include <cstddef> namespace game { struct BattleAttackInfo; struct CBatViewer2DEngine; struct CBatImagesLoader; struct CBatBigFace; struct CBatUnitGroup2; struct CBatUnitAnim; struct CMidgardMsgBox; struct IMidgardObjectMap; struct CBatEncyclopediaInterf; struct CBatLog; struct IBatNotify; struct CBattleViewerGroupAreas { CMqRect unitImageAreas[6]; CMqRect unitBgndImageArea; String unitBgndString; CMqRect slotImageAreas[6]; CMqRect meterImageAreas[6]; CMqRect bigFaceImageArea; CMqRect bigTextImageArea; CMqRect itemImageAreas[2]; CMqRect itemBgndImageArea; String itemBgndString; }; assert_size(CBattleViewerGroupAreas, 416); struct CBattleViewerUnknownData { int unknown; int unknown2; int unknown3; int unknown4; }; assert_size(CBattleViewerUnknownData, 16); struct CBattleViewerUnknown { CBattleViewerUnknownData data; CBattleViewerUnknownData data2[6]; CBattleViewerUnknownData data3[6]; String string; Set<void> list; /** < Each node contains 16 bytes of data. */ }; assert_offset(CBattleViewerUnknown, data3, 112); assert_offset(CBattleViewerUnknown, string, 208); struct CBattleViewerAttackTargetData { bool isBattleGoing; bool unknown; char padding[2]; CMidgardID groupId; UnitPositionMap unitPositions; }; assert_size(CBattleViewerAttackTargetData, 36); struct CBattleViewerItemTargetData { bool isAttacker; bool unknown; char padding[2]; CMidgardID groupId; UnitPositionMap unitPositions; }; assert_size(CBattleViewerItemTargetData, 36); struct CBattleViewerTargetDataSet { CBattleViewerAttackTargetData attack; CBattleViewerItemTargetData items[2]; }; assert_size(CBattleViewerTargetDataSet, 108); struct CBattleViewerUnknownUnitData { CMidgardID unknownId; int unknown; bool unknown2; bool isUnitBig; bool isUnitRetreating; char padding; }; assert_size(CBattleViewerUnknownUnitData, 12); using CUnknownUnitDataMap = Map<CMidgardID, CBattleViewerUnknownUnitData>; struct CUnitRectAndId { CMqRect rect; CMidgardID id; }; assert_size(CUnitRectAndId, 20); struct CBattleViewerTargetUnitData : CUnitRectAndId { int position; bool isAttacker; /**< Meaning assumed. */ bool isRetreating; bool isBig; bool isTargetForSummonOrAttackTargetsBothGroups; bool isTargetForSummon; bool canPerformAttackOnTargetOrAllAttackReach; char padding[2]; }; assert_size(CBattleViewerTargetUnitData, 32); struct CBattleViewerInterfData { CAvoidFlickerImage avoidFlickerImage; void* sounds; BattleMsgData battleMsgData; CUnknownUnitDataMap unknownUnitData; CMidgardID unitId; CBattleViewerTargetDataSet targetData; BattleAttackInfo** attackInfo; char unknown3[4]; CMidgardID itemId; Vector<CBattleViewerTargetUnitData> targetUnitData; CBatViewer2DEngine* batViewer2dEngine; CMqRect dialogInterfArea; CBatImagesLoader* imagesLoader; CBattleViewerGroupAreas groupAreas1; CBattleViewerGroupAreas groupAreas2; CBatBigFace* bigFace; CBatUnitGroup2* batUnitGroup1; CBatUnitGroup2* batUnitGroup2; char unknown4[8]; CBatBigFace* bigFace2; CBatUnitGroup2* batUnitGroup3; CBatUnitGroup2* batUnitGroup4; char unknown41[8]; CBatUnitAnim* unitAnimations[6]; CBatUnitAnim* unitAnimations2[6]; CBattleViewerUnknown unknown11; char unknown5[4]; CBatViewerUtils::CAnimCounter animCounter; char unknown10; bool unknown12; char unknown13[2]; CMqRect unitGroupSpotArea; bool unknown7; bool unknown8; bool unknown9; bool flippedBattle; bool bothPlayersHuman; bool unknown6; char unknown61[2]; CMidgardMsgBox* messageBox; IMidgardObjectMap* objectMap; bool stickyEncy; char padding[3]; }; assert_size(CBattleViewerInterfData, 5384); assert_offset(CBattleViewerInterfData, batViewer2dEngine, 4136); assert_offset(CBattleViewerInterfData, imagesLoader, 4156); assert_offset(CBattleViewerInterfData, bigFace, 4992); assert_offset(CBattleViewerInterfData, bigFace2, 5012); assert_offset(CBattleViewerInterfData, bothPlayersHuman, 5368); assert_offset(CBattleViewerInterfData, objectMap, 5376); struct CBattleViewerInterfData2 { char* dialogName; int battleSpeed; bool battleAnimations; bool battleSpeedInstant; char padding[2]; CMidgardID targetUnitId; LAttackClass attackClass; bool normalAttack; bool unknown4; char unknown5; char unknown51; UiEvent autobattleTimerEvent; bool unknown6; bool unknown7; bool unknown8; char unknown9; CBatEncyclopediaInterf* encyclopedia; char unknown1[48]; CBatLog* log; List<void*> list; /**< Nodes unknown. */ List<void*> list2; List<void*> list3; char unknown2[4]; IBatNotify* battleNotify; CMidgardID selectedUnitId; List<void*> list4; /**< Each node contains 16 bytes of data. */ char unknown3; bool unknown10; char unknown11; char unknown12; }; assert_size(CBattleViewerInterfData2, 196); /** * Renders battle screen and handles user input during battle. * Represents DLG_BATTLE_A from Interf.dlg. */ struct CBattleViewerInterf : public CDragAndDropInterf { IBatViewer batViewer; CBattleViewerInterfData* data; CBattleViewerInterfData2* data2; }; assert_size(CBattleViewerInterf, 36); static inline CBattleViewerInterf* castBatViewerToBattleViewerInterf(IBatViewer* value) { return reinterpret_cast<CBattleViewerInterf*>((std::uintptr_t)value - offsetof(CBattleViewerInterf, batViewer)); } namespace BattleViewerInterfApi { struct Api { using MarkAttackTargets = bool(__thiscall*)(CBattleViewerInterf* thisptr, const CMqPoint* mousePosition, bool setBigFace); MarkAttackTargets markAttackTargets; using IsUnitOnTheLeft = bool(__thiscall*)(const CBattleViewerInterf* thisptr, bool isAttacker); IsUnitOnTheLeft isUnitOnTheLeft; using IsFlipped = bool(__thiscall*)(const CBattleViewerInterf* thisptr); IsFlipped isFlipped; using GetBigFace = CBatBigFace*(__thiscall*)(const CBattleViewerInterf* thisptr); GetBigFace getBigFace; GetBigFace getBigFace2; using GetUnitRect = CMqRect*(__stdcall*)(CMqRect* value, CBattleViewerGroupAreas* groupAreas, int unitPosition, bool isUnitBig, bool isUnitRetreating); GetUnitRect getUnitRect; GetUnitRect getUnitRectPlusExtra; using GetBoolById = bool(__thiscall*)(CUnknownUnitDataMap* thisptr, const CMidgardID* unitId); GetBoolById isUnitBig; GetBoolById isUnitRetreating; GetBoolById getUnknown2; using GetSelectedUnitId = CMidgardID*(__thiscall*)(const CBatUnitGroup2* thisptr, CMidgardID* value, const CMqPoint* mousePosition); GetSelectedUnitId getSelectedUnitId; using HighlightGroupFrame = void(__thiscall*)(CBatUnitGroup2* thisptr, const CMidgardID* targetGroupId, bool isSupportAttack); HighlightGroupFrame highlightGroupFrame; using UnknownMethod = void(__thiscall*)(CBatUnitGroup2* thisptr, const CMidgardID* unitId); UnknownMethod unknownMethod; using UnknownMethod2 = void(__thiscall*)(CBatUnitGroup2* thisptr, const CMidgardID* targetUnitId, bool isSupportAttack); UnknownMethod2 unknownMethod2; using UnknownMethod3 = void(__thiscall*)(CBatUnitGroup2* thisptr, const CMidgardID* targetGroupId, int unitPosition); UnknownMethod3 unknownMethod3; using GetUnitAnimation = CBatUnitAnim**(__thiscall*)(const CBattleViewerInterf* thisptr, const CMidgardID* unitId); GetUnitAnimation getUnitAnimation; using UpdateUnknown = void(__thiscall*)(CBattleViewerInterf* thisptr, bool a2); UpdateUnknown updateUnknown; using UpdateBattleItems = void(__thiscall*)(CBattleViewerInterf* thisptr, bool canUseItem); UpdateBattleItems updateBattleItems; using CBattleViewerTargetDataSetConstructor = CBattleViewerTargetDataSet*( __thiscall*)(CBattleViewerTargetDataSet* thisptr, const BatViewerTargetDataSet* src); CBattleViewerTargetDataSetConstructor battleViewerTargetDataSetCtor; using CBattleViewerTargetDataSetSetAttacker = void(__thiscall*)(CBattleViewerTargetDataSet* thisptr, const CMidgardID* attackerGroupId); CBattleViewerTargetDataSetSetAttacker battleViewerTargetDataSetSetAttacker; using Callback = void(__thiscall*)(CBattleViewerInterf* thisptr); Callback autoBattleCallback; Callback disableAutoBattleAndResolveCallback; struct ButtonCallback { Callback callback; int unknown; }; using CreateButtonFunctor = SmartPointer*(__stdcall*)(SmartPointer* functor, int a2, CBattleViewerInterf* viewer, ButtonCallback* callback); CreateButtonFunctor createButtonFunctor; using UnknownMethod4 = void(__thiscall*)(Vector<CBattleViewerTargetUnitData>* thisptr); UnknownMethod4 unknownMethod4; using FillTargetPositions = void(__stdcall*)(bool a1, UnitPositionMap* positions, UnitPositionList* value); FillTargetPositions fillTargetPositions; using AddTargetUnitData = void(__thiscall*)(CBattleViewerInterf* thisptr, int targetPosition, const CMidgardID* targetUnitId, bool isAttacker, /**< Meaning assumed. */ bool isTargetForSummonOrAttackTargetsBothGroups, bool isTargetForSummon, bool canPerformAttackOnTargetOrAllAttackReach); AddTargetUnitData addTargetUnitData; using SetCheckedForRightUnitsToggleButton = void(__stdcall*)(CBattleViewerInterf* thisptr, bool checked); SetCheckedForRightUnitsToggleButton setCheckedForRightUnitsToggleButton; using UnknownMethod6 = void(__thiscall*)(CBattleViewerInterf* thisptr, bool a2); UnknownMethod6 unknownMethod6; using UnknownMethod7 = void(__thiscall*)(CBattleViewerInterf* thisptr); UnknownMethod7 unknownMethod7; using UpdateCursor = bool(__thiscall*)(CBattleViewerInterf* thisptr, const CMqPoint* mousePosition); UpdateCursor updateCursor; using UnknownMethod9 = void(__thiscall*)(CBattleViewerInterf* thisptr); UnknownMethod9 unknownMethod9; using UnknownMethod10 = void(__thiscall*)(CBattleViewerInterf* thisptr, const CMidgardID* battleItemId, int battleItemIndex, const List<void*>* a4); UnknownMethod10 unknownMethod10; using UnknownMethod11 = void(__thiscall*)(CBattleViewerInterf* thisptr, const CMidgardID* id, const CMidgardID* targetGroupId, const UnitPositionMap* targetPositions, const CBattleViewerGroupAreas* groupAreas, bool a6, const List<void*>* a7); UnknownMethod11 unknownMethod11; using UnknownMethod12 = void(__thiscall*)(CBattleViewerInterf* thisptr); UnknownMethod12 unknownMethod12; }; Api& get(); const IBatViewerVftable* vftable(); } // namespace BattleViewerInterfApi } // namespace game #endif // BATTLEVIEWERINTERF_H
13,896
C++
.h
352
30.713068
99
0.683113
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,488
2denginemapimpl.h
VladimirMakeev_D2ModdingToolset/mss32/include/2denginemapimpl.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 C2DENGINEMAPIMPL_H #define C2DENGINEMAPIMPL_H #include "2denginemap.h" #include "d2map.h" #include "d2vector.h" #include "mqpoint.h" #include "smartptr.h" namespace game { struct C2DEngine; struct CUIManager; using ElementIndexHashMap = Map<int /* elementIndex */, int /* isoLayerPositionHash */, SmartPointer>; assert_size(ElementIndexHashMap, 36); struct EngineMapImageElementData { IMqImage2* image; CMqPoint position; CMqPoint imageSize; int elementIndex; }; assert_size(EngineMapImageElementData, 24); using ElementDataArray = Vector<EngineMapImageElementData, SmartPointer>; assert_size(ElementDataArray, 20); struct EngineMapImageElement { ElementDataArray dataElements; /** * Hash value computed as: * @code{.cpp}isoLayer + ((position->x + position->y + (isoLayer >> 9 << 8)) << 9);@endcode */ int isoLayerPositionHash; int unknown2; int unknown3; int unknown4; int unknown5; bool dirty; /**< Meaning assumed. */ char padding[3]; }; assert_size(EngineMapImageElement, 44); struct C2DEngineMapImplData { C2DEngine* engine2d; SmartPtr<CUIManager> uiManagerPtr; Pair<ElementIndexHashMap, int /* freeElementIndex */> elementHashMapFreeIndexPair; Vector<EngineMapImageElement, SmartPointer> imageElements; Pair<Vector<char[16]>, int> unknownData; bool dirty; /**< Meaning assumed. */ char padding[3]; char unknown[24]; }; assert_size(C2DEngineMapImplData, 120); struct C2DEngineMapImpl : public C2DEngineMap { C2DEngineMapImplData* data; }; assert_size(C2DEngineMapImpl, 8); } // namespace game #endif // C2DENGINEMAPIMPL_H
2,532
C++
.h
77
29.25974
95
0.736151
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,489
streamutils.h
VladimirMakeev_D2ModdingToolset/mss32/include/streamutils.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 STREAMUTILS_H #define STREAMUTILS_H namespace game { struct IMidgardStream; } // namespace game namespace hooks { void streamTurn(game::IMidgardStream* stream, const char* fieldName, int* fieldValue); } // namespace hooks #endif // STREAMUTILS_H
1,075
C++
.h
27
37.888889
86
0.770192
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,490
itemequipment.h
VladimirMakeev_D2ModdingToolset/mss32/include/itemequipment.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 ITEMEQUIPMENT_H #define ITEMEQUIPMENT_H #include "itembase.h" #include "itemexequipment.h" #include <cstddef> namespace game { /** Base class for all items that stack leader can equip. */ struct CItemEquipment : public IItemExEquipment , public CItemBase { CMidgardID modEquipId; CMidgardID attackId; }; assert_size(CItemEquipment, 24); assert_offset(CItemEquipment, CItemEquipment::IItemExEquipment::vftable, 0); assert_offset(CItemEquipment, CItemEquipment::CItemBase::vftable, 4); assert_offset(CItemEquipment, modEquipId, 16); } // namespace game #endif // ITEMEQUIPMENT_H
1,420
C++
.h
38
35.315789
76
0.774545
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,491
d2tree.h
VladimirMakeev_D2ModdingToolset/mss32/include/d2tree.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 D2TREE_H #define D2TREE_H #include "d2assert.h" #include <cstdint> namespace game { enum class TreeNodeColor : int { Red = 0, Black, }; /** Implementation of std::_Tree<T>::node used in game. */ template <typename T> struct TreeNode { TreeNodeColor color; /**< Red or Black, Black if head. */ TreeNode<T>* parent; /**< parent, or root of tree if head. */ TreeNode<T>* left; /**< left subtree, or smallest element if head. */ TreeNode<T>* right; /**< right subtree, or largest element if head. */ T value; }; assert_size(TreeNode<int>, 20); /** Implementation of std::_Tree<T>::const_iterator used in game. * Inline methods exactly correspond to in-game implementation. */ template <typename T> struct ConstTreeIterator { char unknown; char padding[3]; TreeNode<T>* node; TreeNode<T>* nil; bool operator==(const ConstTreeIterator<T>& value) const { return node == value.node && nil == value.nil; } bool operator!=(const ConstTreeIterator<T>& value) const { return !(*this == value); } const T& operator*() const { return node->value; } const T* operator->() const { return &node->value; } ConstTreeIterator<T>& operator++() { if (node->right == nil) { for (; node == node->parent->right; node = node->parent) ; if (node->right != node->parent) node = node->parent; } else { for (node = node->right; node->left != nil; node = node->left) ; } return *this; } ConstTreeIterator<T> operator++(int) { auto result = *this; ++*this; return result; } }; assert_size(ConstTreeIterator<int>, 12); /** Implementation of std::_Tree<T>::iterator used in game. * Inline methods exactly correspond to in-game implementation. */ template <typename T> struct TreeIterator : public ConstTreeIterator<T> { using Base = ConstTreeIterator<T>; T& operator*() const { return node->value; } T* operator->() const { return &node->value; } TreeIterator<T>& operator++() { Base::operator++(); return *this; } TreeIterator<T> operator++(int) { auto result = *this; Base::operator++(); return result; } }; assert_size(TreeIterator<int>, 12); /** Implementation of std::_Tree<T> (ordered red-black tree) used in game. * Inline methods exactly correspond to in-game implementation. */ template <typename T, typename Allocator> struct Tree { char unknown; char padding[3]; std::uint32_t length; /**< Number of nodes. */ char unknown2[4]; TreeNode<T>* head; /**< Special node that is not a part of the tree. */ Allocator allocator; TreeNode<T>* nil; /**< All NIL leaves point to this node. */ Allocator allocator2; TreeIterator<T> begin() { return {0, {}, head->left, nil}; } ConstTreeIterator<T> begin() const { return {0, {}, head->left, nil}; } TreeIterator<T> end() { return {0, {}, head, nil}; } ConstTreeIterator<T> end() const { return {0, {}, head, nil}; } }; using AssertTreeSize = Tree<int, void*>; assert_size(AssertTreeSize, 28); } // namespace game #endif // D2TREE_H
4,210
C++
.h
146
24.020548
75
0.635192
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,492
isoview.h
VladimirMakeev_D2ModdingToolset/mss32/include/isoview.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 ISOVIEW_H #define ISOVIEW_H #include "fullscreeninterf.h" namespace game { struct CDialogInterf; struct CPalMapInterf; struct CImage2Text; namespace editor { struct CIsoViewData { int unknown; CDialogInterf* dlgIsoView; CDialogInterf* dlgIso; CDialogInterf* dlgIsoPal; CDialogInterf* dialogInterf; CPalMapInterf* palMap; char unknown11[24]; CImage2Text* selectedTileInfo; int unknown2; int unknown3; int unknown4; int unknown5; int unknown6; int unknown7; int unknown8; int unknown9; int unknown10; bool showPalMap; char padding[3]; }; assert_size(CIsoViewData, 92); assert_offset(CIsoViewData, dialogInterf, 16); assert_offset(CIsoViewData, selectedTileInfo, 48); assert_offset(CIsoViewData, unknown3, 56); /** Represents DLG_ISO_VIEW from ScenEdit.dlg. */ struct CIsoView : public CFullScreenInterf { CIsoViewData* isoViewData; }; } // namespace editor } // namespace game #endif // ISOVIEW_H
1,805
C++
.h
60
27.3
72
0.759078
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,493
mqnetsystem.h
VladimirMakeev_D2ModdingToolset/mss32/include/mqnetsystem.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 MQNETSYSTEM_H #define MQNETSYSTEM_H #include "d2assert.h" namespace game { struct IMqNetSystemVftable; struct IMqNetSystem { IMqNetSystemVftable* vftable; }; struct IMqNetSystemVftable { using Destructor = void(__thiscall*)(IMqNetSystem* thisptr, char flags); Destructor destructor; using OnConnectionChanged = void(__thiscall*)(IMqNetSystem* thisptr, int netPlayerId); /** Called from IMqNetPlayer::ReceiveMessage to notify about player connection. */ OnConnectionChanged onPlayerConnected; /** Called from IMqNetPlayer::ReceiveMessage to notify about player lost connection. */ OnConnectionChanged onPlayerDisconnected; }; assert_vftable_size(IMqNetSystemVftable, 3); } // namespace game #endif // MQNETSYSTEM_H
1,577
C++
.h
40
36.925
91
0.775229
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,494
transformselfhooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/transformselfhooks.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 TRANSFORMSELFHOOKS_H #define TRANSFORMSELFHOOKS_H #include "targetset.h" namespace game { struct CBatAttackTransformSelf; struct IMidgardObjectMap; struct BattleMsgData; struct CMidgardID; struct BattleAttackInfo; } // namespace game namespace hooks { void __fastcall transformSelfAttackOnHitHooked(game::CBatAttackTransformSelf* thisptr, int /*%edx*/, game::IMidgardObjectMap* objectMap, game::BattleMsgData* battleMsgData, game::CMidgardID* targetUnitId, game::BattleAttackInfo** attackInfo); void __fastcall transformSelfAttackFillTargetsListHooked(game::CBatAttackTransformSelf* thisptr, int /*%edx*/, game::IMidgardObjectMap* objectMap, game::BattleMsgData* battleMsgData, game::TargetSet* targetsList); } // namespace hooks #endif // TRANSFORMSELFHOOKS_H
2,052
C++
.h
42
36.238095
96
0.615385
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,495
buildingtype.h
VladimirMakeev_D2ModdingToolset/mss32/include/buildingtype.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 BUILDINGTYPE_H #define BUILDINGTYPE_H #include "buildingcat.h" #include "currency.h" #include "midgardid.h" #include "midobject.h" #include "mqpoint.h" #include "textandid.h" #include "unitbranchcat.h" namespace game { struct GlobalData; struct CDBTable; struct TBuildingTypeData { int frame1; int frame2; CMqPoint pos; CMqPoint pos2; int posZ; TextAndId name; TextAndId description; char picture[9]; char padding[3]; CMidgardID requiredId; Bank cost; LBuildingCategory category; }; assert_size(TBuildingTypeData, 84); /** Holds building information read from Gbuild.dbf. */ struct TBuildingType : public game::IMidObject { TBuildingTypeData* data; }; assert_size(TBuildingType, 12); /** Holds unit upgrade building information read from Gbuild.dbf. */ struct TBuildingUnitUpgType : public TBuildingType { LUnitBranch branch; int level; }; assert_size(TBuildingUnitUpgType, 28); namespace TBuildingTypeApi { struct Api { using Constructor = TBuildingType*(__thiscall*)(TBuildingType* thisptr, const CDBTable* dbTable, const GlobalData** globalData); Constructor constructor; }; Api& get(); } // namespace TBuildingTypeApi namespace TBuildingUnitUpgTypeApi { const void* vftable(); } } // namespace game #endif // BUILDINGTYPE_H
2,239
C++
.h
74
26.445946
83
0.729264
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,496
currency.h
VladimirMakeev_D2ModdingToolset/mss32/include/currency.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 CURRENCY_H #define CURRENCY_H #include <cstdint> namespace game { enum class CurrencyType : int { Gold = 0, InfernalMana, /**< Mainly used by Legions of the Damned. */ LifeMana, /**< Mainly used by Empire. */ DeathMana, /**< Mainly used by Undead Hordes. */ RunicMana, /**< Mainly used by Mountain Clans. */ GroveMana /**< Mainly used by Elven Alliance. */ }; /** Represents prices as well as player resources. */ struct Bank { std::int16_t infernalMana; std::int16_t lifeMana; std::int16_t deathMana; std::int16_t runicMana; std::int16_t groveMana; std::int16_t gold; }; static inline bool operator==(const Bank& a, const Bank& b) noexcept { // clang-format off return a.gold == b.gold && a.infernalMana == b.infernalMana && a.lifeMana == b.lifeMana && a.deathMana == b.deathMana && a.runicMana == b.runicMana && a.groveMana == b.groveMana; // clang-format on } static inline bool operator!=(const Bank& a, const Bank& b) noexcept { return !(a == b); } /** Same as calling BankApi::get().less(a, b). */ static inline bool operator<(const Bank& a, const Bank& b) noexcept { // clang-format off return a.infernalMana < b.infernalMana || a.lifeMana < b.lifeMana || a.deathMana < b.deathMana || a.runicMana < b.runicMana || a.gold < b.gold || a.groveMana < b.groveMana; // clang-format on } static inline bool operator<=(const Bank& a, const Bank& b) noexcept { return (a < b) || (a == b); } static inline bool operator>(const Bank& a, const Bank& b) noexcept { // clang-format off return a.infernalMana > b.infernalMana && a.lifeMana > b.lifeMana && a.deathMana > b.deathMana && a.runicMana > b.runicMana && a.gold > b.gold && a.groveMana > b.groveMana; // clang-format on } static inline bool operator>=(const Bank& a, const Bank& b) noexcept { // clang-format off return a.infernalMana >= b.infernalMana && a.lifeMana >= b.lifeMana && a.deathMana >= b.deathMana && a.runicMana >= b.runicMana && a.gold >= b.gold && a.groveMana >= b.groveMana; // clang-format on } namespace BankApi { struct Api { /** * Performs pairwise addition of currencies of two banks. * Underflows and overflows of each currency are clamped in range [0 : 9999]. */ using Add = Bank*(__thiscall*)(Bank* bank, const Bank* other); Add add; /** * Performs pairwise subtraction of currencies, subtracting other from bank. * Underflows and overflows of each currency are clamped in range [0 : 9999]. */ using Subtract = Bank*(__thiscall*)(Bank* bank, const Bank* other); Subtract subtract; /** * Multiplies each resource in the bank by specified value. * Results are clamped in range [0 : 9999]. */ using Multiply = Bank*(__thiscall*)(Bank* bank, std::int16_t value); Multiply multiply; /** * Divides each resource in the bank by specified value. * Results are clamped in range [0 : 9999]. */ using Divide = Bank*(__thiscall*)(Bank* bank, std::int16_t value); Divide divide; /** * Returns true if bank is less than other in any currency. * Comparison sequence: infernal, life, death, runic, gold and the grove is the last one. */ using Less = bool(__thiscall*)(const Bank* bank, const Bank* other); Less less; /** Copies currencies of other into this if they are not equal. */ using Copy = Bank*(__thiscall*)(Bank* bank, const Bank* other); Copy copy; /** Sets all currencies to invalid value of 10000. */ using SetInvalid = Bank*(__thiscall*)(Bank* bank); SetInvalid setInvalid; /** Sets all currencies to 0. */ using SetZero = void(__thiscall*)(Bank* bank); SetZero setZero; /** * Sets bank currency to specified value. * Value are clamped in range [0 : 9999]. Nothing changes in case of incorrect currencyValue. * @returns value that was set. */ using SetCurrency = std::int16_t(__thiscall*)(Bank* bank, CurrencyType currencyType, std::int16_t value); SetCurrency set; /** Returns true if all currencies in bank are zero. */ using IsZero = bool(__thiscall*)(const Bank* bank); IsZero isZero; /** Returns true if all currency types are in [0 : 9999] range. */ using IsValid = bool(__thiscall*)(const Bank* bank); IsValid isValid; /** * Converts bank currency values to string. * Same as @code{.cpp} * sprintf(string, "G%04d:R%04d:Y%04d:E%04d:W%04d:B%04d", * gold, infernal, life, death, runic, grove); * @endcode */ using ToString = char*(__thiscall*)(const Bank* bank, char* string); ToString toString; /** Initializes bank structure from string. */ using FromString = Bank*(__stdcall*)(Bank* bank, const char* string); FromString fromString; }; Api& get(); } // namespace BankApi } // namespace game #endif // CURRENCY_H
6,008
C++
.h
168
30.64881
97
0.646016
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,497
stringandid.h
VladimirMakeev_D2ModdingToolset/mss32/include/stringandid.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 STRINGANDID_H #define STRINGANDID_H #include <cstdint> namespace game { struct StringAndId { int id; std::uint32_t length; char* string; }; namespace StringAndIdApi { struct Api { using SetString = StringAndId*(__thiscall*)(StringAndId* thisptr, const char* src); SetString setString; }; Api& get(); } // namespace StringAndIdApi } // namespace game #endif // STRINGANDID_H
1,224
C++
.h
38
29.973684
87
0.754252
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,498
itembattle.h
VladimirMakeev_D2ModdingToolset/mss32/include/itembattle.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 ITEMBATTLE_H #define ITEMBATTLE_H #include "itembase.h" #include "itemexequipment.h" #include <cstddef> namespace game { /** Base class for all non-potion type items that stack leader can use in battle. */ struct CItemBattle : public IItemExEquipment , public CItemBase { CMidgardID attackId; CMidgardID modEquipId; }; assert_size(CItemBattle, 24); assert_offset(CItemBattle, CItemBattle::IItemExEquipment::vftable, 0); assert_offset(CItemBattle, CItemBattle::CItemBase::vftable, 4); assert_offset(CItemBattle, attackId, 16); } // namespace game #endif // ITEMBATTLE_H
1,412
C++
.h
38
35.105263
84
0.769568
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,499
imagepointlist.h
VladimirMakeev_D2ModdingToolset/mss32/include/imagepointlist.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 IMAGEPOINTLIST_H #define IMAGEPOINTLIST_H #include "d2color.h" #include "d2list.h" #include "d2pair.h" #include "mqrect.h" #include "smartptr.h" namespace game { struct IMqImage2; using ImagePtr = SmartPtr<IMqImage2>; using ImagePtrPointPair = Pair<ImagePtr, CMqPoint>; using ImagePointList = List<ImagePtrPointPair>; namespace ImagePointListApi { struct Api { using Add = void(__thiscall*)(ImagePointList* thisptr, ImagePtrPointPair* pair); Add add; using AddText = bool(__stdcall*)(ImagePointList* list, const CMqRect* area, const char* text, const CMqRect* textArea, bool outline, Color color); AddText addText; using AddImageWithText = bool(__stdcall*)(ImagePointList* list, const CMqRect* area, const ImagePtr* image, const CMqPoint* imagePos, const char* text, const CMqRect* textArea, bool outline, Color color); AddImageWithText addImageWithText; }; Api& get(); } // namespace ImagePointListApi } // namespace game #endif // IMAGEPOINTLIST_H
2,314
C++
.h
56
30.303571
84
0.598218
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,500
streamholder.h
VladimirMakeev_D2ModdingToolset/mss32/include/streamholder.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 STREAMHOLDER_H #define STREAMHOLDER_H #include "uievent.h" namespace game { struct CSoundSystemStream; struct CSoundSystemImpl; struct CStreamHolderData { SmartPtr<CSoundSystemStream> soundSystemStream; SmartPtr<CSoundSystemImpl> soundSystemImpl; unsigned int holderFadeMsgId; UiEvent holderFadeEvent; UiEvent updateEvent; int nextTime; int maybeDuration; char* filePath; char* filePath2; int currentStreamPlaybackPos; void* streamHandle; /**< Actual type is HSTREAM from Miles Sound system. */ bool unknown6; char padding[3]; }; assert_size(CStreamHolderData, 96); struct CStreamHolder { CStreamHolderData* data; }; assert_size(CStreamHolder, 4); } // namespace game #endif // STREAMHOLDER_H
1,579
C++
.h
48
30.166667
79
0.768573
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,501
commandmsghooks.h
VladimirMakeev_D2ModdingToolset/mss32/include/commandmsghooks.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 COMMANDMSGHOOKS_H #define COMMANDMSGHOOKS_H namespace game { struct CMqStream; struct CCommandMsg; struct CCmdBattleStartMsg; struct CCmdBattleChooseActionMsg; struct CCmdBattleResultMsg; struct CCmdBattleEndMsg; } // namespace game namespace hooks { void __fastcall cmdBattleStartMsgSerializeHooked(game::CCmdBattleStartMsg* thisptr, int /*%edx*/, game::CMqStream* stream); void __fastcall cmdBattleChooseActionMsgSerializeHooked(game::CCmdBattleChooseActionMsg* thisptr, int /*%edx*/, game::CMqStream* stream); void __fastcall cmdBattleResultMsgSerializeHooked(game::CCmdBattleResultMsg* thisptr, int /*%edx*/, game::CMqStream* stream); void __fastcall cmdBattleEndMsgSerializeHooked(game::CCmdBattleEndMsg* thisptr, int /*%edx*/, game::CMqStream* stream); void __fastcall commandMsgDtorHooked(game::CCommandMsg* thisptr, int /*%edx*/); } // namespace hooks #endif // COMMANDMSGHOOKS_H
2,123
C++
.h
44
37.454545
97
0.638956
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,502
batattacktransformother.h
VladimirMakeev_D2ModdingToolset/mss32/include/batattacktransformother.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 BATATTACKTRANSFORMOTHER_H #define BATATTACKTRANSFORMOTHER_H #include "batattack.h" #include "idlist.h" namespace game { struct IAttack; struct CBatAttackTransformOther : public CBatAttackBase { CMidgardID unitId; CMidgardID unitOrItemId; int attackNumber; IAttack* attack; IdList smallUnits; IdList bigUnits; }; assert_size(CBatAttackTransformOther, 52); namespace CBatAttackTransformOtherApi { IBatAttackVftable* vftable(); } // namespace CBatAttackTransformOtherApi } // namespace game #endif // BATATTACKTRANSFORMOTHER_H
1,380
C++
.h
39
33.051282
72
0.783459
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,503
cmdbattleresultmsg.h
VladimirMakeev_D2ModdingToolset/mss32/include/cmdbattleresultmsg.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 CMDBATTLERESULTMSG_H #define CMDBATTLERESULTMSG_H #include "attackclasscat.h" #include "battleattackinfo.h" #include "battlemsgdata.h" #include "commandmsg.h" namespace game { struct CCmdBattleResultMsg : public CCommandMsgTempl<CommandMsgId::BattleResult, CommandMsgParam::Value0> { BattleMsgData battleMsgData; BattleAttackInfo battleAttackInfo; LAttackClass attackClass; }; assert_size(CCmdBattleResultMsg, 3984); assert_offset(CCmdBattleResultMsg, battleMsgData, 16); namespace CCmdBattleResultMsgApi { struct Api { using Destructor = void(__thiscall*)(CCmdBattleResultMsg* thisptr); Destructor destructor; }; Api& get(); CCommandMsgVftable* vftable(); } // namespace CCmdBattleResultMsgApi } // namespace game #endif // CMDBATTLERESULTMSG_H
1,603
C++
.h
45
33.444444
82
0.787193
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,504
autodialog.h
VladimirMakeev_D2ModdingToolset/mss32/include/autodialog.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 AUTODIALOG_H #define AUTODIALOG_H #include "d2assert.h" #include "d2set.h" #include "d2string.h" #include "smartptr.h" #include "stringarray.h" namespace game { struct IMqImage2; struct CMidAutoDlgImages; struct CMidAutoDlgLog; struct CMidAutoDlgTextLoader; /** * Stores AutoDialog script (.dlg) information. */ struct DialogScriptData { bool initialized; char padding[3]; int unknown; StringArray lines; /**< Script file text lines. */ String scriptPath; /**< Full path to script (.dlg) file. */ }; struct CAutoDialogData { SmartPtr<CMidAutoDlgImages> images; SmartPtr<CMidAutoDlgLog> log; SmartPtr<CMidAutoDlgTextLoader> textLoader; SmartPointer memPool; Set<char[52]> dialogSet; }; assert_size(CAutoDialogData, 60); /** Holds necessary data to create CInterface objects from .dlg files. */ struct CAutoDialog { CAutoDialogData* data; }; assert_size(CAutoDialog, 4); namespace AutoDialogApi { struct Api { /** * Loads AutoDialog script file and populates AutoDialogData with its contents. * @param[in] thisptr pointer to AutoDialogData where to store the data. * @param[in] filePath full path to script file. * @param unknown * @returns thisptr. */ using LoadScriptFile = DialogScriptData*(__thiscall*)(DialogScriptData* thisptr, const char* filePath, int /*unknown*/); LoadScriptFile loadScriptFile; using LoadImage = IMqImage2*(__stdcall*)(const char* imageName); LoadImage loadImage; }; /** Returns AutoDialog functions according to determined version of the game. */ Api& get(); } // namespace AutoDialogApi } // namespace game #endif // AUTODIALOG_H
2,605
C++
.h
78
29.25641
84
0.716448
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,505
ailogic.h
VladimirMakeev_D2ModdingToolset/mss32/include/ailogic.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 AILOGIC_H #define AILOGIC_H #include "idlist.h" #include "midgardid.h" #include "smartptr.h" namespace game { struct CMidgardScenarioMap; struct CMidServerLogicData; struct CAiBlockingStacks; struct CAiLog; struct IAiState; struct AiLogicUnknown { CMidgardScenarioMap* objectMap; CMidServerLogicData* serverLogic; CMidgardID playerId; }; assert_size(AiLogicUnknown, 12); using AiStatePtr = SmartPtr<IAiState>; using AiStateList = List<AiStatePtr>; using AiStateListNode = ListNode<AiStatePtr>; struct AiLogicUnknown2 { CMidgardScenarioMap* objectMap; AiStateList aiStateList; bool unknown; char padding[3]; AiStateListNode* aiStateListNodePtr; int unknown3; CAiBlockingStacks* aiBlockingStacks; IdList list2; IdList list3; int unknown5; bool unknown6; char padding2[3]; CMidgardID playerId; CMidServerLogicData* serverLogic; AiLogicUnknown* aiLogicUnknown; CAiLog* aiLog; }; assert_size(AiLogicUnknown2, 92); struct AiLogicUnknown4 { CMidgardScenarioMap* objectMap; CMidServerLogicData* serverLogic; CMidgardID playerId; AiLogicUnknown2* logicUnknown2; AiLogicUnknown* logicUnknown; IdList* playerIdList; }; assert_size(AiLogicUnknown4, 24); struct AiLogicUnknown3 { CMidgardID playerId; AiLogic* aiLogic; AiLogicUnknown2* logicUnknown2; AiLogicUnknown4* logicUnknown4; }; assert_size(AiLogicUnknown3, 16); struct AiLogic { CMidgardScenarioMap* objectMap; CMidgardID playerId; CMidServerLogicData* serverLogic; int unknown; AiLogicUnknown3* logicUnknown3; AiLogicUnknown2* logicUnknown2; AiLogicUnknown* logicUnknown; }; assert_size(AiLogic, 28); } // namespace game #endif // AILOGIC_H
2,568
C++
.h
90
25.555556
72
0.777326
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,506
catalogvalidate.h
VladimirMakeev_D2ModdingToolset/mss32/include/catalogvalidate.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 CATALOGVALIDATE_H #define CATALOGVALIDATE_H namespace game { struct ICatalogValidate { void* vftable; }; } // namespace game #endif // CATALOGVALIDATE_H
982
C++
.h
27
34.407407
72
0.766316
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,507
refreshinfo.h
VladimirMakeev_D2ModdingToolset/mss32/include/refreshinfo.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 REFRESHINFO_H #define REFRESHINFO_H #include "d2assert.h" #include "netmsg.h" namespace game { struct CMidgardID; struct CMidgardScenarioMap; struct CRefreshInfo : CNetMsg { CMidgardScenarioMap* scenarioMap; bool isExpansionContent; }; assert_size(CRefreshInfo, 12); namespace CRefreshInfoApi { struct Api { using Constructor = CRefreshInfo*(__thiscall*)(CRefreshInfo* thisptr); Constructor constructor; using Constructor2 = CRefreshInfo*(__thiscall*)(CRefreshInfo* thisptr, CMidgardID* scenarioFileId, bool isExpansionContent); Constructor2 constructor2; using Destructor = void(__thiscall*)(CRefreshInfo* thisptr); Destructor destructor; using AddObject = bool(__thiscall*)(CRefreshInfo* thisptr, const CMidgardScenarioMap* scenarioMap, const CMidgardID* objectId); AddObject addObject; }; Api& get(); CNetMsgVftable* vftable(); } // namespace CRefreshInfoApi } // namespace game #endif // REFRESHINFO_H
1,967
C++
.h
52
31.884615
79
0.700369
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,508
resetstackext.h
VladimirMakeev_D2ModdingToolset/mss32/include/resetstackext.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 RESETSTACKEXT_H #define RESETSTACKEXT_H namespace game { struct IResetStackExtVftable; struct IResetStackExt { IResetStackExtVftable* vftable; }; struct IResetStackExtVftable { using Destructor = void(__thiscall*)(IResetStackExt* thisptr, bool freeMemory); Destructor destructor; void* methods[4]; using GetStackId = CMidgardID*(__thiscall*)(IResetStackExt* thisptr, CMidgardID* value); GetStackId getStackId; }; assert_vftable_size(IResetStackExtVftable, 6); } // namespace game #endif // RESETSTACKEXT_H
1,360
C++
.h
37
34.378378
92
0.771516
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,509
capitaldatlist.h
VladimirMakeev_D2ModdingToolset/mss32/include/capitaldatlist.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 CAPITALDATLIST_H #define CAPITALDATLIST_H #include "d2list.h" #include "midgardid.h" namespace game { struct CapitalDatRecord { CMidgardID buildingId; CMidgardID unknownId; List<void*> list; }; assert_size(CapitalDatRecord, 24); using CapitalDatList = List<CapitalDatRecord**>; namespace CapitalDatListApi { struct Api { using Constructor = CapitalDatList*(__thiscall*)(CapitalDatList* thisptr); Constructor constructor; }; Api& get(); } // namespace CapitalDatListApi } // namespace game #endif // CAPITALDATLIST_H
1,368
C++
.h
41
31.170732
78
0.768821
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,510
custommodifier.h
VladimirMakeev_D2ModdingToolset/mss32/include/custommodifier.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 CUSTOMMODIFIER_H #define CUSTOMMODIFIER_H #include "attack.h" #include "currency.h" #include "idvector.h" #include "scripts.h" #include "umunit.h" #include "unitview.h" #include "usstackleader.h" #include <map> #include <mutex> namespace game { struct CMidUnit; struct TUnitModifier; } // namespace game namespace hooks { struct CustomAttackData; struct CAttackModifiedCustom : public game::IAttack { const game::IAttack* prev; }; struct CustomModifierData { game::ModifierElementTypeFlag lastElementQuery; game::Bank enrollCost; game::Bank reviveCost; game::Bank healCost; game::Bank trainingCost; game::IdVector wards; int regen; }; using CustomModifierDataMap = std::map<std::thread::id, CustomModifierData>; struct CCustomModifier { game::IUsUnit usUnit; game::IUsSoldier usSoldier; game::CUmModifier umModifier; game::IUsStackLeader usStackLeader; CAttackModifiedCustom attack; CAttackModifiedCustom attack2; CAttackModifiedCustom altAttack; const game::CMidUnit* unit; const game::TUnitModifier* unitModifier; const std::string scriptFileName; const game::CMidgardID descTxt; const bool display; // Thread-sensitive data CustomModifierDataMap data; std::mutex dataMutex; CustomModifierData& getData(); void setUnit(const game::CMidUnit* value); game::IAttack* getAttack(bool primary); game::IAttack* wrapAltAttack(const game::IAttack* value); bool getDisplay() const; game::CMidgardID getDescTxt() const; std::string getIconName() const; const game::IUsUnit* getPrev() const; const game::IUsSoldier* getPrevSoldier() const; const game::IUsStackLeader* getPrevStackLeader() const; const game::IAttack* getPrevAttack(const game::IAttack* thisptr) const; const CCustomModifier* getPrevCustomModifier() const; CustomAttackData getCustomAttackData(const game::IAttack* thisptr) const; const char* getFormattedGlobalText(const game::CMidgardID& formatId, const game::CMidgardID& baseId) const; void showScriptErrorMessage(const char* functionName, const char* reason) const; void showInvalidRetvalMessage(const char* functionName, const char* reason) const; void notifyModifiersChanged() const; game::CMidgardID getUnitNameTxt() const; game::CMidgardID getUnitBaseNameTxt() const; game::CMidgardID getUnitDescTxt() const; game::CMidgardID getUnitBaseDescTxt() const; game::CMidgardID getAttackNameTxt(bool primary, const game::CMidgardID& baseId) const; game::CMidgardID getAttackBaseNameTxt(const game::IAttack* attack) const; game::CMidgardID getAttackDescTxt(bool primary, const game::CMidgardID& baseId) const; game::CMidgardID getAttackBaseDescTxt(const game::IAttack* attack) const; template <typename F, typename T> T getValue(F function, const char* functionName, const T& prev) const { try { if (function) { bindings::UnitView unitView{unit, getPrev()}; return (*function)(unitView, prev); } } catch (const std::exception& e) { showScriptErrorMessage(functionName, e.what()); } return prev; } template <typename F, typename T> T getValueAs(F function, const char* functionName, const T& prev) const { try { if (function) { bindings::UnitView unitView{unit, getPrev()}; sol::table result = (*function)(unitView, prev); return result.as<T>(); } } catch (const std::exception& e) { showScriptErrorMessage(functionName, e.what()); } return prev; } template <typename F, typename T, typename P> T getValueParam(F function, const char* functionName, const P& param, const T& prev) const { try { if (function) { bindings::UnitView unitView{unit, getPrev()}; return (*function)(unitView, param, prev); } } catch (const std::exception& e) { showScriptErrorMessage(functionName, e.what()); } return prev; } template <typename F, typename T> T getValueNoParam(F function, const char* functionName, T def) const { try { if (function) { return (*function)(); } } catch (const std::exception& e) { showScriptErrorMessage(functionName, e.what()); } return def; } }; static_assert( offsetof(CCustomModifier, usUnit) == offsetof(game::CUmUnit, usUnit), "CustomModifier::usUnit offset should be the same as of CUmUnit as it reuses its rtti info"); static_assert( offsetof(CCustomModifier, usSoldier) == offsetof(game::CUmUnit, usSoldier), "CustomModifier::usSoldier offset should be the same as of CUmUnit as it reuses its rtti info"); static_assert( offsetof(CCustomModifier, umModifier) == offsetof(game::CUmUnit, umModifier), "CustomModifier::umModifier offset should be the same as of CUmUnit as it reuses its rtti info"); CCustomModifier* castModifierToCustomModifier(const game::CUmModifier* modifier); CCustomModifier* castAttackToCustomModifier(const game::IAttack* attack); game::CUmModifier* createCustomModifier(const game::TUnitModifier* unitModifier, const char* scriptFileName, const game::CMidgardID* descTxt, bool display, const game::GlobalData** globalData); } // namespace hooks #endif // CUSTOMMODIFIER_H
6,548
C++
.h
164
33.268293
101
0.688445
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,511
nativegameinfo.h
VladimirMakeev_D2ModdingToolset/mss32/include/nativegameinfo.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 NATIVEGAMEINFO_H #define NATIVEGAMEINFO_H #include "gameinfo.h" namespace hooks { class NativeGameInfo final : public rsg::GameInfo { public: NativeGameInfo(const std::filesystem::path& gameFolderPath); ~NativeGameInfo() override = default; const rsg::UnitsInfo& getUnits() const override; const rsg::UnitInfoArray& getLeaders() const override; const rsg::UnitInfoArray& getSoldiers() const override; int getMinLeaderValue() const override; int getMaxLeaderValue() const override; int getMinSoldierValue() const override; int getMaxSoldierValue() const override; const rsg::ItemsInfo& getItemsInfo() const override; const rsg::ItemInfoArray& getItems() const override; const rsg::ItemInfoArray& getItems(rsg::ItemType itemType) const override; const rsg::SpellsInfo& getSpellsInfo() const override; const rsg::SpellInfoArray& getSpells() const override; const rsg::SpellInfoArray& getSpells(rsg::SpellType spellType) const override; const rsg::LandmarksInfo& getLandmarksInfo() const override; const rsg::LandmarkInfoArray& getLandmarks(rsg::LandmarkType landmarkType) const override; const rsg::LandmarkInfoArray& getLandmarks(rsg::RaceType raceType) const override; const rsg::LandmarkInfoArray& getMountainLandmarks() const override; const rsg::RacesInfo& getRacesInfo() const override; const rsg::RaceInfo& getRaceInfo(rsg::RaceType raceType) const override; const char* getGlobalText(const rsg::CMidgardID& textId) const override; const char* getEditorInterfaceText(const rsg::CMidgardID& textId) const override; const rsg::CityNames& getCityNames() const override; const rsg::SiteTexts& getMercenaryTexts() const override; const rsg::SiteTexts& getMageTexts() const override; const rsg::SiteTexts& getMerchantTexts() const override; const rsg::SiteTexts& getRuinTexts() const override; const rsg::SiteTexts& getTrainerTexts() const override; private: bool readGameInfo(const std::filesystem::path& gameFolderPath); bool readUnitsInfo(); bool readItemsInfo(); bool readSpellsInfo(); bool readLandmarksInfo(); bool readRacesInfo(); bool readEditorInterfaceTexts(const std::filesystem::path& interfFolderPath); bool readCityNames(const std::filesystem::path& scenDataFolderPath); bool readSiteTexts(const std::filesystem::path& scenDataFolderPath); rsg::UnitsInfo unitsInfo{}; rsg::UnitInfoArray leaders{}; rsg::UnitInfoArray soldiers{}; int minLeaderValue{}; int maxLeaderValue{}; int minSoldierValue{}; int maxSoldierValue{}; rsg::ItemsInfo itemsInfo; rsg::ItemInfoArray allItems; std::map<rsg::ItemType, rsg::ItemInfoArray> itemsByType; rsg::SpellsInfo spellsInfo; rsg::SpellInfoArray allSpells; std::map<rsg::SpellType, rsg::SpellInfoArray> spellsByType; rsg::LandmarksInfo landmarksInfo; std::map<rsg::LandmarkType, rsg::LandmarkInfoArray> landmarksByType; std::map<rsg::RaceType, rsg::LandmarkInfoArray> landmarksByRace; rsg::LandmarkInfoArray mountainLandmarks; rsg::RacesInfo racesInfo; rsg::TextsInfo editorInterfaceTexts; rsg::CityNames cityNames; rsg::SiteTexts mercenaryTexts; rsg::SiteTexts mageTexts; rsg::SiteTexts merchantTexts; rsg::SiteTexts ruinTexts; rsg::SiteTexts trainerTexts; }; } // namespace hooks #endif // NATIVEGAMEINFO_H
4,256
C++
.h
92
42.01087
94
0.763909
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,512
aistack.h
VladimirMakeev_D2ModdingToolset/mss32/include/aistack.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 AISTACK_H #define AISTACK_H #include "d2assert.h" #include "idlist.h" namespace game { struct CMqPoint; struct CMidPlayer; struct CMidSubRace; struct CMidStack; struct CAiAttitudes; struct IAiStackVftable; struct IAiStack { IAiStackVftable* vftable; }; struct IAiStackVftable { using Destructor = void(__thiscall*)(IAiStack* thisptr, char flags); Destructor destructor; using GetId = const CMidgardID*(__thiscall*)(const IAiStack* thisptr); GetId getId; using GetStack = const CMidStack*(__thiscall*)(const IAiStack* thisptr); GetStack getStack; using GetPosition = const CMqPoint*(__thiscall*)(const IAiStack* thisptr, CMqPoint* value); GetPosition getPosition; using GetBool = bool(__thiscall*)(const IAiStack* thisptr); GetBool isInside; GetBool isWaterOnly; GetBool isOwnerCaptured; GetBool hasDeadOrLowHpUnits; GetBool inCityUnderRiot; GetBool getUnknown; using SetBool = void(__thiscall*)(IAiStack* thisptr, bool value); SetBool setUnknown; using IsAdjacentTo = bool(__thiscall*)(const IAiStack* thisptr, const CMqPoint* position); IsAdjacentTo isAdjacentTo; /** Simply calls getDistance2 and converts result to double. */ using GetDistance = double(__thiscall*)(const IAiStack* thisptr, const game::CMqPoint* position); GetDistance getDistance; using GetDistance2 = int(__thiscall*)(const IAiStack* thisptr, const game::CMqPoint* position); GetDistance2 getDistance2; using GetOwner = const CMidPlayer*(__thiscall*)(const IAiStack* thisptr); GetOwner getOwner; using GetSubRace = const CMidSubRace*(__thiscall*)(const IAiStack* thisptr); GetSubRace getSubRace; using GetAttitudes = CAiAttitudes*(__thiscall*)(const IAiStack* thisptr); GetAttitudes getAttitudes; void* methods[2]; /** Involves internal IAiActionFilter. */ using UnknownMethod = void(__thiscall*)(const IAiStack* thisptr, IdList* list, int a3); UnknownMethod method19; UnknownMethod method20; }; assert_vftable_size(IAiStackVftable, 21); } // namespace game #endif // AISTACK_H
2,981
C++
.h
75
35.72
99
0.741331
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,513
midvillage.h
VladimirMakeev_D2ModdingToolset/mss32/include/midvillage.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 MIDVILLAGE_H #define MIDVILLAGE_H #include "fortification.h" #include "mq_c_s.h" #include "racecategory.h" namespace game { /** Holds city related data in scenario file and game. */ struct CMidVillage : public CFortification { int tierLevel; int growthTurn; int riotTurn; int regeneration; CMidgardID protectionId; mq_c_s<LRaceCategory> raceData; }; assert_size(CMidVillage, 184); assert_offset(CMidVillage, tierLevel, 144); assert_offset(CMidVillage, raceData.data, 168); } // namespace game #endif // MIDVILLAGE_H
1,367
C++
.h
39
32.820513
72
0.761544
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,514
nativeunitinfo.h
VladimirMakeev_D2ModdingToolset/mss32/include/nativeunitinfo.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 NATIVEUNITINFO_H #define NATIVEUNITINFO_H #include "rsgid.h" #include "unitinfo.h" namespace hooks { class NativeUnitInfo final : public rsg::UnitInfo { public: NativeUnitInfo(const rsg::CMidgardID& unitId, const rsg::CMidgardID& raceId, const rsg::CMidgardID& nameId, int level, int value, rsg::UnitType type, rsg::SubRaceType subrace, rsg::ReachType reach, rsg::AttackType attackType, int hp, int move, int leadership, bool bigUnit, bool male) : unitId{unitId} , raceId{raceId} , nameId{nameId} , level{level} , value{value} , unitType{type} , subrace{subrace} , reach{reach} , attackType{attackType} , hitPoints{hp} , move{move} , leadership{leadership} , bigUnit{bigUnit} , male{male} { } ~NativeUnitInfo() override = default; const rsg::CMidgardID& getUnitId() const override { return unitId; } const rsg::CMidgardID& getRaceId() const override { return raceId; } const rsg::CMidgardID& getNameId() const override { return nameId; } int getLevel() const override { return level; } int getValue() const override { return value; } rsg::UnitType getUnitType() const override { return unitType; } rsg::SubRaceType getSubrace() const override { return subrace; } rsg::ReachType getAttackReach() const override { return reach; } rsg::AttackType getAttackType() const override { return attackType; } int getHp() const override { return hitPoints; } int getMove() const override { return move; } int getLeadership() const override { return leadership; } bool isBig() const override { return bigUnit; } bool isMale() const override { return male; } private: rsg::CMidgardID unitId; rsg::CMidgardID raceId; rsg::CMidgardID nameId; int level{}; int value{}; rsg::UnitType unitType{rsg::UnitType::Soldier}; rsg::SubRaceType subrace{rsg::SubRaceType::Neutral}; rsg::ReachType reach{rsg::ReachType::Adjacent}; rsg::AttackType attackType{rsg::AttackType ::Damage}; int hitPoints{}; int move{}; int leadership{}; bool bigUnit{}; bool male{}; }; } // namespace hooks #endif // NATIVEUNITINFO_H
3,531
C++
.h
130
20.423077
72
0.620006
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,515
imgpacker.h
VladimirMakeev_D2ModdingToolset/mss32/include/imgpacker.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 IMGPACKER_H #define IMGPACKER_H #include "d2string.h" #include "d2vector.h" namespace game { struct CImgPacker { struct PackerLoaderVftable; struct PackerLoader { PackerLoaderVftable* vftable; }; }; struct CImgPacker::PackerLoaderVftable { using Destructor = void(__thiscall*)(CImgPacker::PackerLoader* thisptr, char flags); Destructor destructor; using Method1 = Vector<String>*(__thiscall*)(CImgPacker::PackerLoader* thisptr); Method1 method1; }; assert_vftable_size(CImgPacker::PackerLoaderVftable, 2); struct CImgPackerLoaderWeakDup : public CImgPacker::PackerLoader { CImgPacker::PackerLoader* packerLoader; }; assert_size(CImgPackerLoaderWeakDup, 8); } // namespace game #endif // IMGPACKER_H
1,575
C++
.h
46
31.652174
88
0.765326
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,516
aireaction.h
VladimirMakeev_D2ModdingToolset/mss32/include/aireaction.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 AIREACTION_H #define AIREACTION_H #include "d2assert.h" namespace game { struct IAiReactionVftable; struct IAiReaction { IAiReactionVftable* vftable; }; struct IAiReactionVftable { using Destructor = void(__thiscall*)(IAiReaction* thisptr, char flags); Destructor destructor; void* methods[26]; }; assert_vftable_size(IAiReactionVftable, 27); } // namespace game #endif // AIREACTION_H
1,232
C++
.h
36
32.027778
75
0.767285
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,517
citystackinterf.h
VladimirMakeev_D2ModdingToolset/mss32/include/citystackinterf.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 CITYSTACKINTERF_H #define CITYSTACKINTERF_H #include "midcommandqueue2.h" #include "middatacache.h" #include "middragdropinterf.h" #include "resetstackext.h" #include "smartptr.h" #include <cstddef> namespace game { struct CDDReinfGroup; struct CDDFortInventoryDisplay; struct CDismissUnit; struct CDynLevelUnit; struct CHealUnit; struct CReviveUnit; struct CCityStackInterfData { int unknown; int unknown2; int unknown3; CMidgardID unknownId; int unknown4; CDDReinfGroup* reinfGroup; CMidgardID unknownId2; CDDFortInventoryDisplay* fortInventoryDisplay; char unknown5[24]; CDismissUnit* dismissUnit; CDynLevelUnit* dynLevelUnit; CHealUnit* healUnit; CReviveUnit* reviveUnit; char unknown6[20]; CMidgardID fortificationId; char unknown7[40]; }; assert_size(CCityStackInterfData, 136); assert_offset(CCityStackInterfData, reinfGroup, 20); assert_offset(CCityStackInterfData, fortInventoryDisplay, 28); assert_offset(CCityStackInterfData, dismissUnit, 56); assert_offset(CCityStackInterfData, fortificationId, 92); /** * Shows stack, garrison and unit hire window of cities and capitals. * Represents DLG_CITY_STACK from Interf.dlg. */ struct CCityStackInterf : public CMidDataCache2::INotify { CMidCommandQueue2::INotifyCQ commandQueueNotify; IResetStackExt* resetStackExt; CMidDragDropInterf dragDropInterf; CCityStackInterfData* data; }; assert_size(CCityStackInterf, 44); assert_offset(CCityStackInterf, dragDropInterf, 12); namespace CCityStackInterfApi { struct Api { using Constructor = CCityStackInterf*(__thiscall*)(CCityStackInterf* thisptr, void* taskOpenInterf, CPhaseGame* phaseGame, CMidgardID* cityId); Constructor constructor; struct ButtonCallback { using Callback = void(__thiscall*)(CCityStackInterf* thisptr); Callback callback; int unknown; }; using CreateButtonFunctor = SmartPointer*(__stdcall*)(SmartPointer* functor, int a2, CCityStackInterf* cityStackInterf, ButtonCallback* callback); CreateButtonFunctor createButtonFunctor; }; Api& get(); struct Vftable { const CMidDataCache2::INotifyVftable* notify; const CMidCommandQueue2::INotifyCQVftable* commandQueueNotify; const IResetStackExtVftable* resetStackExt; const CInterfaceVftable* dragDropInterf; const ITaskManagerHolderVftable* taskManagerHolder; const IMidDropManagerVftable* dropManager; }; Vftable& vftable(); } // namespace CCityStackInterfApi } // namespace game #endif // CITYSTACKINTERF_H
3,715
C++
.h
104
29.586538
92
0.713808
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,518
midinventory.h
VladimirMakeev_D2ModdingToolset/mss32/include/midinventory.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 MIDINVENTORY_H #define MIDINVENTORY_H #include "idvector.h" #include "midgardid.h" namespace game { struct CMidInventoryVftable; struct IMidgardObjectMap; struct CMidInventory { CMidInventoryVftable* vftable; IdVector items; }; struct CMidInventoryVftable { void* destructor; using Method1 = bool(__thiscall*)(CMidInventory* thisptr, const CMidgardID* groupId, const IMidgardObjectMap* objectMap); Method1 method1; /** Runs CVisitorDestroyItem for each item in inventory. */ using Clear = bool(__thiscall*)(CMidInventory* thisptr, int* a2, IMidgardObjectMap* objectMap); Clear clear; /** Serializes inventory data. */ using Stream = void*(__thiscall*)(CMidInventory* thisptr, int a2, void* a3); Stream stream; /** Returns true if all item ids refers to valid objects. */ using AllItemsExist = bool(__thiscall*)(CMidInventory* thisptr, IMidgardObjectMap* objectMap); AllItemsExist allItemsExist; /** Returns number of items in inventory. */ using GetItemsCount = int(__thiscall*)(const CMidInventory* thisptr); GetItemsCount getItemsCount; /** Returns item id at specified index. */ using GetItem = const CMidgardID*(__thiscall*)(const CMidInventory* thisptr, int index); GetItem getItem; /** Returns index of specified item id or -1 if item not found. */ using GetItemIndex = int(__thiscall*)(const CMidInventory* thisptr, const CMidgardID* itemId); GetItemIndex getItemIndex; /** Adds item id to inventory. Returns true if added successfully. */ using AddItem = bool(__thiscall*)(CMidInventory* thisptr, int a2, const CMidgardID* itemId, IMidgardObjectMap* objectMap); AddItem addItem; /** Removes item id from inventory. Returns true if removed successfully. */ using RemoveItem = bool(__thiscall*)(CMidInventory* thisptr, int a2, const CMidgardID* itemId, IMidgardObjectMap* objectMap); RemoveItem removeItem; }; assert_vftable_size(CMidInventoryVftable, 10); } // namespace game #endif // MIDINVENTORY_H
3,175
C++
.h
71
37.183099
99
0.674984
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,519
mquicontroller.h
VladimirMakeev_D2ModdingToolset/mss32/include/mquicontroller.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 MQUICONTROLLER_H #define MQUICONTROLLER_H #include "functordispatch0.h" #include "functordispatch1.h" #include "functordispatch2.h" #include "functordispatch3.h" #include "smartptr.h" #define WIN32_LEAN_AND_MEAN #include <Windows.h> namespace game { using UiUpdateCallback = CBFunctorDispatch0wRet<bool>; using UiPaintCallback = CBFunctorDispatch1<HDC>; using UiVisibilityCallback = CBFunctorDispatch1<bool>; using UiKeypressCallback = CBFunctorDispatch3<unsigned int, unsigned int, unsigned int>; using UiMousePressCallback = CBFunctorDispatch3<unsigned short, unsigned short, const POINT*>; using UiMouseMoveCallback = CBFunctorDispatch2<unsigned short, const POINT*>; using UiCloseCallback = CBFunctorDispatch0wRet<bool>; using UiMessageCallback = CBFunctorDispatch2<unsigned int, long>; using UiTimerCallback = CBFunctorDispatch0; struct IMqUIControllerVftable; struct IMqUIController { IMqUIControllerVftable* vftable; }; struct IMqUIControllerVftable { using Destructor = void(__thiscall*)(IMqUIController* thisptr, char flags); Destructor destructor; /** Adds callback and returns event id associated with it. */ template <typename T> using AddCallback = int(__thiscall*)(IMqUIController* thisptr, SmartPtr<T>* functor); /** Removes callback by specified event id. */ using RemoveCallback = void(__thiscall*)(IMqUIController* thisptr, int eventId); AddCallback<UiUpdateCallback> addUpdateCallback; RemoveCallback removeUpdateCallback; AddCallback<UiPaintCallback> addPaintCallback; RemoveCallback removePaintCallback; AddCallback<UiVisibilityCallback> addVisibilityChangeCallback; RemoveCallback removeVisibilityChangeCallback; AddCallback<UiKeypressCallback> addKeypressCallback; RemoveCallback removeKeypressCallback; AddCallback<UiMousePressCallback> addMousePressCallback; RemoveCallback removeMousePressCallback; AddCallback<UiMouseMoveCallback> addMouseMoveCallback; RemoveCallback removeMouseMoveCallback; AddCallback<UiCloseCallback> addCloseCallback; RemoveCallback removeCloseCallback; using AddTimerCallback = int(__thiscall*)(IMqUIController* thisptr, unsigned int timerId, SmartPtr<UiTimerCallback>* functor); AddTimerCallback addTimerCallback; RemoveCallback removeTimerCallback; using AddMessageCallback = int(__thiscall*)(IMqUIController* thisptr, unsigned int msgIdentifier, SmartPtr<UiMessageCallback>* functor); AddMessageCallback addMessageCallback; using RemoveMessageCallback = void(__thiscall*)(IMqUIController* thisptr, int messageId, int eventId); RemoveMessageCallback removeMessageCallback; using RunUpdateCallbacks = bool(__thiscall*)(IMqUIController* thisptr); RunUpdateCallbacks runUpdateCallbacks; using RunTimerCallbacks = int(__thiscall*)(IMqUIController* thisptr, unsigned int timerId); RunTimerCallbacks runTimerCallbacks; using RunPaintCallbacks = bool(__thiscall*)(IMqUIController* thisptr, HDC hdc); RunPaintCallbacks runPaintCallbacks; using RunCloseCallbacks = bool(__thiscall*)(IMqUIController* thisptr); RunCloseCallbacks runCloseCallbacks; using RunVisibilityCallbacks = bool(__thiscall*)(IMqUIController* thisptr, bool hasFocus); RunVisibilityCallbacks runVisibilityCallbacks; using RunKeypressCallbacks = bool(__thiscall*)(IMqUIController* thisptr, unsigned short msg, unsigned short wParam, int dummy, unsigned short lParam); RunKeypressCallbacks runKeypressCallbacks; using RunMousePressCallbacks = bool(__thiscall*)(IMqUIController* thisptr, int a2, int a3, const POINT* point); RunMousePressCallbacks runMousePressCallbacks; using RunMouseMoveCallbacks = bool(__thiscall*)(IMqUIController* thisptr, int wParam, const POINT* point); RunMouseMoveCallbacks runMouseMoveCallbacks; using RunMessageCallbacks = bool(__thiscall*)(IMqUIController* thisptr, void* dummy, unsigned short msg, int wParam, int lParam); RunMessageCallbacks runMessageCallbacks; }; assert_vftable_size(IMqUIControllerVftable, 28); } // namespace game #endif // MQUICONTROLLER_H
5,901
C++
.h
113
40.646018
95
0.672225
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,520
interface.h
VladimirMakeev_D2ModdingToolset/mss32/include/interface.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 INTERFACE_H #define INTERFACE_H #include "interfacechilds.h" #include "mqrect.h" #include "smartptr.h" #include <cstddef> #include <cstdint> namespace game { struct CInterfaceVftable; struct CInterfManagerImpl; struct CInterface; struct IMqRenderer2; struct CMqPoint; struct Tooltip; struct CursorHandle; using CursorHandlePtr = SmartPtr<CursorHandle>; using TooltipPtr = SmartPtr<Tooltip>; struct CInterfaceData { SmartPtr<CInterfManagerImpl> interfManager; CInterface* parent; CMqRect area; CInterfaceChilds childs; CursorHandlePtr cursor; TooltipPtr tooltip; }; assert_size(CInterfaceData, 64); assert_offset(CInterfaceData, childs, 28); template <typename T> struct CInterfaceT { T* vftable; CInterfaceData* interfaceData; }; /** Base class for all ui elements. */ struct CInterface : public CInterfaceT<CInterfaceVftable> { }; struct CInterfaceVftable { using Destructor = void(__thiscall*)(CInterface* thisptr, char flags); Destructor destructor; /** Draws childs of specified root element. */ using Draw = void(__thiscall*)(CInterface* thisptr, CInterface* rootElement, IMqRenderer2* renderer); Draw draw; /** Handles mouse position changes. */ using OnMouseMove = int(__thiscall*)(CInterface* thisptr, const CMqPoint* mousePosition); OnMouseMove onMouseMove; /** * Handles mouse buttons events. * @param mouseButton Windows mouse button message, 'WM_LBUTTONDOWN' for example. */ using HandleMouse = int(__thiscall*)(CInterface* thisptr, std::uint32_t mouseButton, const CMqPoint* mousePosition); HandleMouse handleMouse; /** * Handles keyboard events. * @param key Windows virtual key code. */ using HandleKeyboard = int(__thiscall*)(CInterface* thisptr, int key, int a3); HandleKeyboard handleKeyboard; /** Meaning assumed. */ using OnVisibilityChanged = void(__thiscall*)(CInterface* thisptr, int a2, int a3); OnVisibilityChanged onVisibilityChanged; /** Returns cursor handle of the interface element under the point. */ using GetCursorAtPoint = CursorHandlePtr*(__thiscall*)(CInterface* thisptr, CursorHandlePtr* ptr, const CMqPoint* point); GetCursorAtPoint getCursorAtPoint; /** Returns tooltip of the interface element under the point. */ using GetTooltipAtPoint = TooltipPtr*(__thiscall*)(CInterface* thisptr, TooltipPtr* tooltip, const CMqPoint* point); GetTooltipAtPoint getTooltipAtPoint; /** Called from CInterfManagerImpl::OnMousePress */ using Method8 = CMqPoint*(__thiscall*)(CInterface* thisptr, CMqPoint* p1, CMqPoint* p2); Method8 method8; /** * Meaning assumed. * If returns true then IInterfBorderDisplay should be also drawn. * Check CInterfManagerImplDraw for details. */ using DrawBorder = bool(__thiscall*)(const CInterface* thisptr); DrawBorder shouldDrawBorder; /** * Assumption: returns true if scaling is disabled for this interface element. * CInterface returns false, * CInterfDialog checks interface below it and call its method, or returns false. * CMainView2 returns true, while CFullScreenInterf returns false. */ using ShouldIgnoreScaling = bool(__thiscall*)(const CInterface* thisptr); ShouldIgnoreScaling shouldIgnoreScaling; using Method11 = int(__thiscall*)(CInterface* thisptr); Method11 method11; using GetArea = CMqRect*(__thiscall*)(const CInterface* thisptr); GetArea getArea; using SetArea = bool(__thiscall*)(CInterface* thisptr, const CMqRect* area); SetArea setArea; /** Returns true if specified point is inside interface element area. */ using IsPointInside = bool(__thiscall*)(const CInterface* thisptr, const CMqPoint* point); IsPointInside isPointInside; /** Returns area for CMidPopupInterf, for CInterface returns nullptr. */ GetArea getArea2; /** If returns true, we can call getArea2, result will be non-null.*/ using Method16 = bool(__thiscall*)(CInterface* thisptr); Method16 method16; /** Assumption: resizes interface element and its childs. */ using Method17 = bool(__thiscall*)(CInterface* thisptr, const CMqPoint* size); Method17 method17; /** * Assumption: centers interface element inside specified area. * Centers inside parent element if input area is nullptr. */ using Method18 = bool(__thiscall*)(CInterface* thisptr, const CMqRect* area); Method18 method18; /** Returns parent element. */ using GetParent = CInterface*(__thiscall*)(CInterface* thisptr); GetParent getParent; /** Returns number of child elements. */ using GetChildsCount = int(__thiscall*)(const CInterface* thisptr); GetChildsCount getChildsCount; /** Returns child element at specified index. */ using GetChild = CInterface*(__thiscall*)(CInterface* thisptr, const int* index); GetChild getChild; /** Returns index of child element or -1 if child not found. */ using GetChildIndex = int*(__thiscall*)(CInterface* thisptr, int* index, const CInterface* child); GetChildIndex getChildIndex; /** Adds new interface element to the end of childs array. */ using AddChild = void(__thiscall*)(CInterface* thisptr, CInterface* child); AddChild addChild; using AddChildAndGetIndex = void(__thiscall*)(CInterface* thisptr, int* index, CInterface* child); /** Adds new interface element to the end of childs array and returns its index. */ AddChildAndGetIndex addChildAndGetIndex; /** Set new interface element as first item in childs array. */ AddChild setFirstChild; /** * Set new interface element as first item in childs array and returns its index. * Calls method 11 and possibly 5 after setting element. */ AddChildAndGetIndex setFirstChildAndGetIndex; /** * Deletes child element at specified index. * Calls method 5 before destroying child element. * Does not change childs array size, only sets found element to nullptr * after destructor is called. */ using DeleteChildAt = void(__thiscall*)(CInterface* thisptr, const int* index); DeleteChildAt deleteChildAt; /** * Returns interface element under specified point. * Check if point is inside interface area or its childs. * @param deepCheck if true checks whole hierarchy, otherwise checks direct childs only. * @returns nullptr if nothing found. */ using GetInterfaceAtPoint = CInterface*(__thiscall*)(const CInterface* thisptr, const CMqPoint* point, bool deepCheck); GetInterfaceAtPoint getInterfaceAtPoint; /** Sets cursor handle. */ using SetCursor = CursorHandlePtr*(__thiscall*)(CInterface* thisptr, CursorHandlePtr* cursor); SetCursor setCursor; /** Returns cursor handle. */ using GetCursor = CursorHandlePtr*(__thiscall*)(CInterface* thisptr); GetCursor getCursor; using SetTooltip = void(__thiscall*)(CInterface* thisptr, TooltipPtr* tooltip); SetTooltip setTooltip; using GetTooltip = TooltipPtr*(__thiscall*)(CInterface* thisptr); GetTooltip getTooltip; /** * Sets specified element as parent of this interface. * Parent element will be set if it is not a child of this interface. */ using SetParent = void(__thiscall*)(CInterface* thisptr, CInterface* parent); SetParent setParent; }; assert_vftable_size(CInterfaceVftable, 34); } // namespace game #endif // INTERFACE_H
9,005
C++
.h
202
37.044554
98
0.678392
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,521
itemtalisman.h
VladimirMakeev_D2ModdingToolset/mss32/include/itemtalisman.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 ITEMTALISMAN_H #define ITEMTALISMAN_H #include "itembattle.h" namespace game { struct CItemTalisman : public CItemBattle { }; assert_size(CItemTalisman, 24); } // namespace game #endif // ITEMTALISMAN_H
1,030
C++
.h
27
36.259259
72
0.768072
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,522
dbtable.h
VladimirMakeev_D2ModdingToolset/mss32/include/dbtable.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 DBTABLE_H #define DBTABLE_H #include "d2pair.h" #include "mq_c_s.h" namespace game { struct String; struct CMidgardID; struct TextAndId; struct GlobalData; struct CUmModifier; struct LBuildingCategory; struct LBuildingCategoryTable; struct LUnitBranch; struct LUnitBranchTable; struct LModifGroup; struct LModifGroupTable; struct LAttackClass; struct LAttackClassTable; struct LAttackSource; struct LAttackSourceTable; struct LAttackReach; struct LAttackReachTable; /** One of the classes in game that wraps dbf access logic. */ struct CDBTable; namespace CDBTableApi { struct Api { /** * Finds LBuildingCategory by id in dbf table field. * Populates category fields when found. Throws exception if category could not be found. * @param[inout] category category to store search result. * @param[in] dbTable table object to search. * @param[in] fieldName table field to read category id for search from. * @param[in] table table where to search category by id. * @returns pointer to category. */ using FindBuildingCategory = LBuildingCategory*(__stdcall*)(LBuildingCategory* category, const CDBTable* dbTable, const char* fieldName, const LBuildingCategoryTable* table); FindBuildingCategory findBuildingCategory; /** * Finds LUnitBranch by id in dbf table field. * Populates category fields when found. Throws exception if category could not be found. * @param[inout] category category to store search result. * @param[in] dbTable table object to search. * @param[in] fieldName table field to read category id for search from. * @param[in] table table where to search category by id. * @returns pointer to category. */ using FindUnitBranchCategory = LUnitBranch*(__stdcall*)(LUnitBranch* category, const CDBTable* dbTable, const char* fieldName, const LUnitBranchTable* table); FindUnitBranchCategory findUnitBranchCategory; /** * Finds LModifGroup by id in dbf table field. * Populates category fields when found. Throws exception if category could not be found. * @param[inout] category category to store search result. * @param[in] dbTable table object to search. * @param[in] fieldName table field to read category id for search from. * @param[in] table table where to search category by id. * @returns pointer to category. */ using FindModifGroupCategory = LModifGroup*(__stdcall*)(LModifGroup* category, const CDBTable* dbTable, const char* fieldName, const LModifGroupTable* table); FindModifGroupCategory findModifGroupCategory; /** * Read string from dbf table field (max length is 256 including null terminator). * Throws exception if failed. * @param[inout] value string to store result. * @param[in] dbTable table object to read from. * @param[in] fieldName table field to read from. */ using ReadString = void(__stdcall*)(String* value, const CDBTable* thisptr, const char* fieldName); ReadString readString; using ReadModifier = void(__stdcall*)(CUmModifier** value, const CMidgardID* modifierId, const LModifGroup* group, const char* globalsFolderPath, void* codeBaseEnvProxy, const GlobalData** globalData); ReadModifier readModifier; /** * Reads unit level from dbf table field. * Checks if unit level value does not exceed [unitMinLevel : unitMaxLevel] range, * [1 : 5] by default. Throws exception if level value exceeds range. * @param[inout] level location to store result. * @param[in] dbTable table object to read from. * @param[in] fieldName table field to read from. */ using ReadUnitLevel = void(__stdcall*)(int* level, const CDBTable* dbTable, const char* fieldName); ReadUnitLevel readUnitLevel; /** * Throws exception related to missing value in dbf table. * @param[in] tableName name of the table that misses value. * @param[in] value string representation of missing entity. */ using MissingValueException = void(__stdcall*)(const char* tableName, const char* value); MissingValueException missingValueException; /** * Throws exception related to duplicate records in dbf table. * @param[in] dbTable table object containing duplicates. * @param[in] id id of duplicate entity related to table record. */ using DuplicateRecordException = void(__stdcall*)(const CDBTable* dbTable, CMidgardID* id); DuplicateRecordException duplicateRecordException; /** * Read id from dbf table field. * Checks if id string in table contains valid id. Throws exception in case of invalid id. * @param[inout] id id to store result. * @param[in] dbTable table object to read from. * @param[in] fieldName table field to read from. */ using ReadId = void(__stdcall*)(CMidgardID* id, const CDBTable* dbTable, const char* fieldName); ReadId readId; using ReadText = void(__stdcall*)(TextAndId* text, const CDBTable* dbTable, const char* fieldName, const mq_c_s<Pair<CMidgardID, char*>>* texts); ReadText readText; using FindAttackClass = LAttackClass*(__stdcall*)(LAttackClass* attackClass, const CDBTable* dbTable, const char* fieldName, const LAttackClassTable* table); FindAttackClass findAttackClass; using FindAttackSource = LAttackSource*(__stdcall*)(LAttackSource* attackSource, const CDBTable* dbTable, const char* fieldName, const LAttackSourceTable* table); FindAttackSource findAttackSource; using FindAttackReach = LAttackReach*(__stdcall*)(LAttackReach* attackReach, const CDBTable* dbTable, const char* fieldName, const LAttackReachTable* table); FindAttackReach findAttackReach; using ReadAttackIntValue = void(__stdcall*)(int* value, const CDBTable* dbTable, const char* fieldName, const CMidgardID* attackId); ReadAttackIntValue readInitiative; using ReadPower = void(__thiscall*)(int* thisptr, int* power, const CDBTable* dbTable, const char* fieldName, const CMidgardID* attackId); ReadPower readPower; ReadAttackIntValue readDamage; ReadAttackIntValue readHeal; using ReadAttackLevel = void(__stdcall*)(int* level, const CDBTable* dbTable, const char* fieldName, const CMidgardID* attackId, const LAttackClass* attackClass); ReadAttackLevel readAttackLevel; using ReadBoolValue = void(__stdcall*)(bool* value, const CDBTable* dbTable, const char* fieldName); ReadBoolValue readInfinite; using ReadIntWithBoundsCheck = void(__stdcall*)(int* value, const CDBTable* dbTable, const char* fieldName, int minBound, int maxBound); ReadIntWithBoundsCheck readIntWithBoundsCheck; ReadBoolValue readBool; using GetName = const char*(__thiscall*)(const CDBTable* thisptr); GetName getName; using Eof = bool(__thiscall*)(const CDBTable* thisptr); Eof eof; using Next = bool(__thiscall*)(CDBTable* thisptr); Next next; }; Api& get(); } // namespace CDBTableApi } // namespace game #endif // DBTABLE_H
10,078
C++
.h
202
35.217822
100
0.579092
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