Esempio n. 1
0
    def render(self):
        this = self.weak
        with ui.SplitterWindow(False, 220, styles=styles) as panel:
            with ui.Vertical():
                self.listbox = ui.RearrangeList(className="fill",
                                                onselect=this.onListSelect)
                with ui.Horizontal(className="expand"):
                    ui.Text("Ctrl+↑↓ 上移/下移当前项")
                with ui.Horizontal(className="expand"):
                    ui.Button(label="添加",
                              className="button",
                              onclick=this.onAdd)
                    ui.Button(label="删除",
                              className="button",
                              onclick=this.onDel)
            with ui.Vertical():
                self.render_main()
        ui.AuiItem(panel, caption=self.unique_title, onclose=self.onClose)

        self.listbox.setOnKeyDown(this.onListBoxKey)

        contextmenu = self.render_contextmenu()
        if contextmenu:
            self.listbox.setContextMenu(contextmenu)
        return panel
Esempio n. 2
0
 def render(self):
     with self.render_win() as win:
         with ui.Vertical():
             with ui.Vertical(className="fill padding"):
                 self.textinput = ui.TextInput(className="expand fill",
                                               multiline=True,
                                               style=textstyle)
                 self.textoutput = ui.TextInput(className="expand fill",
                                                multiline=True,
                                                style=textstyle)
             with ui.Horizontal(className="padding"):
                 ui.Button("分析", onclick=self.weak.analyse)
     return win
Esempio n. 3
0
    def render(self):
        with self.render_win() as win:
            with ui.Vertical():
                with ui.Horizontal(className="expand padding"):
                    ui.Button("检测",
                              className="vcenter",
                              onclick=self.check_attach)
                    self.render_top_button()
                    self.attach_status_view = ui.Text(
                        "", className="vcenter grow padding_left")
                    ui.CheckBox("保持最前",
                                className="vcenter",
                                onchange=self.swith_keeptop)
                with ui.Notebook(className="fill") as book:
                    book.setOnPageChange(self.onNotePageChange)
                    self.begin_group()
                    try:
                        self.render_main()
                        self.onNotePageChange(book)
                    except Exception:
                        win.close()
                        raise
                    self.end_group()

        return win
Esempio n. 4
0
    def __init__(self,
                 *args,
                 cancel=True,
                 ok=True,
                 closable=True,
                 scrollable=False,
                 **kwargs):
        kwargs.setdefault('style', dialog_style)
        kwargs.setdefault('styles', styles)
        super().__init__(*args, **kwargs)
        self.weak = WeakBinder(self)

        super().__enter__()
        with ui.Vertical(className="fill"):
            self.view = (ui.ScrollView if scrollable else ui.Vertical)(
                className="fill padding")

            with ui.Horizontal(className="padding right") as footer:
                if cancel:
                    ui.Button(label="取消").id = wxconst.ID_CANCEL
                if ok:
                    ui.Button(label="确定").id = wxconst.ID_OK
            self.footer = footer
        super().__exit__()

        if not closable:
            self.setOnClose(self.prevent_close)
Esempio n. 5
0
    def __init__(self, *args, **kwargs):
        listbox_opt = kwargs.pop('listbox', {})
        kwargs.setdefault('style', dialog_style)
        super().__init__(*args, **kwargs)

        with self:
            with ui.Vertical(styles=styles, style=styles['class']['fill']):
                self.listbox = ui.CheckListBox(className='fill', **listbox_opt)
                with ui.Horizontal(className="expand"):
                    ui.Button(label="全选",
                              className="button",
                              onclick=self.weak.checkAll)
                    ui.Button(label="反选",
                              className="button",
                              onclick=self.weak.reverseCheck)
Esempio n. 6
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(
                              "死亡或者重新读档后需要再次应用")
Esempio n. 7
0
 def render_cheat(self):
     with ui.Vertical(className="fill padding"):
         with ui.GridLayout(cols=4, vgap=10, className="expand"):
             self.cheat_views = [
                 ui.CheckBox(label,
                             onchange=partial(self.toggle_cheat, index=i))
                 for i, label in enumerate(('不被通缉', '决不会饿', '无限健康', '无限氧气',
                                            '无限弹药', '坦克模式', '超级攻击', '超级跳跃',
                                            '最大威望', '最大引力', '满街跑车', '满街破车',
                                            '无限奔跑', '主角防火', '完美操控', '交通通畅',
                                            '超级兔跳', '液压装置', '船可以飞', '车可以飞'))
             ]
             ui.CheckBox("冻结任务计时", onchange=self.freeze_timer)
             ui.CheckBox("一击必杀", onchange=self.one_hit_kill)
         with ui.Horizontal(className="padding"):
             ui.Button("同步", onclick=self.cheat_sync)
Esempio n. 8
0
 def render_cheat(self):
     with ui.Vertical(className="fill padding"):
         with ui.GridLayout(cols=4, vgap=10, className="expand"):
             SimpleCheckBox("infinite_run", "无限奔跑", 0x536F25, (), b'\xEB',
                            b'\x75')
             SimpleCheckBox("drive_on_water", "水上开车", 0x593908, (),
                            b'\x90\x90', b'\x74\x07')
             SimpleCheckBox("no_falling_off_the_bike", "摩托老司机", 0x61393D,
                            (), b'\xE9\xBC\x0E\x00\x00\x90',
                            b'\x0F\x84\xBB\x0E\x00\x90')
             SimpleCheckBox("disable_vehicle_explosions", "不会爆炸", 0x588A77,
                            (), b'\x90\x90', b'\x75\x09')
             SimpleCheckBox("infinite_ammo1", "无限子弹1", 0x5D4ABE, (),
                            b'\x90\x90\x90', b'\xFF\x4E\x08')
             SimpleCheckBox("infinite_ammo2", "无限子弹2", 0x5D4AF5, (),
                            b'\x90\x90\x90', b'\xFF\x4E\x0C')
Esempio n. 9
0
 def render_tool(self):
     with ui.Vertical(className="fill padding"):
         ui.Button("g3l坐标转json", onclick=self.g3l2json)
Esempio n. 10
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)