Skip to content

Commit

Permalink
chore: Cleaning.
Browse files Browse the repository at this point in the history
  • Loading branch information
FlenarnTemp committed Jul 13, 2024
1 parent 78d86fd commit 2d281e2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
27 changes: 13 additions & 14 deletions Plugin/src/Menus/DialogueMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace RE
if (UI::GetSingleton()->GetMenuOpen(menuString))
{
Scaleform::Ptr<RE::DialogueMenu> dialogueMenu = UI::GetSingleton()->GetMenu<RE::DialogueMenu>();
auto menuInputLayer = dialogueMenu.get()->inputLayer;
BSTSmartPointer<BSInputEnableLayer> menuInputLayer = dialogueMenu.get()->inputLayer;

BSInputEnableManager::GetSingleton()->EnableUserEvent(menuInputLayer->layerID, UEFlag::kWheelZoom, enabled, UserEvents::SENDER_ID::kMenu);
}
Expand All @@ -47,32 +47,30 @@ namespace RE
if (UI::GetSingleton()->GetMenuOpen(menuString))
{
Scaleform::Ptr<RE::DialogueMenu> dialogueMenu = UI::GetSingleton()->GetMenu<RE::DialogueMenu>();
auto menuInputLayer = dialogueMenu.get()->inputLayer;
BSTSmartPointer<BSInputEnableLayer> menuInputLayer = dialogueMenu.get()->inputLayer;

BSInputEnableManager::GetSingleton()->EnableOtherEvent(menuInputLayer->layerID, OEFlag::kFavorites, enabled, UserEvents::SENDER_ID::kMenu);
}
}
};

class SetPlayerControls : public Scaleform::GFx::FunctionHandler
class SetMovementEnabled : public Scaleform::GFx::FunctionHandler
{
public:
virtual void Call(const Params& a_params)
{
DEBUG("SetPlayerControls called.");
if (a_params.argCount < 3) return;
if (!a_params.args[0].IsInt()) return;
if (!a_params.args[1].IsInt()) return;
if (!a_params.args[2].IsBoolean()) return;

std::uint32_t type = a_params.args[0].GetInt();
std::uint32_t flags = a_params.args[1].GetInt();
boolean enabled = a_params.args[2].GetBoolean();
DEBUG("SetMovementEnabled called.");
if (a_params.argCount < 1) return;
if (!a_params.args[0].IsBoolean()) return;

bool enabled = a_params.args[0].GetBoolean();
BSFixedString menuString("DialogueMenu");
if (UI::GetSingleton()->GetMenuOpen(menuString))
{
// TODO
Scaleform::Ptr<RE::DialogueMenu> dialogueMenu = UI::GetSingleton()->GetMenu<RE::DialogueMenu>();
BSTSmartPointer<BSInputEnableLayer> menuInputLayer = dialogueMenu.get()->inputLayer;

BSInputEnableManager::GetSingleton()->EnableUserEvent(menuInputLayer->layerID, UEFlag::kMovement, enabled, UserEvents::SENDER_ID::kMenu);
}
}
};
Expand Down Expand Up @@ -420,11 +418,12 @@ namespace RE
{
Scaleform::GFx::Value bgsCodeObj;
a_view->asMovieRoot->GetVariable(&bgsCodeObj, "root.Menu_mc.BGSCodeObj");
RegisterFunction<SetPlayerControls>(&bgsCodeObj, a_view->asMovieRoot, "SetPlayerControls");

RegisterFunction<GetINISetting>(&bgsCodeObj, a_view->asMovieRoot, "GetINISetting");
RegisterFunction<GetModSetting>(&bgsCodeObj, a_view->asMovieRoot, "GetModSetting");

RegisterFunction<SetMovementEnabled>(&bgsCodeObj, a_view->asMovieRoot, "SetMovementEnabled");

RegisterFunction<GetSubtitlePosition_GFx>(&bgsCodeObj, a_view->asMovieRoot, "GetSubtitlePosition");
RegisterFunction<SetSubtitlePosition_GFx>(&bgsCodeObj, a_view->asMovieRoot, "SetSubtitlePosition");

Expand Down
2 changes: 0 additions & 2 deletions Plugin/src/Shared/NPCFileUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,15 +416,13 @@ namespace RE
result << " \"FacialBoneMorphIntensity\" : ";
result << std::setprecision(17) << (morphIntensity);
result << "," << std::endl;
;

return result.str();
}

std::string GenerateFacialBoneRegions(NPCFile npcFile)
{
std::vector<FacialBoneRegion> regions = npcFile.facialBoneRegionsA;

std::stringstream result;

if (regions.size() == 0)
Expand Down
3 changes: 0 additions & 3 deletions Plugin/src/Systems/Dialogue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,11 +602,9 @@ namespace RE
REL::Relocation<std::uintptr_t> startPlayerDialogue{ REL::ID(2196817), 0x652 };
REL::safe_write<uint8_t>(startPlayerDialogue.address(), std::span{ bytes });


// SwitchToPlayerCC - 2214898 ID + AD5 offset.
REL::Relocation<std::uintptr_t> switchToPlayerCC{ REL::ID(2214898), 0xAD5 };
REL::safe_write<uint8_t>(switchToPlayerCC.address() + 7, 0x1);

}
else
{
Expand All @@ -620,7 +618,6 @@ namespace RE
// SwitchToPlayerCC - 2214898 ID + AD5 offset.
REL::Relocation<std::uintptr_t> switchToPlayerCC{ REL::ID(2214898), 0xAD5 };
REL::safe_write<uint8_t>(switchToPlayerCC.address() + 7, 0x2);

}
}

Expand Down

0 comments on commit 2d281e2

Please sign in to comment.