Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
secsome committed Nov 20, 2021
2 parents fc6a384 + 4bcd2fd commit 7c8ef74
Show file tree
Hide file tree
Showing 28 changed files with 668 additions and 303 deletions.
2 changes: 1 addition & 1 deletion FA2pp
17 changes: 10 additions & 7 deletions FA2sp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>false</ConformanceMode>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>
Expand Down Expand Up @@ -95,7 +95,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;WIN32;_CRT_SECURE_NO_WARNINGS;_CONSOLE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;WIN32;_CRT_SECURE_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>false</ConformanceMode>
<ExceptionHandling>false</ExceptionHandling>
<BufferSecurityCheck>
Expand All @@ -122,12 +122,14 @@
<AdditionalOptions>/SAFESEH:NO %(AdditionalOptions)</AdditionalOptions>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<UACExecutionLevel>AsInvoker</UACExecutionLevel>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="FA2pp\FunctionInit.cpp" />
<ClCompile Include="FA2sp\ExtraWindow\CAllieEditor\CAllieEditor.cpp" />
<ClCompile Include="FA2sp\Ext\CAITriggerTypes\Body.cpp" />
<ClCompile Include="FA2sp\Ext\CCreateMap3A\Hooks.cpp" />
<ClCompile Include="FA2sp\Ext\CEasterEgg\Hooks.cpp" />
<ClCompile Include="FA2sp\Ext\CFinalSunDlg\Body.cpp" />
<ClCompile Include="FA2sp\Ext\CFinalSunDlg\Body.ObjectBrowserControl.cpp" />
Expand All @@ -142,6 +144,7 @@
<ClCompile Include="FA2sp\Ext\CLoading\Body.LoadObjects.cpp" />
<ClCompile Include="FA2sp\Ext\CLoading\Hooks.InitPalettes.cpp" />
<ClCompile Include="FA2sp\Ext\CLoading\Hooks.LoadObjects.cpp" />
<ClCompile Include="FA2sp\Ext\CMapD\Hooks.cpp" />
<ClCompile Include="FA2sp\Ext\CPropertyAircraft\Body.cpp" />
<ClCompile Include="FA2sp\Ext\CPropertyBuilding\Body.cpp" />
<ClCompile Include="FA2sp\Ext\CPropertyInfantry\Body.cpp" />
Expand All @@ -154,22 +157,22 @@
<ClCompile Include="FA2sp\Ext\CTeamTypes\Hooks.cpp" />
<ClCompile Include="FA2sp\Ext\CTileSetBrowserFrame\Hooks.cpp" />
<ClCompile Include="FA2sp\Ext\CTileSetBrowserFrame\TabPages\TriggerSort.cpp" />
<ClCompile Include="FA2sp\Ext\CTileSetBrowserView\Hooks.cpp" />
<ClCompile Include="FA2sp\Ext\CTriggerAction\Body.cpp" />
<ClCompile Include="FA2sp\Ext\CTriggerAction\Hooks.cpp" />
<ClCompile Include="FA2sp\Ext\CTriggerEvent\Body.cpp" />
<ClCompile Include="FA2sp\Ext\CTriggerFrame\Hooks.cpp" />
<ClCompile Include="FA2sp\Ext\CTriggerOption\Hooks.cpp" />
<ClCompile Include="FA2sp\Ext\FA2Expand.cpp" />
<ClCompile Include="FA2sp\Ext\Miscs\Hooks.LoadParams.cpp" />
<ClCompile Include="FA2sp\Helpers\ControlHelpers.cpp" />
<ClCompile Include="FA2sp\Helpers\MultimapHelper.cpp" />
<ClCompile Include="FA2sp\Hooks.Debug.cpp" />
<ClCompile Include="FA2sp\MFCWindow\Hooks.cpp" />
<ClCompile Include="FA2sp\Miscs\DrawStuff.cpp" />
<ClCompile Include="FA2sp\Miscs\Exception.cpp" />
<ClCompile Include="FA2sp\Miscs\Hooks.SaveMap.cpp" />
<ClCompile Include="FA2sp\Miscs\Hooks.TheaterInfo.cpp" />
<ClCompile Include="FA2sp\Miscs\SaveMap.cpp" />
<ClCompile Include="FA2sp\Miscs\Palettes.cpp" />
<ClCompile Include="FA2sp\UI\UIColor.cpp" />
<ClCompile Include="FA2sp\Miscs\Hooks.BugFixes.cpp" />
<ClCompile Include="FA2sp\Ext\CScriptTypes\Body.cpp" />
<ClCompile Include="FA2sp\Ext\CTaskforce\Body.cpp" />
Expand All @@ -184,7 +187,7 @@
<ClCompile Include="FA2sp\Miscs\Hooks.ExtWaypoints.cpp" />
<ClCompile Include="FA2sp\Miscs\Hooks.FileNames.cpp" />
<ClCompile Include="FA2sp\Miscs\Hooks.INI.cpp" />
<ClCompile Include="FA2sp\Miscs\Hooks.LoadParamToCombobox.cpp" />
<ClCompile Include="FA2sp\Miscs\Hooks.LoadParams.cpp" />
<ClCompile Include="FA2sp\Miscs\Hooks.Mix.cpp" />
<ClCompile Include="FA2sp\Miscs\Hooks.Performance.cpp" />
<ClCompile Include="FA2sp\Miscs\Hooks.RemapColor.cpp" />
Expand Down Expand Up @@ -230,9 +233,9 @@
<ClInclude Include="FA2sp\Miscs\DrawStuff.h" />
<ClInclude Include="FA2sp\Miscs\Exception.h" />
<ClInclude Include="FA2sp\Miscs\Palettes.h" />
<ClInclude Include="FA2sp\Miscs\SaveMap.h" />
<ClInclude Include="FA2sp\resource.h" />
<ClInclude Include="FA2sp\RunTime.h" />
<ClInclude Include="FA2sp\UI\UIColor.h" />
<ClInclude Include="FA2sp\Helpers\MutexHelper.h" />
<ClInclude Include="FA2sp\Helpers\Translations.h" />
<ClInclude Include="FA2sp\ExtraWindow\CTileManager\CTileManager.h" />
Expand Down
28 changes: 17 additions & 11 deletions FA2sp.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@
<ClInclude Include="FA2sp\Helpers\ControlHelpers.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="FA2sp\UI\UIColor.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="FA2sp\FA2sp.Constants.h">
<Filter>头文件</Filter>
</ClInclude>
Expand Down Expand Up @@ -144,6 +141,9 @@
<ClInclude Include="FA2sp\Ext\CPropertyAircraft\Body.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="FA2sp\Miscs\SaveMap.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="FA2sp\FA2sp.cpp">
Expand Down Expand Up @@ -191,9 +191,6 @@
<ClCompile Include="FA2sp\Ext\CScriptTypes\Hooks.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FA2sp\Ext\Miscs\Hooks.LoadParams.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FA2sp\Helpers\MutexHelper.cpp">
<Filter>源文件</Filter>
</ClCompile>
Expand Down Expand Up @@ -221,9 +218,6 @@
<ClCompile Include="FA2sp\Ext\CTileSetBrowserFrame\Hooks.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FA2sp\UI\UIColor.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FA2sp\Hooks.Debug.cpp">
<Filter>源文件</Filter>
</ClCompile>
Expand All @@ -233,7 +227,7 @@
<ClCompile Include="FA2sp\ExtraWindow\CTileManager\CTileManager.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FA2sp\Miscs\Hooks.LoadParamToCombobox.cpp">
<ClCompile Include="FA2sp\Miscs\Hooks.LoadParams.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FA2sp\Miscs\Hooks.Performance.cpp">
Expand Down Expand Up @@ -302,7 +296,7 @@
<ClCompile Include="FA2sp\Miscs\Exception.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FA2sp\Miscs\Hooks.SaveMap.cpp">
<ClCompile Include="FA2sp\Miscs\SaveMap.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FA2sp\Ext\CAITriggerTypes\Body.cpp">
Expand Down Expand Up @@ -347,6 +341,18 @@
<ClCompile Include="FA2sp\Ext\CPropertyAircraft\Body.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FA2sp\Ext\CCreateMap3A\Hooks.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FA2sp\Ext\CMapD\Hooks.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FA2sp\Ext\CTileSetBrowserView\Hooks.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="FA2sp\Miscs\Hooks.TheaterInfo.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="FA2sp\FA2sp.rc">
Expand Down
32 changes: 32 additions & 0 deletions FA2sp/Ext/CCreateMap3A/Hooks.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <Helpers/Macro.h>
#include <CCreateMap3A.h>
#include <CLoading.h>

#include "../../FA2sp.h"
#include "../../Helpers/Translations.h"

DEFINE_HOOK(4D2E80, CCreateMap3A_OnInitDialog, 5)
{
GET(CCreateMap3A*, pThis, ECX);

pThis->FA2CDialog::OnInitDialog();
auto pCBTheater = (ppmfc::CComboBox*)pThis->GetDlgItem(1046);
pCBTheater->AddString(Translations::GetTranslationItem("TheaterNameTem", FA2sp::Buffer) ? FA2sp::Buffer : "TEMPERATE");
pCBTheater->AddString(Translations::GetTranslationItem("TheaterNameSno", FA2sp::Buffer) ? FA2sp::Buffer : "SNOW");
pCBTheater->AddString(Translations::GetTranslationItem("TheaterNameUrb", FA2sp::Buffer) ? FA2sp::Buffer : "URBAN");
if (CLoading::HasMdFile)
{
pCBTheater->AddString(Translations::GetTranslationItem("TheaterNameUbn", FA2sp::Buffer) ? FA2sp::Buffer : "NEWURBAN");
pCBTheater->AddString(Translations::GetTranslationItem("TheaterNameLun", FA2sp::Buffer) ? FA2sp::Buffer : "LUNAR");
pCBTheater->AddString(Translations::GetTranslationItem("TheaterNameDes", FA2sp::Buffer) ? FA2sp::Buffer : "DESERT");
}
pThis->TheaterIndex = 0;
pThis->DefaultHeight = 0;
pThis->MapWidth = pThis->MapHeight = 80;

pThis->FA2CDialog::UpdateData(false);

R->AL(true);

return 0x4D2F3D;
}
2 changes: 1 addition & 1 deletion FA2sp/Ext/CFinalSunDlg/Body.ObjectBrowserControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ void ObjectBrowserControlExt::Redraw_PlayerLocation()

this->InsertTranslatedString("StartpointsDelete", 21, hPlayerLocation);

if (CINI::CurrentDocument->GetBool("Basic", "MultiplayerOnly"))
if (CMapData::Instance->IsMultiOnly())
{
for (int i = 0; i < 8; ++i)
{
Expand Down
28 changes: 16 additions & 12 deletions FA2sp/Ext/CFinalSunDlg/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,17 @@ DEFINE_HOOK(43209D, CFinalSunDlg_Update_TranslateMenuItems, A)
}
};

translateSubMenu(0, "Menu.File");
int i = 0;
translateSubMenu(i++, "Menu.File");
translateMenuItem(57600, "Menu.File.New");
translateMenuItem(40001, "Menu.File.Open");
translateMenuItem(57603, "Menu.File.Save");
translateMenuItem(40002, "Menu.File.SaveAs");
translateMenuItem(40025, "Menu.File.CheckMap");
translateMenuItem(40017, "Menu.File.RunGame");
// translateMenuItem(40017, "Menu.File.RunGame");
translateMenuItem(40003, "Menu.File.Quit");

translateSubMenu(1, "Menu.Edit");
translateSubMenu(i++, "Menu.Edit");
translateMenuItem(57643, "Menu.Edit.Undo");
translateMenuItem(57644, "Menu.Edit.Redo");
translateMenuItem(57634, "Menu.Edit.Copy");
Expand All @@ -115,7 +116,7 @@ DEFINE_HOOK(43209D, CFinalSunDlg_Update_TranslateMenuItems, A)
translateMenuItem(40037, "Menu.Edit.SingleplayerSettings");
translateMenuItem(40049, "Menu.Edit.INIEditor");

translateSubMenu(2, "Menu.Terrain");
translateSubMenu(i++, "Menu.Terrain");
translateMenuItem(40053, "Menu.Terrain.RaiseGround");
translateMenuItem(40054, "Menu.Terrain.LowerGround");
translateMenuItem(40064, "Menu.Terrain.FlattenGround");
Expand All @@ -126,7 +127,7 @@ DEFINE_HOOK(43209D, CFinalSunDlg_Update_TranslateMenuItems, A)
translateMenuItem(40062, "Menu.Terrain.RaiseSingleTile");
translateMenuItem(40063, "Menu.Terrain.LowerSingleTile");

translateSubMenu(3, "Menu.MapTools");
translateSubMenu(i++, "Menu.MapTools");
translateMenuItem(40077, "Menu.MapTools.ChangeMapHeight");
translateMenuItem(40096, "Menu.MapTools.AutoCreateShores");
translateMenuItem(40085, "Menu.MapTools.AutoLevelUsingCliffs");
Expand All @@ -135,12 +136,15 @@ DEFINE_HOOK(43209D, CFinalSunDlg_Update_TranslateMenuItems, A)
translateMenuItem(40133, "Menu.MapTools.SearchWaypoint");
translateMenuItem(40135, "Menu.MapTools.ToolScripts");

translateSubMenu(4, "Menu.Online");
translateMenuItem(40078, "Menu.Online.Westwood");
translateMenuItem(40081, "Menu.Online.FA2Fansite");
translateMenuItem(40119, "Menu.Online.FA2Forum");
if (0)
{
translateSubMenu(i++, "Menu.Online");
translateMenuItem(40078, "Menu.Online.Westwood");
translateMenuItem(40081, "Menu.Online.FA2Fansite");
translateMenuItem(40119, "Menu.Online.FA2Forum");
}

translateSubMenu(5, "Menu.Options");
translateSubMenu(i++, "Menu.Options");
translateMenuItem(40004, "Menu.Options.Settings");
translateMenuItem(40024, "Menu.Options.ShowMinimap");
translateMenuItem(40023, "Menu.Options.Easymode");
Expand All @@ -150,13 +154,13 @@ DEFINE_HOOK(43209D, CFinalSunDlg_Update_TranslateMenuItems, A)
translateMenuItem(40105, "Menu.Options.DisableAutoLAT");
translateMenuItem(40120, "Menu.Options.DisableSlopeCorrection");

translateSubMenu(6, "Menu.Help");
translateSubMenu(i++, "Menu.Help");
translateMenuItem(57670, "Menu.Help.Manual");
translateMenuItem(40006, "Menu.Help.Info");
translateMenuItem(40075, "Menu.Help.Credits");
translateMenuItem(40022, "Menu.Help.TipOfTheDay");

translateSubMenu(7, "Menu.Layers");
translateSubMenu(i++, "Menu.Layers");
translateMenuItem(30000, "Menu.Layers.Structures");
translateMenuItem(30001, "Menu.Layers.Infantries");
translateMenuItem(30002, "Menu.Layers.Units");
Expand Down
27 changes: 27 additions & 0 deletions FA2sp/Ext/CMapD/Hooks.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <Helpers/Macro.h>

#include "../../FA2sp.h"
#include "../../Helpers/Translations.h"

DEFINE_HOOK(499659, CMapD_UpdateDialog_TheaterName, 6)
{
GET(ppmfc::CComboBox*, pCBTheater, ECX);
GET(const char*, lpTheaterName, EDI);

if (strcmp(lpTheaterName, "TEMPERATE") == 0)
pCBTheater->SetWindowText((Translations::GetTranslationItem("TheaterNameTem", FA2sp::Buffer) ? FA2sp::Buffer : "TEMPERATE"));
else if (strcmp(lpTheaterName, "SNOW") == 0)
pCBTheater->SetWindowText(Translations::GetTranslationItem("TheaterNameSno", FA2sp::Buffer) ? FA2sp::Buffer : "SNOW");
else if (strcmp(lpTheaterName, "URBAN") == 0)
pCBTheater->SetWindowText(Translations::GetTranslationItem("TheaterNameUrb", FA2sp::Buffer) ? FA2sp::Buffer : "URBAN");
else if (strcmp(lpTheaterName, "NEWURBAN") == 0)
pCBTheater->SetWindowText(Translations::GetTranslationItem("TheaterNameUbn", FA2sp::Buffer) ? FA2sp::Buffer : "NEWURBAN");
else if (strcmp(lpTheaterName, "LUNAR") == 0)
pCBTheater->SetWindowText(Translations::GetTranslationItem("TheaterNameLun", FA2sp::Buffer) ? FA2sp::Buffer : "LUNAR");
else if (strcmp(lpTheaterName, "DESERT") == 0)
pCBTheater->SetWindowText(Translations::GetTranslationItem("TheaterNameDes", FA2sp::Buffer) ? FA2sp::Buffer : "DESERT");
else
pCBTheater->SetWindowText(lpTheaterName);

return 0x49965F;
}
4 changes: 2 additions & 2 deletions FA2sp/Ext/CMinimap/Body.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include <CWndView.h>
#include <CMinimap.h>
#include "../FA2Expand.h"

class NOVTABLE CMinimapExt : public CWndView
class NOVTABLE CMinimapExt : public CMinimap
{
public:
typedef BOOL(*FuncT_PTM)(MSG* pMsg);
Expand Down
15 changes: 14 additions & 1 deletion FA2sp/Ext/CTileSetBrowserView/Hooks.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
#include <CTileSetBrowserView.h>
#include <Helpers/Macro.h>
#include <GlobalVars.h>

#include <FA2PP.h>

#include "../../FA2sp.h"

DEFINE_HOOK(4F258B, CTileSetBrowserView_OnDraw_SetOverlayFrameToDisplay, 7)
{
GET(CTileSetBrowserView*, pThis, ESI);
GET(const int, i, ECX);

ppmfc::CString ovlIdx;
ovlIdx.Format("%d", pThis->SelectedOverlayIndex);
int nDisplayLimit = CINI::FAData->GetInteger("OverlayDisplayLimit", ovlIdx, 60);
if (nDisplayLimit > 60)
nDisplayLimit = 60;

R->Stack(STACK_OFFS(0xDC, 0xB8), i);
return i < nDisplayLimit ? 0x4F2230 : 0x4F2598;
}


//DEFINE_HOOK(4F1D70, ASDG, 6)
Expand Down
Loading

0 comments on commit 7c8ef74

Please sign in to comment.