123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- ########################################################################
- # Hello Worlds - Libre 3D RPG game.
- # Copyright (C) 2020 CYBERDEViL
- #
- # This file is part of Hello Worlds.
- #
- # Hello Worlds is free software: you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation, either version 3 of the License, or
- # (at your option) any later version.
- #
- # Hello Worlds is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program. If not, see <https://www.gnu.org/licenses/>.
- #
- ########################################################################
- from ui.startMenu import UI_StartMenu
- from ui.game import UI_CreatureInfoBox, UI_SpellBar, UI_PlayerInfoBox, UI_ItemInfo
- class UI_Manager:
- def __init__(self):
- self._startMenu = UI_StartMenu(base.luiRegion.root)
- self._npcInfoBox = None
- self._spellBar = None
- self._playerInfoBox = None
- self._spellInfoFrame = None
- @property
- def npcInfoBox(self): return self._npcInfoBox
- @property
- def spellInfoFrame(self): return self._spellInfoFrame
- @property
- def startMenu(self): return self._startMenu
- def destroyGameUI(self):
- self._npcInfoBox.close()
- self._spellBar.close()
- self._playerInfoBox.close()
- self._spellInfoFrame.close()
- self._npcInfoBox = None
- self._spellBar = None
- self._playerInfoBox = None
- self._spellInfoFrame = None
- def loadGameUI(self):
- self._npcInfoBox = UI_CreatureInfoBox()
- self._spellBar = UI_SpellBar(parent=base.luiRegion.root)
- self._playerInfoBox = UI_PlayerInfoBox(parent=base.luiRegion.root)
- self._spellInfoFrame = UI_ItemInfo(parent=base.luiRegion.root)
- def hasMouse(self):
- if (self._startMenu.hasMouse()
- or self._npcInfoBox.hasMouse()
- or self._spellBar.hasMouse()
- or self._playerInfoBox.hasMouse()):
- return True
- return False
- def close(self):
- self._startMenu.close()
- self._startMenu = None
|