Package horizons :: Package gui :: Package widgets :: Module routeconfig :: Class RouteConfig
[hide private]
[frames] | no frames]

Class RouteConfig

source code

windows.Window --+
                 |
                RouteConfig

Widget that allows configurating a ship's trading route

Instance Methods [hide private]
 
__init__(self, windows, instance) source code
 
session(self)
Returns: session
source code
 
show(self)
Show the window.
source code
 
hide(self)
Hide the window.
source code
 
on_instance_removed(self) source code
 
on_route_change(self)
Called on changelistener notifications from the route
source code
 
start_button_set_active(self) source code
 
start_button_set_inactive(self) source code
 
start_route(self) source code
 
stop_route(self) source code
 
toggle_route(self) source code
 
remove_entry(self, entry) source code
 
_check_no_entries_label(self)
Update hint informing about how to add waypoints.
source code
 
move_entry(self, entry, direction)
moves an entry up or down
source code
 
show_load_icon(self, slot) source code
 
show_unload_icon(self, slot) source code
 
toggle_load_unload(self, slot, entry) source code
 
slider_adjust(self, slot, res_id, entry) source code
 
add_resource(self, res_id, slot=None, entry=None, has_value=False, value=0) source code
 
handle_resource_click(self, widget, event) source code
 
show_resource_menu(self, slot, entry)
Displays a menu where players can choose which resource to add in the selected slot.
source code
 
hide_resource_menu(self) source code
 
add_trade_slots(self, entry, slot_amount=SLOTS_PER_ENTRY) source code
 
add_gui_entry(self, warehouse, resource_list=None) source code
 
append_warehouse(self, warehouse)
Add a warehouse to the list on the left side.
source code
 
on_map_click(self, event, drag) source code
 
_init_gui(self)
Initial init of gui.
source code
 
_route_cmd(self, method, *args, **kwargs)
Convenience method for calling a method on instance.route via command (mp-safe)
source code
    Inherited from windows.Window
 
_hide_modal_background(self) source code
 
_show_modal_background(self)
Loads transparent background that de facto prohibits access to other gui elements by eating all input events.
source code
 
close(self)
Closes the window.
source code
 
on_escape(self)
Define what happens when ESC is pressed.
source code
 
on_return(self)
Define what happens when RETURN is pressed.
source code
 
open(self, **kwargs)
Open the window.
source code
Class Variables [hide private]
  dummy_icon_path = "content/gui/icons/resources/none_gray.png"
  buy_button_path = "content/gui/images/tabwidget/warehouse_to_s...
  sell_button_path = "content/gui/images/tabwidget/ship_to_wareh...
  MAX_ENTRIES = 5
  MIN_ENTRIES = 2
  SLOTS_PER_ENTRY = 4
Method Details [hide private]

__init__(self, windows, instance)
(Constructor)

source code 
Overrides: windows.Window.__init__

session(self)

source code 
Returns:
session
Decorators:
  • @property

show(self)

source code 

Show the window.

After this call, the window should be visible. You should *never* call this directly in your code.

Overrides: windows.Window.show
(inherited documentation)

hide(self)

source code 

Hide the window.

After this call, the window should not be visible anymore. However, it remains in the stack of open windows and will be visible once it becomes the topmost window again.

You should *never* call this directly in your code, other than in `close()` when you overwrote it in your subclass.

Overrides: windows.Window.hide
(inherited documentation)

_check_no_entries_label(self)

source code 

Update hint informing about how to add waypoints. Only visible when there are none.

show_resource_menu(self, slot, entry)

source code 

Displays a menu where players can choose which resource to add in the selected slot. Available resources are all possible resources and a 'None' resource which allows to delete slot actions. The resources are ordered by their res_id.

append_warehouse(self, warehouse)

source code 

Add a warehouse to the list on the left side.

Parameters:
  • warehouse - Set to add a specific one, else the selected one gets added.

_init_gui(self)

source code 

Initial init of gui. widgets : list of route entry widgets slots : dict with slots for each entry


Class Variable Details [hide private]

buy_button_path

Value:
"content/gui/images/tabwidget/warehouse_to_ship.png"

sell_button_path

Value:
"content/gui/images/tabwidget/ship_to_warehouse.png"