Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
theastropath committed Jun 23, 2023
2 parents 638db93 + 282b0ba commit 0fd8d5f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
6 changes: 4 additions & 2 deletions installer/GUI/InstallerWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def initWindow(self):

filetypes = (('DeusEx.exe', 'DeusEx.exe'),)
initdir = getDefaultPath()
self.SetShowHiddenFiles()
p = fd.askopenfilename(title="Find plain DeusEx.exe", filetypes=filetypes, initialdir=initdir)
if not p:
print('no file selected')
Expand Down Expand Up @@ -154,15 +155,15 @@ def _Install(self):

speedupfix = self.speedupfixval.get()
flavors = Install.Install(self.exe, flavors, speedupfix)
flavors = ', '.join(flavors)
flavorstext = ', '.join(flavors.keys())
extra = ''
if 'Vanilla' in flavors and IsWindows():
extra += '\nCreated DXRando.exe'
if 'Vanilla? Madder.' in flavors and IsWindows():
extra += '\nCreated VMDRandomizer.exe'
self.root.title('DXRando Installation Complete!')
self.root.update()
messagebox.showinfo('DXRando Installation Complete!', 'Installed DXRando for: ' + flavors + extra)
messagebox.showinfo('DXRando Installation Complete!', 'Installed DXRando for: ' + flavorstext + extra)
self.closeWindow()


Expand All @@ -188,6 +189,7 @@ def getDefaultPath():
Path("D:\\") / "Program Files (x86)" / "Steam" / "steamapps" / "common" / "Deus Ex" / "System",
Path.home() /'snap'/'steam'/'common'/'.local'/'share'/'Steam'/'steamapps'/'common'/'Deus Ex'/'System',
Path.home() /'.steam'/'steam'/'SteamApps'/'common'/'Deus Ex'/'System',
Path.home() /'.local'/'share'/'Steam'/'steamapps'/'common'/'Deus Ex'/'System',
]
p:Path
for p in checks:
Expand Down
12 changes: 12 additions & 0 deletions installer/GUI/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ def newInput(self, cls, label:str, tooltip:str, row:int, *args, **kargs):
def FixColors(self, w):
w.config(bg="#eeeeee",fg="black")

def SetShowHiddenFiles(self):
try:
try:
self.root.tk.call('tk_getOpenFile', '-foobarbaz-')
except TclError:
pass
# now set the magic variables accordingly
self.root.tk.call('set', '::tk::dialog::file::showHiddenBtn', '1')
self.root.tk.call('set', '::tk::dialog::file::showHiddenVar', '1')
except:
pass


# from https://stackoverflow.com/a/68701602
class ScrollableFrame:
Expand Down
3 changes: 2 additions & 1 deletion installer/Install/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def _ModifyConfig(text:str, changes:dict, additions:dict) -> str:
outtext = outtext.replace(all, newall)

# add any changes we didn't match on
leftovers = dict(**changes, **additions)
leftovers = dict(**changes)
leftovers.update(**additions)
for k in leftovers.keys():
outtext += '\r\n\r\n[' + k + ']\r\n'
if k in changes:
Expand Down
2 changes: 1 addition & 1 deletion installer/Install/MapVariants.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def InstallMirrors(mapsdir: Path, callback: callable, flavor:str):
temp.unlink()

# TODO: specify version
url = "https://github.com/Die4Ever/unreal-map-flipper/releases/latest/download/" + name
url = "https://github.com/Die4Ever/unreal-map-flipper/releases/download/v0.9.1/" + name
downloadcallback = lambda a,b,c : callback(a,b,c, status="Downloading Maps")
DownloadFile(url, temp, downloadcallback)

Expand Down

0 comments on commit 0fd8d5f

Please sign in to comment.