Changeset - r7056:100d5cd282bd
[Not reviewed]
master
0 8 0
peter1138 - 17 years ago 2007-06-25 10:40:56
peter1138@openttd.org
(svn r10321) -Codechange: refer to sign text by index
8 files changed with 18 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -1678,13 +1678,13 @@ STR_CAN_T_REMOVE_CARGO_TRAM_STATION     
 
##id 0x2000
 
STR_2000_TOWNS                                                  :{WHITE}Towns
 
STR_TOWN_LABEL_POP                                              :{WHITE}{TOWN} ({COMMA})
 
STR_TOWN_LABEL                                                  :{WHITE}{TOWN}
 
STR_TOWN_LABEL_TINY_BLACK                                       :{TINYFONT}{BLACK}{TOWN}
 
STR_TOWN_LABEL_TINY_WHITE                                       :{TINYFONT}{WHITE}{TOWN}
 
STR_2002                                                        :{TINYFONT}{BLACK}{STRING1}
 
STR_2002                                                        :{TINYFONT}{BLACK}{SIGN}
 
STR_2004_BUILDING_MUST_BE_DEMOLISHED                            :{WHITE}Building must be demolished first
 
STR_2005                                                        :{WHITE}{TOWN}
 
STR_2006_POPULATION                                             :{BLACK}Population: {ORANGE}{COMMA}{BLACK}  Houses: {ORANGE}{COMMA}
 
STR_2007_RENAME_TOWN                                            :Rename Town
 
STR_2008_CAN_T_RENAME_TOWN                                      :{WHITE}Can't rename town...
 
STR_2009_LOCAL_AUTHORITY_REFUSES                                :{WHITE}{TOWN} local authority refuses to allow this
 
@@ -1782,13 +1782,13 @@ STR_LANDSCAPING                         
 
STR_2800_PLANT_TREES                                            :Plant trees
 
STR_2801_PLACE_SIGN                                             :Place sign
 
STR_2802_TREES                                                  :{WHITE}Trees
 
STR_2803_TREE_ALREADY_HERE                                      :{WHITE}...tree already here
 
STR_2804_SITE_UNSUITABLE                                        :{WHITE}...site unsuitable
 
STR_2805_CAN_T_PLANT_TREE_HERE                                  :{WHITE}Can't plant tree here...
 
STR_2806                                                        :{WHITE}{STRING}
 
STR_2806                                                        :{WHITE}{SIGN}
 
STR_2808_TOO_MANY_SIGNS                                         :{WHITE}...too many signs
 
STR_2809_CAN_T_PLACE_SIGN_HERE                                  :{WHITE}Can't place sign here...
 
STR_280A_SIGN                                                   :Sign
 
STR_280B_EDIT_SIGN_TEXT                                         :{WHITE}Edit sign text
 
STR_280C_CAN_T_CHANGE_SIGN_NAME                                 :{WHITE}Can't change sign name...
 
STR_280D_SELECT_TREE_TYPE_TO_PLANT                              :{BLACK}Select tree type to plant
 
@@ -3337,9 +3337,10 @@ STR_GROUP_REPLACE_PROTECTION_TIP        
 
STR_PROFIT_GOOD_THIS_YEAR_GOOD_LAST_YEAR                        :{TINYFONT}{BLACK}Profit this year: {GREEN}{CURRENCY} {BLACK}(last year: {GREEN}{CURRENCY}{BLACK})
 
STR_PROFIT_BAD_THIS_YEAR_GOOD_LAST_YEAR                         :{TINYFONT}{BLACK}Profit this year: {RED}{CURRENCY} {BLACK}(last year: {GREEN}{CURRENCY}{BLACK})
 
STR_PROFIT_GOOD_THIS_YEAR_BAD_LAST_YEAR                         :{TINYFONT}{BLACK}Profit this year: {GREEN}{CURRENCY} {BLACK}(last year: {RED}{CURRENCY}{BLACK})
 
STR_PROFIT_BAD_THIS_YEAR_BAD_LAST_YEAR                          :{TINYFONT}{BLACK}Profit this year: {RED}{CURRENCY} {BLACK}(last year: {RED}{CURRENCY}{BLACK})
 

	
 
STR_GROUP_NAME                                                  :{GROUP}
 
STR_SIGN_NAME                                                   :{SIGN}
 
STR_VEHICLE_NAME                                                :{VEHICLE}
 

	
 
########
src/main_gui.cpp
Show inline comments
 
@@ -343,13 +343,14 @@ void ShowNetworkGiveMoneyWindow(PlayerID
 
#endif /* ENABLE_NETWORK */
 

	
 
void ShowRenameSignWindow(const Sign *si)
 
{
 
	_rename_id = si->index;
 
	_rename_what = 0;
 
	ShowQueryString(si->str, STR_280B_EDIT_SIGN_TEXT, 30, 180, NULL, CS_ALPHANUMERAL);
 
	SetDParam(0, si->index);
 
	ShowQueryString(STR_SIGN_NAME, STR_280B_EDIT_SIGN_TEXT, 30, 180, NULL, CS_ALPHANUMERAL);
 
}
 

	
 
void ShowRenameWaypointWindow(const Waypoint *wp)
 
{
 
	int id = wp->index;
 

	
src/signs.cpp
Show inline comments
 
@@ -36,13 +36,13 @@ DEFINE_OLD_POOL(Sign, Sign, SignPoolNewB
 
 * @param si Pointer to the Sign
 
 *
 
 */
 
static void UpdateSignVirtCoords(Sign *si)
 
{
 
	Point pt = RemapCoords(si->x, si->y, si->z);
 
	SetDParam(0, si->str);
 
	SetDParam(0, si->index);
 
	UpdateViewportSignPos(&si->sign, pt.x, pt.y - 6, STR_2806);
 
}
 

	
 
/**
 
 *
 
 * Update the coordinates of all signs
src/signs_gui.cpp
Show inline comments
 
@@ -85,13 +85,14 @@ static void SignListWndProc(Window *w, W
 
			for (i = w->vscroll.pos; i < w->vscroll.cap + w->vscroll.pos && i < w->vscroll.count; i++) {
 
				const Sign *si = _sign_sort[i];
 

	
 
				if (si->owner != OWNER_NONE)
 
					DrawPlayerIcon(si->owner, 4, y + 1);
 

	
 
				DrawString(22, y, si->str, 8);
 
				SetDParam(0, si->index);
 
				DrawString(22, y, STR_SIGN_NAME, 8);
 
				y += 10;
 
			}
 
		}
 
	} break;
 

	
 
	case WE_CLICK: {
src/strgen/strgen.cpp
Show inline comments
 
@@ -501,12 +501,13 @@ static const CmdStruct _cmd_structs[] = 
 
	{"CURRENCY",   EmitSingleChar, SCC_CURRENCY,    1, 0},
 

	
 
	{"WAYPOINT", EmitSingleChar, SCC_WAYPOINT_NAME, 1, 0}, // waypoint name
 
	{"STATION",  EmitSingleChar, SCC_STATION_NAME,  1, 0},
 
	{"TOWN",     EmitSingleChar, SCC_TOWN_NAME,     1, 0},
 
	{"GROUP",    EmitSingleChar, SCC_GROUP_NAME,    1, 0},
 
	{"SIGN",     EmitSingleChar, SCC_SIGN_NAME,     1, 0},
 
	{"VEHICLE",  EmitSingleChar, SCC_VEHICLE_NAME,  1, 0},
 

	
 
	// 0x9D is used for the pseudo command SETCASE
 
	// 0x9E is used for case switching
 

	
 
	{"",               EmitSingleChar, '\n',               0, C_DONTCOUNT},
src/strings.cpp
Show inline comments
 
@@ -26,12 +26,13 @@
 
#include "fileio.h"
 
#include "helpers.hpp"
 
#include "cargotype.h"
 
#include "group.h"
 
#include "debug.h"
 
#include "newgrf_townname.h"
 
#include "signs.h"
 
#include "vehicle.h"
 

	
 
/* for opendir/readdir/closedir */
 
# include "fios.h"
 

	
 
DynamicLanguages _dynlang;
 
@@ -870,12 +871,18 @@ static char* FormatString(char* buff, co
 
				args[0] = v->unitnumber;
 

	
 
				buff = GetStringWithArgs(buff, v->string_id, args, last);
 
				break;
 
			}
 

	
 
			case SCC_SIGN_NAME: { // {SIGN}
 
				const Sign *si = GetSign(GetInt32(&argv));
 
				buff = GetString(buff, si->str, last);
 
				break;
 
			}
 

	
 
			case SCC_SETCASE: { // {SETCASE}
 
				/* This is a pseudo command, it's outputted when someone does {STRING.ack}
 
				 * The modifier is added to all subsequent GetStringWithArgs that accept the modifier. */
 
				modifier = (byte)*str++ << 24;
 
				break;
 
			}
src/table/control_codes.h
Show inline comments
 
@@ -25,12 +25,13 @@ enum {
 
	SCC_INDUSTRY_NAME,
 
	SCC_WAYPOINT_NAME,
 
	SCC_STATION_NAME,
 
	SCC_TOWN_NAME,
 
	SCC_GROUP_NAME,
 
	SCC_VEHICLE_NAME,
 
	SCC_SIGN_NAME,
 

	
 
	SCC_CURRENCY_COMPACT,
 
	SCC_CURRENCY,
 

	
 
	SCC_CARGO,
 
	SCC_CARGO_SHORT,
src/viewport.cpp
Show inline comments
 
@@ -936,13 +936,13 @@ static void ViewportAddStationNames(Draw
 

	
 

	
 
static void AddSign(const Sign *si, StringID str, uint16 width)
 
{
 
	StringSpriteToDraw *sstd;
 

	
 
	sstd = (StringSpriteToDraw*)AddStringToDraw(si->sign.left + 1, si->sign.top + 1, str, si->str, 0);
 
	sstd = (StringSpriteToDraw*)AddStringToDraw(si->sign.left + 1, si->sign.top + 1, str, si->index, 0);
 
	if (sstd != NULL) {
 
		sstd->color = (si->owner == OWNER_NONE) ? 14 : _player_colors[si->owner];
 
		sstd->width = width;
 
	}
 
}
 

	
0 comments (0 inline, 0 general)