Skip to content

Commit c068b70

Browse files
committed
custom icon + auto release
1 parent 3eee144 commit c068b70

4 files changed

Lines changed: 26 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,13 @@ jobs:
4444
if: startsWith(github.ref, 'refs/tags/')
4545
uses: softprops/action-gh-release@v1
4646
with:
47+
files: dist/BZ98R_ModManager.exe
48+
49+
- name: Update Nightly Release
50+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
51+
uses: softprops/action-gh-release@v1
52+
with:
53+
tag_name: nightly
54+
name: Nightly Build
55+
prerelease: true
4756
files: dist/BZ98R_ModManager.exe

build.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ a = Analysis(
1414
['cmd.py'],
1515
pathex=[],
1616
binaries=binaries,
17-
datas=datas,
17+
datas=datas + [('bzone.ttf', '.'), ('modman.ico', '.')],
1818
hiddenimports=hiddenimports + ['PIL.Image', 'PIL.ImageTk'],
1919
hookspath=[],
2020
hooksconfig={},
@@ -48,5 +48,5 @@ exe = EXE(
4848
codesign_identity=None,
4949
entitlements_file=None,
5050
version='file_version_info.txt',
51-
icon=None,
51+
icon='modman.ico',
5252
)

cmd.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,26 @@ def __init__(self, root):
7272
self.root.geometry("1150x850")
7373
self.root.configure(bg=BZ_BG)
7474

75-
self.custom_font_name = "BZONE" if os.path.exists("bzone.ttf") else "Consolas"
76-
7775
if getattr(sys, 'frozen', False):
7876
self.base_dir = os.path.dirname(sys.executable)
77+
self.resource_dir = sys._MEIPASS
7978
else:
8079
self.base_dir = os.path.dirname(os.path.abspath(__file__))
80+
self.resource_dir = self.base_dir
8181

82+
font_path = os.path.join(self.resource_dir, "bzone.ttf")
83+
if os.path.exists(font_path):
84+
self.custom_font_name = "BZONE"
85+
try: ctypes.windll.gdi32.AddFontResourceExW(font_path, 0x10, 0)
86+
except: pass
87+
else:
88+
self.custom_font_name = "Consolas"
89+
90+
icon_path = os.path.join(self.resource_dir, "modman.ico")
91+
if os.path.exists(icon_path):
92+
try: self.root.iconbitmap(icon_path)
93+
except: pass
94+
8295
self.bin_dir = os.path.join(self.base_dir, "bin")
8396
self.config = self.load_config()
8497

modman.ico

50.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)