def __init__(self, parent): self.parent = parent if self.base != "": helpers.bindEvent(self.base, self, "closeClicked", cegui.FrameWindow.EventCloseClicked) if self.toggle_button != "": helpers.bindButtonEvent(self.toggle_button, self, "windowToggle")
def createGui(self): system = helpers.loadWindowLayout("system.layout") self.guiSystem.getGUISheet().addChildWindow(system) self.windows = [system] self.system = system helpers.bindButtonEvent("TopBar/MenuButton", self, "toggleMainMenu") helpers.bindButtonEvent("Windows/EndTurnButton", self, "requestEOT") helpers.bindEvent("Navigation/ZoomIn", self.starmap, "zoomIn", cegui.Window.EventMouseButtonDown) helpers.bindEvent("Navigation/ZoomOut", self.starmap, "zoomOut", cegui.Window.EventMouseButtonDown) helpers.bindEvent("Navigation/Deselect", self, "unselect", cegui.Window.EventMouseButtonDown) helpers.bindEvent("Navigation/Center", self, "focus", cegui.Window.EventMouseButtonDown) helpers.bindEvent("Navigation/Autofit", self.starmap, "autofit", cegui.Window.EventMouseButtonDown) self.message_window = gui.MessageWindow(self) self.design_window = gui.DesignsWindow(self) self.info_window = gui.InformationWindow(self) self.system_window = gui.SystemWindow(self) self.orders_window = gui.OrdersWindow(self) self.sub_windows = [ self.message_window, self.design_window, self.info_window, self.system_window, self.orders_window, ] wm = cegui.WindowManager.getSingleton() self.orders_menu = overlay.RadialMenu(self.camera) wm.getWindow("Starmap").addChildWindow(self.orders_menu.menu) self.information_overlay = overlay.InformationOverlay() wm.getWindow("Starmap").addChildWindow(self.information_overlay.overlay)
def __init__(self, parent, sceneManager): Scene.__init__(self, parent, sceneManager) # when populating a cegui list, must keep the references, otherwise segfault self.servers = [] login = helpers.loadWindowLayout("login.layout") self.guiSystem.getGUISheet().addChildWindow(login) self.windows.append(login) self.login = login # key states self.tab_down = False self.enter_down = False wm = cegui.WindowManager.getSingleton() wm.getWindow("Login/SaveDetails").setSelected(settings.save_details) if settings.user_name != None: wm.getWindow("Login/Username").setText(settings.user_name) if settings.password != None: wm.getWindow("Login/Password").setText(settings.password) if settings.previous_game != None: self.setServer(settings.previous_game) helpers.bindButtonEvent("Login/LoginButton", self, "onConnect") helpers.bindButtonEvent("Login/QuitButton", self, "quit") helpers.bindButtonEvent("Login/ConfigButton", self, "onConfig") helpers.bindEvent("Login/SaveDetails", self, "onSaveDetails", cegui.Checkbox.EventCheckStateChanged) helpers.bindButtonEvent("Message/OkButton", self, "onMessageOk") self.hide()
def __init__(self, parent, window): self.parent = parent self.menu = helpers.loadWindowLayout("menu.layout") window.addChildWindow(self.menu) helpers.bindButtonEvent("Menu/Main", self, "onQuitToMain") helpers.bindButtonEvent("Menu/Desktop", self, "onQuitToDesktop") helpers.bindButtonEvent("Menu/Back", self, "onBack") helpers.bindButtonEvent("Menu/Config", self, "onConfig") helpers.toggleWindow("Menu", True).activate()
def createGui(self): system = helpers.loadWindowLayout("system.layout") self.guiSystem.getGUISheet().addChildWindow(system) self.windows = [system] self.system = system helpers.bindButtonEvent("TopBar/MenuButton", self, "toggleMainMenu") helpers.bindButtonEvent("Windows/EndTurnButton", self, "requestEOT") helpers.bindEvent("Navigation/ZoomIn", self.starmap, "zoomIn", cegui.Window.EventMouseButtonDown) helpers.bindEvent("Navigation/ZoomOut", self.starmap, "zoomOut", cegui.Window.EventMouseButtonDown) helpers.bindEvent("Navigation/Deselect", self, "unselect", cegui.Window.EventMouseButtonDown) helpers.bindEvent("Navigation/Center", self, "focus", cegui.Window.EventMouseButtonDown) helpers.bindEvent("Navigation/Autofit", self.starmap, "autofit", cegui.Window.EventMouseButtonDown) self.message_window = gui.MessageWindow(self) self.design_window = gui.DesignsWindow(self) self.info_window = gui.InformationWindow(self) self.system_window = gui.SystemWindow(self) self.orders_window = gui.OrdersWindow(self) self.sub_windows = [ self.message_window, self.design_window, self.info_window, self.system_window, self.orders_window, ] wm = cegui.WindowManager.getSingleton() self.orders_menu = overlay.RadialMenu(self.camera) wm.getWindow("Starmap").addChildWindow(self.orders_menu.menu) self.information_overlay = overlay.InformationOverlay() wm.getWindow("Starmap").addChildWindow( self.information_overlay.overlay)
def __init__(self, window): self.config = helpers.loadWindowLayout("config.layout") window.addChildWindow(self.config) helpers.bindButtonEvent("Config/OK", self, "onConfigSave") helpers.bindButtonEvent("Config/Cancel", self, "onConfigCancel") helpers.bindButtonEvent("Config/Sound", self, "onSound") helpers.bindButtonEvent("Config/Graphics", self, "onGraphics") helpers.bindEvent("Config", self, "onConfigCancel", cegui.FrameWindow.EventCloseClicked) helpers.bindEvent("Config/Zoom", self, "onZoomChange", cegui.Slider.EventValueChanged) helpers.bindEvent("Config/ShowFps", self, "onShowFpsChange", cegui.Checkbox.EventCheckStateChanged) helpers.bindEvent("Sound", self, "onSoundCancel", cegui.FrameWindow.EventCloseClicked) helpers.bindButtonEvent("Sound/Cancel", self, "onSoundCancel") helpers.bindButtonEvent("Sound/OK", self, "onSoundSave") helpers.bindEvent("Graphics", self, "onGraphicsCancel", cegui.FrameWindow.EventCloseClicked) helpers.bindButtonEvent("Graphics/Cancel", self, "onGraphicsCancel") helpers.bindButtonEvent("Graphics/OK", self, "onGraphicsSave") helpers.toggleWindow("Config").activate() wm = cegui.WindowManager.getSingleton() wm.getWindow("Config/Zoom").currentValue = settings.icon_zoom_switch_level wm.getWindow("Config/ZoomSpeed").setMaxValue(self.max_zoom_speed) wm.getWindow("Config/ZoomSpeed").currentValue = settings.zoom_speed - 1 wm.getWindow("Config/StarsVisible").setSelected(settings.show_stars_during_icon_view) wm.getWindow("Config/ShowFps").setSelected(settings.show_fps) wm.getWindow("Config/ShowIntro").setSelected(settings.show_intro) helpers.toggleWindow("Config", True) helpers.toggleWindow("Sound", False) helpers.toggleWindow("Graphics", False)