Refactor: Python 3.12, build libtcod & SFML from source. Cmake build. Directory cleanup
directories needed: * build - for cmake output * deps - stuff needed to compile McRogueface (headers) libtcod -> ../modules/libtcod/src/libtcod sfml -> ../modules/SFML/include/SFML python -> ../modules/cpython/Include * lib - stuff needed to link McRogueFace (shared objects); also required at runtime libtcod -> `../modules/libtcod/buildsys/autotools/.libs/libtcod.so.1.0.24` sfml -> `../modules/SFML/build/lib/*` python -> `../modules/cpython/libpython3.12.so`; standard lib at ../modules/cpython/build/lib.linux-x86_64-3.12 & ../modules/cpython/Lib You can get dependencies by: - Build from source (i.e. all submodules) - Go download them from each project's website - install packages from your distro and symlink them to deps/lib directories
This commit is contained in:
parent
d0d2eae762
commit
07b597d6f2
999 changed files with 6679 additions and 155791 deletions
48
scripts/UIMenu.py
Normal file
48
scripts/UIMenu.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
class Caption:
|
||||
def __init__(self, text, textsize, color):
|
||||
self.text = text
|
||||
self.textsize = textsize
|
||||
self.color = color
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Caption text={self.text}, textsize={self.textsize}, color={self.color}>"
|
||||
|
||||
class Button:
|
||||
def __init__(self, x, y, w, h, bgcolor, textcolor, text, actioncode):
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.w = w
|
||||
self.h = h
|
||||
self.bgcolor = bgcolor
|
||||
self.textcolor = textcolor
|
||||
self.text = text
|
||||
self.actioncode = actioncode
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Button ({self.x}, {self.y}, {self.w}, {self.h}), bgcolor={self.bgcolor}, textcolor={self.textcolor}, actioncode={self.actioncode}>"
|
||||
|
||||
class Sprite:
|
||||
def __init__(self, tex_index, sprite_index, x, y):
|
||||
self.tex_index = tex_index
|
||||
self.sprite_index = sprite_index
|
||||
self.x = x
|
||||
self.y = y
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Sprite tex_index={self.tex_index}, self.sprite_index={self.sprite_index}, x={self.x}, y={self.y}>"
|
||||
|
||||
class UIMenu:
|
||||
def __init__(self, title, x, y, w, h, bgcolor, visible=False):
|
||||
self.title = title
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.w = w
|
||||
self.h = h
|
||||
self.bgcolor = bgcolor
|
||||
self.visible = visible
|
||||
self.captions = []
|
||||
self.buttons = []
|
||||
self.sprites = []
|
||||
|
||||
def __repr__(self):
|
||||
return f"<UIMenu title={repr(self.title)}, x={self.x}, y={self.y}, w={self.w}, h={self.h}, bgcolor={self.bgcolor}, visible={self.visible}, {len(self.captions)} captions, {len(self.buttons)} buttons, {len(self.sprites)} sprites>"
|
||||
Loading…
Add table
Add a link
Reference in a new issue