File tree Expand file tree Collapse file tree 3 files changed +31
-18
lines changed Expand file tree Collapse file tree 3 files changed +31
-18
lines changed Original file line number Diff line number Diff line change 11
11
12
12
import src .constants as c
13
13
from src .screens .char_create import CreateCommander
14
-
15
- # from customtkinter import FontManager
14
+ from src .screens .screen_manager import ScreenManager
16
15
from src .utils import FontManager
17
16
18
- # from time import sleep
19
- # from tkinter import font
20
- # from PIL import ImageFont
21
-
22
17
23
18
class SpaceTrader (tk .Tk ):
24
19
@@ -31,6 +26,8 @@ def __init__(self):
31
26
self .configure (bg = c .BKG_HEX )
32
27
self ._load_assets ()
33
28
29
+ self .manager = ScreenManager (self )
30
+
34
31
def _load_assets (self ):
35
32
"""
36
33
Loads all game assets, currently just pointers to directories
@@ -51,7 +48,8 @@ def _load_assets(self):
51
48
FontManager .load_font (f"{ self .fonts } palm-pilot-large-bold.ttf" )
52
49
53
50
54
- game = SpaceTrader ()
51
+ window = SpaceTrader ()
52
+
53
+ CreateCommander (window ).tkraise ()
55
54
56
- CreateCommander (game )
57
- game .mainloop ()
55
+ window .mainloop ()
Original file line number Diff line number Diff line change 7
7
have to worry about rewriting the game logic.
8
8
"""
9
9
10
+ from random import randint
11
+
12
+ import src .constants as c
13
+
10
14
11
15
# Disordered list of user interactions
16
+ def get_system_info ():
17
+ global current_system
18
+
19
+ # Format system pressure
20
+ #!pressure = current_system.pressure
21
+ pressure = randint (0 , 7 ) # Placeholder
22
+ pressure_str = f"System is { c .SocietalPressure .name (pressure )} "
23
+
24
+ return pressure_str
25
+
26
+
12
27
def buy_fuel ():
13
28
pass
14
29
15
30
16
31
def buy_news ():
17
- pass
32
+ print ( "Buying news!" )
18
33
19
34
20
35
def warp ():
Original file line number Diff line number Diff line change 1
1
"""
2
2
UI Previewer | RPINerd, 2024
3
-
4
- This script is a simple UI previewer for the Space Trader game. It allows you to request a state and see what the current UI would look like.
5
-
3
+
4
+ This script is a simple UI previewer for the Space Trader game.
5
+ It allows you to request a state and see what the current UI would look like.
6
+
6
7
Usage:
7
8
python ui_preview.py <state>
8
-
9
9
"""
10
10
11
11
import os
14
14
15
15
sys .path .append (os .path .abspath (os .path .join (os .path .dirname (__file__ ), ".." )))
16
16
from src import constants as c
17
- from src .screen_manager import screens
17
+ from src .screens . screen_manager import SCREENS
18
18
from src .screens .system_info import SystemInfo
19
19
from src .utils import FontManager
20
20
@@ -44,12 +44,12 @@ def main(state):
44
44
if __name__ == "__main__" :
45
45
46
46
print ("Select a state to preview..." )
47
- for state in screens :
48
- print (f"{ state } : { screens [state ]['title' ]} " )
47
+ for state in SCREENS :
48
+ print (f"{ state } : { SCREENS [state ]['title' ]} " )
49
49
print ("\n " )
50
50
state = input ("Enter the state to preview: " ).upper ()
51
51
52
- if state in screens :
52
+ if state in SCREENS :
53
53
main (state )
54
54
else :
55
55
print (f"Invalid state: { state } " )
You can’t perform that action at this time.
0 commit comments