Exemple #1
0
 def render_player(self):
     ModelInput("hp", "生命")
     ModelInput("ap", "防弹衣")
     self.coord_view = ModelCoordWidget("coord",
                                        "坐标",
                                        savable=True,
                                        preset=coords)
     # ModelInput("gravity", "重量")
     ModelCoordWidget("speed", "速度")
     ModelInput("rotation", "旋转")
     ModelInput("wanted_level", "通缉等级")
     self.money = ModelInput("money", "金钱")
     ui.Text("")
     with ui.GridLayout(cols=4, vgap=10, className="expand"):
         ui.Button(label="车坐标->人坐标", onclick=self.from_vehicle_coord)
         ui.Button(label="从标记点读取坐标",
                   onclick=self.player_coord_from_waypoint)
         ui.ToggleButton(label="切换无伤状态", onchange=self.set_ped_invincible)
         ui.ToggleButton(label="可以切换武器",
                         onchange=self.set_ped_block_switch_weapons)
         ui.ToggleButton(
             label="不会被拽出车",
             onchange=self.set_ped_can_be_dragged_out_of_vehicle)
         ui.ToggleButton(label="摩托车老司机", onchange=self.set_ped_keep_bike)
         ui.ToggleButton(label="不被通缉", onchange=self.set_never_wanted)
Exemple #2
0
 def render_assembly_functions(self, functions, cols=4, vgap=10):
     with ui.GridLayout(cols=cols, vgap=vgap, className="expand"):
         self.assembly_buttons = {}
         for item in functions:
             button = ui.ToggleButton(
                 label=item.label,
                 onchange=partial(__class__.toggle_assembly_function,
                                  self.weak,
                                  item=item))
             if item.help:
                 button.setToolTip(item.help)
             self.assembly_buttons[item.key] = button
Exemple #3
0
 def render_player(self):
     ModelInput("hp", "生命")
     ModelInput("ap", "防弹衣")
     ModelInput("rotation", "旋转")
     self.coord_view = ModelCoordWidget("coord",
                                        "坐标",
                                        savable=True,
                                        preset=coords)
     ModelCoordWidget("speed", "速度")
     ModelInput("weight", "重量")
     ModelInput("wanted_level", "通缉等级")
     ui.Hr()
     with ui.GridLayout(cols=5, vgap=10, className="expand"):
         ui.Button(label="车坐标->人坐标", onclick=self.from_vehicle_coord)
         ui.ToggleButton(label="切换无伤状态", onchange=self.set_ped_invincible)
Exemple #4
0
    def render_player(self):
        ModelInput("hp", "生命")
        self.maxhp_view = ModelInput("maxhp", "最大生命")
        ModelInput("ap", "防弹衣")
        ModelInput("rotation", "旋转")
        self.coord_view = ModelCoordWidget("coord",
                                           "坐标",
                                           savable=True,
                                           preset=coords)
        ModelCoordWidget("speed", "速度")
        ModelInput("weight", "重量")
        ProxyInput("wanted_level", "通缉等级", self.get_wanted_level,
                   self.set_wanted_level)
        ui.Hr()
        with ui.Vertical(className="fill"):
            with ui.GridLayout(cols=5, vgap=10, className="expand"):
                ui.Button(label="车坐标->人坐标", onclick=self.from_vehicle_coord)
                ui.Button(label="从地图读取坐标", onclick=self.playerCoordFromMap)
                ui.ToggleButton(label="切换无伤状态",
                                onchange=self.set_ped_invincible)

            ui.Text("防止主角受到来自以下的伤害")
            with ui.Horizontal(className="fill"):
                self.player_proof_views = [
                    ui.CheckBox("爆炸",
                                className="vcenter",
                                onchange=partial(self.set_player_proof,
                                                 bitindex=Player.SPECIAL_EP)),
                    ui.CheckBox("碰撞",
                                className="vcenter",
                                onchange=partial(self.set_player_proof,
                                                 bitindex=Player.SPECIAL_DP)),
                    ui.CheckBox("子弹",
                                className="vcenter",
                                onchange=partial(self.set_player_proof,
                                                 bitindex=Player.SPECIAL_BP)),
                    ui.CheckBox("火焰",
                                className="vcenter",
                                onchange=partial(self.set_player_proof,
                                                 bitindex=Player.SPECIAL_FP)),
                ]
                ui.Button("全部",
                          style=btn_md_style,
                          onclick=self.player_proof_all)
                ui.Button("再次应用",
                          style=btn_md_style,
                          onclick=self.player_proof_apply).setToolTip(
                              "死亡或者重新读档后需要再次应用")
Exemple #5
0
 def render_vehicle(self):
     ModelInput("hp", "HP")
     ModelCoordWidget("roll", "滚动")
     ModelCoordWidget("dir", "方向")
     self.vehicle_coord_view = ModelCoordWidget("coord",
                                                "坐标",
                                                savable=True,
                                                preset=coords)
     ModelCoordWidget("speed", "速度")
     ModelInput("weight", "重量")
     ui.Hr()
     with ui.GridLayout(cols=5, vgap=10, className="expand"):
         ui.Button(label="人坐标->车坐标", onclick=self.from_player_coord)
         ui.ToggleButton(label="切换无伤状态",
                         onchange=self.set_vehicle_invincible)
         ui.Button(label="锁车", onclick=self.vehicle_lock_door)
         ui.Button(label="开锁",
                   onclick=partial(self.vehicle_lock_door, lock=False))
Exemple #6
0
 def render_vehicle(self):
     vehicle = self.weak._vehicle
     ModelInput("hp", "HP")
     ModelCoordWidget("dir", "方向")
     self.vehicle_grad_view = ModelCoordWidget("grad", "旋转")
     self.vehicle_coord_view = ModelCoordWidget("coord",
                                                "坐标",
                                                savable=True,
                                                preset=coords)
     ModelCoordWidget("speed", "速度")
     ModelInput("weight", "重量")
     ui.Text("")
     with ui.Vertical(className="fill"):
         with ui.GridLayout(cols=5, vgap=10, className="expand"):
             ui.Button(label="人坐标->车坐标", onclick=self.from_player_coord)
             ui.Button(label="从地图读取坐标", onclick=self.vehicleCoordFromMap)
             ui.ToggleButton(label="切换无伤状态",
                             onchange=self.set_vehicle_invincible)
             ui.Button(label="锁车", onclick=self.vehicle_lock_door)
             ui.Button(label="开锁",
                       onclick=partial(self.vehicle_lock_door, lock=False))
         ui.Hr()
         ui.Text("防止当前载具受到来自以下的伤害")
         with ui.Horizontal(className="fill"):
             self.vehicle_proof_views = [
                 ui.CheckBox("爆炸",
                             className="vcenter",
                             onchange=partial(self.set_vehicle_proof,
                                              bitindex=Vehicle.SPECIAL_EP)),
                 ui.CheckBox("碰撞",
                             className="vcenter",
                             onchange=partial(self.set_vehicle_proof,
                                              bitindex=Vehicle.SPECIAL_DP)),
                 ui.CheckBox("子弹",
                             className="vcenter",
                             onchange=partial(self.set_vehicle_proof,
                                              bitindex=Vehicle.SPECIAL_BP)),
                 ui.CheckBox("火焰",
                             className="vcenter",
                             onchange=partial(self.set_vehicle_proof,
                                              bitindex=Vehicle.SPECIAL_FP)),
             ]
             ui.Button("全部",
                       style=btn_md_style,
                       onclick=self.vehicle_proof_all)
             ui.Button(
                 "再次应用",
                 style=btn_md_style,
                 onclick=self.vehicle_proof_apply).setToolTip("切换载具后需要再次应用")
     ui.Text("颜色")
     with ui.Horizontal(className="fill"):
         self.vehicle_body_color_view = ColorWidget("body_color", "车身1",
                                                    vehicle, "body_color",
                                                    datasets.COLOR_LIST)
         self.vehicle_body2_color_view = ColorWidget(
             "body2_color", "车身2", vehicle, "body2_color",
             datasets.COLOR_LIST)
         self.vehicle_stripe_color_view = ColorWidget(
             "stripe_color", "条纹1", vehicle, "stripe_color",
             datasets.COLOR_LIST)
         self.vehicle_stripe2_color_view = ColorWidget(
             "stripe2_color", "条纹2", vehicle, "stripe2_color",
             datasets.COLOR_LIST)