Changeset - r28598:1e46fbfcf2e6
[Not reviewed]
master
0 4 0
frosch - 3 months ago 2024-01-27 21:40:58
frosch@openttd.org
Codechange: Remove TKM string code.
4 files changed with 0 insertions and 37 deletions:
0 comments (0 inline, 0 general)
src/strgen/strgen_base.cpp
Show inline comments
 
@@ -377,34 +377,6 @@ void EmitPlural(Buffer *buffer, char *bu
 
	EmitWordList(buffer, words, nw);
 
}
 

	
 
/**
 
 * Handle the selection of timekeeping units based on the timekeeping setting.
 
 * This uses the string control character {TKM [value if calendar] [value if wallclock]}, e.g. {TKM month minute}.
 
 * @param buffer The output buffer
 
 * @param buf    The input buffer
 
 * @param        Unused
 
 */
 
void EmitTKM(Buffer* buffer, char* buf, int)
 
{
 
	/* The correct number of words is 2, but we'll check for more in case of typos. */
 
	std::vector<const char *> words(3, nullptr);
 

	
 
	/* Parse each string. */
 
	uint nw = 0;
 
	for (nw = 0; nw < 3; nw++) {
 
		words[nw] = ParseWord(&buf);
 
		if (words[nw] == nullptr) break;
 
	}
 

	
 
	/* Warn about the wrong number of parameters. */
 
	if (nw != 2) {
 
		StrgenFatal("%s: Invalid number of TKM options. Expecting %d, found %d.", _cur_ident, 2, nw);
 
	}
 

	
 
	buffer->AppendUtf8(SCC_TIMEKEEPING_MODE_LIST);
 
	EmitWordList(buffer, words, 2);
 
}
 

	
 
void EmitGender(Buffer *buffer, char *buf, int)
 
{
 
	int argidx = _cur_argidx;
src/strings.cpp
Show inline comments
 
@@ -1443,11 +1443,6 @@ static void FormatString(StringBuilder &
 
					break;
 
				}
 

	
 
				case SCC_TIMEKEEPING_MODE_LIST: { // {TKM}
 
					str = ParseStringChoice(str, (uint8_t)TimerGameEconomy::UsingWallclockUnits(_game_mode == GM_MENU), builder);
 
					break;
 
				}
 

	
 
				case SCC_COMPANY_NAME: { // {COMPANY}
 
					const Company *c = Company::GetIfValid(args.GetNextParameter<CompanyID>());
 
					if (c == nullptr) break;
src/table/control_codes.h
Show inline comments
 
@@ -69,7 +69,6 @@ enum StringControlCode {
 
	SCC_UNITS_MONTHS_OR_MINUTES,
 
	SCC_UNITS_YEARS_OR_PERIODS,
 
	SCC_UNITS_YEARS_OR_MINUTES,
 
	SCC_TIMEKEEPING_MODE_LIST,
 

	
 
	SCC_DATE_TINY,
 
	SCC_DATE_SHORT,
src/table/strgen_tables.h
Show inline comments
 
@@ -30,7 +30,6 @@ struct CmdStruct {
 
};
 

	
 
extern void EmitSingleChar(Buffer *buffer, char *buf, int value);
 
extern void EmitTKM(Buffer* buffer, char* buf, int value);
 
extern void EmitPlural(Buffer *buffer, char *buf, int value);
 
extern void EmitGender(Buffer *buffer, char *buf, int value);
 

	
 
@@ -94,8 +93,6 @@ static const CmdStruct _cmd_structs[] = 
 
	{"UNITS_YEARS_OR_PERIODS",  EmitSingleChar, SCC_UNITS_YEARS_OR_PERIODS,  1,  0, C_NONE},
 
	{"UNITS_YEARS_OR_MINUTES",  EmitSingleChar, SCC_UNITS_YEARS_OR_MINUTES,  1,  0, C_NONE},
 

	
 
	{"TKM",                     EmitTKM,  0,                      0, -1, C_DONTCOUNT}, // Timekeeping mode string selection, e.g. "{TKM month minute}"
 

	
 
	{"P",                 EmitPlural,     0,                      0, -1, C_DONTCOUNT}, // plural specifier
 
	{"G",                 EmitGender,     0,                      0, -1, C_DONTCOUNT}, // gender specifier
 

	
0 comments (0 inline, 0 general)