Package horizons :: Package gui :: Package modules :: Module singleplayermenu :: Class ScenarioMapWidget
[hide private]
[frames] | no frames]

Class ScenarioMapWidget

source code

Start a scenario (with a specific language).

Instance Methods [hide private]
 
__init__(self, windows, singleplayer_menu, aidata) source code
 
end(self) source code
 
get_widget(self) source code
 
act(self, player_name, player_color) source code
 
show(self) source code
 
_show_invalid_scenario_file_popup(self, exception)
Shows a popup complaining about invalid scenario file.
source code
 
_on_map_change(self) source code
 
_update_infos(self, selected_language=None)
Check if selected language is available or pick a fallback language.
source code
 
_update_scenario_translation_infos(self, scenario)
Fill in translation infos of selected scenario to translation label.
source code
 
_get_selected_map(self) source code
Static Methods [hide private]
 
guess_suitable_default_locale(available_languages)
Attempts to guess a reasonable localized scenario to preselect in SP menu.
source code
 
find_map_filename(scenario, target_locale)
Finds the given map's filename with its locale.
source code
 
get_available_languages(scenario) source code
Method Details [hide private]

_show_invalid_scenario_file_popup(self, exception)

source code 

Shows a popup complaining about invalid scenario file.

Parameters:
  • exception - Something that str() will convert to an error message

_update_infos(self, selected_language=None)

source code 

Check if selected language is available or pick a fallback language. Fill in infos of selected scenario.

guess_suitable_default_locale(available_languages)
Static Method

source code 

Attempts to guess a reasonable localized scenario to preselect in SP menu.

If no filename was found so far for our scenario:

  1. Try harder to find locale of user
  2. Try to find a file for the system locale
  3. Fall back to English