#include "MoreLightingOptionsModule.h"
#include "Buildables/FGBuildableWidgetSign.h"
#include "Patching/NativeHookManager.h"
class HFGBuildableWidgetSign
{
public:
static void Hook_GetAdjustedEmissiveValue(TCallScope<float(__cdecl*)(const AFGBuildableWidgetSign*, int32)>& scope, const AFGBuildableWidgetSign* self, int32 Level)
{
if (!self) {
return;
}
float BaseEmissiveValue = scope(self, Level);
float NewEmissiveValue = BaseEmissiveValue * 10.0f;
if (NewEmissiveValue >= 0.0f) {
scope.Override(NewEmissiveValue);
}
}
static void RegisterHooks()
{
SUBSCRIBE_UOBJECT_METHOD(AFGBuildableWidgetSign, GetAdjustedEmissiveValue, &HFGBuildableWidgetSign::Hook_GetAdjustedEmissiveValue);
}
};
// Startup Module for MoreLightingOptions
void FMoreLightingOptionsModule::StartupModule()
{
if (!WITH_EDITOR)
{
HFGBuildableWidgetSign::RegisterHooks();
}
}
void FMoreLightingOptionsModule::ShutdownModule()
{
}
IMPLEMENT_GAME_MODULE(FMoreLightingOptionsModule, MoreLightingOptions);
#include "MoreLightingOptionsModule.h"
#include "Buildables/FGBuildableWidgetSign.h"
#include "Patching/NativeHookManager.h"
class HFGBuildableWidgetSign
{
public:
static void Hook_GetAdjustedEmissiveValue(TCallScope<float(__cdecl*)(const AFGBuildableWidgetSign*, int32)>& scope, const AFGBuildableWidgetSign* self, int32 Level)
{
if (!self) {
return;
}
float BaseEmissiveValue = scope(self, Level);
float NewEmissiveValue = BaseEmissiveValue * 10.0f;
if (NewEmissiveValue >= 0.0f) {
scope.Override(NewEmissiveValue);
}
}
static void RegisterHooks()
{
SUBSCRIBE_UOBJECT_METHOD(AFGBuildableWidgetSign, GetAdjustedEmissiveValue, &HFGBuildableWidgetSign::Hook_GetAdjustedEmissiveValue);
}
};
// Startup Module for MoreLightingOptions
void FMoreLightingOptionsModule::StartupModule()
{
if (!WITH_EDITOR)
{
HFGBuildableWidgetSign::RegisterHooks();
}
}
void FMoreLightingOptionsModule::ShutdownModule()
{
}
IMPLEMENT_GAME_MODULE(FMoreLightingOptionsModule, MoreLightingOptions);