Include setting name in command log for setting change commands
This commit is contained in:
@@ -2363,6 +2363,14 @@ CommandCost CmdChangeSetting(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
||||
return CommandCost();
|
||||
}
|
||||
|
||||
const char *GetSettingNameByIndex(uint32 idx)
|
||||
{
|
||||
const SettingDesc *sd = GetSettingDescription(idx);
|
||||
if (sd == nullptr) return nullptr;
|
||||
|
||||
return sd->desc.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change one of the per-company settings.
|
||||
* @param tile unused
|
||||
@@ -2400,6 +2408,13 @@ CommandCost CmdChangeCompanySetting(TileIndex tile, DoCommandFlag flags, uint32
|
||||
return CommandCost();
|
||||
}
|
||||
|
||||
const char *GetCompanySettingNameByIndex(uint32 idx)
|
||||
{
|
||||
if (idx >= lengthof(_company_settings)) return nullptr;
|
||||
|
||||
return _company_settings[idx].desc.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Top function to save the new value of an element of the Settings struct
|
||||
* @param index offset in the SettingDesc array of the Settings struct which
|
||||
|
Reference in New Issue
Block a user