forked from apoguita/Py4GW
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHello_World.py
More file actions
65 lines (46 loc) · 2.46 KB
/
Hello_World.py
File metadata and controls
65 lines (46 loc) · 2.46 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
from Py4GWCoreLib import GLOBAL_CACHE
import PyImGui
def draw_window():
MIN_WIDTH = 400
MIN_HEIGHT = 600
if PyImGui.begin("quest data"):
window_size = PyImGui.get_window_size()
new_width = max(window_size[0], MIN_WIDTH)
new_height = max(window_size[1], MIN_HEIGHT)
# only update size if it changed
if new_width != window_size[0] or new_height != window_size[1]:
PyImGui.set_window_size(new_width, new_height, PyImGui.ImGuiCond.Always)
# child region adjusts automatically
if PyImGui.begin_child("AccountInfoChild", (new_width - 20, 0), True, PyImGui.WindowFlags.NoFlag):
active_quest = GLOBAL_CACHE.Quest.GetActiveQuest()
active_quest = -1
PyImGui.text(f"Active Quest ID: {active_quest}")
if PyImGui.button("request quest name"):
GLOBAL_CACHE.Quest.RequestQuestName(active_quest)
GLOBAL_CACHE.Quest.RequestQuestDescription(active_quest)
GLOBAL_CACHE.Quest.RequestQuestObjectives(active_quest)
GLOBAL_CACHE.Quest.RequestQuestLocation(active_quest)
GLOBAL_CACHE.Quest.RequestQuestNPC(active_quest)
if GLOBAL_CACHE.Quest.IsQuestNameReady(active_quest):
quest_name = GLOBAL_CACHE.Quest.GetQuestName(active_quest)
PyImGui.text(f"Quest Name: {quest_name}")
if GLOBAL_CACHE.Quest.IsQuestDescriptionReady(active_quest):
quest_info = GLOBAL_CACHE.Quest.GetQuestDescription(active_quest)
PyImGui.text(f"Quest Info: {quest_info}")
if GLOBAL_CACHE.Quest.IsQuestObjectivesReady(active_quest):
objectives = GLOBAL_CACHE.Quest.GetQuestObjectives(active_quest)
PyImGui.text(f"Objectives: {objectives}")
if PyImGui.button("print objectives"):
print(f"{objectives}")
if GLOBAL_CACHE.Quest.IsQuestLocationReady(active_quest):
location = GLOBAL_CACHE.Quest.GetQuestLocation(active_quest)
PyImGui.text(f"Location: {location}")
if GLOBAL_CACHE.Quest.IsQuestNPCReady(active_quest):
npc = GLOBAL_CACHE.Quest.GetQuestNPC(active_quest)
PyImGui.text(f"NPC: {npc}")
PyImGui.end_child()
PyImGui.end()
def main():
draw_window()
if __name__ == "__main__":
main()