Return to repo list

heart-of-gold

Tactical RPG written in python, using pygame.
Return to HMagellan.com

commit d8c07fe756f614546c9b96d470a2a53242130c49
parent 802a753d1edda5437a27f75cfba61cd731b50e66
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Wed, 12 May 2021 17:16:27 -0500

docstrings and pausing mode tweaks

Diffstat:
Msrc/base.py | 31++++++++++++++++++++++++++++---
Msrc/constants.py | 2++
2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/src/base.py b/src/base.py @@ -153,7 +153,7 @@ class BaseManager(manager.Manager): if surface != None: if self.game.control_mode == CTRL_MODES.Base_Normal: self.tile_cursor.update(surface) - elif self.game.control_mode in PAUSE_MODES: + elif self.game.control_mode == CTRL_MODES.Base_Pause: self.pause_menu_buttons.update(surface) self.base_entities.update(surface, self.game.control_mode not in PAUSE_MODES) @@ -208,12 +208,37 @@ class BasePauseButton(entity.Entity): pass class BasePauseSaveButton(BasePauseButton): - pass + """ + Base pause menu button for saving the current + game. + """ + + def be_pressed(self): + """ + Handle being pressed. + """ + self.manager.game.control_mode = CTRL_MODES.Base_Pause_Save class BasePauseLoadButton(BasePauseButton): - pass + """ + Base pause menu button for loading a saved + game. + """ + + def be_pressed(self): + """ + Handle being pressed. + """ + self.manager.game.control_mode = CTRL_MODES.Base_Pause_Load class BasePauseQuitButton(BasePauseButton): + """ + Base pause menu button for quitting the + current game. + """ def be_pressed(self): + """ + Handle being pressed. + """ self.manager.game.quit_game() diff --git a/src/constants.py b/src/constants.py @@ -114,6 +114,8 @@ SCROLLABLE_TURN_MODES = [ ] PAUSE_MODES = [ CTRL_MODES.Base_Pause, + CTRL_MODES.Base_Pause_Save, + CTRL_MODES.Base_Pause_Load, CTRL_MODES.Turn_Pause, CTRL_MODES.Turn_Display_Stats ]