-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
44 lines (33 loc) · 1.32 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from app import (
ResourceWidget, DataframeNavigator, MinimizeWidget,
NavigationButtons, OverlayWidget, css_cache,
get_dataframe
)
from PyQt6.QtWidgets import QApplication
import sys
class Resources(ResourceWidget):
default_values = {'food': "", "wood": "", "stone": "", "gold": ""}
def __init__(self):
super().__init__()
self.df_manager = DataframeNavigator(df=get_dataframe('ottomans_2.html'))
self.app = QApplication(sys.argv)
self.navigationButtons = NavigationButtons(self)
self.description = OverlayWidget(text=f"Loaded ottomans",
size=(10, 200, 400, 200),
css=css_cache.load('description.css')
)
self.update_map(self.default_values)
self.MinimizeWidget = MinimizeWidget(self, css=css_cache.load('Minimize.css'))
def back(self):
self.update_overlays(self.df_manager.back())
def next(self):
self.update_overlays(self.df_manager.next())
def update_overlays(self, update_dict):
self.update_map(update_dict)
self.description.setText(
update_dict.get('description', '')
)
def run(self):
sys.exit(self.app.exec())
if __name__ == "__main__":
Resources().run()