Index: src/settings.cpp =================================================================== --- src/settings.cpp (Revision 11087) +++ src/settings.cpp (Arbeitskopie) @@ -1427,6 +1427,8 @@ SDT_BOOL(Patches, multiple_industry_per_town, 0, 0, false, STR_CONFIG_PATCHES_MULTIPINDTOWN, NULL), SDT_BOOL(Patches, same_industry_close, 0, 0, false, STR_CONFIG_PATCHES_SAMEINDCLOSE, NULL), SDT_BOOL(Patches, bribe, 0, 0, true, STR_CONFIG_PATCHES_BRIBE, NULL), + SDT_CONDBOOL(Patches, exclusive_rights, 75, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_PATCHES_ALLOW_EXCLUSIVE, NULL), + SDT_CONDBOOL(Patches, give_money, 75, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_PATCHES_ALLOW_GIVE_MONEY, NULL), SDT_VAR(Patches, snow_line_height,SLE_UINT8, 0, 0, 7, 2, 13, 0, STR_CONFIG_PATCHES_SNOWLINE_HEIGHT, NULL), SDT_VAR(Patches, colored_news_year,SLE_INT32, 0,NC, 2000, MIN_YEAR, MAX_YEAR, 1, STR_CONFIG_PATCHES_COLORED_NEWS_YEAR,NULL), SDT_VAR(Patches, starting_year, SLE_INT32, 0,NC, 1950, MIN_YEAR, MAX_YEAR, 1, STR_CONFIG_PATCHES_STARTING_YEAR,NULL), Index: src/lang/english.txt =================================================================== --- src/lang/english.txt (Revision 11087) +++ src/lang/english.txt (Arbeitskopie) @@ -1046,6 +1046,8 @@ STR_CONFIG_PATCHES_ROADVEH_QUEUE :{LTBLUE}Road vehicle queueing (with quantum effects): {ORANGE}{STRING1} STR_CONFIG_PATCHES_AUTOSCROLL :{LTBLUE}Pan window when mouse is at the edge: {ORANGE}{STRING1} STR_CONFIG_PATCHES_BRIBE :{LTBLUE}Allow bribing of the local authority: {ORANGE}{STRING1} +STR_CONFIG_PATCHES_ALLOW_EXCLUSIVE :{LTBLUE}Allow buying exclusive transport rights: {ORANGE}{STRING1} +STR_CONFIG_PATCHES_ALLOW_GIVE_MONEY :{LTBLUE}Allow sending money to other companies: {ORANGE}{STRING1} STR_CONFIG_PATCHES_NONUNIFORM_STATIONS :{LTBLUE}Nonuniform stations: {ORANGE}{STRING1} STR_CONFIG_PATCHES_NEW_PATHFINDING_ALL :{LTBLUE}New global pathfinding (NPF, overrides NTP): {ORANGE}{STRING1} STR_CONFIG_PATCHES_FREIGHT_TRAINS :{LTBLUE}Weight multiplier for freight to simulate heavy trains: {ORANGE}{STRING} Index: src/settings_gui.cpp =================================================================== --- src/settings_gui.cpp (Revision 11087) +++ src/settings_gui.cpp (Arbeitskopie) @@ -695,6 +695,8 @@ "multiple_industry_per_town", "same_industry_close", "bribe", + "exclusive_rights", + "give_money", "colored_news_year", "ending_year", "smooth_economy", Index: src/saveload.cpp =================================================================== --- src/saveload.cpp (Revision 11087) +++ src/saveload.cpp (Arbeitskopie) @@ -29,7 +29,7 @@ #include "strings.h" #include -extern const uint16 SAVEGAME_VERSION = 74; +extern const uint16 SAVEGAME_VERSION = 75; uint16 _sl_version; ///< the major savegame version identifier byte _sl_minor_version; ///< the minor savegame version, DO NOT USE! Index: src/town_cmd.cpp =================================================================== --- src/town_cmd.cpp (Revision 11087) +++ src/town_cmd.cpp (Arbeitskopie) @@ -1986,6 +1986,9 @@ static void TownActionBuyRights(Town* t) { + /* Check if it's allowed to by the rights */ + if (!_patches.exclusive_rights) return; + t->exclusive_counter = 12; t->exclusivity = _current_player; Index: src/town_gui.cpp =================================================================== --- src/town_gui.cpp (Revision 11087) +++ src/town_gui.cpp (Arbeitskopie) @@ -20,19 +20,40 @@ #include "variables.h" #include "helpers.hpp" +enum TownAuthorityWidget { + TWA_CLOSEBOX = 0, + TWA_CAPTIOM, + TWA_RATING_INFO, + TWA_COMMAND_LIST, + TWA_SCROLLBAR, + TWA_ACTION_INFO, + TWA_EXECUTE, +}; + static const Widget _town_authority_widgets[] = { -{ WWT_CLOSEBOX, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, -{ WWT_CAPTION, RESIZE_NONE, 13, 11, 316, 0, 13, STR_2022_LOCAL_AUTHORITY, STR_018C_WINDOW_TITLE_DRAG_THIS}, -{ WWT_PANEL, RESIZE_NONE, 13, 0, 316, 14, 105, 0x0, STR_NULL}, -{ WWT_PANEL, RESIZE_NONE, 13, 0, 304, 106, 157, 0x0, STR_2043_LIST_OF_THINGS_TO_DO_AT}, -{ WWT_SCROLLBAR, RESIZE_NONE, 13, 305, 316, 106, 157, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, -{ WWT_PANEL, RESIZE_NONE, 13, 0, 316, 158, 209, 0x0, STR_NULL}, -{ WWT_PUSHTXTBTN, RESIZE_NONE, 13, 0, 316, 210, 221, STR_2042_DO_IT, STR_2044_CARRY_OUT_THE_HIGHLIGHTED}, +{ WWT_CLOSEBOX, RESIZE_NONE, 13, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // TWA_CLOSEBOX +{ WWT_CAPTION, RESIZE_NONE, 13, 11, 316, 0, 13, STR_2022_LOCAL_AUTHORITY, STR_018C_WINDOW_TITLE_DRAG_THIS}, // TWA_CAPTIOM +{ WWT_PANEL, RESIZE_NONE, 13, 0, 316, 14, 105, 0x0, STR_NULL}, // TWA_RATING_INFO +{ WWT_PANEL, RESIZE_NONE, 13, 0, 304, 106, 157, 0x0, STR_2043_LIST_OF_THINGS_TO_DO_AT}, // TWA_COMMAND_LIST +{ WWT_SCROLLBAR, RESIZE_NONE, 13, 305, 316, 106, 157, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST}, // TWA_SCROLLBAR +{ WWT_PANEL, RESIZE_NONE, 13, 0, 316, 158, 209, 0x0, STR_NULL}, // TWA_ACTION_INFO +{ WWT_PUSHTXTBTN, RESIZE_NONE, 13, 0, 316, 210, 221, STR_2042_DO_IT, STR_2044_CARRY_OUT_THE_HIGHLIGHTED}, // TWA_EXECUTE { WIDGETS_END}, }; extern const byte _town_action_costs[8]; +enum TownActions { + TACT_ADVERTISE_SMALL = 0, + TACT_ADVERTISE_MEDIUM, + TACT_ADVERTISE_LARGE, + TACT_ROAD_REBUILD, + TACT_BUILD_STATUE, + TACT_FOUND_BUILDINGS, + TACT_BUY_RIGHTS, + TACT_BRIBE, +}; + /** Get a list of available actions to do at a town. * @param nump if not NULL add put the number of available actions in it * @param pid the player that is querying the town @@ -43,8 +64,9 @@ { Money avail, ref; int num = 0; - uint avail_buttons = 0x7F; // by default all buttons except bribe are enabled. - uint buttons = 0; + /* By default all buttons except bribe are enabled. */ + uint avail_buttons = 0x7F; ///< bin:01111111 + uint buttons = 0x00; if (pid != PLAYER_SPECTATOR) { uint i; @@ -55,7 +77,7 @@ if (t->unwanted[pid]) { avail_buttons = 0; } else if (t->ratings[pid] < RATING_BRIBE_MAXIMUM) { - SETBIT(avail_buttons, 7); // Allow bribing + SETBIT(avail_buttons, TACT_BRIBE); } } @@ -70,9 +92,15 @@ } } + /* Exclusive right are allowed? */ + if (!_patches.exclusive_rights && HASBIT(buttons, TACT_BUY_RIGHTS)) { + CLRBIT(buttons, TACT_BUY_RIGHTS); + } + + /* Disable build statue if already built */ - if (HASBIT(t->statues, pid)) { - CLRBIT(buttons, 4); + if (HASBIT(t->statues, pid) && HASBIT(buttons, TACT_BUILD_STATUE)) { + CLRBIT(buttons, TACT_BUILD_STATUE); num--; } @@ -161,9 +189,9 @@ y += 10; } for (i = 0; buttons; i++, buttons >>= 1) { - if (pos <= -5) break; + if (pos <= -5) break; ///< Draw only the 5 fitting lines - if (buttons&1 && --pos < 0) { + if ((buttons & 1) && --pos < 0) { DrawString(3, y, STR_2046_SMALL_ADVERTISING_CAMPAIGN + i, 6); y += 10; } @@ -185,7 +213,7 @@ case WE_DOUBLE_CLICK: case WE_CLICK: switch (e->we.click.widget) { - case 3: { /* listbox */ + case TWA_COMMAND_LIST: { const Town *t = GetTown(w->window_number); int y = (e->we.click.pt.y - 0x6B) / 10; @@ -200,7 +228,7 @@ if (e->event != WE_DOUBLE_CLICK || y < 0) break; } - case 6: { /* carry out the action */ + case TWA_EXECUTE: { DoCommandP(GetTown(w->window_number)->xy, w->window_number, WP(w,def_d).data_1, NULL, CMD_DO_TOWN_ACTION | CMD_MSG(STR_00B4_CAN_T_DO_THIS)); break; } Index: src/variables.h =================================================================== --- src/variables.h (Revision 11087) +++ src/variables.h (Arbeitskopie) @@ -240,6 +240,9 @@ bool timetabling; ///< Whether to allow timetabling. bool timetable_in_ticks; ///< Whether to show the timetable in ticks rather than days. + + bool exclusive_rights; ///< allow buying exclusive rights + bool give_money; ///< allow giving other players money }; VARDEF Patches _patches; Index: src/network/network_gui.cpp =================================================================== --- src/network/network_gui.cpp (Revision 11087) +++ src/network/network_gui.cpp (Arbeitskopie) @@ -1264,8 +1264,8 @@ _clientlist_proc[i++] = &ClientList_SpeakToAll; if (_network_own_client_index != ci->client_index) { - /* We are no spectator and the player we want to give money to is no spectator */ - if (IsValidPlayer(_network_playas) && IsValidPlayer(ci->client_playas)) { + /* We are no spectator and the player we want to give money to is no spectator and money gifts are allowed */ + if (IsValidPlayer(_network_playas) && IsValidPlayer(ci->client_playas) && _patches.give_money) { GetString(_clientlist_action[i], STR_NETWORK_CLIENTLIST_GIVE_MONEY, lastof(_clientlist_action[i])); _clientlist_proc[i++] = &ClientList_GiveMoney; } Index: src/misc_cmd.cpp =================================================================== --- src/misc_cmd.cpp (Revision 11087) +++ src/misc_cmd.cpp (Arbeitskopie) @@ -341,6 +341,8 @@ */ CommandCost CmdGiveMoney(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { + if (!_patches.give_money) return CMD_ERROR; + const Player *p = GetPlayer(_current_player); CommandCost amount(min((Money)p1, (Money)20000000LL)); Index: src/main_gui.cpp =================================================================== --- src/main_gui.cpp (Revision 11087) +++ src/main_gui.cpp (Arbeitskopie) @@ -63,7 +63,7 @@ void CcGiveMoney(bool success, TileIndex tile, uint32 p1, uint32 p2) { #ifdef ENABLE_NETWORK - if (!success) return; + if (!success || !_patches.give_money) return; char msg[20]; /* Inform the player of this action */