1
0
Fork 0

(svn r17603) -Codechange: since now, towns are 'founded' instead of 'built'

release/1.0
smatz 2009-09-21 18:16:00 +00:00
parent 60a13f49bd
commit 15511678e3
9 changed files with 18 additions and 18 deletions

View File

@ -37,7 +37,7 @@ CommandCallback CcCloneVehicle;
CommandCallback CcPlaySound10; CommandCallback CcPlaySound10;
CommandCallback CcPlaceSign; CommandCallback CcPlaceSign;
CommandCallback CcTerraform; CommandCallback CcTerraform;
CommandCallback CcBuildTown; CommandCallback CcFoundTown;
CommandCallback CcGiveMoney; CommandCallback CcGiveMoney;
/* rail_gui.cpp */ /* rail_gui.cpp */
@ -77,7 +77,7 @@ CommandCallback * const _callback_table[] = {
/* 0x06 */ CcBuildLoco, /* 0x06 */ CcBuildLoco,
/* 0x07 */ CcBuildRoadVeh, /* 0x07 */ CcBuildRoadVeh,
/* 0x08 */ CcBuildShip, /* 0x08 */ CcBuildShip,
/* 0x09 */ CcBuildTown, /* 0x09 */ CcFoundTown,
/* 0x0A */ CcBuildRoadTunnel, /* 0x0A */ CcBuildRoadTunnel,
/* 0x0B */ CcBuildRailTunnel, /* 0x0B */ CcBuildRailTunnel,
/* 0x0C */ CcBuildWagon, /* 0x0C */ CcBuildWagon,

View File

@ -146,7 +146,7 @@ DEF_COMMAND(CmdBuyShareInCompany);
DEF_COMMAND(CmdSellShareInCompany); DEF_COMMAND(CmdSellShareInCompany);
DEF_COMMAND(CmdBuyCompany); DEF_COMMAND(CmdBuyCompany);
DEF_COMMAND(CmdBuildTown); DEF_COMMAND(CmdFoundTown);
DEF_COMMAND(CmdRenameTown); DEF_COMMAND(CmdRenameTown);
DEF_COMMAND(CmdDoTownAction); DEF_COMMAND(CmdDoTownAction);
@ -296,7 +296,7 @@ static const Command _command_proc_table[] = {
{CmdSellShareInCompany, 0}, // CMD_SELL_SHARE_IN_COMPANY {CmdSellShareInCompany, 0}, // CMD_SELL_SHARE_IN_COMPANY
{CmdBuyCompany, 0}, // CMD_BUY_COMANY {CmdBuyCompany, 0}, // CMD_BUY_COMANY
{CmdBuildTown, CMD_OFFLINE}, // CMD_BUILD_TOWN {CmdFoundTown, CMD_OFFLINE}, // CMD_FOUND_TOWN
{CmdRenameTown, CMD_SERVER}, // CMD_RENAME_TOWN {CmdRenameTown, CMD_SERVER}, // CMD_RENAME_TOWN
{CmdDoTownAction, 0}, // CMD_DO_TOWN_ACTION {CmdDoTownAction, 0}, // CMD_DO_TOWN_ACTION

View File

@ -242,7 +242,7 @@ enum {
CMD_SELL_SHARE_IN_COMPANY, ///< sell a share from a company CMD_SELL_SHARE_IN_COMPANY, ///< sell a share from a company
CMD_BUY_COMPANY, ///< buy a company which is bankrupt CMD_BUY_COMPANY, ///< buy a company which is bankrupt
CMD_BUILD_TOWN, ///< build a town CMD_FOUND_TOWN, ///< found a town
CMD_RENAME_TOWN, ///< rename a town CMD_RENAME_TOWN, ///< rename a town
CMD_DO_TOWN_ACTION, ///< do a action from the town detail window (like advertises or bribe) CMD_DO_TOWN_ACTION, ///< do a action from the town detail window (like advertises or bribe)

View File

@ -80,7 +80,7 @@ extern const TextColour _fios_colours[];
void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transport_type, byte bridge_type); void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transport_type, byte bridge_type);
void ShowBuildIndustryWindow(); void ShowBuildIndustryWindow();
void ShowBuildTownWindow(); void ShowFoundTownWindow();
void ShowMusicWindow(); void ShowMusicWindow();

View File

@ -343,7 +343,7 @@ public:
this->HandleButtonClick(DPIW_FUND_WIDGET); this->HandleButtonClick(DPIW_FUND_WIDGET);
if (Town::GetNumItems() == 0) { if (Town::GetNumItems() == 0) {
ShowErrorMessage(STR_ERROR_MUST_BUILD_TOWN_FIRST, STR_ERROR_CAN_T_GENERATE_INDUSTRIES, 0, 0); ShowErrorMessage(STR_ERROR_MUST_FOUND_TOWN_FIRST, STR_ERROR_CAN_T_GENERATE_INDUSTRIES, 0, 0);
} else { } else {
extern void GenerateIndustries(); extern void GenerateIndustries();
_generating_world = true; _generating_world = true;
@ -378,7 +378,7 @@ public:
/* Show error if no town exists at all */ /* Show error if no town exists at all */
if (Town::GetNumItems() == 0) { if (Town::GetNumItems() == 0) {
SetDParam(0, indsp->name); SetDParam(0, indsp->name);
ShowErrorMessage(STR_ERROR_MUST_BUILD_TOWN_FIRST, STR_ERROR_CAN_T_BUILD_HERE, pt.x, pt.y); ShowErrorMessage(STR_ERROR_MUST_FOUND_TOWN_FIRST, STR_ERROR_CAN_T_BUILD_HERE, pt.x, pt.y);
return; return;
} }

View File

@ -2026,9 +2026,9 @@ STR_RESET_LANDSCAPE_CONFIRMATION_TEXT :{WHITE}Are you
# Town generation window (SE) # Town generation window (SE)
STR_FOUND_TOWN_CAPTION :{WHITE}Town Generation STR_FOUND_TOWN_CAPTION :{WHITE}Town Generation
STR_FOUND_TOWN_NEW_TOWN_BUTTON :{BLACK}New Town STR_FOUND_TOWN_NEW_TOWN_BUTTON :{BLACK}New Town
STR_FOUND_TOWN_NEW_TOWN_TOOLTIP :{BLACK}Construct new town STR_FOUND_TOWN_NEW_TOWN_TOOLTIP :{BLACK}Found new town
STR_FOUND_TOWN_RANDOM_TOWN_BUTTON :{BLACK}Random Town STR_FOUND_TOWN_RANDOM_TOWN_BUTTON :{BLACK}Random Town
STR_FOUND_TOWN_RANDOM_TOWN_TOOLTIP :{BLACK}Build town in random location STR_FOUND_TOWN_RANDOM_TOWN_TOOLTIP :{BLACK}Found town in random location
STR_FOUND_TOWN_MANY_RANDOM_TOWNS :{BLACK}Many random towns STR_FOUND_TOWN_MANY_RANDOM_TOWNS :{BLACK}Many random towns
STR_FOUND_TOWN_RANDOM_TOWNS_TOOLTIP :{BLACK}Cover the map with randomly placed towns STR_FOUND_TOWN_RANDOM_TOWNS_TOOLTIP :{BLACK}Cover the map with randomly placed towns
@ -3279,7 +3279,7 @@ STR_ERROR_PROTECTED :{WHITE}This com
# Town related errors # Town related errors
STR_ERROR_CAN_T_GENERATE_TOWN :{WHITE}Can't build any towns STR_ERROR_CAN_T_GENERATE_TOWN :{WHITE}Can't build any towns
STR_ERROR_CAN_T_RENAME_TOWN :{WHITE}Can't rename town... STR_ERROR_CAN_T_RENAME_TOWN :{WHITE}Can't rename town...
STR_ERROR_CAN_T_BUILD_TOWN_HERE :{WHITE}Can't build town here... STR_ERROR_CAN_T_FOUND_TOWN_HERE :{WHITE}Can't found town here...
STR_ERROR_TOO_CLOSE_TO_EDGE_OF_MAP_SUB :{WHITE}... too close to edge of map STR_ERROR_TOO_CLOSE_TO_EDGE_OF_MAP_SUB :{WHITE}... too close to edge of map
STR_ERROR_TOO_CLOSE_TO_ANOTHER_TOWN :{WHITE}... too close to another town STR_ERROR_TOO_CLOSE_TO_ANOTHER_TOWN :{WHITE}... too close to another town
STR_ERROR_TOO_MANY_TOWNS :{WHITE}... too many towns STR_ERROR_TOO_MANY_TOWNS :{WHITE}... too many towns
@ -3292,7 +3292,7 @@ STR_ERROR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Can't ge
STR_ERROR_CAN_T_BUILD_HERE :{WHITE}Can't build {STRING} here... STR_ERROR_CAN_T_BUILD_HERE :{WHITE}Can't build {STRING} here...
STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY :{WHITE}Can't construct this industry type here... STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY :{WHITE}Can't construct this industry type here...
STR_ERROR_INDUSTRY_TOO_CLOSE :{WHITE}... too close to another industry STR_ERROR_INDUSTRY_TOO_CLOSE :{WHITE}... too close to another industry
STR_ERROR_MUST_BUILD_TOWN_FIRST :{WHITE}... must build town first STR_ERROR_MUST_FOUND_TOWN_FIRST :{WHITE}... must found town first
STR_ERROR_ONLY_ONE_ALLOWED_PER_TOWN :{WHITE}... only one allowed per town STR_ERROR_ONLY_ONE_ALLOWED_PER_TOWN :{WHITE}... only one allowed per town
STR_ERROR_CAN_ONLY_BE_BUILT_IN_TOWNS_WITH_POPULATION_OF_1200 :{WHITE}... can only be built in towns with a population of at least 1200 STR_ERROR_CAN_ONLY_BE_BUILT_IN_TOWNS_WITH_POPULATION_OF_1200 :{WHITE}... can only be built in towns with a population of at least 1200
STR_ERROR_CAN_ONLY_BE_BUILT_IN_RAINFOREST :{WHITE}... can only be built in rainforest areas STR_ERROR_CAN_ONLY_BE_BUILT_IN_RAINFOREST :{WHITE}... can only be built in rainforest areas

View File

@ -827,7 +827,7 @@ static void ToolbarScenGenTown(Window *w)
{ {
w->HandleButtonClick(TBSE_TOWNGENERATE); w->HandleButtonClick(TBSE_TOWNGENERATE);
SndPlayFx(SND_15_BEEP); SndPlayFx(SND_15_BEEP);
ShowBuildTownWindow(); ShowFoundTownWindow();
} }
static void ToolbarScenGenIndustry(Window *w) static void ToolbarScenGenIndustry(Window *w)

View File

@ -1596,7 +1596,7 @@ static CommandCost TownCanBePlacedHere(TileIndex tile)
* @param text unused * @param text unused
* @return the cost of this operation or an error * @return the cost of this operation or an error
*/ */
CommandCost CmdBuildTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) CommandCost CmdFoundTown(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
{ {
/* Only in the scenario editor */ /* Only in the scenario editor */
if (_game_mode != GM_EDITOR) return CMD_ERROR; if (_game_mode != GM_EDITOR) return CMD_ERROR;

View File

@ -840,7 +840,7 @@ void ShowTownDirectory()
new TownDirectoryWindow(&_town_directory_desc); new TownDirectoryWindow(&_town_directory_desc);
} }
void CcBuildTown(bool success, TileIndex tile, uint32 p1, uint32 p2) void CcFoundTown(bool success, TileIndex tile, uint32 p1, uint32 p2)
{ {
if (success) { if (success) {
SndPlayTileFx(SND_1F_SPLAT, tile); SndPlayTileFx(SND_1F_SPLAT, tile);
@ -1032,12 +1032,12 @@ public:
{ {
uint32 townnameparts; uint32 townnameparts;
if (!GenerateTownName(&townnameparts)) { if (!GenerateTownName(&townnameparts)) {
ShowErrorMessage(STR_ERROR_TOO_MANY_TOWNS, STR_ERROR_CAN_T_BUILD_TOWN_HERE, 0, 0); ShowErrorMessage(STR_ERROR_TOO_MANY_TOWNS, STR_ERROR_CAN_T_FOUND_TOWN_HERE, 0, 0);
return; return;
} }
DoCommandP(tile, this->town_size | this->city << 2 | this->town_layout << 3, townnameparts, DoCommandP(tile, this->town_size | this->city << 2 | this->town_layout << 3, townnameparts,
CMD_BUILD_TOWN | CMD_MSG(STR_ERROR_CAN_T_BUILD_TOWN_HERE), CcBuildTown); CMD_FOUND_TOWN | CMD_MSG(STR_ERROR_CAN_T_FOUND_TOWN_HERE), CcFoundTown);
} }
virtual void OnPlaceObjectAbort() virtual void OnPlaceObjectAbort()
@ -1054,7 +1054,7 @@ static const WindowDesc _found_town_desc(
NULL, _nested_found_town_widgets, lengthof(_nested_found_town_widgets) NULL, _nested_found_town_widgets, lengthof(_nested_found_town_widgets)
); );
void ShowBuildTownWindow() void ShowFoundTownWindow()
{ {
if (_game_mode != GM_EDITOR && !Company::IsValidID(_local_company)) return; if (_game_mode != GM_EDITOR && !Company::IsValidID(_local_company)) return;
AllocateWindowDescFront<FoundTownWindow>(&_found_town_desc, 0); AllocateWindowDescFront<FoundTownWindow>(&_found_town_desc, 0);