コード例 #1
0
ファイル: gamescreenmanager.py プロジェクト: nsmoooose/csp
    def __init__(self, cspsim):
        SlotManager.__init__(self)

        self.cspsim = cspsim
               
        self.connectToInputInterfaceAction(self.cspsim, 'QUIT', self.on_Quit)
        self.connectToInputInterfaceAction(self.cspsim, 'PAUSE', self.on_Pause)
コード例 #2
0
ファイル: wf-python.py プロジェクト: nsmoooose/csp
    def __init__(self):
        csp.cspsim.Window.__init__(self)
        SlotManager.__init__(self)

        print("Loading hello_world.xml user interface file.")
        serializer = csp.cspsim.Serialization()
        serializer.load(self, 'hello_world.xml')
        
        helloButton = self.getById('hello')
        if helloButton != None:
            print("Connecting click event to button")
            self.connectToClickSignal(helloButton, self.hello_Click)
コード例 #3
0
ファイル: library.py プロジェクト: nsmoooose/csp
    def __init__(self):
        csp.cspsim.Window.__init__(self)
        SlotManager.__init__(self)    
        
        # Install the move window event handler.
        self.moveEventHandler = csp.cspsim.ControlMoveEventHandler(self)

        serializer = csp.cspsim.Serialization()
        serializer.load(self, os.path.join('library', 'index.xml'))

        closeButton = self.getById('close')
        if closeButton != None:
            self.connectToClickSignal(closeButton, self.close_Click)
コード例 #4
0
ファイル: help.py プロジェクト: nsmoooose/csp
    def __init__(self):
        csp.cspsim.Window.__init__(self)
        SlotManager.__init__(self)
        
        # Install the move window event handler.
        self.moveEventHandler = csp.cspsim.ControlMoveEventHandler(self)

        self.topics = {'${help_welcome}' : 'index.xml', 
                       '${help_f16_first_steps}' : 'f16_first_steps.xml',
                       '${help_keyboard_aircraft}' : 'aircraft_controls.xml',
                       '${help_keyboard_view}' : 'view_controls.xml',
                       '${help_mouse}' : 'mouse.xml',
                       '${help_joystick}' : 'joystick.xml'}
コード例 #5
0
ファイル: messagebox.py プロジェクト: nsmoooose/csp
    def __init__(self, cspsim):
        csp.cspsim.Window.__init__(self)
        SlotManager.__init__(self)

        # Install the move window event handler.
        self.moveEventHandler = csp.cspsim.ControlMoveEventHandler(self)

        self.cspsim = cspsim

        # Load the user interface for this window.
        serializer = csp.cspsim.Serialization()
        serializer.load(self, 'messagebox.xml')
                
        # Listen to the click signal for the ok button.
        okButton = self.getById('ok')
        if okButton != None:
            self.connectToClickSignal(okButton, self.ok_Click)
コード例 #6
0
ファイル: pause.py プロジェクト: nsmoooose/csp
    def __init__(self, cspsim):
        csp.cspsim.Window.__init__(self)
        SlotManager.__init__(self)

        # Install the move window event handler.
        self.moveEventHandler = csp.cspsim.ControlMoveEventHandler(self)

        self.cspsim = cspsim
        self.cspsim.togglePause()

        # Load the user interface for this window.
        serializer = csp.cspsim.Serialization()
        serializer.load(self, 'pause.xml')

        resumeButton = self.getById('resume')
        if resumeButton != None:
            self.connectToClickSignal(resumeButton, self.resume_Click)
コード例 #7
0
ファイル: tutorials.py プロジェクト: nsmoooose/csp
    def __init__(self, cspsim):
        csp.cspsim.Window.__init__(self)
        SlotManager.__init__(self)

        # Install the move window event handler.
        self.moveEventHandler = csp.cspsim.ControlMoveEventHandler(self)
        self.missionDict = {}
        self.cspsim = cspsim
        self.missions = [
            self.FakeMission(self.cspsim),
            TakeOff(self.cspsim),
            TimeOfDayDawn(self.cspsim),
            TimeOfDayDay(self.cspsim),
            TimeOfDayDusk(self.cspsim),
            TimeOfDayNight(self.cspsim),
            Vehicles(self.cspsim),
            Cars(self.cspsim)
            ]
コード例 #8
0
ファイル: topmenu.py プロジェクト: nsmoooose/csp
    def __init__(self, cspsim):
        csp.cspsim.Window.__init__(self)
        SlotManager.__init__(self)
       
        self.cspsim = cspsim
       
        serializer = csp.cspsim.Serialization()
        serializer.load(self, 'topmenu.xml')

        optionsButton = self.getById('options')
        if optionsButton != None:
            self.connectToClickSignal(optionsButton, self.options_Click)

        quitButton = self.getById('quit')
        if quitButton != None:
            self.connectToClickSignal(quitButton, self.quit_Click)
            
        helpButton = self.getById('help')
        if helpButton != None:
            self.connectToClickSignal(helpButton, self.help_Click)
コード例 #9
0
ファイル: mainmenu.py プロジェクト: nsmoooose/csp
    def __init__(self, cspsim):
        csp.cspsim.Window.__init__(self)
        SlotManager.__init__(self)

        self.cspsim = cspsim
        
        serializer = csp.cspsim.Serialization()
        serializer.load(self, 'main_menu.xml')
        
        instantActionButton = self.getById('instantAction')
        if instantActionButton != None:
            self.connectToClickSignal(instantActionButton, self.instantAction_Click)
        
        optionsButton = self.getById('options')
        if optionsButton != None:
            self.connectToClickSignal(optionsButton, self.options_Click)
            
        tutorialsButton = self.getById('tutorials')
        if tutorialsButton != None:
            self.connectToClickSignal(tutorialsButton, self.tutorials_Click)
        
        quitButton = self.getById('quit')
        if quitButton != None:
            self.connectToClickSignal(quitButton, self.quit_Click)
コード例 #10
0
ファイル: desktop.py プロジェクト: nsmoooose/csp
 def __init__(self):
     csp.cspsim.Window.__init__(self)
     SlotManager.__init__(self)
    
     serializer = csp.cspsim.Serialization()
     serializer.load(self, 'desktop.xml')
コード例 #11
0
ファイル: options.py プロジェクト: nsmoooose/csp
    def __init__(self, cspsim):
        csp.cspsim.Window.__init__(self)
        SlotManager.__init__(self)

        # Install the move window event handler.
        self.moveEventHandler = csp.cspsim.ControlMoveEventHandler(self)

        self.cspsim = cspsim

        # Load the user interface for this window.
        serializer = csp.cspsim.Serialization()
        serializer.load(self, 'options.xml')

        # Make a copy of the current configuration. This copy
        # is used while we have the window open.
        self.configuration = self.cspsim.getConfiguration().clone()

        # Listen to the click signal for the ok button.
        okButton = self.getById('ok')
        if okButton != None:
            self.connectToClickSignal(okButton, self.ok_Click)

        # Listen to the click signal for the cancel button.
        cancelButton = self.getById('cancel')
        if cancelButton != None:
            self.connectToClickSignal(cancelButton, self.cancel_Click)

        closeButton = self.getById('close')
        if closeButton != None:
            self.connectToClickSignal(closeButton, self.cancel_Click)

        # Class with usefull functions to handle listboxes.
        listBoxManager = ListBoxManager()

        # List all availible themes in the corresponding listbox and select the current one.
        self.themeListBox = self.getById('theme')
        if self.themeListBox != None:
            themes = self.configuration.getUserInterface().enumerateThemes()
            listBoxManager.addListToControl(self.themeListBox, themes)
            self.themeListBox.setSelectedItemByText(self.configuration.getUserInterface().getTheme())
            self.connectToSelectedItemChangedSignal(self.themeListBox, self.theme_Changed)

        # List all localizations made and select the current.
        self.languageListBox = self.getById('language')
        if self.languageListBox != None:
            languages = self.configuration.getUserInterface().enumerateLanguages()
            listBoxManager.addListToControl(self.languageListBox, languages)
            self.languageListBox.setSelectedItemByText(self.configuration.getUserInterface().getLanguage())
            self.connectToSelectedItemChangedSignal(self.languageListBox, self.language_Changed)

        # List all screen resolutions and set the current value.
        self.resolutionListBox = self.getById('resolution')
        if self.resolutionListBox != None:
            currentResolution = str(self.configuration.getDisplay().getWidth()) + 'x' + str(self.configuration.getDisplay().getHeight())
            displayModes = self.configuration.getDisplay().enumerateDisplayModes()
            listBoxManager = ListBoxManager()
            listBoxManager.addListToControl(self.resolutionListBox, displayModes)
            self.resolutionListBox.setSelectedItemByText(currentResolution)
            self.connectToSelectedItemChangedSignal(self.resolutionListBox, self.resolution_Changed)

        # Set the fullscreen status checkbox.
        self.fullscreen = self.getById('fullscreen')
        if self.fullscreen != None:
            self.fullscreen.setChecked(self.configuration.getDisplay().getFullscreen())
            self.connectToCheckedChangedSignal(self.fullscreen, self.fullscreen_Changed)

        self.clouds = self.getById('clouds')
        if self.clouds != None:
            self.clouds.setChecked(self.configuration.getDisplay().getClouds())
            self.connectToCheckedChangedSignal(self.clouds, self.clouds_Changed)