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
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)
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)
def render_global(self): ModelInput("game_hour", "当前小时") ModelInput("game_minute", "当前分钟") exui.Label("日期") with ui.Horizontal(className="expand"): ui.Button("回退一天", onclick=self.day_back) ui.Button("前进一天", onclick=self.day_forward)
def render_drop_rates(self): self._drop_rates_scan_data = (b'\x00\x00\x00????????????????????\x00\x00\x00\x00\x01\x00\x00\x00????' b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x3F\x00\x00\x80\x3F') self._drop_rates_table = ( (b'\x2D', 'very_common', '药'), (b'\x2F', 'common', '白'), (b'\x32', 'uncommon', '绿'), (b'\x33', 'very_uncommon', '月'), (b'\x34', 'rare', '蓝'), (b'\x35', 'very_rare', '紫'), (b'\x36', 'legendary', '橙/珠光') ) self._drop_rates_preset = ( ('原始', (200, 100, 10, 5, 1, 0.1, 0.01)), ('仅橙', (0.001, 0.001, 0.001, 0.001, 0.001, 100, 10000)), ('仅紫', (0.001, 0.001, 0.001, 0.001, 0.001, 1000, 0.001)), ('仅蓝', (0.001, 0.001, 0.001, 0.001, 1000, 0.001, 0.001)), ('10x橙', (200, 100, 10, 5, 1, 0.1, 0.1)), ('100x橙', (200, 100, 10, 5, 1, 0.1, 1)), ('1000x橙', (200, 100, 10, 5, 1, 0.1, 10)), ) self._drop_rates = types.SimpleNamespace() ui.Hr() with ui.Horizontal(className='expand'): ui.Button('读取地址', onclick=self.read_drop_rates) for i, item in enumerate(self._drop_rates_preset): ui.Button(item[0], className='btn_md', onclick=partial(self.set_drop_rates_preset, index=i)) self._drop_rates_views = [Input(key, label, addr=partial(__class__.get_drop_rates_item, self.weak, key=key), type=float) for _id, key, label in self._drop_rates_table]
def render_drop_rates(self): self._drop_rates_scan_data = ( b'\xFF\xFF\xFF\xFF', b'\x00\x00\x00????????????????????' b'\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' ) self._drop_rates_table = ( (b'\x4C', 'chest_awesome_ini', 'ChestAwesomeIni'), (b'\x53', 'verycommon', '遍地'), (b'\x54', 'verycommon_lower', '遍地 lower'), (b'\x55', 'common', '普通'), (b'\x57', 'uncommon', '罕见'), (b'\x58', 'uncommoner', '更罕见'), (b'\x59', 'rare', '稀有'), (b'\x5A', 'veryrare', '非常稀有'), (b'\x5B', 'awesome_verycommon', '特殊遍地'), (b'\x5C', 'awesome_common', '特殊普通'), (b'\x5D', 'awesome_uncommon', '特殊罕见'), (b'\x5E', 'awesome_uncommoner', '特殊更罕见'), (b'\x5F', 'awesome_rare', '特殊稀有'), (b'\x60', 'awesome_veryrare', '特殊非常稀有'), (b'\x61', 'awesome_legendary', '特殊传说'), ) self._drop_rates_preset = ( ('原始', (1, 200, 100, 10, 5, 1, 0.1, 0.05, 1, 1, 1, 1, 1, 0.1, 0.01)), ('更好', (10, 40, 20, 5, 2.5, 1, 1, 0.5, 1, 1, 1, 1, 1, 1, 0.5)), ('最好', (1, 0.01, 0.01, 0.01, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 1, 25, 50, 100)), ('5x橙', (1, 200, 100, 10, 5, 1, 0.1, 0.05, 1, 1, 1, 1, 1, 0.1, 0.05)), ('10x橙', (1, 200, 100, 10, 5, 1, 0.2, 0.1, 1, 1, 1, 1, 1, 0.2, 0.1)), ('50x橙', (1, 200, 100, 10, 5, 1, 1, 0.5, 1, 1, 1, 1, 1, 1, 0.5)), ) self._drop_rates = types.SimpleNamespace() ui.Hr() with ui.Horizontal(className='expand'): ui.Button('读取地址', onclick=self.read_drop_rates) for i, item in enumerate(self._drop_rates_preset): ui.Button(item[0], className='btn_md', onclick=partial(self.set_drop_rates_preset, index=i)) self._drop_rates_views = [ Input(key, label, addr=partial(__class__.get_drop_rates_item, self.weak, key=key), type=float) for _id, key, label in self._drop_rates_table ]
def render(self): super().render() with ui.Horizontal(className="fill"): if self.has_ammo: self.ammo_view = ui.SpinCtrl(className="fill", min=0, max=9999, initial=0) ui.Button("最大", style=btn_sm_style, onclick=self.max_ammo) ui.Button("移除", style=btn_sm_style, onclick=self.remove_weapon) self.render_btn()
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)
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( "死亡或者重新读档后需要再次应用")
def render_config(self): with ConfigGroup(self.config): FloatConfig('auto_driving_speed', '自动驾驶速度', 10) SelectConfig('explotion_type', '爆炸类型', datasets.EXPLOTION_TYPE) IntConfig('explotion_radius', '爆炸半径', 3) ui.Hr() ui.Button("放弃本次配置修改", onclick=self.discard_config)
def render(self): super().render() with ui.Horizontal(className="fill"): self.view = ui.ColorPicker(className="expand", onchange=lambda v: self.write()) self.render_btn() ui.Button("清除", style=btn_sm_style, onclick=self.clear_color)
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
def render_ammo(self): for i, label in enumerate( ('狙击枪', '手枪', '手雷', '左轮手枪', '冲锋枪', '霰弹枪', '战斗步枪', '火箭筒')): with ModelInput('weapon_ammos.%d.value' % i, label).container: ui.Button(label="最大", className='btn_sm', onclick=partial(self.weapon_ammo_max, i=i)) ModelInput('weapon_ammos.%d.regen_rate' % i, '恢复速度')
def __init__(self, onpagechange, total, page=1): super().__init__(className="expand center") this = WeakBinder(self) self.onpagechange = onpagechange self.total = total self.page = page with self: self.total_view = ui.Text(" 共%d页 " % total, className="vcenter") self.page_input = ui.SpinCtrl(className="expand", min=1, max=total, initial=page, wxstyle=0x4600) ui.Button(label="跳转", className="button", onclick=this.on_page) ui.Button(label="上页", className="button", onclick=this.on_prev) ui.Button(label="下页", className="button", onclick=this.on_next) self.page_input.setOnEnter(this.on_page)
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.Text("") with ui.Horizontal(className="expand"): ui.Button(label="人坐标->车坐标", onclick=self.from_player_coord) ui.Button(label="从标记点读取坐标", onclick=self.vehicle_coord_from_waypoint) ui.Button(label="锁车", onclick=self.vehicle_lock_door) ui.Button(label="开锁", onclick=partial(self.vehicle_lock_door, lock=False))
def render_weapon(self): player = self.weak._player self.weapon_views = [] for i in range(1, len(self.WEAPON_LIST)): self.weapon_views.append( WeaponWidget(player, "weapon%d" % i, "武器槽%d" % i, i, self.SLOT_NO_AMMO, self.WEAPON_LIST)) with Group.active_group().footer: ui.Button(label="一键最大", onclick=self.weapon_max)
def render_weapon(self): player = self.weak._player self.weapon_views = [] for i in range(13): self.weapon_views.append( WeaponWidget(player, "weapon%d" % i, "武器槽%d" % (i + 1), i, datasets.SLOT_NO_AMMO, datasets.WEAPON_LIST, self.on_weapon_change)) ui.Button(label="一键最大", onclick=self.weapon_max)
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))
def render_pokemon(self): # pokemon = self.weak._pokemon active_pokemon = self._active_pokemon ui.RadioBox("带着的宝可梦", className="expand", choices=tuple(str(i) for i in range(1, 7)), onselect=self.on_active_pokemo_swith) with Groups(None, self.weak.onNotePageChange): with Group("basic", "基本", active_pokemon): ModelInput("breedInfo.bIntimate", "亲密度", spin=True, max=255) ModelSelect("breedInfo.wBreed", "种族", choices=self.datasets.BREED_NAMES) ModelInput("Header.dwChar", "性格值", hex=True) ModelInput("Header.dwID", "ID", hex=True) ModelSelect("personality", "性格", choices=self.datasets.PERSONALITYS, onselect=self.on_personality_select) ui.Text("性格描述", className="vcenter") self.personality_desc = ui.Text("", className="vcenter") ModelSelect("breedInfo.wItem", "手持道具", choices=self.datasets.ITEMS) ModelInput("breedInfo.dwExp", "经验值") with Group("basic", "能力", active_pokemon): pass with Group("basic", "技能", active_pokemon): pass with Group("basic", "缎带", active_pokemon): pass with Group("basic", "其它", active_pokemon): pass with ui.Horizontal(className="expand"): ui.Button("读入", className="btn_sm", onclick=self.read_active_pokemon) ui.Button("写回", className="btn_sm", onclick=self.write_active_pokemon)
def render_main(self): with ui.FlexGridLayout(cols=2, vgap=10, className="expand padding") as infobar: ui.Text("地址", className="vcenter input_label") self.addr_view = ui.TextInput(readonly=True, className="expand") ui.Text("代码", className="vcenter input_label") self.code_view = ui.TextInput(readonly=True, multiline=True, className="expand") infobar.AddGrowableCol(1) infobar.AddGrowableRow(1) self.textarea = ui.TextInput(multiline=True, className="fill") with ui.Horizontal(className="expand"): ui.ComboBox(wxstyle=wxconst.CB_READONLY, className="fill") ui.Button(label="保存该项", className="button", onclick=self.onSaveIt) ui.Button(label="保存文件", className="button", onclick=self.onSave) ui.Button(label="另存为", className="button", onclick=self.onSaveAs)
def get_ingame_item_dialog(self): """物品信息对话框""" name = 'ingame_item_dialog' dialog = getattr(self, name, None) if dialog is None: with DialogGroup(name, "物品详情", self.ingame_item, cols=1, dialog_style={'width': 800, 'height': 1400}, closable=False, horizontal=False, button=False) as dialog: ModelCheckBox("enabled") ModelInput("slot") ModelSelect("type", choices=datasets.INVENTORY_ITEMS.choices, values=datasets.INVENTORY_ITEMS.values, instance=self.ingame_item) ModelInput("quantity") ModelInput("max_quantity") ModelInput("model", hex=True) with dialog.footer: ui.Button("复制", className='btn_sm', onclick=self.weak.ingame_item_copy) ui.Button("粘贴", className='btn_sm', onclick=self.weak.ingame_item_paste) setattr(self, name, dialog) return dialog
def render_person_items(self): """游戏中物品""" for label, index_range in (('水平武器', (0, 7)), ('药丸', (7, 8)), ('垂直武器', (8, 13)), ('其他物品', (15, 24))): r = 1 for i in range(*index_range): prop = "items.%d" % i select = ModelChoiceDisplay(prop + ".type", "%s%d" % (label, r), choices=datasets.INVENTORY_ITEMS.choices, values=datasets.INVENTORY_ITEMS.values) with select.container: ui.Button("详情", className="btn_sm", onclick=partial(__class__.show_ingame_item, self.weak, instance=self._person, prop=prop)) r += 1
def render_ammo(self): for i, label in enumerate( ('突击步枪子弹', '霰弹枪子弹', '手雷', '冲锋枪子弹', '手枪子弹', '火箭炮弹药', '狙击步枪子弹')): with ModelInput('mgr.weapon_ammos.%d.value' % i, label).container: ui.Button(label="最大", className='btn_sm', onclick=partial(self.weapon_ammo_max, i=i)) with ModelInput('mgr.weapon_ammos.%d.regen_rate' % i, '恢复速度').container: ModelCheckBox('mgr.weapon_ammos.%d.infinite' % i, '不减', alone=True)
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
def __init__(self, title, onselect, onsearch=None, *args, **kwargs): kwargs.setdefault('style', dialog_style) self.onsearch = onsearch super().__init__(title, *args, **kwargs) with self: with ui.Horizontal(className='expand'): self.input = ui.TextInput(className='fill', wxstyle=wxconst.TE_PROCESS_ENTER) ui.Button(label="搜索", className='btn_sm', onclick=self.weak.onenter) self.listbox = ui.ListBox(className='fill', onselect=onselect) self.input.setOnEnter(self.weak.onenter)
def render_person(self): Choice("角色", datasets.PERSONS, self.on_person_change) ModelInput("hp_max") ModelInput("resist") ModelInput("str") ModelInput("mgc") ModelInput("agl") ModelInput("vit") ModelInput("hp_heal") ModelArrayInput("resistance", label=["%s抗性" % item for item in datasets.ATTRIBUTE]) ModelFlagWidget("adaptive", cols=3, labels=datasets.ATTRIBUTE) with Group.active_group().footer: ui.Button("全技能", onclick=self.weak.all_skills)
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)
def render_person_items(self): """游戏中物品""" for i in range(models.Character.items.length): prop = "items.%d" % i select = ModelChoiceDisplay( prop + ".type", "物品%d" % (i + 1), choices=datasets.INVENTORY_ITEMS.choices, values=datasets.INVENTORY_ITEMS.values) with select.container: ui.Button("详情", className="btn_sm", onclick=partial(__class__.show_ingame_item, self.weak, instance=self._person, prop=prop))
def render_saved_items(self): """整理界面个人物品""" for i in range(models.SavedItemHolder.items.length): prop = "items.%d" % i select = ModelChoiceDisplay( prop + ".type", "", choices=datasets.INVENTORY_ITEMS.choices, values=datasets.INVENTORY_ITEMS.values) with select.container: ui.Button("详情", className="btn_sm", onclick=partial(__class__.show_saved_item, self.weak, instance=self._saved_items, prop=prop))
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)