Changeset - r2201:660b847c7f07
[Not reviewed]
master
0 5 0
tron - 19 years ago 2005-07-26 19:04:19
tron@openttd.org
(svn r2717) Move _userstring to strings.[ch]
5 files changed with 7 insertions and 6 deletions:
0 comments (0 inline, 0 general)
engine.c
Show inline comments
 
/* $Id$ */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "engine.h"
 
#include "table/engines.h"
 
#include "gfx.h"
 
#include "player.h"
 
#include "command.h"
 
@@ -744,14 +746,13 @@ void UnInitNewgrEngines(void)
 
}
 

	
 
StringID GetCustomEngineName(int engine)
 
{
 
	if (!_engine_custom_names[engine])
 
		return _engine_name_strings[engine];
 
	strncpy(_userstring, _engine_custom_names[engine], USERSTRING_LEN);
 
	_userstring[USERSTRING_LEN - 1] = '\0';
 
	ttd_strlcpy(_userstring, _engine_custom_names[engine], lengthof(_userstring));
 
	return STR_SPEC_USERSTRING;
 
}
 

	
 

	
 
void AcceptEnginePreview(Engine *e, PlayerID player)
 
{
misc_gui.c
Show inline comments
 
@@ -63,13 +63,13 @@ static void LandInfoWndProc(Window *w, W
 
		if (lid->costclear != CMD_ERROR) {
 
			SetDParam(0, lid->costclear);
 
			str = STR_01A5_COST_TO_CLEAR;
 
		}
 
		DrawStringCentered(140, 38, str, 0);
 

	
 
		snprintf(_userstring, USERSTRING_LEN, "%.4X", lid->tile);
 
		snprintf(_userstring, lengthof(_userstring), "%.4X", lid->tile);
 
		SetDParam(0, TileX(lid->tile));
 
		SetDParam(1, TileY(lid->tile));
 
		SetDParam(2, STR_SPEC_USERSTRING);
 
		DrawStringCentered(140, 49, STR_LANDINFO_COORDS, 0);
 

	
 
		SetDParam(0, STR_01A9_NONE);
settings_gui.c
Show inline comments
 
@@ -1196,13 +1196,13 @@ static void NewgrfWndProc(Window *w, Win
 
			// draw filename
 
			x = DrawString(5, 199, STR_NEWGRF_FILENAME, 0);
 
			DoDrawString(_sel_grffile->filename, x + 2, 199, 0x01);
 

	
 
			// draw grf id
 
			x = DrawString(5, 209, STR_NEWGRF_GRF_ID, 0);
 
			snprintf(_userstring, USERSTRING_LEN, "%08X", _sel_grffile->grfid);
 
			snprintf(_userstring, lengthof(_userstring), "%08X", _sel_grffile->grfid);
 
			DrawString(x + 2, 209, STR_SPEC_USERSTRING, 0x01);
 
		}
 
	} break;
 

	
 
	case WE_CLICK:
 
		switch(e->click.widget) {
strings.c
Show inline comments
 
@@ -13,12 +13,14 @@
 
#include "news.h"
 
#include "screenshot.h"
 
#include "waypoint.h"
 
#include "industry.h"
 
#include "variables.h"
 

	
 
char _userstring[128];
 

	
 
static char *StationGetSpecialString(char *buff, int x);
 
static char *GetSpecialTownNameString(char *buff, int ind, uint32 seed);
 
static char *GetSpecialPlayerNameString(char *buff, int ind, const int32 *argv);
 

	
 
static char *FormatString(char *buff, const char *str, const int32 *argv, uint casei);
 

	
variables.h
Show inline comments
 
@@ -437,14 +437,12 @@ extern const TileTypeProcs * const _tile
 
// will become obsolete once airports are loaded from seperate file
 
extern const byte _airport_size_x[];
 
extern const byte _airport_size_y[];
 

	
 
/* misc */
 
VARDEF char _screenshot_name[128];
 
#define USERSTRING_LEN 128
 
VARDEF char _userstring[USERSTRING_LEN];
 
VARDEF byte _vehicle_design_names;
 

	
 
/* tunnelbridge */
 
#define MAX_BRIDGES 13
 

	
 
/* For new pathfinding. Define here so it is globally available without having
0 comments (0 inline, 0 general)