diff --git a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp new file mode 100644 index 0000000000..24abd87f7d --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_DoEveryFrame.cpp @@ -0,0 +1,98 @@ +#include "../BuildMenu.func.hpp" + +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/UI/MenuHandlerState.func.hpp" +#include "OpenSHC/UI/MinimapViewState.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eGM.hpp" +#include "OpenSHC/IO/Graphics/GmID.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Rendering/ScreenResolutionEnum.hpp" +#include "OpenSHC/UI/Enums/BuildMenuTabType.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" + +#include "OpenSHC/Globals/COL_MAGENTA.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MinimapViewState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00433030 + void BuildMenu::MenuView_BuildMenu_DoEveryFrame() + { + if (DAT_GameCore::instance.activeMenuTab.buildMenuTab != OpenSHC::UI::Enums::BMTT_MENU_HIDDEN + && DAT_GameCore::instance.activeMenuTab.buildMenuTab != OpenSHC::UI::Enums::BMTT_UNKNOWN_62) { + if (DAT_MinimapViewState::instance.field_0xc == 0) { + DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 2; + } + if (DAT_MenuHandlerState::instance.isBuildMenuTransitioning_0x18) { + MACRO_CALL_MEMBER(OpenSHC::UI::MenuHandlerState_Func::computeBuildMenuTransitionShift, + DAT_MenuHandlerState::ptr)(); + } + if (DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated == 2) { + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_640x480) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 2, + DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 472); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, + DAT_PencilRenderCore::ptr)(DAT_MenuHandlerState::instance.x, + DAT_MenuHandlerState::instance.y + 406, DAT_MenuHandlerState::instance.x + 799, + DAT_MenuHandlerState::instance.y + 471, COL_MAGENTA::instance.shortValue); + if (DAT_GameCore::instance.activeMenuTab.buildMenuTab == OpenSHC::UI::Enums::BMTT_SOLDIERS) { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 5, + DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 445); + } else { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 1, + DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 450); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::setRenderingRect, + DAT_TextureRenderCoreObject::ptr)(DAT_MenuHandlerState::instance.x + 17, + DAT_MenuHandlerState::instance.y + 473, DAT_MenuHandlerState::instance.x + 513, + DAT_MenuHandlerState::instance.y + 576); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawTgxGmOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::IO::Graphics::GID_INTERFACE_BUTTONS, 7, + DAT_MenuHandlerState::instance.x + - DAT_MenuHandlerState::instance.buildMenuBackgroundLeftShift_0x24 + 17, + DAT_MenuHandlerState::instance.y + 473); + MACRO_CALL_MEMBER( + OpenSHC::UI::Rendering::TextureRenderCore_Func::setRenderingRectToGameResolution, + DAT_TextureRenderCoreObject::ptr)(); + } + } + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue + = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + DAT_MinimapViewState::instance.needsRedraw = TRUE; + if (!DAT_GameCore::instance.isBinkVideoPlaying) { + MACRO_CALL_MEMBER( + OpenSHC::UI::MinimapViewState_Func::renderMinimapMain, DAT_MinimapViewState::ptr)(); + } + } + if (DAT_GameCore::instance.isVictoryOrDefeatUnk != 0) { + DAT_GameCore::instance.isVictoryOrDefeatUnk = 0; + DAT_GameState::instance.mapAndTime.gameOver = TRUE; + DAT_GameState::instance.mapAndTime.gameOverTime = timeGetTime() - 6000; + DAT_GameState::instance.mapAndTime.playerIsAlive[DAT_GameSynchronyState::instance.currentPlayerSlotID] + = 1; + DAT_GameCore::instance.skipStoreSKMasters = 1; + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_WIN_DEFEAT_WINDOW, 1); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp new file mode 100644 index 0000000000..a90bfba498 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/BuildMenu/MenuView_BuildMenu_Prepare.cpp @@ -0,0 +1,70 @@ +#include "../BuildMenu.func.hpp" + +#include "OpenSHC/Map/MapPropertiesState.func.hpp" +#include "OpenSHC/Text/UserTextHandler.func.hpp" +#include "OpenSHC/UI/DisplayElements.func.hpp" +#include "OpenSHC/Game/GameMode.hpp" +#include "OpenSHC/Text/TextArrayIndexType.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" +#include "OpenSHC/UI/Enums/DisplayElementID.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MapPropertiesState.hpp" +#include "OpenSHC/Globals/DAT_MouseState.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" +#include "OpenSHC/Globals/DAT_UnitsState.hpp" +#include "OpenSHC/Globals/DAT_UserTextHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b960f0.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00431A90 + void BuildMenu::MenuView_BuildMenu_Prepare() + { + MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( + OpenSHC::Text::TAIT_UNKNOWN); + if (DAT_GameCore::instance.activeMenuTab.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_BATTERINGRAM + && DAT_GameCore::instance.activeMenuTab.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD + && DAT_GameCore::instance.menuTabToSwitchTo.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_BATTERINGRAM + && DAT_GameCore::instance.menuTabToSwitchTo.tabType != OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD) { + DAT_TileMapState::instance.shiftRelated0or3 = 0; + DAT_UnitsState::instance.unitCountOfSelection[DAT_GameSynchronyState::instance.currentPlayerSlotID] = 0; + } + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_KEEP_AND_GRANERY_PLACEMENT_INFO, 0); + DAT_WindowAndDirectDraw::instance.pendingMenuRedraw = TRUE; + if (MACRO_CALL_MEMBER(OpenSHC::Map::MapPropertiesState_Func::getEventIDForTimeUntilDefeatEventType, + DAT_MapPropertiesState::ptr)() + >= 0) { + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_TIME_UNTIL_DEFEAT, 1); + } + if (DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SOLITARY) { + if (DAT_GameCore::instance.mapU4Int0 != 0) { + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_UNKNOWN_25, 1); + } + // the original tests the game mode again after each call + if (DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SOLITARY) { + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_PLAYER_INFO_ON_HOVER, 1); + if (DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SOLITARY + && DAT_GameSynchronyState::instance.currentGameMode != OpenSHC::Game::GM_SKIRMISH_SINGLE_PLAYER + && DAT_GameState::instance.mapAndTime.skirmishNoRushTicks != 0) { + MACRO_CALL(OpenSHC::UI::DisplayElements_Func::CheckDisplayElementByIDAndSetForUnlimitedDisplay)( + OpenSHC::UI::Enums::DEID_NO_RUSH, 1); + } + } + } + DAT_MouseState::instance.waitCursorToggle = 0; + INT_00b960f0::instance = 0; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoInitial.cpp new file mode 100644 index 0000000000..5255bfb825 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CampaignUnk/MenuView_CampaignUnk_DoInitial.cpp @@ -0,0 +1,30 @@ +#include "../CampaignUnk.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DD0C0 + void CampaignUnk::MenuView_CampaignUnk_DoInitial() + { + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL(UI::Helpers_Func::ColorEntireScreen)(COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp new file mode 100644 index 0000000000..b315668d4b --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoInitial.cpp @@ -0,0 +1,45 @@ +#include "../Credits.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextEditorState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004262B0 + void Credits::MenuView_Credits_DoInitial() + { + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + DAT_TextEditorState::instance.pendingCreditsFadeBorder = TRUE; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp new file mode 100644 index 0000000000..b9f2064000 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoEveryFrame.cpp @@ -0,0 +1,33 @@ +#include "../CrusadeEndscreen.func.hpp" + +#include "OpenSHC/Audio/MSS/SoundSystem.func.hpp" +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/DE/SHCDE/eMusicIDs.hpp" + +#include "OpenSHC/Globals/DAT_SoundSystemState.hpp" +#include "OpenSHC/Globals/DAT_UnknownBinkIndex.hpp" +#include "OpenSHC/Globals/INT_00ed27b8.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004E1F50 + void CrusadeEndscreen::MenuView_CrusadeEndscreen_DoEveryFrame() + { + if (MACRO_CALL(UI::Helpers_Func::TicksSinceCounterStart)()) { + MACRO_CALL(Rendering_Func::ProcessCreditsScriptCommands)(); + if (DAT_UnknownBinkIndex::instance >= 59 && !INT_00ed27b8::instance) { + MACRO_CALL_MEMBER(Audio::MSS::SoundSystem_Func::setSomeSoundTime, DAT_SoundSystemState::ptr)(); + MACRO_CALL_MEMBER(Audio::MSS::SoundSystem_Func::setupVolumeAndSoundID, DAT_SoundSystemState::ptr)( + DE::SHCDE::MUSIC_GERMAN_EGG); + INT_00ed27b8::instance = TRUE; + } + MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoInitial.cpp new file mode 100644 index 0000000000..6cb7fb9fd9 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_DoInitial.cpp @@ -0,0 +1,35 @@ +#include "../CrusadeEndscreen.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00ed27b8.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004D91D0 + void CrusadeEndscreen::MenuView_CrusadeEndscreen_DoInitial() + { + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + INT_00ed27b8::instance = FALSE; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp new file mode 100644 index 0000000000..ee42406177 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CrusadeEndscreen/MenuView_CrusadeEndscreen_Prepare.cpp @@ -0,0 +1,276 @@ +#include "../CrusadeEndscreen.func.hpp" + +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Credits.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Game/TrailType.hpp" +#include "OpenSHC/Text/GameLanguage.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_NumberOfStoredMenuStrings.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DF2E0 + void CrusadeEndscreen::MenuView_CrusadeEndscreen_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "sktrail_win.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_sktrail_win_tgx_005ab768); + // "endframe1.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_endframe1_tgx_005ab758); + // "endframe2.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_endframe2_tgx_005ab748); + // "endframe3.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_endframe3_tgx_005ab738); + // "endframe4.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_endframe4_tgx_005ab728); + // "endframe5.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_endframe5_tgx_005ab718); + // "endframe6.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_endframe6_tgx_005ab708); + // "endframe7.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_endframe7_tgx_005ab6f8); + // "endframe8.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_endframe8_tgx_005ab6e8); + // "jesterlast.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_jesterlast_tgx_005ab6d8); + MACRO_CALL(UI::Credits_Func::ResetCredits)(); + DAT_NumberOfStoredMenuStrings::instance = 0; + // the five texts are written out: a loop over them loses (quick_diff 0.9985 -> 0.9718) + // "Congratulations!" + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_SKTRAIL_WIN, 0)); + // "Many have set out..." + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_SKTRAIL_WIN, 1)); + // "...but few will have survived this journey." + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_SKTRAIL_WIN, 2)); + // "You have bested the Crusader Trail!" + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_SKTRAIL_WIN, 3)); + // "You have bested the Crusader Extreme Trail!" + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_SKTRAIL_WIN, 4)); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundEntry)(1, 0); + // the repeated blocks are written out: the original has no loop here + MACRO_CALL(UI::Credits_Func::AppendCreditsShowImageCommand)(41, 0, 230, 203, 336, 168, 0, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 0, 15, 1, 402, 234, 0, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 0, 15, 0, 400, 232, 0, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 1, 106, 53, 4); + // "rt_vict1.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_rt_vict1_bik_005a78fc, 106, 53, 0, 0); + // "fx\\speech\\rt_anger_04.wav" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + (char*)s_fx_speech_rt_anger_04_wav_005ab6bc, 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 2, 331, 24, 4); + // "sn_vict2.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_sn_vict2_bik_005a78ec, 331, 24, 0, 0); + // "fx\\speech\\sn_add_player.wav" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + (char*)s_fx_speech_sn_add_player_wav_005ab6a0, 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 3, 557, 53, 4); + // "pg_taunt2.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_pg_taunt2_bik_005a7c44, 557, 53, 0, 0); + // "fx\\speech\\pg_add_player.wav" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + (char*)s_fx_speech_pg_add_player_wav_005ab684, 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 4, 640, 223, 4); + // "wf_anger1.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_wf_anger1_bik_005a7b20, 640, 223, 0, 0); + // "fx\\speech\\wf_anger_04.wav" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + (char*)s_fx_speech_wf_anger_04_wav_005ab668, 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 5, 557, 394, 4); + // "saladin_angry.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_saladin_angry_bik_005a7b0c, 557, 394, 0, 0); + // "fx\\speech\\sa_extra_01.wav" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + (char*)s_fx_speech_sa_extra_01_wav_005ab64c, 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 6, 332, 436, 4); + // "sultan_natural.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_sultan_natural_bik_005a78a4, 332, 436, 0, 0); + // "fx\\speech\\su_congrats_01.wav" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + (char*)s_fx_speech_su_congrats_01_wav_005ab62c, 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 7, 106, 394, 4); + // "richard_taunting.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_richard_taunting_bik_005a7d00, 106, 394, 0, 0); + // "fx\\speech\\ri_congrats_01.wav" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + (char*)s_fx_speech_ri_congrats_01_wav_005ab60c, 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 8, 35, 223, 4); + // "bad_arab_taunt.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_bad_arab_taunt_bik_005a7d2c, 35, 223, 0, 0); + // "fx\\speech\\ca_add_player_01.wav" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoWithAudioCommand)( + (char*)s_fx_speech_ca_add_player_01_wav_005ab5ec, 3, 0, 100); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(4, 3); + // 17 in Italian, 16 otherwise + int fontSizeUnk = 16; + if (DAT_TextManagerObject::instance.gameLanguage == Text::GL_ITALIAN) { + fontSizeUnk = 17; + } + MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 1, fontSizeUnk, 1, 262, 238, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 1, fontSizeUnk, 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, 90); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 2, fontSizeUnk, 1, 262, 238, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 2, fontSizeUnk, 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 2); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(1, 90); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 2); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 2); + if (DAT_GameCore::instance.currentTrailType == Game::TT_EXTREME) { + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 4, fontSizeUnk, 1, 262, 238, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 4, fontSizeUnk, 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 4); + } else { + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 3, fontSizeUnk, 1, 262, 238, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextCommand)(15, 3, fontSizeUnk, 0, 260, 236, 282, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(3, 3); + } + // Written out too: the original has no loop here. + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 1); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 106, 53, 4); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 106, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 2); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 331, 24, 4); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 331, 24, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 3); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 557, 53, 4); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 557, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 4); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 640, 223, 4); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 640, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 5); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 557, 394, 4); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 557, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 6); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 332, 436, 4); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 332, 436, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 7); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 106, 394, 4); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 106, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(8, 8); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageTransitionCommand)(5, 9, 35, 223, 4); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 35, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsImageEndCommand)(42, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsTextEndCommand)(16, 3); + MACRO_CALL(UI::Credits_Func::AppendCreditsSegmentEndCommand)(); + // Written out too: the original has no loop here. + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 106, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 331, 24, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 557, 53, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 640, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 557, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 332, 436, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 106, 394, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + // "action_jester.bik" + MACRO_CALL(UI::Credits_Func::AppendCreditsBinkVideoCommand)( + 12, (char*)s_action_jester_bik_005aa504, 35, 223, 0, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsSoundStreamCommand)(24, 0); + MACRO_CALL(UI::Credits_Func::AppendCreditsClearImageCommand)(); + MACRO_CALL(Rendering_Func::TicksStartCounter)(); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp new file mode 100644 index 0000000000..26f9c3eabe --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_DoEveryFrame.cpp @@ -0,0 +1,43 @@ +#include "../CustomScenarios.func.hpp" + +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00425FF0 + void CustomScenarios::MenuView_CustomScenarios_DoEveryFrame() + { + DAT_UnknownGFXIndex::instance + = DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_NONE; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(DAT_UnknownGFXIndex::instance, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].height) + / 2); + if (DAT_MenuTextInputState::instance.dialogResult == 1) { + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_MAP_EDITOR_PROPERTIES, 0); + } + if (DAT_MenuTextInputState::instance.dialogResult == -1) { + MACRO_CALL(OpenSHC::UI::MenuViews::CustomScenarios_Func::MenuView_CustomScenarios_Prepare)(); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp new file mode 100644 index 0000000000..116646b124 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/CustomScenarios/MenuView_CustomScenarios_Prepare.cpp @@ -0,0 +1,59 @@ +#include "../CustomScenarios.func.hpp" + +#include "OpenSHC/Game/GameStateStructures.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UIButtonDefinedData.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/INT_00b95abc.hpp" +#include "OpenSHC/Globals/INT_00b960e4.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00425EA0 + void CustomScenarios::MenuView_CustomScenarios_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_builder.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_frontend_builder_tgx_005a2084); + // "frontend_builder2.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_frontend_builder2_tgx_005a206c); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + DWORD const now = timeGetTime(); + // the four buttons start their animation 1600 ms apart + for (int i = 0; i < 4; ++i) { + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[364 + i].stateTransitionTimeBaseUnk_0x18 + = now - (3 - i) * 1600; + } + INT_00b95abc::instance = -1; + DAT_MenuTextInputState::instance.dialogResult = 0; + DAT_GameCore::instance.missionNumber1to20 = 0; + DAT_GameCore::instance.mapLoadedForEditor = FALSE; + DAT_GameCore::instance.gameMode_2 = Game::GM_EDITOR; + INT_00b960e4::instance = FALSE; + if (DAT_GameSynchronyState::instance.currentPlayerSlotID == 0) { + DAT_GameSynchronyState::instance.currentPlayerSlotID = 1; + } + DAT_GameSynchronyState::instance + .currentPlayerFullIDArray[DAT_GameSynchronyState::instance.currentPlayerSlotID] = 1; + MACRO_CALL_MEMBER(Game::GameStateStructures_Func::resetTeams, DAT_GameState::ptr)(); + DAT_UnknownGFXIndex::instance = 0; + DAT_GameCore::instance.buildmenuMenuTabToSwitchTo.tabType = UI::Enums::BASMTT_HUNTERSHUT; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp new file mode 100644 index 0000000000..7a9ed5e894 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/GameStartEnterName/MenuView_GameStartEnterName_DoInitial.cpp @@ -0,0 +1,43 @@ +#include "../GameStartEnterName.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004406F0 + void GameStartEnterName::MenuView_GameStartEnterName_DoInitial() + { + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBorderAndGfx.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBorderAndGfx.cpp new file mode 100644 index 0000000000..7cc095c442 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBorderAndGfx.cpp @@ -0,0 +1,26 @@ +#include "../General.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DB5C0 + void General::MenuView_General_DoInitial_BlackBorderAndGfx() + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, + 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + MACRO_CALL(OpenSHC::UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL(OpenSHC::UI::Rendering_Func::RenderGfxHelperUnk)(0, 0, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp new file mode 100644 index 0000000000..962e2b8ede --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture.cpp @@ -0,0 +1,44 @@ +#include "../General.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00425F60 + void General::MenuView_General_DoInitial_BlackBoxDefaultBorderAndPicture() + { + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(DAT_UnknownGFXIndex::instance, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].height) + / 2); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_CrusadeAndRankMenu.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_CrusadeAndRankMenu.cpp new file mode 100644 index 0000000000..f660261b2a --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_CrusadeAndRankMenu.cpp @@ -0,0 +1,34 @@ +#include "../General.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DD750 + void General::MenuView_General_DoInitial_CrusadeAndRankMenu() + { + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL(UI::Rendering_Func::RenderGfxHelperUnk)(0, 0, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_DefaultMainMenuStructure.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_DefaultMainMenuStructure.cpp new file mode 100644 index 0000000000..c13960bcc9 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_DefaultMainMenuStructure.cpp @@ -0,0 +1,33 @@ +#include "../General.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004276F0 + void General::MenuView_General_DoInitial_DefaultMainMenuStructure() + { + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_ScreenToBlack.cpp b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_ScreenToBlack.cpp new file mode 100644 index 0000000000..c15970e3ab --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/General/MenuView_General_DoInitial_ScreenToBlack.cpp @@ -0,0 +1,31 @@ +#include "../General.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00430100 + void General::MenuView_General_DoInitial_ScreenToBlack() + { + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp new file mode 100644 index 0000000000..5e718ac58d --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignIntro/MenuView_HistoricCampaignIntro_Prepare.cpp @@ -0,0 +1,65 @@ +#include "../HistoricCampaignIntro.func.hpp" + +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_00eb0b20.hpp" +#include "OpenSHC/Globals/DAT_00ed2780.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_NumberOfStoredMenuStrings.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/FLOAT_00ec0834.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DBAF0 + void HistoricCampaignIntro::MenuView_HistoricCampaignIntro_Prepare() + { + MACRO_CALL(UI::Helpers_Func::PrepareHistoryBook)(); + // the campaign's picture + switch (DAT_GameCore::instance.historicCampaignNumber) { + case 1: + // "c1pic.tgx" + DAT_00eb0b20::instance = MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_c1pic_tgx_005ab0ec); + break; + case 2: + // "c2pic.tgx" + DAT_00eb0b20::instance = MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_c2pic_tgx_005ab0e0); + break; + case 3: + // "c3pic.tgx" + DAT_00eb0b20::instance = MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_c3pic_tgx_005ab0d4); + break; + case 4: + // "c4pic.tgx" + DAT_00eb0b20::instance = MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_c4pic_tgx_005ab0c8); + break; + } + // the campaign's title and opening text, the first two of its six in TEXT_CAMPAIGN_INFO + DAT_NumberOfStoredMenuStrings::instance = 0; + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_CAMPAIGN_INFO, DAT_GameCore::instance.historicCampaignNumber * 6 - 5)); + MACRO_CALL(UI::Helpers_Func::StoreStringInMenuStringArray)( + MACRO_CALL_MEMBER(Text::TextManager_Func::getTextStringInGroupAtOffset, DAT_TextManagerObject::ptr)( + DE::SHCDE::TEXT_CAMPAIGN_INFO, DAT_GameCore::instance.historicCampaignNumber * 6 - 4)); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + FLOAT_00ec0834::instance = 0.0; + DAT_00ed2780::instance = 1; + MACRO_CALL(Rendering_Func::TicksStartCounter)(); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp new file mode 100644 index 0000000000..45975792e5 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_DoEveryFrame.cpp @@ -0,0 +1,32 @@ +#include "../HistoricCampaignSelect.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" + +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00425580 + void HistoricCampaignSelect::MenuView_HistoricCampaignSelect_DoEveryFrame() + { + DAT_UnknownGFXIndex::instance + = DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_NONE; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(DAT_UnknownGFXIndex::instance, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].height) + / 2); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp new file mode 100644 index 0000000000..ac48f36523 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/HistoricCampaignSelect/MenuView_HistoricCampaignSelect_Prepare.cpp @@ -0,0 +1,44 @@ +#include "../HistoricCampaignSelect.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_MenuModalComposition3.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UIButtonDefinedData.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/INT_00b95abc.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00425500 + void HistoricCampaignSelect::MenuView_HistoricCampaignSelect_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_combat.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_frontend_combat_tgx_005a2028); + // "frontend_combat2.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_frontend_combat2_tgx_005a2010); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + DWORD const now = timeGetTime(); + // the four buttons start their animation 1600 ms apart + for (int i = 0; i < 4; ++i) { + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[355 + i].stateTransitionTimeBaseUnk_0x18 + = now - (3 - i) * 1600; + } + INT_00b95abc::instance = -1; + DAT_UnknownGFXIndex::instance = 0; + MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, DAT_MenuModalComposition3::ptr)( + UI::Enums::MMT_NONE, FALSE); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp new file mode 100644 index 0000000000..0044bd9269 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/HistoricMissionSelect/MenuView_HistoricMissionSelect_Prepare.cpp @@ -0,0 +1,46 @@ +#include "../HistoricMissionSelect.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_00b95b2c.hpp" +#include "OpenSHC/Globals/DAT_00b96100.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00426830 + void HistoricMissionSelect::MenuView_HistoricMissionSelect_Prepare() + { + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_combat2.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_frontend_combat2_tgx_005a2010); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + DAT_GameCore::instance.section1066 = 0; + DAT_MenuTextInputState::instance.lastListClickTime = 0; + DAT_MenuTextInputState::instance.lastClickedListIndex = -1; + // the campaign is four chapters of five missions + int chapter; + if (DAT_GameCore::instance.missionNumber1to20 < 6) { + chapter = 0; + } else if (DAT_GameCore::instance.missionNumber1to20 < 11) { + chapter = 1; + } else if (DAT_GameCore::instance.missionNumber1to20 < 16) { + chapter = 2; + } else { + chapter = 3; + } + DAT_00b95b2c::instance = chapter; + DAT_00b96100::instance = chapter * 5 + 1; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp b/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp new file mode 100644 index 0000000000..6917f54426 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/IntroLogos/MenuView_IntroLogos_Prepare.cpp @@ -0,0 +1,35 @@ +#include "../IntroLogos.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_IntroBlendStrength.hpp" +#include "OpenSHC/Globals/DAT_IntroStep.hpp" +#include "OpenSHC/Globals/DAT_IntroTimestamp.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00424720 + void IntroLogos::MenuView_IntroLogos_Prepare() + { + if (DAT_IntroStep::instance == 0) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "logo1.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_logo1_tgx_005a1f74); + } else if (DAT_IntroStep::instance == 1) { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "logo2.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_logo2_tgx_005a1f68); + } + DAT_IntroBlendStrength::instance = 0; + DAT_IntroTimestamp::instance = timeGetTime(); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp new file mode 100644 index 0000000000..9ce45f2d50 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_DoEveryFrame.cpp @@ -0,0 +1,34 @@ +#include "../IntroVideo.func.hpp" + +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/Rendering/Bink/BinkControlClass.func.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_BinkControlState.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MouseState.hpp" +#include "OpenSHC/Globals/TIME_IntroVideo_Prepare.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00424AD0 + void IntroVideo::MenuView_IntroVideo_DoEveryFrame() + { + DWORD const now = timeGetTime(); + if (now - TIME_IntroVideo_Prepare::instance >= 400) { + if (DAT_MouseState::instance.draggingStopped) { + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::stopBinkPlayback, + DAT_BinkControlState::ptr)(0); + } + if (DAT_BinkControlState::instance.binkObjPtrArray[0] == NULL) { + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_GAME_START_ENTER_NAME, 0); + } + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp new file mode 100644 index 0000000000..993dd9e161 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/IntroVideo/MenuView_IntroVideo_Prepare.cpp @@ -0,0 +1,40 @@ +#include "../IntroVideo.func.hpp" + +#include "OpenSHC/Rendering/Bink/BinkControlClass.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_BinkControlState.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/TIME_IntroVideo_Prepare.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00424A50 + void IntroVideo::MenuView_IntroVideo_Prepare() + { + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, + 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + // "intro.bik" + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, DAT_BinkControlState::ptr)(0, + s_intro_bik_005a1f80, 0, 0, DAT_MenuHandlerState::instance.x + 80, + DAT_MenuHandlerState::instance.y + 60, 0); + TIME_IntroVideo_Prepare::instance = timeGetTime(); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp new file mode 100644 index 0000000000..4d096c77e2 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/LobbyMenu/MenuView_LobbyMenu_Prepare.cpp @@ -0,0 +1,120 @@ +#include "../LobbyMenu.func.hpp" + +#include "OpenSHC/Text/UserTextHandler.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/Game/TrailType.hpp" +#include "OpenSHC/Text/TextArrayIndexType.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition3.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UserTextHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b95f6c.hpp" +#include "OpenSHC/Globals/INT_00b960f0.hpp" +#include "OpenSHC/Globals/INT_00b960fc.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00427320 + void LobbyMenu::MenuView_LobbyMenu_Prepare() + { + MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, DAT_MenuModalComposition3::ptr)( + UI::Enums::MMT_NONE, FALSE); + DAT_GameCore::instance.gameMode_2 = Game::GM_SKIRMISH_AND_MULTIPLAYER; + DAT_GameCore::instance.currentTrailType = Game::TT_FIRST_EDITION; + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_GameSynchronyState::instance.field_0x106ee4 = 0; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_combat3.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_frontend_combat3_tgx_005a2134); + // "firefly-small.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_firefly_small_tgx_005a226c); + // "table.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_table_tgx_005a2260); + // "tslice1.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice1_tgx_005a2254); + // "tslice2.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice2_tgx_005a2248); + // "tslice3.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice3_tgx_005a223c); + // "tslice4.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice4_tgx_005a2230); + // "tslice5.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice5_tgx_005a2224); + // "tslice6.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice6_tgx_005a2218); + // "tslice7.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice7_tgx_005a220c); + // "tslice8.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice8_tgx_005a2200); + // "tslice1b.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice1b_tgx_005a21f0); + // "tslice2b.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice2b_tgx_005a21e0); + // "tslice3b.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice3b_tgx_005a21d0); + // "tslice4b.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice4b_tgx_005a21c0); + // "tslice5b.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice5b_tgx_005a21b0); + // "tslice6b.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice6b_tgx_005a21a0); + // "tslice7b.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice7b_tgx_005a2190); + // "tslice8b.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_tslice8b_tgx_005a2180); + // "pick_opponent_normal.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_pick_opponent_normal_tgx_005a2164); + // "pick_opponent_large.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_pick_opponent_large_tgx_005a214c); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + DAT_UserTextHandlerState::instance.allowUserTextInput = 0; + MACRO_CALL_MEMBER(Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( + Text::TAIT_UNKNOWN); + MACRO_CALL_MEMBER(Text::UserTextHandler_Func::clearTextAndCursor, DAT_UserTextHandlerState::ptr)(); + INT_00b960fc::instance = timeGetTime(); + INT_00b95f6c::instance = 0; + INT_00b960f0::instance = INT_00b960fc::instance; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp new file mode 100644 index 0000000000..9882e98f53 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_DoInitial.cpp @@ -0,0 +1,55 @@ +#include "../MainMenu.func.hpp" + +#include "OpenSHC/Rendering/Bink/BinkControlClass.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_BinkControlState.hpp" +#include "OpenSHC/Globals/DAT_MainMenuSwingSwordBool.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b95f68.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00424CD0 + void MainMenu::MenuView_MainMenu_DoInitial() + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, + 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + MACRO_CALL(OpenSHC::UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(DAT_UnknownGFXIndex::instance, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[DAT_UnknownGFXIndex::instance].height) + / 2); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + INT_00b95f68::instance = FALSE; + // "richard_swordswing.bik" + MACRO_CALL_MEMBER(OpenSHC::Rendering::Bink::BinkControlClass_Func::playBINK, DAT_BinkControlState::ptr)(0, + s_richard_swordswing_bik_005a1fc4, 0, 0, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 508, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 22, 0); + DAT_MainMenuSwingSwordBool::instance = 0; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp new file mode 100644 index 0000000000..f4ec8f1d28 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MainMenu/MenuView_MainMenu_Prepare.cpp @@ -0,0 +1,52 @@ +#include "../MainMenu.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_MainMenuSwingSwordBool.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition2.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition3.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UnknownGFXIndex.hpp" +#include "OpenSHC/Globals/INT_00b95abc.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00424C40 + void MainMenu::MenuView_MainMenu_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_main.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_frontend_main_tgx_005a1fb0); + // "frontend_main2.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_frontend_main2_tgx_005a1f9c); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + INT_00b95abc::instance = -1; + DAT_UnknownGFXIndex::instance = 0; + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_GameCore::instance.gameMode_2 = OpenSHC::Game::GM_CAMPAIGN_MISSION; + DAT_MainMenuSwingSwordBool::instance = 0; + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition1::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition2::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + MACRO_CALL_MEMBER(OpenSHC::UI::MenuModalComposition_Func::activateModalDialog, + DAT_MenuModalComposition3::ptr)(OpenSHC::UI::Enums::MMT_NONE, FALSE); + DAT_GameState::instance.mapAndTime.difficulty = 1; + DAT_GameCore::instance.missionDifficulty_3 = 1; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp new file mode 100644 index 0000000000..c31faa5357 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MapEditorLandscaping/MenuView_MapEditorLandscaping_DoEveryFrame.cpp @@ -0,0 +1,43 @@ +#include "../MapEditorLandscaping.func.hpp" + +#include "OpenSHC/UI/MinimapViewState.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eGM.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MinimapViewState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004313C0 + void MapEditorLandscaping::MenuView_MapEditorLandscaping_DoEveryFrame() + { + if (DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_SIEGETENT_SIEGETOWER + || DAT_GameCore::instance.activeMenuTab.tabType == OpenSHC::UI::Enums::BASMTT_SIEGETENT_SHIELD) { + return; + } + if (DAT_MinimapViewState::instance.field_0xc == 0) { + DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 2; + } + if (DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated == 2) { + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::renderGM, + DAT_TextureRenderCoreObject::ptr)(OpenSHC::DE::SHCDE::GM_INTERFACE_PANELS, 3, + DAT_MenuHandlerState::instance.x, DAT_MenuHandlerState::instance.y + 434); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + DAT_MinimapViewState::instance.needsRedraw = TRUE; + MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::renderMinimapLandscaping, DAT_MinimapViewState::ptr)( + DAT_MenuHandlerState::instance.x + 664, DAT_MenuHandlerState::instance.y + 464, 128, 128); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp new file mode 100644 index 0000000000..3c877fc8a7 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MissionSelect/MenuView_MissionSelect_DoEveryFrame.cpp @@ -0,0 +1,58 @@ +#include "../MissionSelect.func.hpp" + +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/UI/Enums/MenuModalType.hpp" + +#include "OpenSHC/Globals/COL_VERY_SOFT_YELLOW.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004268C0 + void MissionSelect::MenuView_MissionSelect_DoEveryFrame() + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + if (DAT_MenuTextInputState::instance.currentModalDialog != OpenSHC::UI::Enums::MMT_NO_MENU + || DAT_MenuModalComposition1::instance.activeModalDialogID != OpenSHC::UI::Enums::MMT_NONE) { + return; + } + int const y1 = DAT_MenuHandlerState::instance.y + 190; + int const x2 = DAT_MenuHandlerState::instance.x + 570; + int const x1 = DAT_MenuHandlerState::instance.x + 229; + int const y2 = DAT_MenuHandlerState::instance.y + 289; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1 - 1, x2, y1 - 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y2 + 1, x2, y2 + 1, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x1, y1, x1, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawLine, DAT_PencilRenderCore::ptr)( + x2, y1, x2, y2, COL_VERY_SOFT_YELLOW::instance.shortValue); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + // "Mission" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderTextBanner, + DAT_PencilRenderCore::ptr)(OpenSHC::DE::SHCDE::TEXT_MAINOPTIONS, 15, + DAT_MenuHandlerState::instance.x + 184, DAT_MenuHandlerState::instance.y + 100, 432, 50); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp b/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp new file mode 100644 index 0000000000..8c78948f9f --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/MpConnection/MenuView_MpConnection_Prepare.cpp @@ -0,0 +1,44 @@ +#include "../MpConnection.func.hpp" + +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuModalComposition.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MenuModalComposition1.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00427110 + void MpConnection::MenuView_MpConnection_Prepare() + { + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_combat3.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_frontend_combat3_tgx_005a2134); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL_MEMBER( + Synchrony::GameSynchronyState_Func::initializeMultiplayerLobby, DAT_GameSynchronyState::ptr)(); + MACRO_CALL_MEMBER(UI::MenuModalComposition_Func::activateModalDialog, DAT_MenuModalComposition1::ptr)( + (UI::Enums::MenuModalType)DAT_GameSynchronyState::instance.nextModalDialog, FALSE); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/ScenarioDescription/MenuView_ScenarioDescription_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/ScenarioDescription/MenuView_ScenarioDescription_DoInitial.cpp new file mode 100644 index 0000000000..2cf469452c --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/ScenarioDescription/MenuView_ScenarioDescription_DoInitial.cpp @@ -0,0 +1,31 @@ +#include "../ScenarioDescription.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004DD300 + void ScenarioDescription::MenuView_ScenarioDescription_DoInitial() + { + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL(UI::Helpers_Func::ColorEntireScreen)(COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL(UI::Rendering_Func::RenderGfxHelperUnk)(0, 0, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp new file mode 100644 index 0000000000..7017507970 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoEveryFrame.cpp @@ -0,0 +1,119 @@ +#include "../SelectCrusade.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_HighlightedSkirmishType.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x0042BBF0 + void SelectCrusade::MenuView_SelectCrusade_DoEveryFrame() + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderedBoxWithBlendedBackground, + DAT_PencilRenderCore::ptr)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 88, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 624, 400); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawHeaderBanner, + DAT_PencilRenderCore::ptr)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 88, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 624, 400); + int const titleY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 130; + int const titleX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + // "Choose type of Crusader game" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 0), + titleX, titleY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 16, FALSE, 0); + if (DAT_HighlightedSkirmishType::instance == 1) { + int const nameY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + int const nameX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Crusader 'First Edition' Trail" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 1), + nameX, nameY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 16, FALSE, 0); + int const descriptionY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; + int const descriptionX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Fight through 50 linked Crusader games" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 2), + descriptionX, descriptionY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, + FALSE, 0); + } + if (DAT_HighlightedSkirmishType::instance == 2) { + int const nameY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + int const nameX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Custom Game" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 3), + nameX, nameY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 16, FALSE, 0); + int const descriptionY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; + int const descriptionX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Customize your own Crusader game." + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE, 4), + descriptionX, descriptionY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, + FALSE, 0); + } + if (DAT_HighlightedSkirmishType::instance == 3) { + int const nameY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + int const nameX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Crusader 'Warchest' Trail" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 21), + nameX, nameY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 16, FALSE, 0); + int const descriptionY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; + int const descriptionX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Fight through 30 linked Crusader games" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 22), + descriptionX, descriptionY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, + FALSE, 0); + } + if (DAT_HighlightedSkirmishType::instance == 4) { + int const nameY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + int const nameX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Crusader Extreme Trail" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 23), + nameX, nameY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 16, FALSE, 0); + int const descriptionY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 440; + int const descriptionX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + // "Fight through 20 linked Extreme games" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_SKIRMISH_CHOOSE2, 24), + descriptionX, descriptionY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, + FALSE, 0); + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoInitial.cpp new file mode 100644 index 0000000000..c16c5bf280 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/SelectCrusade/MenuView_SelectCrusade_DoInitial.cpp @@ -0,0 +1,35 @@ +#include "../SelectCrusade.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_HighlightedSkirmishType.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x0042BB90 + void SelectCrusade::MenuView_SelectCrusade_DoInitial() + { + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + DAT_HighlightedSkirmishType::instance = 0; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp new file mode 100644 index 0000000000..004823253a --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/SingleplayerMapChoice/MenuView_SingleplayerMapChoice_Prepare.cpp @@ -0,0 +1,94 @@ +#include "../SingleplayerMapChoice.func.hpp" + +#include "OpenSHC/Map/TileMapState.func.hpp" +#include "OpenSHC/OS.func.hpp" +#include "OpenSHC/Text/UserTextHandler.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuItems/SinglePlayerMapChoice.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Game/GameMode.hpp" +#include "OpenSHC/Game/GameMode2.hpp" +#include "OpenSHC/Text/TextArrayIndexType.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_00b960dc.hpp" +#include "OpenSHC/Globals/DAT_ButtonBackgroundBlendStrength.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_MapMissionType.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_MinimapViewState.hpp" +#include "OpenSHC/Globals/DAT_SH1_SiegeAdvancedMode.hpp" +#include "OpenSHC/Globals/DAT_SiegeRemainingPoints.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_TileMapState.hpp" +#include "OpenSHC/Globals/DAT_UserTextHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/DWORD_00b95b1c.hpp" +#include "OpenSHC/Globals/INT_00b95b64.hpp" +#include "OpenSHC/Globals/Menu_SingleplayerMapChoice.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00448D40 + void SingleplayerMapChoice::MenuView_SingleplayerMapChoice_Prepare() + { + Menu_SingleplayerMapChoice::instance.thousand = 0; + DAT_MenuTextInputState::instance.lastListClickTime = 0; + DAT_MenuTextInputState::instance.lastClickedListIndex = -1; + DAT_GameSynchronyState::instance.currentGameMode = Game::GM_SOLITARY; + DAT_GameCore::instance.gameMode_2 = Game::GM_BUILDERUnk; + if (INT_00b95b64::instance != 0) { + DAT_MenuTextInputState::instance.fileListSortOrder = 0; + DAT_GameSynchronyState::instance.isHost = TRUE; + DAT_GameSynchronyState::instance.currentPlayerSlotID = 1; + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_GameSynchronyState::instance.skirmishRelated1 = -1; + DAT_GameSynchronyState::instance.DAT_MapSelectionRelativeSelected = -1; + DAT_GameSynchronyState::instance.mapName[0] = '\0'; + DAT_GameCore::instance.mapDescription[0] = '\0'; + MACRO_CALL(OS_Func::_memset)(DAT_MinimapViewState::instance.loadedMiniMap, 0, + sizeof(DAT_MinimapViewState::instance.loadedMiniMap)); + DAT_GameSynchronyState::instance.reparseMaps = TRUE; + DAT_SH1_SiegeAdvancedMode::instance = 0; + DAT_SiegeRemainingPoints::instance = 0; + } else { + MACRO_CALL( + UI::MenuItems::SinglePlayerMapChoice_Func::MenuItemActionHandler_SingleplayerMapChoice_MapTable)( + DAT_GameSynchronyState::instance.DAT_MapSelectionRelativeSelected); + DAT_GameSynchronyState::instance.skirmishRelated1 = 1; + } + DAT_ButtonBackgroundBlendStrength::instance = 32; + DAT_00b960dc::instance = -3; + DWORD_00b95b1c::instance = timeGetTime(); + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + if ((int)DAT_MapMissionType::instance < 2) { + // "frontend_economics2.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_frontend_economics2_tgx_005a203c); + } else { + // "frontend_combat2.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_frontend_combat2_tgx_005a2010); + } + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL_MEMBER(Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( + Text::TAIT_UNKNOWN); + MACRO_CALL_MEMBER(Map::TileMapState_Func::setupAllMapSections, DAT_TileMapState::ptr)(); + INT_00b95b64::instance = 0; + DAT_GameCore::instance.activeMenuTab.tabType = DAT_MapMissionType::instance != 0; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_DoInitial.cpp new file mode 100644 index 0000000000..eb975da1ed --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Unknown26/MenuView_Unknown26_CampaignRelatedUnk_DoInitial.cpp @@ -0,0 +1,30 @@ +#include "../Unknown26.func.hpp" + +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004E1E30 + void Unknown26::MenuView_Unknown26_CampaignRelatedUnk_DoInitial() + { + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL(UI::Helpers_Func::ColorEntireScreen)(COL_BLACK::instance.shortValue); + MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp new file mode 100644 index 0000000000..fee8a53434 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Unknown33/MenuView_Unknown33_DoEveryFrame.cpp @@ -0,0 +1,64 @@ +#include "../Unknown33.func.hpp" + +#include "OpenSHC/Game/GameCore.func.hpp" +#include "OpenSHC/Game/GameStateStructures.func.hpp" +#include "OpenSHC/Synchrony.func.hpp" +#include "OpenSHC/Synchrony/GameSynchronyState.func.hpp" +#include "OpenSHC/Commands/GameCommandType.hpp" +#include "OpenSHC/UI/Enums/BuildingsAndStatusMenuTabType.hpp" +#include "OpenSHC/UI/Enums/MenuViewType.hpp" + +#include "OpenSHC/Globals/DAT_00b960f8.hpp" +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_GameState.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_UIDragDropDefinedData.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b960f0.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x0042C090 + void Unknown33::MenuView_Unknown33_DoEveryFrame() + { + if (!MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::checkAllPlayersReadyAndCleanupSlots, + DAT_GameSynchronyState::ptr)()) { + return; + } + if (DAT_GameSynchronyState::instance.isHost) { + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_HOST_SHARE_LOBBY_STATE); + DAT_GameSynchronyState::instance.DAT_GameCommandParam0 = 0; + MACRO_CALL_MEMBER(OpenSHC::Synchrony::GameSynchronyState_Func::queueCommand, + DAT_GameSynchronyState::ptr)(OpenSHC::Commands::GCT_TRIGGER_LOBBY_PLAYER_INFORMATION_REFRESH); + } + for (int playerID = 1; playerID < countof(DAT_GameSynchronyState::instance.currentPlayerFullIDArray); + ++playerID) { + if (DAT_GameSynchronyState::instance.currentPlayerFullIDArray[playerID] == -1 + && (DAT_GameCore::instance.mapU4Int0 == 0 + || playerID != DAT_GameState::instance.mapAndTime.somePlayerID) + && DAT_GameSynchronyState::instance.currentAIArray[playerID] == 0) { + MACRO_CALL_MEMBER( + OpenSHC::Game::GameStateStructures_Func::destroyPlayerCompletely, DAT_GameState::ptr)(playerID); + } + } + MACRO_CALL(OpenSHC::Synchrony_Func::SetAIPlayerNickNames)(); + DAT_GameSynchronyState::instance.timeSkirmishGameStart = timeGetTime(); + DAT_GameCore::instance.buildmenuMenuTabToSwitchTo.tabType = OpenSHC::UI::Enums::BASMTT_HUNTERSHUT; + MACRO_CALL_MEMBER(OpenSHC::Game::GameCore_Func::switchToMenuView, DAT_GameCore::ptr)( + OpenSHC::UI::Enums::MVT_BUILD_MENU, 0); + DAT_GameSynchronyState::instance.DAT_TwoIfNotHost = 0; + for (int i = 0; i < countof(DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue); ++i) { + DAT_GameSynchronyState::instance.DAT_PlayerSlotArraySomeValue[i] = 0; + } + DAT_00b960f8::instance = 0; + INT_00b960f0::instance = 0; + DAT_UIDragDropDefinedData::instance.MenuView_TriggerInitial = TRUE; + DAT_WindowAndDirectDraw::instance.unk_resetViewportRelated = 1; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp new file mode 100644 index 0000000000..b2bbef460c --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame.cpp @@ -0,0 +1,35 @@ +#include "../Unknown61ReturnToSkrimishMenuUnk.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004272C0 + void Unknown61ReturnToSkrimishMenuUnk::MenuView_Unknown61ReturnToSkrimishMenuUnk_DoEveryFrame() + { + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->yPosition = borderHeight; + menu->xPosition = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp new file mode 100644 index 0000000000..60a9995b68 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial.cpp @@ -0,0 +1,43 @@ +#include "../Unknown61ReturnToSkrimishMenuUnk.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00427240 + void Unknown61ReturnToSkrimishMenuUnk::MenuView_Unknown61ReturnToSkrimishMenuUnk_DoInitial() + { + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp new file mode 100644 index 0000000000..a8bde1e4cb --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/Unknown61ReturnToSkrimishMenuUnk/MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare.cpp @@ -0,0 +1,51 @@ +#include "../Unknown61ReturnToSkrimishMenuUnk.func.hpp" + +#include "OpenSHC/Game/Skirmish/SkirmishLobbySetupStructure.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/MenuItems/SelectCrusade.func.hpp" +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/SEC_SkirmishLobbySetupStructure.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004409C0 + void Unknown61ReturnToSkrimishMenuUnk::MenuView_Unknown61ReturnToSkrimishMenuUnk_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_combat3.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_frontend_combat3_tgx_005a2134); + MACRO_CALL(UI::Helpers_Func::LoadTGX_shc_back)(); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + // 2 is the Custom Game button + MACRO_CALL(UI::MenuItems::SelectCrusade_Func::MenuItemActionHandler_SelectCrusade_Main)(2); + MACRO_CALL_MEMBER(Game::Skirmish::SkirmishLobbySetupStructure_Func::restoreSkirmishLobbySetup, + SEC_SkirmishLobbySetupStructure::ptr)(); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp new file mode 100644 index 0000000000..f0210141ae --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedCreateSiege/MenuView_UnusedCreateSiege_Prepare.cpp @@ -0,0 +1,34 @@ +#include "../UnusedCreateSiege.func.hpp" + +#include "OpenSHC/Text/UserTextHandler.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Text/TextArrayIndexType.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UserTextHandlerState.hpp" +#include "OpenSHC/Globals/INT_00b960e4.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00430690 + void UnusedCreateSiege::MenuView_UnusedCreateSiege_Prepare() + { + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + MACRO_CALL_MEMBER(OpenSHC::Text::UserTextHandler_Func::resetToTextIndex, DAT_UserTextHandlerState::ptr)( + OpenSHC::Text::TAIT_NINE__FILTER_B); + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_builder2.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_frontend_builder2_tgx_005a206c); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + INT_00b960e4::instance = FALSE; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp new file mode 100644 index 0000000000..34054bc480 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedDemoBuyItScreen/MenuView_UnusedDemoBuyItScreen_Prepare.cpp @@ -0,0 +1,45 @@ +#include "../UnusedDemoBuyItScreen.func.hpp" + +#include "OpenSHC/Audio/MSS/SoundSystem.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Rendering/ScreenResolutionEnum.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_GameSynchronyState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_SoundSystemState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b95b34.hpp" +#include "OpenSHC/Globals/INT_00b960e0.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00426570 + void UnusedDemoBuyItScreen::MenuView_UnusedDemoBuyItScreen_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "demo buy it screen.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_demo_buy_it_screen_tgx_005a20f8); + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, + 0, DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + INT_00b95b34::instance = timeGetTime(); + INT_00b960e0::instance = 0; + if (DAT_WindowAndDirectDraw::instance.currentGameResolution == OpenSHC::Rendering::SRE_800x600) { + INT_00b960e0::instance = 24; + } + MACRO_CALL_MEMBER(OpenSHC::Audio::MSS::SoundSystem_Func::shutdownSoundSystem, DAT_SoundSystemState::ptr)(); + if (DAT_GameSynchronyState::instance.openOnClose) { + DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp new file mode 100644 index 0000000000..cc3d2fd80b --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_DoInitial.cpp @@ -0,0 +1,45 @@ +#include "../UnusedEconomicGametypeSelect.func.hpp" + +#include "OpenSHC/UI/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00b95f68.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00425A40 + void UnusedEconomicGametypeSelect::MenuView_UnusedEconomicGametypeSelect_DoInitial() + { + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + MACRO_CALL(UI::Rendering_Func::DrawOuterMenuBorder)(); + MACRO_CALL_MEMBER( + UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + INT_00b95f68::instance = FALSE; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp new file mode 100644 index 0000000000..08add0b236 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicGametypeSelect/MenuView_UnusedEconomicGametypeSelect_Prepare.cpp @@ -0,0 +1,39 @@ +#include "../UnusedEconomicGametypeSelect.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_UIButtonDefinedData.hpp" +#include "OpenSHC/Globals/INT_00b95abc.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004259D0 + void UnusedEconomicGametypeSelect::MenuView_UnusedEconomicGametypeSelect_Prepare() + { + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_economics.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_frontend_economics_tgx_005a2054); + // "frontend_economics2.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_frontend_economics2_tgx_005a203c); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + DWORD const now = timeGetTime(); + // this menu's three buttons start their animation 1600 ms apart + for (int i = 0; i < 3; ++i) { + DAT_UIButtonDefinedData::instance.ButtonGmDataArray[360 + i].stateTransitionTimeBaseUnk_0x18 + = now - (3 - i) * 1600; + } + INT_00b95abc::instance = -1; + DAT_GameCore::instance.isTimeHalted2 = 0; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp new file mode 100644 index 0000000000..ea6d6aeee5 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedEconomicMissionSelect/MenuView_UnusedEconomicMissionSelect_Prepare.cpp @@ -0,0 +1,32 @@ +#include "../UnusedEconomicMissionSelect.func.hpp" + +#include "OpenSHC/UI/Helpers.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuTextInputState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x00426C50 + void UnusedEconomicMissionSelect::MenuView_UnusedEconomicMissionSelect_Prepare() + { + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "frontend_economics2.tgx" + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::loadGfxFile, + DAT_TextureRenderCoreObject::ptr)(s_frontend_economics2_tgx_005a203c); + MACRO_CALL(OpenSHC::UI::Helpers_Func::LoadTGX_shc_back)(); + DAT_GameCore::instance.section1066 = 0; + DAT_MenuTextInputState::instance.lastListClickTime = 0; + DAT_GameCore::instance.missionNumber1to20 = 33; + DAT_MenuTextInputState::instance.lastClickedListIndex = -1; + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp new file mode 100644 index 0000000000..ebaf34cba6 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoEveryFrame.cpp @@ -0,0 +1,47 @@ +#include "../UnusedExtremeAd.func.hpp" + +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/UI/Credits.func.hpp" +#include "OpenSHC/UI/Helpers.func.hpp" + +#include "OpenSHC/Globals/DAT_00ed278c.hpp" +#include "OpenSHC/Globals/DAT_MouseState.hpp" +#include "OpenSHC/Globals/DAT_UnknownBinkCount.hpp" +#include "OpenSHC/Globals/DAT_UnknownBinkIndex.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" +#include "OpenSHC/Globals/INT_00ed3140.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004E1AA0 + void UnusedExtremeAd::MenuView_UnusedExtremeAd_DoEveryFrame() + { + if (!MACRO_CALL(UI::Helpers_Func::TicksSinceCounterStart)()) { + return; + } + if (DAT_MouseState::instance.rightClickStop) { + MACRO_CALL(UI::Credits_Func::StopCreditsPlaybackAndSounds)(); + } + if (DAT_MouseState::instance.leftClickStart + && MACRO_CALL(UI::Helpers_Func::FindCampaignMapHotspotAtMouse)() == 1) { + MACRO_CALL(UI::Credits_Func::EndCreditsSegmentAndAdvanceToNext)(); + ++DAT_00ed278c::instance; + if (DAT_00ed278c::instance == 3) { + DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; + } + } + MACRO_CALL(Rendering_Func::ProcessCreditsScriptCommands)(); + if (DAT_UnknownBinkIndex::instance < DAT_UnknownBinkCount::instance) { + MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); + } + ++INT_00ed3140::instance; + if (DAT_UnknownBinkIndex::instance >= DAT_UnknownBinkCount::instance) { + DAT_WindowAndDirectDraw::instance.postWindowCloseMessage = 1; + } + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoInitial.cpp new file mode 100644 index 0000000000..4ae30d24bd --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedExtremeAd/MenuView_UnusedExtremeAd_DoInitial.cpp @@ -0,0 +1,33 @@ +#include "../UnusedExtremeAd.func.hpp" + +#include "OpenSHC/Rendering.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x004E1A50 + void UnusedExtremeAd::MenuView_UnusedExtremeAd_DoInitial() + { + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL(Rendering_Func::RenderActiveCreditsElements)(); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp new file mode 100644 index 0000000000..d50a7de5a5 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_DoInitial.cpp @@ -0,0 +1,58 @@ +#include "../UnusedOldTitleMenu.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/COL_BLACK.hpp" +#include "OpenSHC/Globals/COL_WHITE.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x0042DD00 + void UnusedOldTitleMenu::MenuView_UnusedOldTitleMenu_DoInitial() + { + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)(0, 0, + DAT_WindowAndDirectDraw::instance.resolutionX, DAT_WindowAndDirectDraw::instance.resolutionY, + COL_BLACK::instance.shortValue); + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + menu->xPosition = borderWidth; + menu->yPosition = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + MACRO_CALL_MEMBER( + UI::Rendering::PencilRenderCore_Func::drawPixelPattern4x4OverWholeScreen, DAT_PencilRenderCore::ptr)(); + int const top = (DAT_WindowAndDirectDraw::instance.resolutionY - 400) / 2; + int const left = (DAT_WindowAndDirectDraw::instance.resolutionX - 600) / 2; + MACRO_CALL_MEMBER(UI::Rendering::PencilRenderCore_Func::drawColorBox, DAT_PencilRenderCore::ptr)( + left, top, left + 600, top + 400, COL_WHITE::instance.shortValue); + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::renderLoadedGfx, DAT_TextureRenderCoreObject::ptr)( + 0, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 100, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100); + // "FireFly's" + MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + s_FireFly_s_005a22c4, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 210, Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_0080FF, 15, FALSE, 0); + // "Crusader" + MACRO_CALL_MEMBER(Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + s_Crusader_005a22b8, DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 248, Text::TTA_LEFT, + OpenSHC::Rendering::Colors::COL_000000, 17, FALSE, 0); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp new file mode 100644 index 0000000000..7c6566e236 --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedOldTitleMenu/MenuView_UnusedOldTitleMenu_Prepare.cpp @@ -0,0 +1,34 @@ +#include "../UnusedOldTitleMenu.func.hpp" + +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/string-literals.hpp" + +#include "OpenSHC/Globals/DAT_GameCore.hpp" +#include "OpenSHC/Globals/DAT_MenuHandlerState.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x0042DCB0 + void UnusedOldTitleMenu::MenuView_UnusedOldTitleMenu_Prepare() + { + int const borderHeight = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight; + int const borderWidth = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth; + Menu* const menu = DAT_MenuHandlerState::instance.currentMenu; + DAT_GameCore::instance.currentlyInGameUnk_0xa4 = FALSE; + menu->yPosition = borderHeight; + menu->xPosition = borderWidth; + DAT_MenuHandlerState::instance.y = borderHeight; + DAT_MenuHandlerState::instance.x = borderWidth; + DAT_TextureRenderCoreObject::instance.totalLoadedGfx = 0; + // "gm_fly.tgx" + MACRO_CALL_MEMBER(UI::Rendering::TextureRenderCore_Func::loadGfxFile, DAT_TextureRenderCoreObject::ptr)( + s_gm_fly_tgx_005a2110); + } + + } +} +} diff --git a/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp b/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp new file mode 100644 index 0000000000..fe819c2f9b --- /dev/null +++ b/src/OpenSHC/UI/MenuViews/UnusedSelectRandomNumberOfEnemies/MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame.cpp @@ -0,0 +1,54 @@ +#include "../UnusedSelectRandomNumberOfEnemies.func.hpp" + +#include "OpenSHC/Text/TextManager.func.hpp" +#include "OpenSHC/UI/Rendering/PencilRenderCore.func.hpp" +#include "OpenSHC/UI/Rendering/TextureRenderCore.func.hpp" +#include "OpenSHC/DE/SHCDE/eTextSections.hpp" +#include "OpenSHC/Rendering/Colors/ColorsEnum.hpp" +#include "OpenSHC/Rendering/Enums/RenderTarget.hpp" +#include "OpenSHC/Text/TextAlignment.hpp" + +#include "OpenSHC/Globals/DAT_PencilRenderCore.hpp" +#include "OpenSHC/Globals/DAT_TextManagerObject.hpp" +#include "OpenSHC/Globals/DAT_TextureRenderCoreObject.hpp" +#include "OpenSHC/Globals/DAT_WindowAndDirectDraw.hpp" + +namespace OpenSHC { +namespace UI { + namespace MenuViews { + + // FUNCTION: STRONGHOLDCRUSADER 0x0042B960 + void UnusedSelectRandomNumberOfEnemies::MenuView_UnusedSelectRandomNumberOfEnemies_DoEveryFrame() + { + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::TextureRenderCore_Func::drawGfxOnFlaggedSurface, + DAT_TextureRenderCoreObject::ptr)(0, + (DAT_WindowAndDirectDraw::instance.resolutionX + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].width) + / 2, + (DAT_WindowAndDirectDraw::instance.resolutionY + - DAT_TextureRenderCoreObject::instance.loadedGfxArray[0].height) + / 2); + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_SCREEN_MENU; + MACRO_CALL_MEMBER(OpenSHC::UI::Rendering::PencilRenderCore_Func::drawBorderedBoxWithBlendedBackground, + DAT_PencilRenderCore::ptr)(DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 100, + DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 100, 600, 400); + int const titleY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 200; + int const titleX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 400; + DAT_TextureRenderCoreObject::instance.drawBufferChoiceValue = OpenSHC::Rendering::Enums::RT_MAP_GAME; + // "How many opponents can you handle!" + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderTextToScreen, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_NEW_TEXT, 1), + titleX, titleY, OpenSHC::Text::TTA_CENTER, OpenSHC::Rendering::Colors::COL_CCFAFF, 17, FALSE, 0); + int const textY = DAT_WindowAndDirectDraw::instance.mainMenuBorderHeight + 400; + int const textX = DAT_WindowAndDirectDraw::instance.mainMenuBorderWidth + 200; + // "This will create some random opponents for you. You can still change opponent types afterwards." + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::renderMultilineText5Unk, DAT_TextManagerObject::ptr)( + MACRO_CALL_MEMBER(OpenSHC::Text::TextManager_Func::getTextStringInGroupAtOffset, + DAT_TextManagerObject::ptr)(OpenSHC::DE::SHCDE::TEXT_NEW_TEXT, 2), + textX, textY, 400, OpenSHC::Rendering::Colors::COL_CCFAFF, 18, 0); + } + + } +} +} diff --git a/status/addresses-SHC-3BB0A8C1.txt b/status/addresses-SHC-3BB0A8C1.txt index ed989c9a21..72e0709061 100644 --- a/status/addresses-SHC-3BB0A8C1.txt +++ b/status/addresses-SHC-3BB0A8C1.txt @@ -6661,7 +6661,7 @@ SHC_3BB0A8C1_0x004246E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424700 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00424720 | 0.0% | Pending +SHC_3BB0A8C1_0x00424720 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424770 | 100.0% | Reimplemented @@ -6669,9 +6669,9 @@ SHC_3BB0A8C1_0x004247A0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424990 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00424A50 | 0.0% | Pending +SHC_3BB0A8C1_0x00424A50 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00424AD0 | 0.0% | Pending +SHC_3BB0A8C1_0x00424AD0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424B10 | 100.0% | Reimplemented @@ -6679,9 +6679,9 @@ SHC_3BB0A8C1_0x00424BD0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424BE0 | 0.0% | Pending -SHC_3BB0A8C1_0x00424C40 | 0.0% | Pending +SHC_3BB0A8C1_0x00424C40 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00424CD0 | 0.0% | Pending +SHC_3BB0A8C1_0x00424CD0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00424DA0 | 100.0% | Reimplemented @@ -6707,9 +6707,9 @@ SHC_3BB0A8C1_0x004254EC | 0.0% | Pending SHC_3BB0A8C1_0x004254F0 | 0.0% | Pending -SHC_3BB0A8C1_0x00425500 | 0.0% | Pending +SHC_3BB0A8C1_0x00425500 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00425580 | 0.0% | Pending +SHC_3BB0A8C1_0x00425580 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004255D0 | 0.0% | Pending @@ -6725,9 +6725,9 @@ SHC_3BB0A8C1_0x004259C8 | 0.0% | Pending SHC_3BB0A8C1_0x004259CC | 0.0% | Pending -SHC_3BB0A8C1_0x004259D0 | 0.0% | Pending +SHC_3BB0A8C1_0x004259D0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00425A40 | 0.0% | Pending +SHC_3BB0A8C1_0x00425A40 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00425AD0 | 100.0% | Reimplemented @@ -6751,21 +6751,21 @@ SHC_3BB0A8C1_0x00425E90 | 0.0% | Pending SHC_3BB0A8C1_0x00425E94 | 0.0% | Pending -SHC_3BB0A8C1_0x00425EA0 | 0.0% | Pending +SHC_3BB0A8C1_0x00425EA0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00425F60 | 0.0% | Pending +SHC_3BB0A8C1_0x00425F60 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00425FF0 | 0.0% | Pending +SHC_3BB0A8C1_0x00425FF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00426060 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004261E0 | 0.0% | Pending -SHC_3BB0A8C1_0x004262B0 | 0.0% | Pending +SHC_3BB0A8C1_0x004262B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00426340 | 0.0% | Pending -SHC_3BB0A8C1_0x00426570 | 0.0% | Pending +SHC_3BB0A8C1_0x00426570 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00426600 | 0.0% | Pending @@ -6777,15 +6777,15 @@ SHC_3BB0A8C1_0x00426750 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004267F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00426830 | 0.0% | Pending +SHC_3BB0A8C1_0x00426830 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004268C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004268C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004269E0 | 0.0% | Pending SHC_3BB0A8C1_0x00426B80 | 0.0% | Pending -SHC_3BB0A8C1_0x00426C50 | 0.0% | Pending +SHC_3BB0A8C1_0x00426C50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00426CA0 | 100.0% | Reimplemented @@ -6799,7 +6799,7 @@ SHC_3BB0A8C1_0x00426FB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00427080 | 0.0% | Pending -SHC_3BB0A8C1_0x00427110 | 0.0% | Pending +SHC_3BB0A8C1_0x00427110 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00427180 | 100.0% | Reimplemented @@ -6807,15 +6807,15 @@ SHC_3BB0A8C1_0x004271E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00427210 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00427240 | 0.0% | Pending +SHC_3BB0A8C1_0x00427240 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004272C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004272C0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x00427320 | 0.0% | Pending +SHC_3BB0A8C1_0x00427320 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004274F0 | 0.0% | Pending -SHC_3BB0A8C1_0x004276F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004276F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00427740 | 0.0% | Pending @@ -7439,15 +7439,15 @@ SHC_3BB0A8C1_0x0042B8E0 | 0.0% | Pending SHC_3BB0A8C1_0x0042B8F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0042B960 | 0.0% | Pending +SHC_3BB0A8C1_0x0042B960 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042BA50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042BB70 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0042BB90 | 0.0% | Pending +SHC_3BB0A8C1_0x0042BB90 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0042BBF0 | 0.0% | Pending +SHC_3BB0A8C1_0x0042BBF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042BF00 | 100.0% | Reimplemented @@ -7455,7 +7455,7 @@ SHC_3BB0A8C1_0x0042BFC0 | 0.0% | Pending SHC_3BB0A8C1_0x0042C060 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0042C090 | 0.0% | Pending +SHC_3BB0A8C1_0x0042C090 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042C190 | 0.0% | Pending @@ -8255,9 +8255,9 @@ SHC_3BB0A8C1_0x0042DBB0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042DC60 | 0.0% | Pending -SHC_3BB0A8C1_0x0042DCB0 | 0.0% | Pending +SHC_3BB0A8C1_0x0042DCB0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x0042DD00 | 0.0% | Pending +SHC_3BB0A8C1_0x0042DD00 | 100.0% | Reimplemented SHC_3BB0A8C1_0x0042DE20 | 100.0% | Reimplemented @@ -9625,7 +9625,7 @@ SHC_3BB0A8C1_0x004300F3 | 0.0% | Pending SHC_3BB0A8C1_0x004300F4 | 0.0% | Pending -SHC_3BB0A8C1_0x00430100 | 0.0% | Pending +SHC_3BB0A8C1_0x00430100 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00430150 | 100.0% | Reimplemented @@ -10115,7 +10115,7 @@ SHC_3BB0A8C1_0x00430685 | 0.0% | Pending SHC_3BB0A8C1_0x00430686 | 0.0% | Pending -SHC_3BB0A8C1_0x00430690 | 0.0% | Pending +SHC_3BB0A8C1_0x00430690 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004306D0 | 0.0% | Pending @@ -10539,7 +10539,7 @@ SHC_3BB0A8C1_0x00430CC0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00430CE0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004313C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004313C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00431460 | 100.0% | Reimplemented @@ -11077,11 +11077,11 @@ SHC_3BB0A8C1_0x0043198A | 0.0% | Pending SHC_3BB0A8C1_0x00431990 | 0.0% | Pending -SHC_3BB0A8C1_0x00431A90 | 0.0% | Pending +SHC_3BB0A8C1_0x00431A90 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00431B60 | 0.0% | Pending -SHC_3BB0A8C1_0x00433030 | 0.0% | Pending +SHC_3BB0A8C1_0x00433030 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00433200 | 100.0% | Reimplemented @@ -13645,7 +13645,7 @@ SHC_3BB0A8C1_0x00440560 | 0.0% | Pending SHC_3BB0A8C1_0x00440600 | 0.0% | Pending -SHC_3BB0A8C1_0x004406F0 | 0.0% | Pending +SHC_3BB0A8C1_0x004406F0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00440770 | 0.0% | Pending @@ -13659,7 +13659,7 @@ SHC_3BB0A8C1_0x004409B0 | 0.0% | Pending SHC_3BB0A8C1_0x004409B4 | 0.0% | Pending -SHC_3BB0A8C1_0x004409C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004409C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00440A50 | 0.0% | Pending @@ -16379,7 +16379,7 @@ SHC_3BB0A8C1_0x004482F0 | 0.0% | Pending SHC_3BB0A8C1_0x004489F0 | 0.0% | Pending -SHC_3BB0A8C1_0x00448D40 | 0.0% | Pending +SHC_3BB0A8C1_0x00448D40 | 100.0% | Reimplemented SHC_3BB0A8C1_0x00448E90 | 0.0% | Pending @@ -36015,7 +36015,7 @@ SHC_3BB0A8C1_0x004D8DF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D8EC0 | 0.0% | Pending -SHC_3BB0A8C1_0x004D91D0 | 0.0% | Pending +SHC_3BB0A8C1_0x004D91D0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004D9230 | 0.0% | Pending @@ -36201,7 +36201,7 @@ SHC_3BB0A8C1_0x004DB490 | 100.0% | Reimplemented, mismatches in float constants SHC_3BB0A8C1_0x004DB4F0 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004DB5C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004DB5C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DB600 | 0.0% | Pending @@ -36209,7 +36209,7 @@ SHC_3BB0A8C1_0x004DB7B0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DB8B0 | 0.0% | Pending -SHC_3BB0A8C1_0x004DBAF0 | 0.0% | Pending +SHC_3BB0A8C1_0x004DBAF0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DBBA4 | 0.0% | Pending @@ -36261,21 +36261,21 @@ SHC_3BB0A8C1_0x004DCC70 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DCC90 | 0.0% | Pending -SHC_3BB0A8C1_0x004DD0C0 | 0.0% | Pending +SHC_3BB0A8C1_0x004DD0C0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DD100 | 0.0% | Pending -SHC_3BB0A8C1_0x004DD300 | 0.0% | Pending +SHC_3BB0A8C1_0x004DD300 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DD350 | 0.0% | Pending -SHC_3BB0A8C1_0x004DD750 | 0.0% | Pending +SHC_3BB0A8C1_0x004DD750 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DD7B0 | 0.0% | Pending SHC_3BB0A8C1_0x004DE300 | 0.0% | Pending -SHC_3BB0A8C1_0x004DF2E0 | 0.0% | Pending +SHC_3BB0A8C1_0x004DF2E0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004DFB90 | 0.0% | Pending @@ -36377,17 +36377,17 @@ SHC_3BB0A8C1_0x004E1810 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E1A20 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004E1A50 | 0.0% | Pending +SHC_3BB0A8C1_0x004E1A50 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004E1AA0 | 0.0% | Pending +SHC_3BB0A8C1_0x004E1AA0 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E1B30 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004E1E30 | 0.0% | Pending +SHC_3BB0A8C1_0x004E1E30 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E1E70 | 100.0% | Reimplemented -SHC_3BB0A8C1_0x004E1F50 | 0.0% | Pending +SHC_3BB0A8C1_0x004E1F50 | 100.0% | Reimplemented SHC_3BB0A8C1_0x004E1FA0 | 0.0% | Pending