debug fps command (#3418)

This commit is contained in:
qndel 2021-11-07 12:23:31 +01:00 committed by GitHub
commit 53f89fb9d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View file

@ -725,6 +725,12 @@ std::string DebugCmdPlayerInfo(const string_view parameter)
player._pInvincible ? 1 : 0, player._pHitPoints);
}
std::string DebugCmdToggleFPS(const string_view parameter)
{
frameflag = !frameflag;
return "";
}
std::vector<DebugCmdItem> DebugCmdList = {
{ "help", "Prints help overview or help for a specific command.", "({command})", &DebugCmdHelp },
{ "give gold", "Fills the inventory with gold.", "", &DebugCmdGiveGoldCheat },
@ -755,6 +761,7 @@ std::vector<DebugCmdItem> DebugCmdList = {
{ "iteminfo", "Shows info of currently selected item.", "", &DebugCmdItemInfo },
{ "questinfo", "Shows info of quests.", "{id}", &DebugCmdQuestInfo },
{ "playerinfo", "Shows info of player.", "{playerid}", &DebugCmdPlayerInfo },
{ "fps", "Toggles displaying FPS", "", &DebugCmdToggleFPS },
};
} // namespace
@ -817,7 +824,8 @@ bool CheckDebugTextCommand(const string_view text)
parameter = text.substr(dbgCmd.text.length() + 1);
const auto result = dbgCmd.actionProc(parameter);
Log("DebugCmd: {} Result: {}", text, result);
InitDiabloMsg(result);
if (result != "")
InitDiabloMsg(result);
return true;
}