mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-20 10:52:41 +01:00
Codefix: incorrect naming of enum class members
This commit is contained in:
@@ -260,7 +260,7 @@ bool CrashLog::WriteScreenshot()
|
||||
void CrashLog::SendSurvey() const
|
||||
{
|
||||
if (_game_mode == GM_NORMAL) {
|
||||
_survey.Transmit(NetworkSurveyHandler::Reason::CRASH, true);
|
||||
_survey.Transmit(NetworkSurveyHandler::Reason::Crash, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ void ShowSelectGameWindow()
|
||||
static void AskExitGameCallback(Window *, bool confirmed)
|
||||
{
|
||||
if (confirmed) {
|
||||
_survey.Transmit(NetworkSurveyHandler::Reason::EXIT, true);
|
||||
_survey.Transmit(NetworkSurveyHandler::Reason::Exit, true);
|
||||
_exit_game = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2342,7 +2342,7 @@ struct SurveyResultTextfileWindow : public TextfileWindow {
|
||||
{
|
||||
this->ConstructWindow();
|
||||
|
||||
auto result = _survey.CreatePayload(NetworkSurveyHandler::Reason::PREVIEW, true);
|
||||
auto result = _survey.CreatePayload(NetworkSurveyHandler::Reason::Preview, true);
|
||||
this->LoadText(result);
|
||||
this->InvalidateData();
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
NetworkSurveyHandler _survey = {};
|
||||
|
||||
NLOHMANN_JSON_SERIALIZE_ENUM(NetworkSurveyHandler::Reason, {
|
||||
{NetworkSurveyHandler::Reason::PREVIEW, "preview"},
|
||||
{NetworkSurveyHandler::Reason::LEAVE, "leave"},
|
||||
{NetworkSurveyHandler::Reason::EXIT, "exit"},
|
||||
{NetworkSurveyHandler::Reason::CRASH, "crash"},
|
||||
{NetworkSurveyHandler::Reason::Preview, "preview"},
|
||||
{NetworkSurveyHandler::Reason::Leave, "leave"},
|
||||
{NetworkSurveyHandler::Reason::Exit, "exit"},
|
||||
{NetworkSurveyHandler::Reason::Crash, "crash"},
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,10 +25,10 @@ protected:
|
||||
|
||||
public:
|
||||
enum class Reason : uint8_t {
|
||||
PREVIEW, ///< User is previewing the survey result.
|
||||
LEAVE, ///< User is leaving the game (but not exiting the application).
|
||||
EXIT, ///< User is exiting the application.
|
||||
CRASH, ///< Game crashed.
|
||||
Preview, ///< User is previewing the survey result.
|
||||
Leave, ///< User is leaving the game (but not exiting the application).
|
||||
Exit, ///< User is exiting the application.
|
||||
Crash, ///< Game crashed.
|
||||
};
|
||||
|
||||
void Transmit(Reason reason, bool blocking = false);
|
||||
|
||||
@@ -820,7 +820,7 @@ void HandleExitGameRequest()
|
||||
_exit_game = true;
|
||||
} else if (_settings_client.gui.autosave_on_exit) {
|
||||
DoExitSave();
|
||||
_survey.Transmit(NetworkSurveyHandler::Reason::EXIT, true);
|
||||
_survey.Transmit(NetworkSurveyHandler::Reason::Exit, true);
|
||||
_exit_game = true;
|
||||
} else {
|
||||
AskExitGame();
|
||||
@@ -1053,7 +1053,7 @@ void SwitchToMode(SwitchMode new_mode)
|
||||
if (new_mode != SM_SAVE_GAME) ChangeAutosaveFrequency(true);
|
||||
|
||||
/* Transmit the survey if we were in normal-mode and not saving. It always means we leaving the current game. */
|
||||
if (_game_mode == GM_NORMAL && new_mode != SM_SAVE_GAME) _survey.Transmit(NetworkSurveyHandler::Reason::LEAVE);
|
||||
if (_game_mode == GM_NORMAL && new_mode != SM_SAVE_GAME) _survey.Transmit(NetworkSurveyHandler::Reason::Leave);
|
||||
|
||||
/* Keep track when we last switch mode. Used for survey, to know how long someone was in a game. */
|
||||
if (new_mode != SM_SAVE_GAME) {
|
||||
|
||||
Reference in New Issue
Block a user