示例#1
0
    def __init__(self, camp, pc: gears.base.Character, conlist: pbge.container.ContainerList, **kwargs):
        """

        :type camp: gears.GearHeadCampaign
        """
        super().__init__(0,0,0,0,**kwargs)

        self.camp = camp
        self.pc = pc
        self.conlist = conlist
        self.info_cache = dict()

        self.cc_up_button = widgets.ButtonWidget(0, 0, EQUIPMENT_COLUMN.w, 16, sprite=pbge.image.Image("sys_updownbuttons.png", 128, 16), off_frame=1)
        self.cc_down_button = widgets.ButtonWidget(0, 0, EQUIPMENT_COLUMN.w, 16, sprite=pbge.image.Image("sys_updownbuttons.png", 128, 16), frame=2, on_frame=2, off_frame=3)
        self.crate_selector = widgets.ScrollColumnWidget(0, 0, EQUIPMENT_COLUMN.w, EQUIPMENT_COLUMN.h - 42, up_button = self.cc_up_button, down_button=self.cc_down_button, padding=2)

        self.crate_column = widgets.ColumnWidget(EQUIPMENT_COLUMN.dx, EQUIPMENT_COLUMN.dy, EQUIPMENT_COLUMN.w, EQUIPMENT_COLUMN.h, draw_border=True)

        self.crate_column.add_interior(self.cc_up_button)
        self.crate_column.add_interior(self.crate_selector)
        self.crate_column.add_interior(self.cc_down_button)

        self.children.append(self.crate_column)

        self.ic_up_button = widgets.ButtonWidget(0, 0, INVENTORY_COLUMN.w, 16, sprite=pbge.image.Image("sys_updownbuttons.png", 128, 16), off_frame=1)
        self.ic_down_button = widgets.ButtonWidget(0, 0, INVENTORY_COLUMN.w, 16, sprite=pbge.image.Image("sys_updownbuttons.png", 128, 16), frame=2, on_frame=2, off_frame=3)
        self.inventory_selector = widgets.ScrollColumnWidget(0, 0, INVENTORY_COLUMN.w, INVENTORY_COLUMN.h - 42, up_button = self.ic_up_button, down_button=self.ic_down_button, padding=2)

        self.inventory_column = widgets.ColumnWidget(INVENTORY_COLUMN.dx,INVENTORY_COLUMN.dy,INVENTORY_COLUMN.w,INVENTORY_COLUMN.h,draw_border=True)

        self.inventory_column.add_interior(self.ic_up_button)
        self.inventory_column.add_interior(self.inventory_selector)
        self.inventory_column.add_interior(self.ic_down_button)

        self.children.append(self.inventory_column)
        self.children.append(PlayerCharacterSwitchPlusBPInfo(camp,pc,self.set_pc,draw_border=True))

        self.update_selectors()

        self.finished = False
示例#2
0
    def __init__(self, camp):
        self._active_info = None
        super(FieldHQ, self).__init__(0, 0, 0, 0)

        self.up_button = widgets.ButtonWidget(0,
                                              0,
                                              fhqinfo.RIGHT_COLUMN.w,
                                              16,
                                              sprite=pbge.image.Image(
                                                  "sys_updownbuttons.png", 128,
                                                  16),
                                              off_frame=1)
        self.down_button = widgets.ButtonWidget(0,
                                                0,
                                                fhqinfo.RIGHT_COLUMN.w,
                                                16,
                                                sprite=pbge.image.Image(
                                                    "sys_updownbuttons.png",
                                                    128, 16),
                                                frame=2,
                                                on_frame=2,
                                                off_frame=3)

        self.member_selector = widgets.ScrollColumnWidget(
            0,
            0,
            fhqinfo.RIGHT_COLUMN.w,
            fhqinfo.RIGHT_COLUMN.h - 42,
            up_button=self.up_button,
            down_button=self.down_button,
            autoclick=True,
            focus_locked=True)

        self.r_column = widgets.ColumnWidget(fhqinfo.RIGHT_COLUMN.dx,
                                             fhqinfo.RIGHT_COLUMN.dy,
                                             fhqinfo.RIGHT_COLUMN.w,
                                             fhqinfo.RIGHT_COLUMN.h)
        self.r_column.add_interior(self.up_button)
        self.r_column.add_interior(self.member_selector)
        self.r_column.add_interior(self.down_button)
        self.children.append(self.r_column)
        self.member_widgets = dict()
        self.camp = camp
        self.active_pc = camp.pc
        self.update_party()
        self.finished = False

        self.active_info = camp.pc
示例#3
0
    def __init__(self, camp):
        super(FieldHQ, self).__init__(0, 0, 0, 0)

        self.up_button = widgets.ButtonWidget(0,
                                              0,
                                              fhqinfo.RIGHT_COLUMN.w,
                                              16,
                                              sprite=pbge.image.Image(
                                                  "sys_updownbuttons.png", 128,
                                                  16),
                                              off_frame=1)
        self.down_button = widgets.ButtonWidget(0,
                                                0,
                                                fhqinfo.RIGHT_COLUMN.w,
                                                16,
                                                sprite=pbge.image.Image(
                                                    "sys_updownbuttons.png",
                                                    128, 16),
                                                frame=2,
                                                on_frame=2,
                                                off_frame=3)

        self.member_selector = widgets.ScrollColumnWidget(
            0,
            0,
            fhqinfo.RIGHT_COLUMN.w,
            fhqinfo.RIGHT_COLUMN.h - 42,
            up_button=self.up_button,
            down_button=self.down_button)

        self.r_column = widgets.ColumnWidget(fhqinfo.RIGHT_COLUMN.dx,
                                             fhqinfo.RIGHT_COLUMN.dy,
                                             fhqinfo.RIGHT_COLUMN.w,
                                             fhqinfo.RIGHT_COLUMN.h)
        self.r_column.add_interior(self.up_button)
        self.r_column.add_interior(self.member_selector)
        self.r_column.add_interior(self.down_button)

        self.children.append(self.r_column)

        self.member_widgets = dict()

        for pc in camp.party:
            self.member_selector.add_interior(
                PartyMemberButton(camp,
                                  pc,
                                  fhq=self,
                                  on_click=self.click_member))
            if isinstance(pc, gears.base.Character):
                self.member_widgets[pc] = CharacterInfoWidget(camp,
                                                              pc,
                                                              self,
                                                              active=False)
                self.children.append(self.member_widgets[pc])
            elif isinstance(pc, gears.base.Mecha):
                self.member_widgets[pc] = MechaInfoWidget(camp,
                                                          pc,
                                                          self,
                                                          active=False)
                self.children.append(self.member_widgets[pc])

        self.camp = camp
        self.finished = False
        self.active_pc = camp.pc
        self.active_widget = self.member_widgets.get(camp.pc, None)
        if self.active_widget:
            self.active_widget.active = True