Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/pyinstaller-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
pip install pyinstaller
pip install jsoncparser
pip install certifi
pip install pyyaml
pip install am-i-connected
pip install pyperclip
- name: Run PyInstaller
run: |
pyinstaller --noconfirm --onedir --console --name "Snark" --add-data "version.txt:." --add-data "activities.txt:." --add-data "logo128.png:." --add-data "icon-win32.ico:." --add-data "icon-linux.png:." --add-data "LICENSE:." --add-data "README.md:." --add-data "save:save/" --add-data "themes:themes/" --add-data "third_party:third_party/" --add-data "images:images/" --add-data "logs:logs/" "GUI.py"
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pyinstaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
pip install pyinstaller
pip install jsoncparser
pip install certifi
pip install pyyaml
pip install am-i-connected
pip install pyperclip
- name: Run PyInstaller
run: |
pyinstaller --noconfirm --onedir --console --name "Snark" --add-data "version.txt:." --add-data "activities.txt:." --add-data "logo128.png:." --add-data "icon-win32.ico:." --add-data "icon-linux.png:." --add-data "LICENSE:." --add-data "README.md:." --add-data "save:save/" --add-data "themes:themes/" --add-data "third_party:third_party/" --add-data "images:images/" --add-data "logs:logs/" "GUI.py"
Expand Down
95 changes: 21 additions & 74 deletions GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import jsonc
import certifi
import ssl
from am_i_connected import CheckThereIsConnection

selected_scr = ''
scr_dat = ''
Expand Down Expand Up @@ -72,58 +73,6 @@ def interp(self):
scr_dat = [self.mode, scr]
guii.exec_script(scr_dat)

class ScriptWin:

def __init__(self):
self.nroot = Tk()
self.win()
self.nroot.mainloop()

def win(self):
self.flags = Flags()
self.nroot.title("Scripts")

frame = Frame(self.nroot, borderwidth=2, relief="sunken")
frame.grid(column=1, row=1, sticky=(N, E, S, W))
self.nroot.columnconfigure(1, weight=1)
self.nroot.rowconfigure(1, weight=1)

if self.flags.allowScripts:
self.scripts = []
if getattr(sys, 'frozen', False):
EXE_LOCATION = os.path.dirname( sys.executable )
else:
EXE_LOCATION = os.path.dirname( os.path.realpath( __file__ ) )
scr_dir = os.path.join(EXE_LOCATION, "scripts")
for s in os.listdir(scr_dir):
self.scripts.append(s.replace('.txt', ''))
print(self.scripts)

self.scr_list = Listbox(frame)
self.scr_list.grid(column=1, row=1, sticky=(N, S, E, W), padx=40, pady=(40, 0), rowspan=5)
count = 0
for n in self.scripts:
count += 1
self.scr_list.insert(count, n)

select_scr = Button(frame, text="Select", command=self.select)
select_scr.grid(column=1, row=6, sticky=(S))
else:
b_smd = Label(frame, text=f"Proper script functionality will be implemented in a future release,\nfor now though, the script button is here so I don't have to\ncompletely remodel the GUI with its removal.")
b_smd.grid(column=1, row=1, sticky=(S), padx=25, pady=25)

select_scr = Button(frame, text="I understand", command=self.close)
select_scr.grid(column=1, row=6, sticky=(S))
def close(self):
self.nroot.destroy()

def select(self):
global selected_scr
selected_scr = self.scripts[int(self.scr_list.curselection()[0])]
print(selected_scr)
scr_interp = Interp(selected_scr)
self.nroot.destroy()

class OptWin:

def __init__(self):
Expand Down Expand Up @@ -261,15 +210,16 @@ def save_options(self):

def check_version(self):
url = "https://github.com/PostScriptReal/Snark_Compiler/raw/refs/heads/main/version.txt"
webVer = urlopen(url, context=ssl.create_default_context(cafile=certifi.where())).read().decode('utf-8')
print(webVer)
if CheckThereIsConnection():
webVer = urlopen(url, context=ssl.create_default_context(cafile=certifi.where())).read().decode('utf-8')
print(webVer)

# Don't you dare make a Fortnite joke
vFile = open("version.txt", "r")
curVer = vFile.read()
# Don't you dare make a Fortnite joke
vFile = open("version.txt", "r")
curVer = vFile.read()

if curVer != webVer:
a = GetNewVersion(webVer, self.chkVerTheme)
if curVer != webVer:
a = GetNewVersion(webVer, self.chkVerTheme)

def __init__(self):
super().__init__()
Expand All @@ -285,7 +235,7 @@ def __init__(self):
self.selTheme = self.options["theme"]

winSizeFile = False
winSizeVer = 2
winSizeVer = 3
if sys.platform == "linux" and os.path.exists(f"WinSize{winSizeVer}.txt"):
wsFile = open(f"WinSize{winSizeVer}.txt", "r")
ws = wsFile.readlines()
Expand Down Expand Up @@ -370,9 +320,7 @@ def __init__(self):
self.frame = Frame(self, borderwidth=2, relief="sunken", bg=thCol["bg"])
self.frame.grid(column=6, row=2, sticky=(N, E, S, W))
self.header = Frame(self.frame, borderwidth=2, bg=thCol["bg"])
self.header.grid(column=1, row=1, sticky=(N, W, E), columnspan=69)
mtbtns = Frame(self.frame, borderwidth=2, bg=thCol["bg"])
mtbtns.grid(column=1, row=9, sticky=(S), columnspan=69)
self.header.grid(column=0, row=1, sticky=(N, W, E), columnspan=69)
menu = Frame(self.frame, borderwidth=2, bg=thCol["bg"])
menu.grid(column=0, row=2, sticky=(W, S), columnspan=69)
"""
Expand All @@ -395,28 +343,28 @@ def __init__(self):

# Create Header Buttons
self.dupe_button = Button(self.header, text="Games", command=self.bd_menu, bg=thCol["btn"][0], cursor="hand2")
self.dupe_button.grid(column=0, row=0, sticky=(N), ipadx=buttonPad)
self.dupe_button.grid(column=0, row=0, sticky="nw", ipadx=buttonPad)

self.cmpiler_button = Button(self.header, text="Compilers", command=self.cmpSetupMenu, bg=thCol["btn"][0], cursor="hand2")
self.cmpiler_button.grid(column=1, row=0, sticky=(N), ipadx=buttonPad)
self.cmpiler_button.grid(column=1, row=0, sticky="nw", ipadx=buttonPad)

self.mat_button = Button(self.header, text="Decompile", command=self.mnc_menu, bg=thCol["btn"][0], cursor="hand2")
self.mat_button.grid(column=2, row=0, sticky=(N), ipadx=buttonPad)
self.mat_button.grid(column=2, row=0, sticky="nw", ipadx=buttonPad)

self.comp_button = Button(self.header, text="Compile", command=self.cmp_menu, bg=thCol["btn"][0], cursor="hand2")
self.comp_button.grid(column=3, row=0, sticky=(N), ipadx=buttonPad)
self.comp_button.grid(column=3, row=0, sticky="nw", ipadx=buttonPad)

self.scripts = Button(self.header, text="Batch Manager", command=self.scripts, bg=thCol["btn"][0], cursor="hand2")
self.scripts.grid(column=4, row=0, sticky=(N), ipadx=buttonPad)
self.scripts.grid(column=4, row=0, sticky="nw", ipadx=buttonPad)

self.options = Button(self.header, text="Options", command=self.optionsMenu, bg=thCol["btn"][0], cursor="hand2")
self.options.grid(column=6, row=0, sticky=(N), ipadx=buttonPad)
self.options.grid(column=6, row=0, sticky="nw", ipadx=buttonPad)

self.help = Button(self.header, text="Help", command=self.help, bg=thCol["btn"][0], cursor="hand2")
self.help.grid(column=7, row=0, sticky=(N), ipadx=buttonPad)
self.help.grid(column=7, row=0, sticky="nw", ipadx=buttonPad)

self.aboutB = Button(self.header, text="About", command=self.about, cursor="hand2")
self.aboutB.grid(column=5, row=0, sticky=(N), ipadx=buttonPad)
self.aboutB.grid(column=5, row=0, sticky="nw", ipadx=buttonPad)

# Getting the width of the window before adding in the menus so I can fix the width of the window on different OSs/distros
if winSizeFile and not ws[0] == "":
Expand Down Expand Up @@ -470,7 +418,7 @@ def __init__(self):
print(self.goodHeight)

if sys.platform == 'linux':
self.geometry(f"{self.goodWidth}x{self.goodHeight}")
self.geometry(f"{self.goodWidth+1}x{self.goodHeight}")
else:
self.geometry("501x443")

Expand Down Expand Up @@ -622,8 +570,7 @@ def updateOpt(self, key, val):
self.cmpMenu.updateOpt(key, val)
self.decMenu.updateOpt(key, val)
self.optMenu.updateOpt(key, val)
if self.flags.allowScripts:
self.batchMenu.updateOpt(key, val)
self.batchMenu.updateOpt(key, val)

def updateGames(self, comp):
self.cmpMenu.updateGames(comp)
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,9 @@
<td><a href="http://geckons.com/halflife/">GeckoN's v6 MDL Decompiler</a></td>
<td>Proprietary</td>
</tr>
<tr>
<td><a href="https://store.steampowered.com/app/225840/Sven_Coop/">Sven Co-op StudioMDL</a></td>
<td>Proprietary</td>
</tr>
</table>
</div>
2 changes: 1 addition & 1 deletion interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import sys
import subprocess
import yaml
# import yaml

# Class that gets information from the script header (the lines of text sandwiched inbetween the dashes)
class SSTVer:
Expand Down
Loading
Loading