Skip to content

Commit 9718000

Browse files
committed
Add fix for mod specific UI in data/ui/generic
1 parent b7d678c commit 9718000

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

.github/workflows/build-and-release-eop.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,4 @@ jobs:
9696
artifacts: "${{ env.EOP_VERSION }}.zip"
9797
bodyFile: "./documentationGenerator/releaseInfo/releaseDescription.md"
9898
token: ${{ secrets.GITHUB_TOKEN }}
99-
commit: "master"
10099
allowUpdates: true

M2TWEOP Code/M2TWEOP library/patchesForGame.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,9 @@ char* __fastcall patchesForGame::getBrowserPicConstructed(int cultureID, edbEntr
341341
}
342342
}
343343
unitActions::logStringGame("getBrowserPicConstructed error: " + std::string(modPath + picPath));
344+
FILE_PATH = modPath + "/data/ui/generic/generic_constructed_building.tga";
345+
if (std::filesystem::exists(FILE_PATH))
346+
return FILE_PATH.data();
344347
FILE_PATH = GAME_PATH + "/data/ui/generic/generic_constructed_building.tga";
345348
return FILE_PATH.data();
346349
}
@@ -401,6 +404,9 @@ char* __fastcall patchesForGame::getBrowserPicConstruction(int cultureID, edbEnt
401404
}
402405
}
403406
unitActions::logStringGame("getBrowserPicConstruction error: " + std::string(modPath + picPath));
407+
FILE_PATH = modPath + "/data/ui/generic/generic_preconstructed_building.tga";
408+
if (std::filesystem::exists(FILE_PATH))
409+
return FILE_PATH.data();
404410
FILE_PATH = GAME_PATH + "/data/ui/generic/generic_preconstructed_building.tga";
405411
return FILE_PATH.data();
406412
}
@@ -460,6 +466,9 @@ char* __fastcall patchesForGame::getBuildingPic(buildingLevel* level, int cultur
460466
}
461467
}
462468
unitActions::logStringGame("getBuildingPic error: " + std::string(modPath + picPath));
469+
FILE_PATH = modPath + "/data/ui/generic/generic_building.tga";
470+
if (std::filesystem::exists(FILE_PATH))
471+
return FILE_PATH.data();
463472
FILE_PATH = GAME_PATH + "/data/ui/generic/generic_building.tga";
464473
return FILE_PATH.data();
465474
}
@@ -519,6 +528,9 @@ char* __fastcall patchesForGame::getBuildingPicConstructed(buildingLevel* level,
519528
}
520529
}
521530
unitActions::logStringGame("getBuildingPicConstructed error: " + std::string(modPath + picPath));
531+
FILE_PATH = modPath + "/data/ui/generic/generic_constructed_building.tga";
532+
if (std::filesystem::exists(FILE_PATH))
533+
return FILE_PATH.data();
522534
FILE_PATH = GAME_PATH + "/data/ui/generic/generic_constructed_building.tga";
523535
return FILE_PATH.data();
524536
}
@@ -578,6 +590,9 @@ char* __fastcall patchesForGame::getBuildingPicConstruction(buildingLevel* level
578590
}
579591
}
580592
unitActions::logStringGame("getBuildingPicConstruction error: " + std::string(modPath + picPath));
593+
FILE_PATH = modPath + "/data/ui/generic/generic_preconstructed_building.tga";
594+
if (std::filesystem::exists(FILE_PATH))
595+
return FILE_PATH.data();
581596
FILE_PATH = GAME_PATH + "/data/ui/generic/generic_preconstructed_building.tga";
582597
return FILE_PATH.data();
583598
}

documentationGenerator/releaseInfo/releaseDescription.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
## **Release Notes**
88
***NOTE : NOT SAVEGAME COMPATIBLE!!!!***
99

10+
#### **M2TWEOP-3-3-1**
11+
- Fixed custom mod building UI in `data/ui/generic` not being read correctly when EOP was installed - *Medik*
12+
1013
<!-- ### **Launcher** -->
1114

15+
#### **M2TWEOP-3-3-0**
1216

1317
(all changes by Fynn)
1418
### **Library**

0 commit comments

Comments
 (0)