forked from Skin36/APOC-Editor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapoctor.py
More file actions
194 lines (165 loc) · 7.52 KB
/
apoctor.py
File metadata and controls
194 lines (165 loc) · 7.52 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
from tkinter import filedialog as fd
from patcher.read_patches import read_patch
from editor.readsave.read_svg import read_save
from editor.dump_ai.dump_ai import read_weap
from editor.dump_ai.dump_ai import read_brain
from editor.dump_ai.dump_ai import read_exp
from tkinter.tix import *
from tkinter import ttk
def opensvg():
root = Tk()
root.minsize(width=500, height=400)
root.title("Savegame editor")
def butCallback():
root.destroy()
mainScreen()
b1 = Button(text="Return", width=30, height=2, command=butCallback)
b1.grid(row=21, column=3, columnspan = 2)
fileOpen = fd.askopenfile(defaultextension=".0*", filetypes=[("All types", ".0*")], initialdir="./SAVEGAME")
#ToolTp = Balloon()
read_save(fileOpen.name,root)
root.mainloop()
def openpatch():
root = Tk()
root.minsize(width=500, height=400)
root.title("Savegame editor")
def butCallback():
root.destroy()
mainScreen()
b1 = Button(text="Return", width=30, height=2, command=butCallback)
b1.grid(row=21, column=3, columnspan = 2)
#ToolTp = Balloon()
read_patch(root)
root.mainloop()
def openai():
root = Tk()
root.minsize(width=200, height=1)
root.title("DUMP")
aileb1 = Label(root,text="Open...", width=30, height=2)
aileb1.grid(row=1, column=1, columnspan=2)
def butCallback_AI1():
fileOpen = fd.askopenfile(defaultextension=".dat", filetypes=[("All types", "weap*.dat")],
initialdir="./AIFILES")
read_weap(fileOpen.name,0)
top = Toplevel(root)
top.minsize(width=200, height=1)
top.title("DUMP weapexp")
aileb = Label(top, text="DONE", width=30, height=2)
aileb.grid(row=1, column=1, columnspan=2)
b1_ai = Button(root,text="Open weapexp.dat", width=30, height=2, command=butCallback_AI1)
def butCallback_AI2():
fileOpen = fd.askopenfile(defaultextension=".0*", filetypes=[("All types", "SAVEGAME.0*")], initialdir="./SAVEGAME")
read_weap(fileOpen.name, 1)
top = Toplevel(root)
top.minsize(width=200, height=1)
top.title("DUMP BRAIN")
aileb = Label(top, text="DONE", width=30, height=2)
aileb.grid(row=1, column=1, columnspan=2)
b2_ai = Button(root,text="Open weapexp City save", width=30, height=2, command=butCallback_AI2)
def butCallback_AI3():
fileOpen = fd.askopenfile(defaultextension=".0*", filetypes=[("All types", "TACTGAME.0*")], initialdir="./SAVEGAME")
read_weap(fileOpen.name, 2)
top = Toplevel(root)
top.minsize(width=200, height=1)
top.title("DUMP BRAIN")
aileb = Label(top, text="DONE", width=30, height=2)
aileb.grid(row=1, column=1, columnspan=2)
b3_ai = Button(root,text="Open weapexp Tac save", width=30, height=2, command=butCallback_AI3)
spr1_ai=ttk.Separator(root, orient = HORIZONTAL)
def butCallback_BR1():
fileOpen = fd.askopenfile(defaultextension=".dat", filetypes=[("All types", "BRAIN*.dat")],
initialdir="./AIFILES")
read_brain(fileOpen.name,0)
top = Toplevel(root)
top.minsize(width=200, height=1)
top.title("DUMP BRAIN")
aileb = Label(top, text="DONE", width=30, height=2)
aileb.grid(row=1, column=1, columnspan=2)
b4_ai = Button(root, text="Open brain.dat", width=30, height=2, command=butCallback_BR1)
b5_ai = Button(root, text="Open brain City save", width=30, height=2)
def butCallback_BR3():
fileOpen = fd.askopenfile(defaultextension=".dat", filetypes=[("All types", "TACTGAME.0*")],
initialdir="./SAVEGAME")
read_brain(fileOpen.name,2)
top = Toplevel(root)
top.minsize(width=200, height=1)
top.title("DUMP BRAIN")
aileb = Label(top, text="DONE", width=30, height=2)
aileb.grid(row=1, column=1, columnspan=2)
b6_ai = Button(root, text="Open brain Tac save", width=30, height=2, command=butCallback_BR3)
spr2_ai = ttk.Separator(root, orient=HORIZONTAL)
def butCallback_exp1():
fileOpen = fd.askopenfile(defaultextension=".dat", filetypes=[("All types", "EXPER*.dat")],
initialdir="./AIFILES")
read_exp(fileOpen.name,0)
top = Toplevel(root)
top.minsize(width=200, height=1)
top.title("DUMP EXPERIEN")
aileb = Label(top, text="DONE", width=30, height=2)
aileb.grid(row=1, column=1, columnspan=2)
b7_exp = Button(root, text="Open EXPERIEN.dat", width=30, height=2, command=butCallback_exp1)
b8_exp = Button(root, text="Open EXPERIEN City save", width=30, height=2)
def butCallback_exp2():
fileOpen = fd.askopenfile(defaultextension=".dat", filetypes=[("All types", "TACTGAME.0*")],
initialdir="./SAVEGAME")
read_exp(fileOpen.name,2)
top = Toplevel(root)
top.minsize(width=200, height=1)
top.title("DUMP EXPERIEN")
aileb = Label(top, text="DONE", width=30, height=2)
aileb.grid(row=1, column=1, columnspan=2)
b9_exp = Button(root, text="Open EXPERIEN Tac save", width=30, height=2, command=butCallback_exp2)
b1_ai.grid(row=2, column=1, columnspan=2)
b2_ai.grid(row=3, column=1, columnspan=2)
b3_ai.grid(row=4, column=1, columnspan=2)
spr1_ai.grid(row=5, column=1, columnspan=2, sticky='ew', pady=5)
#spr1_ai.rowconfigure(1, weight=1)
b4_ai.grid(row=6, column=1, columnspan=2)
b5_ai.grid(row=7, column=1, columnspan=2)
b6_ai.grid(row=8, column=1, columnspan=2)
spr2_ai.grid(row=9, column=1, columnspan=2, sticky='ew', pady=5)
b7_exp.grid(row=10, column=1, columnspan=2)
b8_exp.grid(row=11, column=1, columnspan=2)
b9_exp.grid(row=12, column=1, columnspan=2)
root.mainloop()
def mainScreen():
root = Tk()
root.minsize(width=500, height=400)
root.title("Apoc editor")
#b1=Button(text="Cityscape editor", width=30, height=2)
b1=Button(text="Patcher", width=30, height=2)
b2=Button(text="Cityscape files editor", width=30, height=2)
b3=Button(text="Battlescape editor", width=30, height=2)
b4=Button(text="Battlescape files editor", width=30, height=2)
def butCallback1():
root.destroy()
openpatch()
b1=Button(root, text='Patcher', width=30, height=2, command=butCallback1)
def butCallback5():
root.destroy()
opensvg()
b5=Button(root, text='Savedgames editor', width=30, height=2, command=butCallback5)
def butCallback6():
root.destroy()
openai()
b6=Button(text="DUMP AI files", width=30, height=2, command=butCallback6)
b7=Button(text="Exit", width=30, height=2,command=root.destroy)
Label(text="Press to edit:", width=20, height=2).pack()
b1.pack()
b2.pack()
b3.pack()
b4.pack()
b5.pack()
b6.pack()
b7.pack()
ToolTp = Balloon()
ToolTp.bind_widget(b1, balloonmsg="edit ufo2p.exe")
ToolTp.bind_widget(b2, balloonmsg="edit Cityscape files in 'UFODATA' folder")
ToolTp.bind_widget(b3, balloonmsg="edit TACP.EXE")
ToolTp.bind_widget(b4, balloonmsg="edit Battlescape files in 'TACDATA' folder")
ToolTp.bind_widget(b5, balloonmsg="edit Savedgames")
ToolTp.bind_widget(b6, balloonmsg="Patch game")
ToolTp.bind_widget(b7, balloonmsg="Exit editor")
root.mainloop()
if __name__ == '__main__':
mainScreen()