Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/youneuoy/M2TWEOP-library
Browse files Browse the repository at this point in the history
…into auto-dxvk
  • Loading branch information
EddieEldridge committed Nov 28, 2023
2 parents 5472216 + 6c5fea3 commit 0b960b6
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 67 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/build-and-release-eop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
# This job is used to build EOP
# It runs on every commit pushed to GitHub
build-eop:
runs-on: windows-2019
runs-on: windows-2022

# Steps
steps:
Expand All @@ -24,6 +24,8 @@ jobs:

- name: Build EOP
uses: ./.github/workflows/composite-actions/build-eop
with:
vsversion: "2022"

- uses: actions/upload-artifact@v3
with:
Expand All @@ -33,7 +35,7 @@ jobs:
# This job is used to update the online documentation
# It requires a commit message beginning with 'Docs' to run
update-docs:
runs-on: windows-2019
runs-on: windows-2022

if: "startsWith(github.event.head_commit.message, 'Docs:')"
steps:
Expand All @@ -42,6 +44,8 @@ jobs:

- name: Build EOP
uses: ./.github/workflows/composite-actions/build-eop
with:
vsversion: "2022"

- name: Update EOP Online Documentation
uses: ./.github/workflows/composite-actions/build-docs
Expand All @@ -51,7 +55,7 @@ jobs:
# This job is used to release EOP to GitHub and update the documentation
# It requires a commit message beginning with 'Release' to run
release-eop:
runs-on: windows-2019
runs-on: windows-2022

# If the latest commit message starts with 'Release', update docs and issue a release on GitHub
if: "startsWith(github.event.head_commit.message, 'Release:')"
Expand All @@ -61,6 +65,8 @@ jobs:

- name: Build EOP
uses: ./.github/workflows/composite-actions/build-eop
with:
vsversion: "2022"

- name: Read release version info from source
run: |
Expand Down Expand Up @@ -91,4 +97,4 @@ jobs:
bodyFile: "./documentationGenerator/releaseInfo/releaseDescription.md"
token: ${{ secrets.GITHUB_TOKEN }}
commit: "master"
allowUpdates: true
allowUpdates: true
4 changes: 2 additions & 2 deletions .github/workflows/composite-actions/build-eop/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
# Use msvc-dev building
- uses: ilammy/msvc-dev-cmd@v1
with:
vsversion: "16.0"
vsversion: "2022"

- name: Show checked out files
run: ls -l
Expand Down Expand Up @@ -52,4 +52,4 @@ runs:
ls -l documentationGenerator/EOPDocs;
ls -l documentationGenerator/EOPDocs/build;
ls -l documentationGenerator/EOPDocs/build/html;
shell: bash
shell: bash
8 changes: 4 additions & 4 deletions M2TWEOP Code/M2TWEOP GUI/M2TWEOP GUI.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
8 changes: 4 additions & 4 deletions M2TWEOP Code/M2TWEOP STRAT AI/M2TWEOP STRAT AI.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
8 changes: 4 additions & 4 deletions M2TWEOP Code/M2TWEOP library/M2TWEOP library.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,28 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
8 changes: 4 additions & 4 deletions M2TWEOP Code/M2TWEOP library/realGameTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -3433,12 +3433,12 @@ struct factionStruct {
float* resourceModifiers;
DWORD resourceModifiersEnd;
DWORD resourceModifiersEnd2;
int32_t factionBannerIndex; //0x0AA0
int32_t agentNameFactionId[12]; //0x0AA4
char pad_0AD4[24]; //0x0AD4
char pad_0A8C[12]; //0x0AD4
UNICODE_STRING** someString;
UNICODE_STRING** localizedName;
undefined field_0xaa0[76];
int32_t factionBannerIndex; //0x0AA0
int32_t agentNameFactionId[12]; //0x0AA4
undefined field_0xad4[24];
int money; /* money of the faction */
int KingsPurse; /* money of the faction */
int32_t incomeDoubled; //0x0AF4
Expand Down
7 changes: 0 additions & 7 deletions M2TWEOP Code/M2TWEOP library/themeManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
#include "headersSTD.h"
#include "imgui.h"

// Convert RGBA strings to ImVec4
auto parseColor = [](const std::string &colorStr) -> ImVec4
{
ImVec4 color;
sscanf_s(colorStr.c_str(), "rgba(%f, %f, %f, %f)", &color.x, &color.y, &color.z, &color.w);
return color;
};

void tomlToStyle(std::string themeName);

Expand Down
8 changes: 4 additions & 4 deletions M2TWEOP Code/M2TWEOP tools/M2TWEOP tools.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions M2TWEOP DataFiles/eopData/gameCfg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"isBlockLaunchWithoutEop": false,
"isDiscordRichPresenceEnabled": true,
"isDiscordRichPresenceEnabled": false,
"isDeveloperModeNeeded": true,
"isTacticalMapViewerNeeded": true,
"isContextMenuNeeded": true,
"isDXVKEnabled": false
}
}
3 changes: 2 additions & 1 deletion M2TWEOP-luaPlugin/luaPlugin/luaP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ sol::state* luaP::init(std::string& luaFilePath, std::string& modPath)
/***
Basic factionStruct table
@tfield int dipNum
@tfield int factionID
@tfield getFactionName getFactionName
@tfield int cultureID
@tfield int AIPersonalityType
Expand Down Expand Up @@ -1870,6 +1870,7 @@ sol::state* luaP::init(std::string& luaFilePath, std::string& modPath)
*/
types.factionStruct = luaState.new_usertype<factionStruct>("factionStruct");
types.factionStruct.set("dipNum", &factionStruct::dipNum);
types.factionStruct.set("factionID", &factionStruct::dipNum);
types.factionStruct.set("AIPersonalityType", &factionStruct::AIPersonalityType);
types.factionStruct.set("AIPersonalityName", &factionStruct::AIPersonalityName);
/***
Expand Down
4 changes: 2 additions & 2 deletions M2TWEOP-luaPlugin/luaPlugin/luaP2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,7 @@ void luaP::initCampaign()
@usage
local sMap = gameDataAll.get().stratMap;
local region = sMap.getRegion(2);
local totalStrength = region:getHostileArmiesStrength(myFac.dipNum)
local totalStrength = region:getHostileArmiesStrength(myFac.factionID)
*/
typeAll.regionStruct.set_function("getHostileArmiesStrength", &gameHelpers::getHostileArmiesStrength);

Expand Down Expand Up @@ -2074,7 +2074,7 @@ void luaP::initP2()
@tfield float mapHeightDoubled
@tfield int sidesNum Returns a battleSide[8]. Maximum: 8.
@tfield battleSide[8] sides
@tfield factionSide[31] faction alliance array, -1 if not in battle, start at 1 so faction dipnum + 1
@tfield factionSide[31] faction alliance array, -1 if not in battle, start at 1 so faction ID + 1
tfield getPlayerArmy getPlayerArmy
@tfield getBattleResidence getBattleResidence
Expand Down
8 changes: 4 additions & 4 deletions M2TWEOP-luaPlugin/luaPlugin/luaPlugin.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
Expand Down
28 changes: 4 additions & 24 deletions M2TWEOP-luaPlugin/luaPlugin/realGameTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1367,26 +1367,6 @@ struct battleAI
char pad_07A4[96]; //0x07A4
}; //Size: 0x0804

/*
0 not in battle
1 prebattle scroll
2 delay (also for preconflict phase of successful ambushes)
3 deployment
4
5 conflict (also for pause)
6 victory scroll
7 pursuit
8
9 postbattle scroll (not for autoresolved battles)
0 succesful ambush
1 failed ambush
2 normal
3 siege
4 sally besieger
5 naval
6 withdrawal?
*/

struct battleSide {
bool isDefender;//0x0000
uchar field_0x1;//0x0001
Expand Down Expand Up @@ -3453,12 +3433,12 @@ struct factionStruct {
float* resourceModifiers;
DWORD resourceModifiersEnd;
DWORD resourceModifiersEnd2;
int32_t factionBannerIndex; //0x0AA0
int32_t agentNameFactionId[12]; //0x0AA4
char pad_0AD4[24]; //0x0AD4
char pad_0A8C[12]; //0x0AD4
UNICODE_STRING** someString;
UNICODE_STRING** localizedName;
undefined field_0xaa0[76];
int32_t factionBannerIndex; //0x0AA0
int32_t agentNameFactionId[12]; //0x0AA4
undefined field_0xad4[24];
int money; /* money of the faction */
int KingsPurse; /* money of the faction */
int32_t incomeDoubled; //0x0AF4
Expand Down
3 changes: 2 additions & 1 deletion documentationGenerator/releaseInfo/releaseDescription.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@
- Event function has different parameters (see more below)
- Lot of info like different public order and growth types inside settlement struct moved to their own struct
- Many renamed fields in edu entry struct
- `dipNum` in factionStruct -> `factionID` (dipNum still works for compatibility but it is not in docs, you should change it where you use it)

**Note:** Please use the Lua docs to find problems with obsolete namings

### New Event Structure Example
In the below example the eventData parameter contains 4 fields with information, which you can see in the documentation under "Exports
In the below example the eventData parameter contains 4 fields with information, which you can see in the documentation under "Exports":

```lua
---A settlement is being processed for the start of its faction's turn.
Expand Down

0 comments on commit 0b960b6

Please sign in to comment.