Logo Search packages:      
Sourcecode: gameclock version File versions  Download package

def gtkui::GameclockUI::end_turn (   self,
  widget = None,
  event = None 
)
handle end turn events

this passes the message to the gaming engine as quickly as
possible then goes around updating the UI

Definition at line 528 of file gtkui.py.

                                                   :
        """handle end turn events
        
        this passes the message to the gaming engine as quickly as
        possible then goes around updating the UI
        """
        # it may be that we need to start the display
        if not self.game.running():
            self.game.end_turn()
            self.start_game()
        elif not self.first_clock.next:
            self.game.pause()
        else:
            self.game.end_turn()

        # update the current clock pointer
        self.cur_clock = self.cur_clock.next
        if not self.cur_clock:
            self.cur_clock = self.first_clock

        # some reason it doesn't work to just update the old clock label, we need to update both
        self.refresh()
        self.hilight()
        self.maybe_print("ended turn")
        # mouse pointer debugging code, see #4511
        if event and event.device:
            self.maybe_print("widget: %s" % widget)
            self.maybe_print("device name: %s" % event.device.name)
            self.maybe_print("device idt: %s" % event.deviceid)


Generated by  Doxygen 1.6.0   Back to index