Added an INI option toggling hero menu autoscaling
This commit is contained in:
parent
96f0e89d72
commit
e3b11ce1ac
@ -5,3 +5,4 @@ AchievementFix = true
|
||||
VideoInterruptPatch = true
|
||||
ForceBorderless = true
|
||||
AttachLightHitEffectCrashFix = true
|
||||
AutoScaleHeroMenu = true
|
||||
|
||||
@ -23,7 +23,8 @@ static std::map<std::string, bool> g_settings{
|
||||
{ "AchievementFix", true },
|
||||
{ "VideoInterruptPatch", true },
|
||||
{ "ForceBorderless", true },
|
||||
{ "AttachLightHitEffectCrashFix", true }
|
||||
{ "AttachLightHitEffectCrashFix", true },
|
||||
{ "AutoScaleHeroMenu", true }
|
||||
};
|
||||
|
||||
namespace {
|
||||
@ -191,14 +192,14 @@ SKSEPluginLoad(const LoadInterface* skse) {
|
||||
|
||||
GetPapyrusInterface()->Register(Papyrus::Bind);
|
||||
|
||||
LoadINI(&g_settings, "Data/SKSE/Plugins/EnderalSE.ini");
|
||||
|
||||
MainMenuPatch::Install();
|
||||
DialogueMenuPatch::Install();
|
||||
HeroMenuPatch::Install();
|
||||
HeroMenuPatch::Install(g_settings.at("AutoScaleHeroMenu"));
|
||||
TweenMenuPatch::Install();
|
||||
HUDMenuPatch::Install();
|
||||
|
||||
LoadINI(&g_settings, "Data/SKSE/Plugins/EnderalSE.ini");
|
||||
|
||||
if (g_settings.at("AchievementFix")) {
|
||||
logger::info("Patching achievements...");
|
||||
AchievementFix::Install();
|
||||
|
||||
@ -21,8 +21,14 @@ RE::BSEventNotifyControl HeroMenuPatch::ProcessEvent_Hook(RE::InputEvent** a_eve
|
||||
return _ProcessEvent(this, a_event, a_source);
|
||||
}
|
||||
|
||||
void HeroMenuPatch::Install()
|
||||
void HeroMenuPatch::Install(bool aAutoScaleHeroMenu)
|
||||
{
|
||||
HeroMenuPatch::bAutoScaleHeroMenu = aAutoScaleHeroMenu;
|
||||
|
||||
if (HeroMenuPatch::bAutoScaleHeroMenu) {
|
||||
logger::info("Hero menu autoscaling has been enabled.");
|
||||
}
|
||||
|
||||
// Patch MenuControls to close the menu
|
||||
REL::Relocation<std::uintptr_t> vTable(RE::VTABLE_MenuControls[0]);
|
||||
_ProcessEvent = vTable.write_vfunc(0x1, &HeroMenuPatch::ProcessEvent_Hook);
|
||||
@ -80,7 +86,7 @@ void HeroMenuPatch::FillMenuValues()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!REL::Module::IsVR()) {
|
||||
if (HeroMenuPatch::bAutoScaleHeroMenu && !REL::Module::IsVR()) {
|
||||
// Fit the movie into the screen (widescreen support)
|
||||
uiMovie->SetViewScaleMode(RE::BSScaleformManager::ScaleModeType::kShowAll);
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
class HeroMenuPatch : public RE::MenuControls
|
||||
{
|
||||
public:
|
||||
static void Install();
|
||||
static void Install(bool bAutoScaleHeroMenu = true);
|
||||
|
||||
static uint64_t OpenStats(uint32_t arg_1, uint32_t arg_2, uint32_t arg_3, uint32_t arg_4, uint32_t arg_5);
|
||||
|
||||
@ -19,4 +19,6 @@ public:
|
||||
|
||||
using ProcessEvent_t = decltype(static_cast<RE::BSEventNotifyControl (RE::MenuControls::*)(RE::InputEvent* const*, RE::BSTEventSource<RE::InputEvent*>*)>(&RE::MenuControls::ProcessEvent));
|
||||
static inline REL::Relocation<ProcessEvent_t> _ProcessEvent;
|
||||
|
||||
inline static bool bAutoScaleHeroMenu;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user