Changeset - r20325:7a8caf009bab
[Not reviewed]
master
0 2 0
frosch - 11 years ago 2013-06-08 16:54:19
frosch@openttd.org
(svn r25335) -Change: Revisit the map menu in scenario editor: Remove linkgraph legend, add industry list.
2 files changed with 41 insertions and 14 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -184,394 +184,394 @@ STR_COLOUR_DARK_GREEN                   
 
STR_COLOUR_BLUE                                                 :Blue
 
STR_COLOUR_CREAM                                                :Cream
 
STR_COLOUR_MAUVE                                                :Mauve
 
STR_COLOUR_PURPLE                                               :Purple
 
STR_COLOUR_ORANGE                                               :Orange
 
STR_COLOUR_BROWN                                                :Brown
 
STR_COLOUR_GREY                                                 :Grey
 
STR_COLOUR_WHITE                                                :White
 

	
 
# Units used in OpenTTD
 
STR_UNITS_VELOCITY_IMPERIAL                                     :{COMMA} mph
 
STR_UNITS_VELOCITY_METRIC                                       :{COMMA} km/h
 
STR_UNITS_VELOCITY_SI                                           :{COMMA} m/s
 

	
 
STR_UNITS_POWER_IMPERIAL                                        :{COMMA}hp
 
STR_UNITS_POWER_METRIC                                          :{COMMA}hp
 
STR_UNITS_POWER_SI                                              :{COMMA}kW
 

	
 
STR_UNITS_WEIGHT_SHORT_METRIC                                   :{COMMA}t
 
STR_UNITS_WEIGHT_SHORT_SI                                       :{COMMA}kg
 

	
 
STR_UNITS_WEIGHT_LONG_METRIC                                    :{COMMA} tonne{P "" s}
 
STR_UNITS_WEIGHT_LONG_SI                                        :{COMMA} kg
 

	
 
STR_UNITS_VOLUME_SHORT_METRIC                                   :{COMMA}l
 
STR_UNITS_VOLUME_SHORT_SI                                       :{COMMA}m³
 

	
 
STR_UNITS_VOLUME_LONG_METRIC                                    :{COMMA} litre{P "" s}
 
STR_UNITS_VOLUME_LONG_SI                                        :{COMMA} m³
 

	
 
STR_UNITS_FORCE_SI                                              :{COMMA} kN
 

	
 
STR_UNITS_HEIGHT_IMPERIAL                                       :{COMMA} ft
 
STR_UNITS_HEIGHT_SI                                             :{COMMA} m
 

	
 
# Common window strings
 
STR_LIST_FILTER_TITLE                                           :{BLACK}Filter string:
 
STR_LIST_FILTER_OSKTITLE                                        :{BLACK}Enter filter string
 
STR_LIST_FILTER_TOOLTIP                                         :{BLACK}Enter a keyword to filter the list for
 

	
 
STR_TOOLTIP_SORT_ORDER                                          :{BLACK}Select sorting order (descending/ascending)
 
STR_TOOLTIP_SORT_CRITERIA                                       :{BLACK}Select sorting criteria
 
STR_TOOLTIP_FILTER_CRITERIA                                     :{BLACK}Select filtering criteria
 
STR_BUTTON_SORT_BY                                              :{BLACK}Sort by
 
STR_BUTTON_LOCATION                                             :{BLACK}Location
 
STR_BUTTON_RENAME                                               :{BLACK}Rename
 

	
 
STR_TOOLTIP_CLOSE_WINDOW                                        :{BLACK}Close window
 
STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS                              :{BLACK}Window title - drag this to move window
 
STR_TOOLTIP_SHADE                                               :{BLACK}Shade window - only show the title bar
 
STR_TOOLTIP_DEBUG                                               :{BLACK}Show NewGRF debug information
 
STR_TOOLTIP_DEFSIZE                                             :{BLACK}Resize window to default size. Ctrl+Click to store current size as default
 
STR_TOOLTIP_STICKY                                              :{BLACK}Mark this window as uncloseable by the 'Close All Windows' key. Ctrl+Click to also save state as default
 
STR_TOOLTIP_RESIZE                                              :{BLACK}Click and drag to resize this window
 
STR_TOOLTIP_TOGGLE_LARGE_SMALL_WINDOW                           :{BLACK}Toggle large/small window size
 
STR_TOOLTIP_VSCROLL_BAR_SCROLLS_LIST                            :{BLACK}Scroll bar - scrolls list up/down
 
STR_TOOLTIP_HSCROLL_BAR_SCROLLS_LIST                            :{BLACK}Scroll bar - scrolls list left/right
 
STR_TOOLTIP_DEMOLISH_BUILDINGS_ETC                              :{BLACK}Demolish buildings etc. on a square of land. Ctrl selects the area diagonally. Shift toggles building/showing cost estimate
 

	
 
# Query window
 
STR_BUTTON_DEFAULT                                              :{BLACK}Default
 
STR_BUTTON_CANCEL                                               :{BLACK}Cancel
 
STR_BUTTON_OK                                                   :{BLACK}OK
 

	
 
# On screen keyboard window
 
STR_OSK_KEYBOARD_LAYOUT                                         :`1234567890-=\qwertyuiop[]asdfghjkl;'  zxcvbnm,./ .
 
STR_OSK_KEYBOARD_LAYOUT_CAPS                                    :~!@#$%^&*()_+|QWERTYUIOP{{}}ASDFGHJKL:"  ZXCVBNM<>? .
 

	
 
# Measurement tooltip
 
STR_MEASURE_LENGTH                                              :{BLACK}Length: {NUM}
 
STR_MEASURE_AREA                                                :{BLACK}Area: {NUM} x {NUM}
 
STR_MEASURE_LENGTH_HEIGHTDIFF                                   :{BLACK}Length: {NUM}{}Height difference: {HEIGHT}
 
STR_MEASURE_AREA_HEIGHTDIFF                                     :{BLACK}Area: {NUM} x {NUM}{}Height difference: {HEIGHT}
 

	
 

	
 
# These are used in buttons
 
STR_SORT_BY_CAPTION_NAME                                        :{BLACK}Name
 
STR_SORT_BY_CAPTION_DATE                                        :{BLACK}Date
 
# These are used in dropdowns
 
STR_SORT_BY_NAME                                                :Name
 
STR_SORT_BY_PRODUCTION                                          :Production
 
STR_SORT_BY_TYPE                                                :Type
 
STR_SORT_BY_TRANSPORTED                                         :Transported
 
STR_SORT_BY_NUMBER                                              :Number
 
STR_SORT_BY_PROFIT_LAST_YEAR                                    :Profit last year
 
STR_SORT_BY_PROFIT_THIS_YEAR                                    :Profit this year
 
STR_SORT_BY_AGE                                                 :Age
 
STR_SORT_BY_RELIABILITY                                         :Reliability
 
STR_SORT_BY_TOTAL_CAPACITY_PER_CARGOTYPE                        :Total capacity per cargo type
 
STR_SORT_BY_MAX_SPEED                                           :Maximum speed
 
STR_SORT_BY_MODEL                                               :Model
 
STR_SORT_BY_VALUE                                               :Value
 
STR_SORT_BY_LENGTH                                              :Length
 
STR_SORT_BY_LIFE_TIME                                           :Remaining lifetime
 
STR_SORT_BY_TIMETABLE_DELAY                                     :Timetable delay
 
STR_SORT_BY_FACILITY                                            :Station type
 
STR_SORT_BY_WAITING                                             :Waiting cargo value
 
STR_SORT_BY_RATING_MAX                                          :Highest cargo rating
 
STR_SORT_BY_RATING_MIN                                          :Lowest cargo rating
 
STR_SORT_BY_ENGINE_ID                                           :EngineID (classic sort)
 
STR_SORT_BY_COST                                                :Cost
 
STR_SORT_BY_POWER                                               :Power
 
STR_SORT_BY_TRACTIVE_EFFORT                                     :Tractive effort
 
STR_SORT_BY_INTRO_DATE                                          :Introduction Date
 
STR_SORT_BY_RUNNING_COST                                        :Running Cost
 
STR_SORT_BY_POWER_VS_RUNNING_COST                               :Power/Running Cost
 
STR_SORT_BY_CARGO_CAPACITY                                      :Cargo Capacity
 
STR_SORT_BY_RANGE                                               :Range
 
STR_SORT_BY_POPULATION                                          :Population
 
STR_SORT_BY_RATING                                              :Rating
 

	
 
# Tooltips for the main toolbar
 
STR_TOOLBAR_TOOLTIP_PAUSE_GAME                                  :{BLACK}Pause game
 
STR_TOOLBAR_TOOLTIP_FORWARD                                     :{BLACK}Fast forward the game
 
STR_TOOLBAR_TOOLTIP_OPTIONS                                     :{BLACK}Options
 
STR_TOOLBAR_TOOLTIP_SAVE_GAME_ABANDON_GAME                      :{BLACK}Save game, abandon game, exit
 
STR_TOOLBAR_TOOLTIP_DISPLAY_MAP                                 :{BLACK}Display map, extra viewport or list of signs
 
STR_TOOLBAR_TOOLTIP_DISPLAY_TOWN_DIRECTORY                      :{BLACK}Display town directory
 
STR_TOOLBAR_TOOLTIP_DISPLAY_SUBSIDIES                           :{BLACK}Display subsidies
 
STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_STATIONS            :{BLACK}Display list of company's stations
 
STR_TOOLBAR_TOOLTIP_DISPLAY_COMPANY_FINANCES                    :{BLACK}Display company finances information
 
STR_TOOLBAR_TOOLTIP_DISPLAY_COMPANY_GENERAL                     :{BLACK}Display general company information
 
STR_TOOLBAR_TOOLTIP_DISPLAY_GRAPHS                              :{BLACK}Display graphs
 
STR_TOOLBAR_TOOLTIP_DISPLAY_COMPANY_LEAGUE                      :{BLACK}Display company league table
 
STR_TOOLBAR_TOOLTIP_FUND_CONSTRUCTION_OF_NEW                    :{BLACK}Fund construction of new industry or list all industries
 
STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_TRAINS              :{BLACK}Display list of company's trains. Ctrl+Click toggles opening the group/vehicle list
 
STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_ROAD_VEHICLES       :{BLACK}Display list of company's road vehicles. Ctrl+Click toggles opening the group/vehicle list
 
STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_SHIPS               :{BLACK}Display list of company's ships. Ctrl+Click toggles opening the group/vehicle list
 
STR_TOOLBAR_TOOLTIP_DISPLAY_LIST_OF_COMPANY_AIRCRAFT            :{BLACK}Display list of company's aircraft. Ctrl+Click toggles opening the group/vehicle list
 
STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_IN                            :{BLACK}Zoom the view in
 
STR_TOOLBAR_TOOLTIP_ZOOM_THE_VIEW_OUT                           :{BLACK}Zoom the view out
 
STR_TOOLBAR_TOOLTIP_BUILD_RAILROAD_TRACK                        :{BLACK}Build railway track
 
STR_TOOLBAR_TOOLTIP_BUILD_ROADS                                 :{BLACK}Build roads
 
STR_TOOLBAR_TOOLTIP_BUILD_SHIP_DOCKS                            :{BLACK}Build ship docks
 
STR_TOOLBAR_TOOLTIP_BUILD_AIRPORTS                              :{BLACK}Build airports
 
STR_TOOLBAR_TOOLTIP_LANDSCAPING                                 :{BLACK}Open the landscaping toolbar to raise/lower land, plant trees, etc.
 
STR_TOOLBAR_TOOLTIP_SHOW_SOUND_MUSIC_WINDOW                     :{BLACK}Show sound/music window
 
STR_TOOLBAR_TOOLTIP_SHOW_LAST_MESSAGE_NEWS                      :{BLACK}Show last message/news report, show message options
 
STR_TOOLBAR_TOOLTIP_LAND_BLOCK_INFORMATION                      :{BLACK}Land area information, console, script debug, screenshots, about OpenTTD
 
STR_TOOLBAR_TOOLTIP_SWITCH_TOOLBAR                              :{BLACK}Switch toolbars
 

	
 
# Extra tooltips for the scenario editor toolbar
 
STR_SCENEDIT_TOOLBAR_TOOLTIP_SAVE_SCENARIO_LOAD_SCENARIO        :{BLACK}Save scenario, load scenario, abandon scenario editor, exit
 
STR_SCENEDIT_TOOLBAR_OPENTTD                                    :{YELLOW}OpenTTD
 
STR_SCENEDIT_TOOLBAR_SCENARIO_EDITOR                            :{YELLOW}Scenario Editor
 
STR_SCENEDIT_TOOLBAR_TOOLTIP_MOVE_THE_STARTING_DATE_BACKWARD    :{BLACK}Move the starting date backward 1 year
 
STR_SCENEDIT_TOOLBAR_TOOLTIP_MOVE_THE_STARTING_DATE_FORWARD     :{BLACK}Move the starting date forward 1 year
 
STR_SCENEDIT_TOOLBAR_TOOLTIP_SET_DATE                           :{BLACK}Click to enter the starting year
 
STR_SCENEDIT_TOOLBAR_TOOLTIP_DISPLAY_MAP_TOWN_DIRECTORY         :{BLACK}Display map, town directory
 
STR_SCENEDIT_TOOLBAR_LANDSCAPE_GENERATION                       :{BLACK}Landscape generation
 
STR_SCENEDIT_TOOLBAR_TOWN_GENERATION                            :{BLACK}Town generation
 
STR_SCENEDIT_TOOLBAR_INDUSTRY_GENERATION                        :{BLACK}Industry generation
 
STR_SCENEDIT_TOOLBAR_ROAD_CONSTRUCTION                          :{BLACK}Road construction
 
STR_SCENEDIT_TOOLBAR_PLANT_TREES                                :{BLACK}Plant trees. Shift toggles building/showing cost estimate
 
STR_SCENEDIT_TOOLBAR_PLACE_SIGN                                 :{BLACK}Place sign
 
STR_SCENEDIT_TOOLBAR_PLACE_OBJECT                               :{BLACK}Place object. Shift toggles building/showing cost estimate
 

	
 
############ range for SE file menu starts
 
STR_SCENEDIT_FILE_MENU_SAVE_SCENARIO                            :Save scenario
 
STR_SCENEDIT_FILE_MENU_LOAD_SCENARIO                            :Load scenario
 
STR_SCENEDIT_FILE_MENU_SAVE_HEIGHTMAP                           :Save heightmap
 
STR_SCENEDIT_FILE_MENU_LOAD_HEIGHTMAP                           :Load heightmap
 
STR_SCENEDIT_FILE_MENU_QUIT_EDITOR                              :Abandon scenario editor
 
STR_SCENEDIT_FILE_MENU_SEPARATOR                                :
 
STR_SCENEDIT_FILE_MENU_QUIT                                     :Exit
 
############ range for SE file menu starts
 

	
 
############ range for settings menu starts
 
STR_SETTINGS_MENU_GAME_OPTIONS                                  :Game options
 
STR_SETTINGS_MENU_CONFIG_SETTINGS                               :Advanced settings
 
STR_SETTINGS_MENU_SCRIPT_SETTINGS                               :AI/Game script settings
 
STR_SETTINGS_MENU_NEWGRF_SETTINGS                               :NewGRF settings
 
STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS                          :Transparency options
 
STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED                          :Town names displayed
 
STR_SETTINGS_MENU_STATION_NAMES_DISPLAYED                       :Station names displayed
 
STR_SETTINGS_MENU_WAYPOINTS_DISPLAYED                           :Waypoint names displayed
 
STR_SETTINGS_MENU_SIGNS_DISPLAYED                               :Signs displayed
 
STR_SETTINGS_MENU_SHOW_COMPETITOR_SIGNS                         :Competitor signs and names displayed
 
STR_SETTINGS_MENU_FULL_ANIMATION                                :Full animation
 
STR_SETTINGS_MENU_FULL_DETAIL                                   :Full detail
 
STR_SETTINGS_MENU_TRANSPARENT_BUILDINGS                         :Transparent buildings
 
STR_SETTINGS_MENU_TRANSPARENT_SIGNS                             :Transparent signs
 
############ range ends here
 

	
 
############ range for file menu starts
 
STR_FILE_MENU_SAVE_GAME                                         :Save game
 
STR_FILE_MENU_LOAD_GAME                                         :Load game
 
STR_FILE_MENU_QUIT_GAME                                         :Abandon game
 
STR_FILE_MENU_SEPARATOR                                         :
 
STR_FILE_MENU_EXIT                                              :Exit
 
############ range ends here
 

	
 
############ range for map menu starts
 
# map menu
 
STR_MAP_MENU_MAP_OF_WORLD                                       :Map of world
 
STR_MAP_MENU_EXTRA_VIEW_PORT                                    :Extra viewport
 
STR_MAP_MENU_LINGRAPH_LEGEND                                    :Cargo Flow Legend
 
STR_MAP_MENU_SIGN_LIST                                          :Sign list
 
############ range for town menu starts, yet the town directory is shown in the map menu in the scenario editor
 

	
 
############ range for town menu starts
 
STR_TOWN_MENU_TOWN_DIRECTORY                                    :Town directory
 
############ end of the 'Display map' dropdown
 
STR_TOWN_MENU_FOUND_TOWN                                        :Found town
 
############ end of the 'Town' dropdown
 
############ range ends here
 

	
 
############ range for subsidies menu starts
 
STR_SUBSIDIES_MENU_SUBSIDIES                                    :Subsidies
 
############ range ends here
 

	
 
############ range for graph menu starts
 
STR_GRAPH_MENU_OPERATING_PROFIT_GRAPH                           :Operating profit graph
 
STR_GRAPH_MENU_INCOME_GRAPH                                     :Income graph
 
STR_GRAPH_MENU_DELIVERED_CARGO_GRAPH                            :Delivered cargo graph
 
STR_GRAPH_MENU_PERFORMANCE_HISTORY_GRAPH                        :Performance history graph
 
STR_GRAPH_MENU_COMPANY_VALUE_GRAPH                              :Company value graph
 
STR_GRAPH_MENU_CARGO_PAYMENT_RATES                              :Cargo payment rates
 
############ range ends here
 

	
 
############ range for company league menu starts
 
STR_GRAPH_MENU_GOAL                                             :Current goals
 
STR_GRAPH_MENU_COMPANY_LEAGUE_TABLE                             :Company league table
 
STR_GRAPH_MENU_DETAILED_PERFORMANCE_RATING                      :Detailed performance rating
 
STR_GRAPH_MENU_HIGHSCORE                                        :Highscore table
 
############ range ends here
 

	
 
############ range for industry menu starts
 
STR_INDUSTRY_MENU_INDUSTRY_DIRECTORY                            :Industry directory
 
STR_INDUSTRY_MENU_INDUSTRY_CHAIN                                :Industry chains
 
STR_INDUSTRY_MENU_FUND_NEW_INDUSTRY                             :Fund new industry
 
############ range ends here
 

	
 
############ range for railway construction menu starts
 
STR_RAIL_MENU_RAILROAD_CONSTRUCTION                             :Railway construction
 
STR_RAIL_MENU_ELRAIL_CONSTRUCTION                               :Electrified railway construction
 
STR_RAIL_MENU_MONORAIL_CONSTRUCTION                             :Monorail construction
 
STR_RAIL_MENU_MAGLEV_CONSTRUCTION                               :Maglev construction
 
############ range ends here
 

	
 
############ range for road construction menu starts
 
STR_ROAD_MENU_ROAD_CONSTRUCTION                                 :Road construction
 
STR_ROAD_MENU_TRAM_CONSTRUCTION                                 :Tramway construction
 
############ range ends here
 

	
 
############ range for waterways construction menu starts
 
STR_WATERWAYS_MENU_WATERWAYS_CONSTRUCTION                       :Waterways construction
 
############ range ends here
 

	
 
############ range for airport construction menu starts
 
STR_AIRCRAFT_MENU_AIRPORT_CONSTRUCTION                          :Airport construction
 
############ range ends here
 

	
 
############ range for landscaping menu starts
 
STR_LANDSCAPING_MENU_LANDSCAPING                                :Landscaping
 
STR_LANDSCAPING_MENU_PLANT_TREES                                :Plant trees
 
STR_LANDSCAPING_MENU_PLACE_SIGN                                 :Place sign
 
############ range ends here
 

	
 
############ range for music menu starts
 
STR_TOOLBAR_SOUND_MUSIC                                         :Sound/music
 
############ range ends here
 

	
 
############ range for message menu starts
 
STR_NEWS_MENU_LAST_MESSAGE_NEWS_REPORT                          :Last message/news report
 
STR_NEWS_MENU_MESSAGE_HISTORY_MENU                              :Message history
 
############ range ends here
 

	
 
############ range for about menu starts
 
STR_ABOUT_MENU_LAND_BLOCK_INFO                                  :Land area information
 
STR_ABOUT_MENU_SEPARATOR                                        :
 
STR_ABOUT_MENU_TOGGLE_CONSOLE                                   :Toggle console
 
STR_ABOUT_MENU_AI_DEBUG                                         :AI/Game script debug
 
STR_ABOUT_MENU_SCREENSHOT                                       :Screenshot
 
STR_ABOUT_MENU_ZOOMIN_SCREENSHOT                                :Fully zoomed in screenshot
 
STR_ABOUT_MENU_DEFAULTZOOM_SCREENSHOT                           :Default zoom screenshot
 
STR_ABOUT_MENU_GIANT_SCREENSHOT                                 :Whole map screenshot
 
STR_ABOUT_MENU_ABOUT_OPENTTD                                    :About 'OpenTTD'
 
STR_ABOUT_MENU_SPRITE_ALIGNER                                   :Sprite aligner
 
STR_ABOUT_MENU_TOGGLE_BOUNDING_BOXES                            :Toggle bounding boxes
 
STR_ABOUT_MENU_TOGGLE_DIRTY_BLOCKS                              :Toggle colouring of dirty blocks
 
############ range ends here
 

	
 
############ range for days starts (also used for the place in the highscore window)
 
STR_ORDINAL_NUMBER_1ST                                          :1st
 
STR_ORDINAL_NUMBER_2ND                                          :2nd
 
STR_ORDINAL_NUMBER_3RD                                          :3rd
 
STR_ORDINAL_NUMBER_4TH                                          :4th
 
STR_ORDINAL_NUMBER_5TH                                          :5th
 
STR_ORDINAL_NUMBER_6TH                                          :6th
 
STR_ORDINAL_NUMBER_7TH                                          :7th
 
STR_ORDINAL_NUMBER_8TH                                          :8th
 
STR_ORDINAL_NUMBER_9TH                                          :9th
 
STR_ORDINAL_NUMBER_10TH                                         :10th
 
STR_ORDINAL_NUMBER_11TH                                         :11th
 
STR_ORDINAL_NUMBER_12TH                                         :12th
 
STR_ORDINAL_NUMBER_13TH                                         :13th
 
STR_ORDINAL_NUMBER_14TH                                         :14th
 
STR_ORDINAL_NUMBER_15TH                                         :15th
 
STR_ORDINAL_NUMBER_16TH                                         :16th
 
STR_ORDINAL_NUMBER_17TH                                         :17th
 
STR_ORDINAL_NUMBER_18TH                                         :18th
 
STR_ORDINAL_NUMBER_19TH                                         :19th
 
STR_ORDINAL_NUMBER_20TH                                         :20th
 
STR_ORDINAL_NUMBER_21ST                                         :21st
 
STR_ORDINAL_NUMBER_22ND                                         :22nd
 
STR_ORDINAL_NUMBER_23RD                                         :23rd
 
STR_ORDINAL_NUMBER_24TH                                         :24th
 
STR_ORDINAL_NUMBER_25TH                                         :25th
 
STR_ORDINAL_NUMBER_26TH                                         :26th
 
STR_ORDINAL_NUMBER_27TH                                         :27th
 
STR_ORDINAL_NUMBER_28TH                                         :28th
 
STR_ORDINAL_NUMBER_29TH                                         :29th
 
STR_ORDINAL_NUMBER_30TH                                         :30th
 
STR_ORDINAL_NUMBER_31ST                                         :31st
 
############ range for days ends
 

	
 
############ range for months starts
 
STR_MONTH_ABBREV_JAN                                            :Jan
 
STR_MONTH_ABBREV_FEB                                            :Feb
 
STR_MONTH_ABBREV_MAR                                            :Mar
 
STR_MONTH_ABBREV_APR                                            :Apr
 
STR_MONTH_ABBREV_MAY                                            :May
 
STR_MONTH_ABBREV_JUN                                            :Jun
 
STR_MONTH_ABBREV_JUL                                            :Jul
 
STR_MONTH_ABBREV_AUG                                            :Aug
 
STR_MONTH_ABBREV_SEP                                            :Sep
 
STR_MONTH_ABBREV_OCT                                            :Oct
 
STR_MONTH_ABBREV_NOV                                            :Nov
 
STR_MONTH_ABBREV_DEC                                            :Dec
 

	
 
STR_MONTH_JAN                                                   :January
 
STR_MONTH_FEB                                                   :February
 
STR_MONTH_MAR                                                   :March
 
STR_MONTH_APR                                                   :April
 
STR_MONTH_MAY                                                   :May
 
STR_MONTH_JUN                                                   :June
 
STR_MONTH_JUL                                                   :July
 
STR_MONTH_AUG                                                   :August
 
STR_MONTH_SEP                                                   :September
 
STR_MONTH_OCT                                                   :October
 
STR_MONTH_NOV                                                   :November
 
STR_MONTH_DEC                                                   :December
 
############ range for months ends
 

	
 
# Graph window
 
STR_GRAPH_KEY_BUTTON                                            :{BLACK}Key
 
STR_GRAPH_KEY_TOOLTIP                                           :{BLACK}Show key to graphs
 
STR_GRAPH_X_LABEL_MONTH                                         :{TINY_FONT}{STRING}{} {STRING}
 
STR_GRAPH_X_LABEL_MONTH_YEAR                                    :{TINY_FONT}{STRING}{} {STRING}{}{NUM}
 
STR_GRAPH_Y_LABEL                                               :{TINY_FONT}{STRING2}
 
STR_GRAPH_Y_LABEL_NUMBER                                        :{TINY_FONT}{COMMA}
 

	
 
STR_GRAPH_OPERATING_PROFIT_CAPTION                              :{WHITE}Operating Profit Graph
 
STR_GRAPH_INCOME_CAPTION                                        :{WHITE}Income Graph
 
STR_GRAPH_CARGO_DELIVERED_CAPTION                               :{WHITE}Units of cargo delivered
 
STR_GRAPH_COMPANY_PERFORMANCE_RATINGS_CAPTION                   :{WHITE}Company performance ratings (maximum rating=1000)
 
STR_GRAPH_COMPANY_VALUES_CAPTION                                :{WHITE}Company values
 

	
 
STR_GRAPH_CARGO_PAYMENT_RATES_CAPTION                           :{WHITE}Cargo Payment Rates
 
STR_GRAPH_CARGO_PAYMENT_RATES_X_LABEL                           :{TINY_FONT}{BLACK}Days in transit
 
STR_GRAPH_CARGO_PAYMENT_RATES_TITLE                             :{TINY_FONT}{BLACK}Payment for delivering 10 units (or 10,000 litres) of cargo a distance of 20 squares
 
STR_GRAPH_CARGO_ENABLE_ALL                                      :{TINY_FONT}{BLACK}Enable all
 
STR_GRAPH_CARGO_DISABLE_ALL                                     :{TINY_FONT}{BLACK}Disable all
 
STR_GRAPH_CARGO_TOOLTIP_ENABLE_ALL                              :{BLACK}Display all cargoes on the cargo payment rates graph
 
STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL                             :{BLACK}Display no cargoes on the cargo payment rates graph
 
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO                            :{BLACK}Toggle graph for cargo type on/off
 
STR_GRAPH_CARGO_PAYMENT_CARGO                                   :{TINY_FONT}{BLACK}{STRING}
 

	
 
STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP                            :{BLACK}Show detailed performance ratings
 

	
 
# Graph key window
 
STR_GRAPH_KEY_CAPTION                                           :{WHITE}Key to company graphs
 
STR_GRAPH_KEY_COMPANY_SELECTION_TOOLTIP                         :{BLACK}Click here to toggle company's entry on graph on/off
 

	
 
# Company league window
 
STR_COMPANY_LEAGUE_TABLE_CAPTION                                :{WHITE}Company League Table
 
STR_COMPANY_LEAGUE_COMPANY_NAME                                 :{ORANGE}{COMPANY} {BLACK}{COMPANY_NUM} '{STRING}'
 
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ENGINEER                   :Engineer
 
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRAFFIC_MANAGER            :Traffic Manager
 
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TRANSPORT_COORDINATOR      :Transport Coordinator
 
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_ROUTE_SUPERVISOR           :Route Supervisor
 
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_DIRECTOR                   :Director
 
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHIEF_EXECUTIVE            :Chief Executive
 
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_CHAIRMAN                   :Chairman
 
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_PRESIDENT                  :President
 
STR_COMPANY_LEAGUE_PERFORMANCE_TITLE_TYCOON                     :Tycoon
 

	
 
# Performance detail window
 
STR_PERFORMANCE_DETAIL                                          :{WHITE}Detailed performance rating
 
STR_PERFORMANCE_DETAIL_KEY                                      :{BLACK}Detail
 
STR_PERFORMANCE_DETAIL_AMOUNT_CURRENCY                          :{BLACK}({CURRENCY_SHORT}/{CURRENCY_SHORT})
 
STR_PERFORMANCE_DETAIL_AMOUNT_INT                               :{BLACK}({COMMA}/{COMMA})
 
STR_PERFORMANCE_DETAIL_PERCENT                                  :{WHITE}{NUM}%
 
STR_PERFORMANCE_DETAIL_SELECT_COMPANY_TOOLTIP                   :{BLACK}View details about this company
 
############ Those following lines need to be in this order!!
 
STR_PERFORMANCE_DETAIL_VEHICLES                                 :{BLACK}Vehicles:
 
STR_PERFORMANCE_DETAIL_STATIONS                                 :{BLACK}Stations:
src/toolbar_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
/** @file toolbar_gui.cpp Code related to the (main) toolbar. */
 

	
 
#include "stdafx.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "window_func.h"
 
#include "viewport_func.h"
 
#include "command_func.h"
 
#include "vehicle_gui.h"
 
#include "rail_gui.h"
 
#include "road_gui.h"
 
#include "date_func.h"
 
#include "vehicle_func.h"
 
#include "sound_func.h"
 
#include "terraform_gui.h"
 
#include "strings_func.h"
 
#include "company_func.h"
 
#include "company_gui.h"
 
#include "vehicle_base.h"
 
#include "cheat_func.h"
 
#include "transparency_gui.h"
 
#include "screenshot.h"
 
#include "signs_func.h"
 
#include "fios.h"
 
#include "console_gui.h"
 
#include "news_gui.h"
 
#include "ai/ai_gui.hpp"
 
#include "tilehighlight_func.h"
 
#include "smallmap_gui.h"
 
#include "graph_gui.h"
 
#include "textbuf_gui.h"
 
#include "linkgraph/linkgraph_gui.h"
 
#include "newgrf_debug.h"
 
#include "hotkeys.h"
 
#include "engine_base.h"
 
#include "highscore.h"
 
#include "game/game.hpp"
 

	
 
#include "widgets/toolbar_widget.h"
 

	
 
#include "network/network.h"
 
#include "network/network_gui.h"
 
#include "network/network_func.h"
 

	
 

	
 
RailType _last_built_railtype;
 
RoadType _last_built_roadtype;
 

	
 
static ScreenshotType _confirmed_screenshot_type; ///< Screenshot type the current query is about to confirm.
 

	
 
/** Toobar modes */
 
enum ToolbarMode {
 
	TB_NORMAL,
 
	TB_UPPER,
 
	TB_LOWER
 
};
 

	
 
/** Callback functions. */
 
enum CallBackFunction {
 
	CBF_NONE,
 
	CBF_PLACE_SIGN,
 
	CBF_PLACE_LANDINFO,
 
};
 

	
 
/**
 
 * Drop down list entry for showing a checked/unchecked toggle item.
 
 */
 
class DropDownListCheckedItem : public DropDownListStringItem {
 
	uint checkmark_width;
 
public:
 
	bool checked;
 

	
 
	DropDownListCheckedItem(StringID string, int result, bool masked, bool checked) : DropDownListStringItem(string, result, masked), checked(checked)
 
	{
 
		this->checkmark_width = GetStringBoundingBox(STR_JUST_CHECKMARK).width + 3;
 
	}
 

	
 
	virtual ~DropDownListCheckedItem() {}
 

	
 
	uint Width() const
 
	{
 
		return DropDownListStringItem::Width() + this->checkmark_width;
 
	}
 

	
 
	void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const
 
	{
 
		bool rtl = _current_text_dir == TD_RTL;
 
		if (this->checked) {
 
			DrawString(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, STR_JUST_CHECKMARK, sel ? TC_WHITE : TC_BLACK);
 
		}
 
		DrawString(left + WD_FRAMERECT_LEFT + (rtl ? 0 : this->checkmark_width), right - WD_FRAMERECT_RIGHT - (rtl ? this->checkmark_width : 0), top, this->String(), sel ? TC_WHITE : TC_BLACK);
 
	}
 
};
 

	
 
/**
 
 * Drop down list entry for showing a company entry, with companies 'blob'.
 
 */
 
class DropDownListCompanyItem : public DropDownListItem {
 
	Dimension icon_size;
 
public:
 
	bool greyed;
 

	
 
	DropDownListCompanyItem(int result, bool masked, bool greyed) : DropDownListItem(result, masked), greyed(greyed)
 
	{
 
		this->icon_size = GetSpriteSize(SPR_COMPANY_ICON);
 
	}
 

	
 
	virtual ~DropDownListCompanyItem() {}
 

	
 
	bool Selectable() const
 
	{
 
		return true;
 
	}
 

	
 
	uint Width() const
 
	{
 
		CompanyID company = (CompanyID)this->result;
 
		SetDParam(0, company);
 
		SetDParam(1, company);
 
		return GetStringBoundingBox(STR_COMPANY_NAME_COMPANY_NUM).width + this->icon_size.width + 3;
 
	}
 

	
 
	uint Height(uint width) const
 
	{
 
		return max(this->icon_size.height + 2U, (uint)FONT_HEIGHT_NORMAL);
 
	}
 

	
 
	void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const
 
	{
 
		CompanyID company = (CompanyID)this->result;
 
		bool rtl = _current_text_dir == TD_RTL;
 

	
 
		/* It's possible the company is deleted while the dropdown is open */
 
		if (!Company::IsValidID(company)) return;
 

	
 
		int icon_offset = (bottom - top - icon_size.height) / 2;
 
		int text_offset = (bottom - top - FONT_HEIGHT_NORMAL) / 2;
 

	
 
		DrawCompanyIcon(company, rtl ? right - this->icon_size.width - WD_FRAMERECT_RIGHT : left + WD_FRAMERECT_LEFT, top + icon_offset);
 

	
 
		SetDParam(0, company);
 
		SetDParam(1, company);
 
		TextColour col;
 
		if (this->greyed) {
 
			col = (sel ? TC_SILVER : TC_GREY) | TC_NO_SHADE;
 
		} else {
 
			col = sel ? TC_WHITE : TC_BLACK;
 
		}
 
		DrawString(left + WD_FRAMERECT_LEFT + (rtl ? 0 : 3 + this->icon_size.width), right - WD_FRAMERECT_RIGHT - (rtl ? 3 + this->icon_size.width : 0), top + text_offset, STR_COMPANY_NAME_COMPANY_NUM, col);
 
	}
 
};
 

	
 
/**
 
 * Pop up a generic text only menu.
 
 * @param w Toolbar
 
 * @param widget Toolbar button
 
 * @param list List of items
 
 * @param def Default item
 
 */
 
static void PopupMainToolbMenu(Window *w, int widget, DropDownList *list, int def)
 
{
 
	ShowDropDownList(w, list, def, widget, 0, true, true);
 
	if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
 
}
 

	
 
/**
 
 * Pop up a generic text only menu.
 
 * @param w Toolbar
 
 * @param widget Toolbar button
 
 * @param string String for the first item in the menu
 
 * @param count Number of items in the menu
 
 * @param skip Hide first \a skip items in the menu
 
 */
 
static void PopupMainToolbMenu(Window *w, int widget, StringID string, int count, int skip = 0)
 
{
 
	DropDownList *list = new DropDownList();
 
	for (int i = skip; i < count; i++) {
 
		list->push_back(new DropDownListStringItem(string + i, i, false));
 
	}
 
	ShowDropDownList(w, list, skip, widget, 140, true, true);
 
	if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
 
	PopupMainToolbMenu(w, widget, list, skip);
 
}
 

	
 
/** Enum for the Company Toolbar's network related buttons */
 
static const int CTMN_CLIENT_LIST = -1; ///< Show the client list
 
static const int CTMN_NEW_COMPANY = -2; ///< Create a new company
 
static const int CTMN_SPECTATE    = -3; ///< Become spectator
 

	
 
/**
 
 * Pop up a generic company list menu.
 
 */
 
static void PopupMainCompanyToolbMenu(Window *w, int widget, int grey = 0)
 
{
 
	DropDownList *list = new DropDownList();
 

	
 
#ifdef ENABLE_NETWORK
 
	if (widget == WID_TN_COMPANIES && _networking) {
 
		/* Add the client list button for the companies menu */
 
		list->push_back(new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_CLIENT_LIST, CTMN_CLIENT_LIST, false));
 

	
 
		if (_local_company == COMPANY_SPECTATOR) {
 
			list->push_back(new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_NEW_COMPANY, CTMN_NEW_COMPANY, NetworkMaxCompaniesReached()));
 
		} else {
 
			list->push_back(new DropDownListStringItem(STR_NETWORK_COMPANY_LIST_SPECTATE, CTMN_SPECTATE, NetworkMaxSpectatorsReached()));
 
		}
 
	}
 
#endif /* ENABLE_NETWORK */
 

	
 
	for (CompanyID c = COMPANY_FIRST; c < MAX_COMPANIES; c++) {
 
		if (!Company::IsValidID(c)) continue;
 
		list->push_back(new DropDownListCompanyItem(c, false, HasBit(grey, c)));
 
	}
 

	
 
	ShowDropDownList(w, list, _local_company == COMPANY_SPECTATOR ? CTMN_CLIENT_LIST : (int)_local_company, widget, 240, true, true);
 
	if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
 
	PopupMainToolbMenu(w, widget, list, _local_company == COMPANY_SPECTATOR ? CTMN_CLIENT_LIST : (int)_local_company);
 
}
 

	
 

	
 
static ToolbarMode _toolbar_mode;
 

	
 
static CallBackFunction SelectSignTool()
 
{
 
	if (_cursor.sprite == SPR_CURSOR_SIGN) {
 
		ResetObjectToPlace();
 
		return CBF_NONE;
 
	} else {
 
		SetObjectToPlace(SPR_CURSOR_SIGN, PAL_NONE, HT_RECT, WC_MAIN_TOOLBAR, 0);
 
		return CBF_PLACE_SIGN;
 
	}
 
}
 

	
 
/* --- Pausing --- */
 

	
 
static CallBackFunction ToolbarPauseClick(Window *w)
 
{
 
	if (_networking && !_network_server) return CBF_NONE; // only server can pause the game
 

	
 
	if (DoCommandP(0, PM_PAUSED_NORMAL, _pause_mode == PM_UNPAUSED, CMD_PAUSE)) {
 
		if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
 
	}
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Toggle fast forward mode.
 
 *
 
 * @param w Unused.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction ToolbarFastForwardClick(Window *w)
 
{
 
	_fast_forward ^= true;
 
	if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Game Option button menu entries.
 
 */
 
enum OptionMenuEntries {
 
	OME_GAMEOPTIONS,
 
	OME_SETTINGS,
 
	OME_SCRIPT_SETTINGS,
 
	OME_NEWGRFSETTINGS,
 
	OME_TRANSPARENCIES,
 
	OME_SHOW_TOWNNAMES,
 
	OME_SHOW_STATIONNAMES,
 
	OME_SHOW_WAYPOINTNAMES,
 
	OME_SHOW_SIGNS,
 
	OME_SHOW_COMPETITOR_SIGNS,
 
	OME_FULL_ANIMATION,
 
	OME_FULL_DETAILS,
 
	OME_TRANSPARENTBUILDINGS,
 
	OME_SHOW_STATIONSIGNS,
 
};
 

	
 
/**
 
 * Handle click on Options button in toolbar.
 
 *
 
 * @param w parent window the shown Drop down list is attached to.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction ToolbarOptionsClick(Window *w)
 
{
 
	DropDownList *list = new DropDownList();
 
	list->push_back(new DropDownListStringItem(STR_SETTINGS_MENU_GAME_OPTIONS,             OME_GAMEOPTIONS, false));
 
	list->push_back(new DropDownListStringItem(STR_SETTINGS_MENU_CONFIG_SETTINGS,          OME_SETTINGS, false));
 
	/* Changes to the per-AI settings don't get send from the server to the clients. Clients get
 
	 * the settings once they join but never update it. As such don't show the window at all
 
	 * to network clients. */
 
	if (!_networking || _network_server) list->push_back(new DropDownListStringItem(STR_SETTINGS_MENU_SCRIPT_SETTINGS, OME_SCRIPT_SETTINGS, false));
 
	list->push_back(new DropDownListStringItem(STR_SETTINGS_MENU_NEWGRF_SETTINGS,          OME_NEWGRFSETTINGS, false));
 
	list->push_back(new DropDownListStringItem(STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS,     OME_TRANSPARENCIES, false));
 
	list->push_back(new DropDownListItem(-1, false));
 
	list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED,    OME_SHOW_TOWNNAMES, false, HasBit(_display_opt, DO_SHOW_TOWN_NAMES)));
 
	list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_STATION_NAMES_DISPLAYED, OME_SHOW_STATIONNAMES, false, HasBit(_display_opt, DO_SHOW_STATION_NAMES)));
 
	list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_WAYPOINTS_DISPLAYED,     OME_SHOW_WAYPOINTNAMES, false, HasBit(_display_opt, DO_SHOW_WAYPOINT_NAMES)));
 
	list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_SIGNS_DISPLAYED,         OME_SHOW_SIGNS, false, HasBit(_display_opt, DO_SHOW_SIGNS)));
 
	list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_SHOW_COMPETITOR_SIGNS,   OME_SHOW_COMPETITOR_SIGNS, false, HasBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS)));
 
	list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_FULL_ANIMATION,          OME_FULL_ANIMATION, false, HasBit(_display_opt, DO_FULL_ANIMATION)));
 
	list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_FULL_DETAIL,             OME_FULL_DETAILS, false, HasBit(_display_opt, DO_FULL_DETAIL)));
 
	list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_TRANSPARENT_BUILDINGS,   OME_TRANSPARENTBUILDINGS, false, IsTransparencySet(TO_HOUSES)));
 
	list->push_back(new DropDownListCheckedItem(STR_SETTINGS_MENU_TRANSPARENT_SIGNS,       OME_SHOW_STATIONSIGNS, false, IsTransparencySet(TO_SIGNS)));
 

	
 
	ShowDropDownList(w, list, 0, WID_TN_SETTINGS, 140, true, true);
 
	if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Handle click on one of the entries in the Options button menu.
 
 *
 
 * @param index Index being clicked.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction MenuClickSettings(int index)
 
{
 
	switch (index) {
 
		case OME_GAMEOPTIONS:          ShowGameOptions();                               return CBF_NONE;
 
		case OME_SETTINGS:             ShowGameSettings();                              return CBF_NONE;
 
		case OME_SCRIPT_SETTINGS:      ShowAIConfigWindow();                            return CBF_NONE;
 
		case OME_NEWGRFSETTINGS:       ShowNewGRFSettings(!_networking && _settings_client.gui.UserIsAllowedToChangeNewGRFs(), true, true, &_grfconfig); return CBF_NONE;
 
		case OME_TRANSPARENCIES:       ShowTransparencyToolbar();                       break;
 

	
 
		case OME_SHOW_TOWNNAMES:       ToggleBit(_display_opt, DO_SHOW_TOWN_NAMES);     break;
 
		case OME_SHOW_STATIONNAMES:    ToggleBit(_display_opt, DO_SHOW_STATION_NAMES);  break;
 
		case OME_SHOW_WAYPOINTNAMES:   ToggleBit(_display_opt, DO_SHOW_WAYPOINT_NAMES); break;
 
		case OME_SHOW_SIGNS:           ToggleBit(_display_opt, DO_SHOW_SIGNS);          break;
 
		case OME_SHOW_COMPETITOR_SIGNS:
 
			ToggleBit(_display_opt, DO_SHOW_COMPETITOR_SIGNS);
 
			InvalidateWindowClassesData(WC_SIGN_LIST, -1);
 
			break;
 
		case OME_FULL_ANIMATION:       ToggleBit(_display_opt, DO_FULL_ANIMATION);      break;
 
		case OME_FULL_DETAILS:         ToggleBit(_display_opt, DO_FULL_DETAIL);         break;
 
		case OME_TRANSPARENTBUILDINGS: ToggleTransparency(TO_HOUSES);                   break;
 
		case OME_SHOW_STATIONSIGNS:    ToggleTransparency(TO_SIGNS);                    break;
 
	}
 
	MarkWholeScreenDirty();
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * SaveLoad entries in scenario editor mode.
 
 */
 
enum SaveLoadEditorMenuEntries {
 
	SLEME_SAVE_SCENARIO   = 0,
 
	SLEME_LOAD_SCENARIO,
 
	SLEME_SAVE_HEIGHTMAP,
 
	SLEME_LOAD_HEIGHTMAP,
 
	SLEME_EXIT_TOINTRO,
 
	SLEME_EXIT_GAME       = 6,
 
	SLEME_MENUCOUNT,
 
};
 

	
 
/**
 
 * SaveLoad entries in normal game mode.
 
 */
 
enum SaveLoadNormalMenuEntries {
 
	SLNME_SAVE_GAME   = 0,
 
	SLNME_LOAD_GAME,
 
	SLNME_EXIT_TOINTRO,
 
	SLNME_EXIT_GAME = 4,
 
	SLNME_MENUCOUNT,
 
};
 

	
 
/**
 
 * Handle click on Save button in toolbar in normal game mode.
 
 *
 
 * @param w parent window the shown save dialogue is attached to.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction ToolbarSaveClick(Window *w)
 
{
 
	PopupMainToolbMenu(w, WID_TN_SAVE, STR_FILE_MENU_SAVE_GAME, SLNME_MENUCOUNT);
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Handle click on SaveLoad button in toolbar in the scenario editor.
 
 *
 
 * @param w parent window the shown save dialogue is attached to.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction ToolbarScenSaveOrLoad(Window *w)
 
{
 
	PopupMainToolbMenu(w, WID_TE_SAVE, STR_SCENEDIT_FILE_MENU_SAVE_SCENARIO, SLEME_MENUCOUNT);
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Handle click on one of the entries in the SaveLoad menu.
 
 *
 
 * @param index Index being clicked.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction MenuClickSaveLoad(int index = 0)
 
{
 
	if (_game_mode == GM_EDITOR) {
 
		switch (index) {
 
			case SLEME_SAVE_SCENARIO:  ShowSaveLoadDialog(SLD_SAVE_SCENARIO);  break;
 
			case SLEME_LOAD_SCENARIO:  ShowSaveLoadDialog(SLD_LOAD_SCENARIO);  break;
 
			case SLEME_SAVE_HEIGHTMAP: ShowSaveLoadDialog(SLD_SAVE_HEIGHTMAP); break;
 
			case SLEME_LOAD_HEIGHTMAP: ShowSaveLoadDialog(SLD_LOAD_HEIGHTMAP); break;
 
			case SLEME_EXIT_TOINTRO:   AskExitToGameMenu();                    break;
 
			case SLEME_EXIT_GAME:      HandleExitGameRequest();                break;
 
		}
 
	} else {
 
		switch (index) {
 
			case SLNME_SAVE_GAME:      ShowSaveLoadDialog(SLD_SAVE_GAME); break;
 
			case SLNME_LOAD_GAME:      ShowSaveLoadDialog(SLD_LOAD_GAME); break;
 
			case SLNME_EXIT_TOINTRO:   AskExitToGameMenu();               break;
 
			case SLNME_EXIT_GAME:      HandleExitGameRequest();           break;
 
		}
 
	}
 
	return CBF_NONE;
 
}
 

	
 
/* --- Map button menu --- */
 

	
 
enum MapMenuEntries {
 
	MME_SHOW_SMALLMAP        = 0,
 
	MME_SHOW_EXTRAVIEWPORTS,
 
	MME_SHOW_LINKGRAPH,
 
	MME_SHOW_SIGNLISTS,
 
	MME_SHOW_TOWNDIRECTORY,    ///< This entry is only used in Editor mode
 
	MME_MENUCOUNT_NORMAL     = 4,
 
	MME_MENUCOUNT_EDITOR     = 5,
 
	MME_SHOW_TOWNDIRECTORY,
 
	MME_SHOW_INDUSTRYDIRECTORY,
 
};
 

	
 
static CallBackFunction ToolbarMapClick(Window *w)
 
{
 
	PopupMainToolbMenu(w, WID_TN_SMALL_MAP, STR_MAP_MENU_MAP_OF_WORLD, MME_MENUCOUNT_NORMAL);
 
	DropDownList *list = new DropDownList();
 
	list->push_back(new DropDownListStringItem(STR_MAP_MENU_MAP_OF_WORLD,            MME_SHOW_SMALLMAP,          false));
 
	list->push_back(new DropDownListStringItem(STR_MAP_MENU_EXTRA_VIEW_PORT,         MME_SHOW_EXTRAVIEWPORTS,    false));
 
	list->push_back(new DropDownListStringItem(STR_MAP_MENU_LINGRAPH_LEGEND,         MME_SHOW_LINKGRAPH,         false));
 
	list->push_back(new DropDownListStringItem(STR_MAP_MENU_SIGN_LIST,               MME_SHOW_SIGNLISTS,         false));
 
	PopupMainToolbMenu(w, WID_TN_SMALL_MAP, list, 0);
 
	return CBF_NONE;
 
}
 

	
 
static CallBackFunction ToolbarScenMapTownDir(Window *w)
 
{
 
	PopupMainToolbMenu(w, WID_TE_SMALL_MAP, STR_MAP_MENU_MAP_OF_WORLD, MME_MENUCOUNT_EDITOR);
 
	DropDownList *list = new DropDownList();
 
	list->push_back(new DropDownListStringItem(STR_MAP_MENU_MAP_OF_WORLD,            MME_SHOW_SMALLMAP,          false));
 
	list->push_back(new DropDownListStringItem(STR_MAP_MENU_EXTRA_VIEW_PORT,         MME_SHOW_EXTRAVIEWPORTS,    false));
 
	list->push_back(new DropDownListStringItem(STR_MAP_MENU_SIGN_LIST,               MME_SHOW_SIGNLISTS,         false));
 
	list->push_back(new DropDownListStringItem(STR_TOWN_MENU_TOWN_DIRECTORY,         MME_SHOW_TOWNDIRECTORY,     false));
 
	list->push_back(new DropDownListStringItem(STR_INDUSTRY_MENU_INDUSTRY_DIRECTORY, MME_SHOW_INDUSTRYDIRECTORY, false));
 
	PopupMainToolbMenu(w, WID_TE_SMALL_MAP, list, 0);
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Handle click on one of the entries in the Map menu.
 
 *
 
 * @param index Index being clicked.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction MenuClickMap(int index)
 
{
 
	switch (index) {
 
		case MME_SHOW_SMALLMAP:       ShowSmallMap();            break;
 
		case MME_SHOW_EXTRAVIEWPORTS: ShowExtraViewPortWindow(); break;
 
		case MME_SHOW_LINKGRAPH:      ShowLinkGraphLegend();     break;
 
		case MME_SHOW_SIGNLISTS:      ShowSignList();            break;
 
		case MME_SHOW_TOWNDIRECTORY:  if (_game_mode == GM_EDITOR) ShowTownDirectory(); break;
 
		case MME_SHOW_TOWNDIRECTORY:  ShowTownDirectory();       break;
 
		case MME_SHOW_INDUSTRYDIRECTORY: ShowIndustryDirectory(); break;
 
	}
 
	return CBF_NONE;
 
}
 

	
 
/* --- Town button menu --- */
 

	
 
static CallBackFunction ToolbarTownClick(Window *w)
 
{
 
	PopupMainToolbMenu(w, WID_TN_TOWNS, STR_TOWN_MENU_TOWN_DIRECTORY, (_settings_game.economy.found_town == TF_FORBIDDEN) ? 1 : 2);
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Handle click on one of the entries in the Town menu.
 
 *
 
 * @param index Index being clicked.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction MenuClickTown(int index)
 
{
 
	switch (index) {
 
		case 0: ShowTownDirectory(); break;
 
		case 1: // setting could be changed when the dropdown was open
 
			if (_settings_game.economy.found_town != TF_FORBIDDEN) ShowFoundTownWindow();
 
			break;
 
	}
 
	return CBF_NONE;
 
}
 

	
 
/* --- Subidies button menu --- */
 

	
 
static CallBackFunction ToolbarSubsidiesClick(Window *w)
 
{
 
	PopupMainToolbMenu(w, WID_TN_SUBSIDIES, STR_SUBSIDIES_MENU_SUBSIDIES, 1);
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Handle click on the entry in the Subsidies menu.
 
 *
 
 * @param index Unused.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction MenuClickSubsidies(int index)
 
{
 
	switch (index) {
 
		case 0: ShowSubsidiesList(); break;
 
	}
 
	return CBF_NONE;
 
}
 

	
 
/* --- Stations button menu --- */
 

	
 
static CallBackFunction ToolbarStationsClick(Window *w)
 
{
 
	PopupMainCompanyToolbMenu(w, WID_TN_STATIONS);
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Handle click on the entry in the Stations menu
 
 *
 
 * @param index CompanyID to show station list for
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction MenuClickStations(int index)
 
{
 
	ShowCompanyStations((CompanyID)index);
 
	return CBF_NONE;
 
}
 

	
 
/* --- Finances button menu --- */
 

	
 
static CallBackFunction ToolbarFinancesClick(Window *w)
 
{
 
	PopupMainCompanyToolbMenu(w, WID_TN_FINANCES);
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Handle click on the entry in the finances overview menu.
 
 *
 
 * @param index CompanyID to show finances for.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction MenuClickFinances(int index)
 
{
 
	ShowCompanyFinances((CompanyID)index);
 
	return CBF_NONE;
 
}
 

	
 
/* --- Company's button menu --- */
 

	
 
static CallBackFunction ToolbarCompaniesClick(Window *w)
 
{
 
	PopupMainCompanyToolbMenu(w, WID_TN_COMPANIES);
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Handle click on the entry in the Company menu.
 
 *
 
 * @param index Menu entry to handle.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction MenuClickCompany(int index)
 
{
 
#ifdef ENABLE_NETWORK
 
	if (_networking) {
 
		switch (index) {
 
			case CTMN_CLIENT_LIST:
 
				ShowClientList();
 
				return CBF_NONE;
 

	
 
			case CTMN_NEW_COMPANY:
 
				if (_network_server) {
 
					DoCommandP(0, 0, _network_own_client_id, CMD_COMPANY_CTRL);
 
				} else {
 
					NetworkSendCommand(0, 0, 0, CMD_COMPANY_CTRL, NULL, NULL, _local_company);
 
				}
 
				return CBF_NONE;
 

	
 
			case CTMN_SPECTATE:
 
				if (_network_server) {
 
					NetworkServerDoMove(CLIENT_ID_SERVER, COMPANY_SPECTATOR);
 
					MarkWholeScreenDirty();
 
				} else {
 
					NetworkClientRequestMove(COMPANY_SPECTATOR);
 
				}
 
				return CBF_NONE;
 
		}
 
	}
 
#endif /* ENABLE_NETWORK */
 
	ShowCompany((CompanyID)index);
 
	return CBF_NONE;
 
}
 

	
 
/* --- Graphs button menu --- */
 

	
 
static CallBackFunction ToolbarGraphsClick(Window *w)
 
{
 
	PopupMainToolbMenu(w, WID_TN_GRAPHS, STR_GRAPH_MENU_OPERATING_PROFIT_GRAPH, (_toolbar_mode == TB_NORMAL) ? 6 : 8);
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Handle click on the entry in the Graphs menu.
 
 *
 
 * @param index Graph to show.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction MenuClickGraphs(int index)
 
{
 
	switch (index) {
 
		case 0: ShowOperatingProfitGraph();    break;
 
		case 1: ShowIncomeGraph();             break;
 
		case 2: ShowDeliveredCargoGraph();     break;
 
		case 3: ShowPerformanceHistoryGraph(); break;
 
		case 4: ShowCompanyValueGraph();       break;
 
		case 5: ShowCargoPaymentRates();       break;
 
		/* functions for combined graphs/league button */
 
		case 6: ShowCompanyLeagueTable();      break;
 
		case 7: ShowPerformanceRatingDetail(); break;
 
	}
 
	return CBF_NONE;
 
}
 

	
 
/* --- League button menu --- */
 

	
 
static CallBackFunction ToolbarLeagueClick(Window *w)
 
{
 
	PopupMainToolbMenu(w, WID_TN_LEAGUE, STR_GRAPH_MENU_GOAL, _networking ? 3 : 4, Game::GetInstance() != NULL ? 0 : 1);
 
	return CBF_NONE;
 
}
 

	
 
/**
 
 * Handle click on the entry in the CompanyLeague menu.
 
 *
 
 * @param index Menu entry number.
 
 * @return #CBF_NONE
 
 */
 
static CallBackFunction MenuClickLeague(int index)
 
{
 
	switch (index) {
 
		case 0: ShowGoalsList();               break;
 
		case 1: ShowCompanyLeagueTable();      break;
 
		case 2: ShowPerformanceRatingDetail(); break;
 
		case 3: ShowHighscoreTable();          break;
 
	}
 
	return CBF_NONE;
 
}
 

	
0 comments (0 inline, 0 general)