def __init__(self, *args, **kwds):
        ToolPanel.__init__(self, *args, **kwds)
        self.tool = trn.get_terrain_tool('toolFlatten')

        # controls
        # Needed to set the slider range here because using the
        # __update_slider_range doesn't update the slider range if called
        # during dialog contruction.
        outdoor = app.get_outdoor()
        if outdoor is None:
            min_value = 0.0
            max_value = 100.0
        else:
            min_value = outdoor.getminheight()
            max_value = outdoor.getmaxheight()
        value = (max_value - min_value) / 2
        self.slider_height = floatslider.FloatSlider(self,
                                                     -1,
                                                     "Height",
                                                     value,
                                                     min_value,
                                                     max_value,
                                                     precision=10.0)
        self.checkbox_adaptive = wx.CheckBox(self, -1, "")
        self.slider_adaptive = floatslider.FloatSlider(self,
                                                       -1,
                                                       "Adaptive",
                                                       0.5,
                                                       0.0,
                                                       1.0,
                                                       precision=1000.0)

        self.__set_properties()
        self.__do_layout()
        self._bind_events()
    def __init__(self, *args, **kwds):
        ToolPanel.__init__(self, *args, **kwds)
        self.tool = trn.get_terrain_tool('toolPaint')

        self.slider_blend = floatslider.FloatSlider(self,
                                                    -1,
                                                    "Blend",
                                                    0.5,
                                                    0.0,
                                                    1.0,
                                                    precision=1000.0)
        self.staticbox_filter = wx.StaticBox(self, -1, "Filter")
        self.checkbox_slope = wx.CheckBox(self, -1, "Filter by slope")
        self.slider_min_slope = floatslider.FloatSlider(self,
                                                        -1,
                                                        "Min. slope",
                                                        15.0,
                                                        0.0,
                                                        90.0,
                                                        precision=10.0)
        self.slider_max_slope = floatslider.FloatSlider(self,
                                                        -1,
                                                        "Max. slope",
                                                        45.0,
                                                        0.0,
                                                        90.0,
                                                        precision=10.0)
        self.staticline_filter = wx.StaticLine(self, -1)
        self.checkbox_height = wx.CheckBox(self, -1, "Filter by height")
        # Needed to set the height sliders range here because using the
        # __update_sliders_height doesn't update the height sliders range if
        # called during dialog contruction.
        outdoor = app.get_outdoor()
        if outdoor is None:
            min_value = 0.0
            max_value = 100.0
        else:
            min_value = outdoor.getminheight()
            max_value = outdoor.getmaxheight()
        value = 0.8 * min_value + 0.2 * max_value
        self.slider_min_height = floatslider.FloatSlider(self,
                                                         -1,
                                                         "Min. height",
                                                         value,
                                                         min_value,
                                                         max_value,
                                                         precision=10.0)
        value = 0.2 * min_value + 0.8 * max_value
        self.slider_max_height = floatslider.FloatSlider(self,
                                                         -1,
                                                         "Max. height",
                                                         value,
                                                         min_value,
                                                         max_value,
                                                         precision=10.0)

        self.__set_properties()
        self._do_layout()
        self._bind_events()
Beispiel #3
0
    def __init__(self, *args, **kwds):
        editorpanel.EditorPanel.__init__(self, *args, **kwds)
        self.light = None

        self.label_type = wx.StaticText(self, -1, "Light type")
        self.choice_type = choice.Choice(
            self, -1, choices=["Point", "Spot", "Directional", "Bulb"])
        self.csel_ambient = colorsel.ColorSelector(self, -1, "Ambient")
        self.csel_diffuse = colorsel.ColorSelector(self, -1, "Diffuse")
        self.csel_specular = colorsel.ColorSelector(self, -1, "Specular")
        self.staticbox_spot = wx.StaticBox(self, -1, "Spot")
        self.staticbox_static = wx.StaticBox(self, -1, "Static light")
        self.slider_spot_burn = floatslider.FloatSlider(self,
                                                        -1,
                                                        "Spot burn",
                                                        0.5,
                                                        0.0,
                                                        1.0,
                                                        precision=1000.0)
        self.slider_lightmapambientfactor = floatslider.FloatSlider(
            self,
            -1,
            "Lightmap ambient factor",
            0.2,
            0.0,
            2.0,
            precision=1000.0)
        self.slider_lightmapdiffusefactor = floatslider.FloatSlider(
            self,
            -1,
            "Lightmap diffuse factor",
            0.2,
            0.0,
            2.0,
            precision=1000.0)
        self.slider_terrainambientfactor = floatslider.FloatSlider(
            self,
            -1,
            "Terrain ambient factor",
            1.0,
            0.0,
            2.0,
            precision=1000.0)
        self.slider_terraindiffusefactor = floatslider.FloatSlider(
            self,
            -1,
            "Terrain diffuse factor",
            1.0,
            0.0,
            2.0,
            precision=1000.0)
        self.__set_properties()
        self.__do_layout()
        self.__bind_events()
Beispiel #4
0
    def __on_create_ctrl(self, event):
        """ Create the special control for the selected property """
        prop = self.properties_by_internal_label[ event.GetPropertyName() ]

        # Float slider
        if prop.format[Format_Editor] == Editor_Slider_Float:            
            self.last_control = floatslider.FloatSlider(
                                        self, 
                                        -1, 
                                        value=float(0.0),
                                        min_value=float( prop.format[Format_Min] ),
                                        max_value=float(prop.format[Format_Max] ),
                                        float_ctrl_size=(50, -1)
                                        )
        # Integer slider
        elif prop.format[Format_Editor] == Editor_Slider_Int:            
            self.last_control = intslider.IntSlider(
                                        self,
                                        -1,
                                        value=int(0),
                                        min_value=int( prop.format[Format_Min] ),
                                        max_value=int( prop.format[Format_Max] ),
                                        int_ctrl_size=(50, -1)
                                        )
        self.last_control.SetSize( self.GetSizeControl() )
        self.last_control.SetPosition( self.GetPositionControl() )

        self.GetParent().Bind(wx.EVT_PAINT, self.__on_change_size)
        self.Bind(events.EVT_CHANGING, self.__on_changed, self.last_control)
        self.Bind(events.EVT_CHANGED, self.__on_changed, self.last_control)
Beispiel #5
0
    def __init__(self, *args, **kwds):
        editorpanel.EditorPanel.__init__(self, *args, **kwds)
        self.character = None
        self.anim_indices = []
        self.filter_name = ""

        self.filterlabel = wx.StaticText(self, -1, "Filter:")
        self.filter = wx.TextCtrl(self, -1)
        self.label = wx.StaticText(self, -1, "Animation played:")
        self.list = wx.ListCtrl(self,
                                -1,
                                style=wx.LC_REPORT | wx.LC_SINGLE_SEL
                                | wx.LC_SORT_ASCENDING)
        self.text_name = vtextctrl.ValidatedTextCtrl(
            self, -1, "Name:", validator=self.__validate_anim_name)
        self.slider_fade_in = floatslider.FloatSlider(self,
                                                      -1,
                                                      "Fade in time:",
                                                      1.0,
                                                      0.0,
                                                      2.0,
                                                      precision=100.0)
        self.check_backwards = wx.CheckBox(self, -1, "Play backwards")
        self.check_loop = wx.CheckBox(self, -1, "Loop")
        self.button_person = wx.Button(self, -1, "Switch to first person")
        self.button_del = wx.Button(self, -1, "Delete an animation...")

        self.__set_properties()
        self.__do_layout()
        self.__bind_events()
    def __init__(self, *args, **kwds):
        wx.Panel.__init__(self, *args, **kwds)

        self.slider_attenuation = floatslider.FloatSlider(self,
                                                          -1,
                                                          "Attenuation",
                                                          1.0,
                                                          -0.5,
                                                          3.0,
                                                          precision=100.0)
        self.slider_intensity = floatslider.FloatSlider(self,
                                                        -1,
                                                        "Intensity",
                                                        0.5,
                                                        0.0,
                                                        1.0,
                                                        precision=1000.0)
 def __init__(self, parent):
     togwin.ChildToggableDialog.__init__(
         self, "Multiplace object", parent
         )
     
     self.slider_density = floatslider.FloatSlider(
         self, -1, "Density", 0.5, 0.0, 1.0, precision=1000.0
         )
     self.slider_diameter = floatslider.FloatSlider(
         self, -1, "Diameter", 10.0, 1.0, 100.0, precision=10.0
         )
     self.checkbox_random_rotation = wx.CheckBox(self, -1, "Random rotation")
     self.slider_size_offset = floatslider.FloatSlider(
         self, -1, "Max. size offset (%)", 0.0, 0.0, 100.0, precision=10.0
         )
     
     self.__set_properties()
     self.__do_layout()
     self.__bind_events()
 def __init__(self, *args, **kwds):
     editorpanel.EditorPanel.__init__(self, *args, **kwds)
     
     self.fslider_fov = floatslider.FloatSlider(
         self, -1, "FOV", 60.0, 1.0, 179.0, precision=10.0
         )
     self.fslider_near = floatslider.FloatSlider(
         self, -1, "Near plane", 0.1, 0.0, 1.0, precision=1000.0
         )
     self.fslider_far = floatslider.FloatSlider(
         self, -1, "Far plane", 5000.0, 100.0, 20000.0, precision=0.1
         )
     self.fslider_speed = floatslider.FloatSlider(
         self, -1, "Speed", 6.0, 0.0, 1000.0, precision=1.0
         )
     self.fslider_mousex = floatslider.FloatSlider(
         self, -1, "Mouse Sensitivity X", 1.0, 0.0, 5.0, precision=10.0
         )
     self.fslider_mousey = floatslider.FloatSlider(
         self, -1, "Mouse Sensitivity Y", 1.0, 0.0, 5.0, precision=10.0
         )
     self.mouse_invert = wx.CheckBox( self, -1, "Invert mouse vertical" )
     self.button_camera = wx.Button(self, -1, "Edit camera")
     
     self.__set_properties()
     self.__do_layout()
     self.__bind_events()
    def __init__(self, *args, **kwds):
        wx.Panel.__init__(self, *args, **kwds)
        self.tool = trn.get_terrain_tool('toolGrass')

        self.slider_alpha = floatslider.FloatSlider(self,
                                                    -1,
                                                    "Alpha",
                                                    1.0,
                                                    0.0,
                                                    1.0,
                                                    precision=100.0)

        self._do_layout()
        self._bind_events()
Beispiel #10
0
    def __init__(self, *args, **kwds):
        ToolPanel.__init__(self, *args, **kwds)
        self.tool = trn.get_terrain_tool('toolSlope')

        self.slider_slope = floatslider.FloatSlider(self,
                                                    -1,
                                                    "Slope",
                                                    45.0,
                                                    0.0,
                                                    90.0,
                                                    precision=10.0)

        self.__set_properties()
        self.__do_layout()
        self._bind_events()
Beispiel #11
0
 def __init__(self, parent, var_name, parent_graphs):
     wx.PyControl.__init__(self, parent, style=wx.NO_BORDER|wx.TAB_TRAVERSAL)
     self.var_name = var_name
     self.parent_graphs = parent_graphs
     parent_graphs.append(self)
     
     # controls
     self.checkbox_enable = wx.CheckBox(self, -1, var_name)
     self.color = wx.lib.colourselect.ColourSelect(self, -1)
     self.label_frequency = wx.StaticText(self, -1, "Sampling frequency:")
     self.int_frequency = intctrl.IntCtrl(
         self, value=1000, min=1, max=100000, limited=True,
         size=wx.Size(40,-1), style=wx.TE_RIGHT
         )
     self.label_milliseconds = wx.StaticText(self, -1, "milliseconds")
     self.slider_smooth = floatslider.FloatSlider(
         self, -1, "Smoothness:", 0.5, 0.0, 1.0, precision=1000.0
         )
     self.button_remove = wx.Button(self, -1, "Remove", style=wx.BU_EXACTFIT)
     
     self.__set_properties()
     self.__do_layout()
     self.__bind_events()
Beispiel #12
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, -1)
        
        self.gameport = "Orochimaru"
        self.number_connections = 3
        
        self.multiplayer = False
        self.server = False
        self.searching = False
        self.network = None
        
        self.singlecheck = wx.RadioButton(
                                    self, 
                                    -1, 
                                    "Singleplayer",
                                    style = wx.RB_GROUP 
                                    )
        self.servercheck = wx.RadioButton( 
                                    self,
                                    -1, 
                                    "Multiplayer Server" 
                                    )
        self.clientcheck = wx.RadioButton( 
                                    self, 
                                    -1, 
                                    "Multiplayer Client" 
                                    )
        
        self.button_search = wx.Button( self, -1, "Start Search" )
        self.button_search.Disable()
        self.button_connect_to = wx.Button(
                                        self, 
                                        -1, 
                                        "Connect to -> ", 
                                        style = wx.BU_RIGHT
                                        )
        self.button_connect_to.Disable()
        self.hostedit = wx.TextCtrl( self, -1, "Host" )
        self.hostedit.SetValue( "127.0.0.1" )
        self.hostedit.Disable()

        self.connectbtn = []
        for i in range( self.number_connections ):
            self.connectbtn.append(
                wx.Button(
                    self,
                    -1, 
                    "Connect to < empty >"  
                    )
                )
            self.connectbtn[ i ].Disable()
            
        self.button_cancel = wx.Button( self, -1, "Cancel Search" )
        self.button_cancel.Disable()
        self.button_start = wx.Button( self, -1, "Start" )
        
        self.serverbox = wx.StaticBox( self, -1, "Normal Options" )
        self.clientbox = wx.StaticBox( self, -1, "Client options" )
        
        self.mousebox = wx.StaticBox( self, -1, "Mouse options" )
        state = app.get_state( "game" )

        self.invertbtn = wx.CheckBox( self, -1, "Invert mouse vertical" )
        
        self.invertbtn.SetValue( state.getmouseyinvert() )
        
        self.mousexslider = floatslider.FloatSlider(
            self, -1, "Sensitivity X", 1.0, 0.0, 5.0, precision=10.0
            )
        self.mousexslider.set_value( state.getmousexfactor() )
        self.mouseyslider = floatslider.FloatSlider(
            self, -1, "Sensitivity Y", 1.0, 0.0, 5.0, precision=10.0
            )
        self.mouseyslider.set_value( state.getmouseyfactor() )
        
        self.fullreloadslider = floatslider.FloatSlider(
            self, -1, "Full Reload Time", 1.0, 0.0, 5.0, precision=10.0
            )
        self.fullreloadslider.set_value( state.getfullreloadtime() )
        
        self.crossmodelabel = wx.StaticText( self, -1, "Cross Mode" )
        self.crossmodelist = wx.ComboBox( 
                                        self,
                                        -1, 
                                        "Cross Mode", 
                                        style=wx.CB_READONLY, 
                                        choices=["Never","Normal","Always"]
                                        )
        
        self.crossmodelist.Select( state.getcrossmode() )

        self.timer = wx.Timer(self)
        self.timer.Start( 1000 )

        self.__do_layout()
        self.__do_binding()
        
        self.parent = parent
        
        if pynebula.exists( "/sys/servers/network" ):
            self.singlecheck.Disable()
            self.servercheck.Disable()
            self.clientcheck.Disable()
            self.button_start.Disable()
Beispiel #13
0
    def __init__(self, parent):
        togwin.ChildToggableDialog.__init__(self, "Terrain texture brush",
                                            parent)

        # texture selector control
        # TODO: Retrieve the texture images from Nebula terrain object
        self.imgbox_textures = imgbox.ImageBox(self,
                                               image_size=wx.Size(80, 80))
        fileserver = servers.get_file_server()
        self.imgbox_textures.append_image(
            wx.Bitmap(fileserver.manglepath("outgui:images/001.png"),
                      wx.BITMAP_TYPE_ANY))
        self.imgbox_textures.append_image(
            wx.Bitmap(fileserver.manglepath("outgui:images/007.png"),
                      wx.BITMAP_TYPE_ANY))
        self.imgbox_textures.append_image(
            wx.Bitmap(fileserver.manglepath("outgui:images/011.png"),
                      wx.BITMAP_TYPE_ANY))

        self.sizer_filter_group_staticbox = wx.StaticBox(self, -1, "Filter")
        self.slider_size = floatslider.FloatSlider(self,
                                                   -1,
                                                   "Size:",
                                                   0.5,
                                                   0.0,
                                                   1.0,
                                                   precision=1000.0)
        self.slider_blend = floatslider.FloatSlider(self,
                                                    -1,
                                                    "Blend:",
                                                    0.5,
                                                    0.0,
                                                    1.0,
                                                    precision=1000.0)
        self.slider_intensity = floatslider.FloatSlider(self,
                                                        -1,
                                                        "Intensity:",
                                                        0.5,
                                                        0.0,
                                                        1.0,
                                                        precision=1000.0)
        self.checkbox_slope = wx.CheckBox(self, -1, "Filter by slope")
        self.slider_min_slope = floatslider.FloatSlider(self,
                                                        -1,
                                                        "Min. slope:",
                                                        15.0,
                                                        0.0,
                                                        90.0,
                                                        precision=10.0)
        self.slider_max_slope = floatslider.FloatSlider(self,
                                                        -1,
                                                        "Max. slope:",
                                                        45.0,
                                                        0.0,
                                                        90.0,
                                                        precision=10.0)
        self.static_line_filter = wx.StaticLine(self, -1)
        self.checkbox_height = wx.CheckBox(self, -1, "Filter by height")
        self.slider_min_height = floatslider.FloatSlider(self,
                                                         -1,
                                                         "Min. height:",
                                                         20.0,
                                                         0.0,
                                                         100.0,
                                                         precision=10.0)
        self.slider_max_height = floatslider.FloatSlider(self,
                                                         -1,
                                                         "Max. height:",
                                                         60.0,
                                                         0.0,
                                                         100.0,
                                                         precision=10.0)

        self.__set_properties()
        self.__do_layout()