Heroes of Hammerwatch II

Heroes of Hammerwatch II

Not enough ratings
1 life only
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
8.014 KB
5 Jun @ 3:18pm
1 Change Note ( view )

Subscribe to download
1 life only

Description
modifies:

scripts/GUI/MissionEndMenu.as


and makes it unable to return to character after death.


code line 715:

void OnFunc(Widget@ sender, const string &in name) override
{
auto parse = name.split(" ");
if (parse[0] == "close")
{
destroyPlayer();

if (m_disabledCounter > 0)
return;

cast<AGameplayGameMode>(g_gameMode).SavePlayerAndTown();

m_manager.CloseWindow(this);
}
else if (parse[0] == "set-tab")
{
if (parse[1] == "materials")
TabIncome();
else if (parse[1] == "stats")
TabStats();
}
}

void OnClose() override
{
destroyPlayer();
if (m_showCongratulation)
g_gameMode.ShowDialog("a", Resources::GetString(".menu.mission_end.new_game_plus"), Resources::GetString(".menu.ok"), this);
}

void destroyPlayer()
{
auto plr = GetLocalPlayerRecord();
uint m_deletingCharKey = plr.uniqueKey;
@plr = null;
auto gm = cast<BaseGameMode>(g_gameMode);
if (gm !is null)
gm.m_windowManager.AddWindowObject(PickCharacterWindow(gm.m_guiBuilder));
if (m_deletingCharKey != 0)
{
PersistentSaves::SetCharacter(m_deletingCharKey, null, "");
}
}
}