Skip to content

Commit

Permalink
Fix monster battle arena entrance.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyall committed Dec 4, 2024
1 parent f63c619 commit 25749a0
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@

#include "SDK/Engine_classes.hpp"
#include "SDK/UMG_classes.hpp"

#include "SDK/WB_Map2_Root_classes.hpp"
#include "SDK/WB_BattlePlayerStatus_Root_classes.hpp"
#include "SDK/WB_Battle_MonsterDamage2_classes.hpp"
#include "SDK/WB_BattleMonsterName_classes.hpp"
#include "SDK/WB_MBREncount_Root_classes.hpp"
#include "SDK/WB_MBREncount_Encount_WindowItem_classes.hpp"
#include "SDK/WB_MBREncount_Encount_Window_classes.hpp"

#include <spdlog/spdlog.h>
#include <spdlog/sinks/basic_file_sink.h>
Expand Down Expand Up @@ -357,6 +361,30 @@ void HUD()
return;
}

// Monster battle arena
if (obj->GetName().contains("WB_MBREncount_Root_C")) {
SDK::UWB_MBREncount_Root_C* mbrEncount = (SDK::UWB_MBREncount_Root_C*)obj;
SDK::UCanvasPanelSlot* encountSlot = (SDK::UCanvasPanelSlot*)mbrEncount->Encount->Slot;
SDK::UCanvasPanelSlot* renderSlot = (SDK::UCanvasPanelSlot*)mbrEncount->Render->Slot;

SDK::FMargin renderOffsets = renderSlot->GetOffsets();

if (fAspectRatio > fNativeAspect) {
if (renderOffsets.Left != 1080.00f * fAspectRatio) {
renderSlot->SetOffsets(SDK::FMargin(0.00f, 0.00f, 1080.00f * fAspectRatio, 1080.00f));
mbrEncount->Encount->SetRenderScale((SDK::FVector2D(1.00f * fAspectMultiplier, 1.00f)));
}
}
else if (fAspectRatio < fNativeAspect) {
if (renderOffsets.Top != 1920.00f / fAspectRatio) {
renderSlot->SetOffsets(SDK::FMargin(0.00f, 0.00f, 1920.00f, 1920.00f / fAspectRatio));
mbrEncount->Encount->SetRenderScale((SDK::FVector2D(1.00f, 1.00f / fAspectMultiplier)));
}
}

return;
}

// Span HUD
if (bSpanHUD) {
if (obj->GetName().contains("WB_BattleUnit_Root_C")|| obj->GetName().contains("WB_BattleTop_Root_C") || obj->GetName().contains("WB_Field_Top_Root_C") || obj->GetName().contains("WB_MiniMapMenu_Root_C") || obj->GetName().contains("WB_TownName_Root_C") || obj->GetName().contains("WB_FacilityShop_Root_C"))
Expand Down

0 comments on commit 25749a0

Please sign in to comment.