1
0
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:
Rubidium
2026-01-11 22:15:36 +01:00
committed by rubidium42
parent e0be9f09f9
commit c49f1da09e
6 changed files with 13 additions and 13 deletions

View File

@@ -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);
}
}

View File

@@ -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;
}
}

View File

@@ -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();
}

View File

@@ -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"},
})
/**

View File

@@ -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);

View File

@@ -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) {