Пример #1
0
    def ask_action(self):
        c = self.io.get_key("Avail cmds: " + "".join(sorted(self.action_funcs.keys())))

        if c in self.action_funcs:
            self.action_funcs[c]()
            return feedback(Action.Debug)
        else:
            self.io.msg("Undefined debug key: {}".format(c))
Пример #2
0
    def ask_action(self):
        c = self.io.get_key("Avail cmds: " +
                            "".join(sorted(self.action_funcs.keys())))

        if c in self.action_funcs:
            self.action_funcs[c]()
            return feedback(Action.Debug)
        else:
            self.io.msg("Undefined debug key: {}".format(c))
Пример #3
0
def pickup_items(actions):
    lines = tuple(Line(str(item), i) for i, item in enumerate(actions.view_floor_items()))

    if not lines:
        return feedback(ActionError.NoItemsOnGround)
    elif len(lines) == 1:
        return actions.pickup_items((lines[0][0], ))

    key, selections = lines_view(
        actions.io.whole_window,
        lines,
        multi_select=True,
        select_keys=Bind.Backpack_Select_Keys,
        header="Select items to pick up"
    )
    if key in Bind.Cancel and selections:
        return actions.pickup_items(selections)
Пример #4
0
 def update_without_acting(self):
     self.actions._do_action(0)
     return feedback(Action.Generic)
Пример #5
0
 def update_without_acting(self):
     self.actions._do_action(0)
     return feedback(Action.Generic)