def interact_with(self, p): """ :type p: This is completely pointless and only included for uniformity with the other interact_with methods. """ var = DialogWindow("This is a door.") var.show() TilePy.game_object.dialog_window_stack.append(var)
def interact_with(self, player): if not self.done: self.turn_to_face_player(player) for x in self.text: var = DialogWindow(x) var.show() TilePy.game_object.dialog_window_stack.append(var)
def interact_with(self, player): if not self.done: TilePy.game_object.game_log(TilePy.game_object.dialog_window_stack, 1) TilePy.game_object.game_log("added to inventory: " + self.name, 0) var = DialogWindow(self.text) var.show() TilePy.game_object.dialog_window_stack.append(var) self.done = True self.in_inventory = True player.inventory.append(self)
def __init__(self, title, buttons, results): DialogWindow.__init__(self, title) # The main frame holds the whole content for the window. # The basic design idea of the dialog looks like: # +----------------------+ # | Title caption | # +----------------------+ # | main frame | # | ++++++++++++++++++++ | # | + + | # | + with + | # | + + | # | + user content + | # | + + | # | +------------------+ | # | + Action frame + | # | ++++++++++++++++++++ | # +----------------------+ self.padding = 5 self._mainframe = VFrame() self._mainframe.border = BORDER_NONE self._mainframe.spacing = 5 self._mainframe.padding = 0 self._contentframe = VFrame() self._contentframe.border = BORDER_NONE self._contentframe.spacing = 0 self._contentframe.padding = 0 self._mainframe.add_child(self._contentframe) # Buttons will be placed in the action frame. self._actionframe = HFrame() self._actionframe.border = BORDER_NONE self._actionframe.padding = 0 self._mainframe.add_child(self._actionframe) self.set_buttons(buttons, results) self._signals[SIG_DIALOGRESPONSE] = [] self.set_child(self._mainframe)
def __init__ (self, title, buttons, results): DialogWindow.__init__ (self, title) # The main frame holds the whole content for the window. # The basic design idea of the dialog looks like: # +----------------------+ # | Title caption | # +----------------------+ # | main frame | # | ++++++++++++++++++++ | # | + + | # | + with + | # | + + | # | + user content + | # | + + | # | +------------------+ | # | + Action frame + | # | ++++++++++++++++++++ | # +----------------------+ self.padding = 5 self._mainframe = VFrame () self._mainframe.border = BORDER_NONE self._mainframe.spacing = 5 self._mainframe.padding = 0 self._contentframe = VFrame () self._contentframe.border = BORDER_NONE self._contentframe.spacing = 0 self._contentframe.padding = 0 self._mainframe.add_child (self._contentframe) # Buttons will be placed in the action frame. self._actionframe = HFrame () self._actionframe.border = BORDER_NONE self._actionframe.padding = 0 self._mainframe.add_child (self._actionframe) self.set_buttons (buttons, results) self._signals[SIG_DIALOGRESPONSE] = [] self.set_child (self._mainframe)
def openDialog(self, rvType): rv_dialog = DialogWindow(rvType) rv_dialog.resize(rv_dialog.width(), self.height()) rv_dialog.move(self.x() + self.width() + 10, self.y()) rv_dialog.show()