def render_main(self): with Group("global", "全局", self._global): ModelInput("turn").set_help('0~1,下面会一直累加(慎用)') ModelInput("minutes") ModelInput("seconds_1") ModelInput("seconds_0") ModelInput("our_points") ModelInput("enemy_points") ModelInput("basketry_left_top") ModelInput("basketry_left_middle") ModelInput("basketry_left_bottom") ModelInput("basketry_right_top") ModelInput("basketry_right_middle") ModelInput("basketry_right_bottom") ModelInput("ball_owner").set_help('球在人手里(0~3),地上或空中(6)') with Group("player", "我方角色", self.person) as group: Choice("角色", ("1P", "2P", "3P", "4P"), self.on_person_change) # ModelInput("jump") # ModelInput("power") ModelInput("character").set_help('0~3') with ModelSelect.choices_cache: ModelSelect("equip_1", instance=self.equip_holder, choices=datasets.ITEMS) ModelSelect("equip_2", instance=self.equip_holder, choices=datasets.ITEMS) ModelSelect("equip_3", instance=self.equip_holder, choices=datasets.ITEMS) with StaticGroup("快捷键"): ui.Text("B: 获得球") ui.Text("N: 左边耐久置0") ui.Text("M: 球筐耐久恢复")
def render_main(self): with Group("global", "全局", self._global): ModelInput("money", "金钱") ModelInput("exp", "驾驶员经验") with Group("player", "我方角色", self.person, cols=4): Choice("角色", datasets.PARTNERS, self.on_person_change) ModelInput("ability", "机体类型(海陆空)及变身能力") ModelInput("spiritual_type", "精神类型") ModelSelect("robot", "机体图", choices=datasets.ROBOTS) ModelInput("map_y", "地图X坐标") ModelInput("map_x", "地图Y坐标") ModelInput("map_avatar", "地图头像") ModelSelect("weapon_1", "上武器", choices=datasets.WEAPONS) ModelSelect("weapon_2", "下武器", choices=datasets.WEAPONS) ModelInput("mobile", "机动") ModelInput("strength", "强度") ModelInput("defense", "防卫") ModelInput("speed", "速度") ModelInput("hp", "HP") ModelInput("hpmax", "HP上限") ModelInput("move", "行动次数") ModelInput("spiritual", "精神") ModelInput("spiritual_max", "精神上限") self.lazy_group(Group("items", "道具", None), self.render_items) # self.lazy_group(Group("weapons", "武器", self.weapon), self.render_weapons) # with Group("enemy", "敌人", None, cols=4): # for addr, name in models.ENEMY_ATTRS: # Input(name, None, addr, size=1) with StaticGroup("快捷键"): ui.Text("恢复HP: alt+h")
def render_main(self): person = self.person chariot = self.chariot with Group("global", "全局", self._global): ModelInput("money", "金钱") ModelInput("battlein", "遇敌率") ModelCheckBox("battlein", "不遇敌", enable=0xFF, disable=0) with Group("player", "角色", person, cols=4): Choice("角色", datasets.PERSONS, self.on_person_change) ModelInput("level", "等级") ModelInput("hpmax", "HP上限") ModelInput("hp", "HP") ModelInput("atk", "攻击") ModelInput("defense", "守备") ModelInput("strength", "强度") ModelInput("intelli", "智力") ModelInput("stamina", "体力") ModelInput("speed", "速度") ModelInput("battle", "战斗") ModelInput("drive", "驾驶") ModelInput("fix", "修理") ModelInput("exp", "经验") self.lazy_group(Group("human_items", "角色装备/物品", person, cols=4), self.render_human_items) self.lazy_group(Group("chariot", "战车", chariot, cols=4), self.render_chariot) self.lazy_group(Group("chariot_items", "战车装备/物品", chariot, cols=4), self.render_chariot_items) with StaticGroup("快捷键"): ui.Text("左移: alt+left\n" "右移: alt+right\n" "上移: alt+up\n" "下移: alt+right\n" "恢复HP: alt+h")
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(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_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 render_global(self): ui.Hr() ui.Text('游戏版本: v1.1') ProxyInput( "CurrentHealthValue", "生命", *Descriptor(lambda: self.activePlayer.health, "CurrentHealthValue")) ProxyInput( "CurrentHealthValue", "生命上限", *Descriptor(lambda: self.activePlayer.health.healthStat, "ModifiedValue")) ProxyInput( "CurrentShieldValue", "护盾", *Descriptor(lambda: self.activePlayer.health, "CurrentShieldValue")) ProxyInput( "CurrentShieldValue", "护盾上限", *Descriptor(lambda: self.activePlayer.health.shieldStat, "ModifiedValue")) ProxyInput( "CurrentGuardCountValue", "防御次数", *Descriptor(lambda: self.activePlayer.health, "CurrentGuardCountValue")) ProxyInput( "CurrentGuardCountValue", "防御次数上限", *Descriptor(lambda: self.activePlayer.health.guardCountStat, "ModifiedValue")) ProxyInput( "balance", "宝石", *Descriptor(lambda: self.activePlayer.platWallet, "balance")) ProxyInput( "balance", "金币", *Descriptor(lambda: self.activePlayer.goldWallet, "balance"))
def render_main(self): with Group("global", "全局", self._global): ModelInput("growth_points", "成长点数") ModelInput("money_1p", "1p金钱") ModelInput("money_2p", "2p金钱") with Group("player", "我方角色", self.person, cols=4) as group: Choice("角色", ("1P", "2P"), self.on_person_change) for addr, name in models.PERSON_ATTRS: ModelInput(name) with group.footer: dialog_style = {'width': 1200, 'height': 900} with DialogGroup("items", "道具", self.itemholder, cols=4, dialog_style=dialog_style) as dialog_group: indexs = (0, 8, 1, 9, 2, 10, 3, 11, 4, 12, 5, 13, 6, 14, 7, 15) with ModelSelect.choices_cache: for i in indexs: ModelSelect("items.%d" % i, "道具%02d" % (i + 1), choices=datasets.ITEMS) with DialogGroup("skills", "技能", self.skillholder, dialog_style=dialog_style): values = [1 << i for i in range(7, -1, -1)] for i, labels in enumerate(datasets.SKILL_ITEMS): ModelFlagWidget("have_%s" % (i + 1), "拥有", labels=labels, values=values, checkbtn=True, cols=4) ModelFlagWidget("active_%s" % (i + 1), "激活", labels=labels, values=values, checkbtn=True, cols=4) with Group("enemy", "敌人", None, cols=4) as group: for addr, name in models.ENEMY_ATTRS: Input(name, None, addr, size=1) with StaticGroup("快捷键"): ui.Text("恢复HP: alt+h")
def render_hotkey(self): with ui.Horizontal(className="fill padding"): self.spawn_vehicle_id_view = ui.ListBox( className="expand", onselect=self.on_spawn_vehicle_id_change, choices=(item[0] for item in VEHICLE_LIST)) with ui.ScrollView(className="fill padding"): self.render_common_text() ui.Text("附近车辆爆炸(使用秘籍BIGBANG): alt+enter")
def render_hotkeys(self): ui.Text("H: 回复护甲+血量\n" "P: 回复载具推进+血量\n" "B: 前进\n" "N: 向上\n" "Shift+N: 向下\n" "Alt+F: 技能冷却\n" ";: 弹药全满\n" ".: 升级\n")
def render_one_list(self, group): """渲染其中一个列表""" li = ui.ListView(className="fill") li.enableCheckboxes() li.appendColumns(*group['head']) if group['hascount']: li.appendColumn('数量') li.insertItems(group['items']) with ui.Horizontal(className="expand"): uncheck_action = ui.CheckBox(label="不选中表示移除该物品", className="vcenter") if group['hascount']: ui.Text("数量 ", className="vcenter") input_num = ui.SpinCtrl(className="vcenter") ui.Text(" ") ui.Button(label="修改数量", className="button", onclick=partial( self.set_count, view=li, group=group, input_num=input_num)).setToolTip('勾选高亮选中的项的数量') ui.Button(label="勾选选中", className="button", onclick=partial(self.list_view_check_select, view=li)).setToolTip('勾选高亮选中的项') ui.Button(label="全选", className="button", onclick=partial(self.list_view_checkall, view=li)) ui.Button(label="全不选", className="button", onclick=partial(self.list_view_uncheckall, view=li)) ui.Button(label="读取", className="button", onclick=partial(self.list_view_read, view=li, group=group)) ui.Button(label="写入", className="button", onclick=partial(self.list_view_write, view=li, group=group, uncheck_action=uncheck_action))
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_hotkey(self): with ui.ScrollView(className="fill"): self.render_common_text() ui.Text("大加速: alt+shift+m\n" "生成选中的载具并进入: alt+shift+v\n" "当前武器子弹全满: alt+g\n" "瞬移到标记点: alt+shift+g\n" "瞬移到目的地: alt+1\n" "根据摄像机朝向设置当前实体的朝向: alt+e\n" "爆破最近的车: alt+o")
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 render_hotkeys(self): ui.Text("H: 回复护甲+血量\n" "P: 回复载具推进+血量\n" "B: 前进\n" "N: 向上\n" "Shift+N: 向下\n" "F3: 切换2倍移动速度\n" ";: 弹药全满\n" ".: 升级\n" "': 当前武器高精准,高射速\n" "/: 武器等级与人物等级同步(装备中的武器需切到背包再装备)")
def render_hotkey(self): with ui.Horizontal(className="fill padding"): self.spawn_vehicle_id_view = ui.ListBox( className="expand", onselect=self.on_spawn_vehicle_id_change, choices=(item[0] for item in VEHICLE_LIST)) with ui.ScrollView(className="fill padding"): self.render_common_text() ui.Text("根据左边列表生产载具: alt+V\n" "瞬移到地图指针处: ctrl+alt+g\n" "瞬移到标记点: alt+shift+g\n" "切换转向并加速: alt+shift+m\n" "附近的车大风车: alt+r\n" "附近的人大风车: alt+shift+r")
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_main(self): with Group("global", "全局", self._global): ModelInput("hp") # ModelInput("tankhp") ModelCheckBox("invincible", enable=0x20, disable=0) ModelInput("ammo") ModelInput("bomb") ModelInput("shell") ModelSelect("weapon", choices=WEAPONS, values=WEAPON_VALUES) ModelSelect("bombtype", choices=BOMB_TYPES, values=BOMB_VALUES) with StaticGroup("功能"): self.render_functions(('max_ammo', 'fast_shoot')) with StaticGroup("快捷键"): ui.Text("恢复HP: alt+h")
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_main(self): with Group("global", "全局", self._global): self.render_global() self.lazy_group(Group("person", "角色", self.person, cols=4), self.render_person) self.lazy_group(Group("favors", "好感度", self._global), self.render_favors) self.lazy_group(Group("items", "道具", self._global, cols=4), self.render_items) self.lazy_group(Group("event_items", "事件道具", self._global), self.render_event_items) self.lazy_group(Group("person_battles", "战斗中", self._global, cols=4), self.render_person_battles) self.lazy_group(StaticGroup("功能"), self.render_functions) with StaticGroup("快捷键"): ui.Text("恢复HP: alt+h")
def render_main(self): with Group("global", "全局", self._global): ModelSelect("enemy", "角色", choices=datasets.PLAYERS) ModelSelect("enemy", "敌人模型", choices=datasets.ENEMY_LABELS, values=datasets.ENEMY_VALUES) ModelInput("level", "等级") ModelInput("lives", "命数") ModelInput("hp", "HP") ModelInput("exp", "总经验") ModelInput("tool_count", "手持物数量") ModelInput("play_level", "关卡") ModelCheckBox("invincible", "无伤", enable=0xffff, disable=0) with StaticGroup("快捷键"): ui.Text("恢复HP: alt+h\n" "敌人一击必杀: alt+空格")
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_hotkeys(self): ui.Text("左移: alt+left\n" "右移: alt+right\n" "上移: alt+up\n" "下移: alt+right\n" "恢复HP: alt+h")
def render_hotkeys(self): ui.Text("Capslock: 大招槽满\n" "h: 血量满\n")
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)
def Label(text): return ui.Text(text, className="input_label expand")