Skip to content

Commit 935213a

Browse files
committed
add button file
1 parent 7fd66f5 commit 935213a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

button.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from texture import Texture
77
from open import Open
88
from download import Download
9+
from file import File
910

1011
class Button:
1112
"""
@@ -22,6 +23,7 @@ class Button:
2223
iconHlposer : tk.PhotoImage
2324
iconVisualStudio : tk.PhotoImage
2425
iconVTFEdit : tk.PhotoImage
26+
iconExplorer : tk.PhotoImage
2527

2628
btn_hammer : tk.Button
2729
btn_hammer_plus_plus : tk.Button
@@ -34,6 +36,7 @@ class Button:
3436
btn_particle : tk.Button
3537
btn_Launch_dev : tk.Button
3638
btn_Launch : tk.Button
39+
btn_file_explorer : tk.Button
3740

3841
model : Model
3942
texture : Texture
@@ -49,6 +52,7 @@ def __init__(self,sourceSDK):
4952
self.open = Open(self.sdk)
5053

5154
base_path = os.path.dirname(os.path.abspath(__file__))
55+
self.iconExplorer = tk.PhotoImage(file=os.path.join(base_path, "icons", "fileexplorer.png"))
5256
self.iconHpp = tk.PhotoImage(file=os.path.join(base_path, "icons", "hpp.png"))
5357
self.iconHammer = tk.PhotoImage(file=os.path.join(base_path, "icons", "hammer.png"))
5458
self.iconSource = tk.PhotoImage(file=os.path.join(base_path, "icons", "source.png"))
@@ -89,6 +93,10 @@ def display(self):
8993
"""
9094
display button on gui
9195
"""
96+
97+
file = File(self.sdk)
98+
self.btn_file_explorer = tk.Button(self.sdk.root, text="Files", command=file.display_files,image=self.iconExplorer,compound=tk.LEFT, background="#4c5844",fg="white")
99+
self.btn_file_explorer.pack(side="left")
92100

93101
if os.path.isfile(self.sdk.bin_folder + "/hammer.exe"):
94102
self.btn_hammer = tk.Button(self.sdk.root, text="hammer", command=self.open_hammer,image=self.iconHammer,compound=tk.LEFT, background="#4c5844",fg="white")

fileListApp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def load_files(self, folder):
5959

6060
self.current_folder = folder
6161
self.files = [f for f in os.listdir(folder) if os.path.isdir(os.path.join(folder, f)) or f.endswith(
62-
(".vmf", ".txt", ".cfg", ".vtf", ".vmt", ".qc", ".mdl", ".vcd", ".res", ".bsp", "dir.vpk", ".tga", ".wav", ".mp3", ".sln"))]
62+
(".vmf", ".txt", ".cfg", ".vtf", ".vmt", ".qc", ".mdl", ".vcd", ".res", ".bsp", "dir.vpk", ".tga", ".wav", ".mp3", ".sln", ".bik", ".bat"))]
6363

6464
columns = max(1, int(self.root.winfo_width() / 150))
6565
row = col = 0

0 commit comments

Comments
 (0)