Skip to content

Instantly share code, notes, and snippets.

@Ryan-rsm-McKenzie
Created June 7, 2020 02:51
Show Gist options
  • Save Ryan-rsm-McKenzie/a23f980992519a2415e58d9705ebb685 to your computer and use it in GitHub Desktop.
Save Ryan-rsm-McKenzie/a23f980992519a2415e58d9705ebb685 to your computer and use it in GitHub Desktop.
invoke level-up notification
auto task = SKSE::GetTaskInterface();
task->AddUITask([]() {
enum
{
QUEST_UPDATE,
SKILL_LEVEL_UPDATE,
PLAYER_LEVEL_UPDATE,
SHOUT_UPDATE
};
enum
{
kNotificationText,
kStatus,
kSoundID,
kObjectiveCount,
kNotificationType,
kLevel,
kStartPercent,
kEndPercent,
kDragonText
};
auto ui = RE::UI::GetSingleton();
auto hud = ui->GetMenu<RE::HUDMenu>();
auto view = hud ? hud->view : nullptr;
auto delegate = hud ? hud->fxDelegate : nullptr;
if (view && delegate) {
RE::FxResponseArgsEx<9> args;
args[kNotificationText] = "lorem ipsum dolem";
args[kStatus] = "";
args[kSoundID] = "";
args[kObjectiveCount] = 0;
args[kNotificationType] = SKILL_LEVEL_UPDATE;
args[kLevel] = 42;
args[kStartPercent] = 0.20;
args[kEndPercent] = 0.80;
args[kDragonText] = "";
delegate->Invoke(view.get(), "ShowNotification", args);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment