Skip to content

Commit

Permalink
v0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sumeet-chand committed Jun 8, 2024
1 parent efe6a8a commit 7228a81
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 23 deletions.
41 changes: 33 additions & 8 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and test software
name: test and release software

on:
push:
Expand All @@ -8,6 +8,7 @@ on:
jobs:
build_and_test_windows:
runs-on: windows-latest
timeout-minutes: 30

steps:
- name: Checkout repository
Expand All @@ -16,21 +17,29 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.9'

- name: Install dependencies
run: |
pip install Pillow requests pyinstaller pyautogui
- name: Build for Windows
run: |
pyinstaller --onefile --noconsole --icon=assets/view_earth.ico --distpath=. Heroes3MapLiker.py
pyinstaller --onefile --noconsole --icon=assets/view_earth.ico --distpath=dist Heroes3MapLiker.py
- name: Run Windows Tests
run: python tests.py

- name: Upload windows artifact
uses: actions/upload-artifact@v2
with:
name: windows-binaries
path: dist/main.exe
if: success()

build_and_test_macos:
runs-on: macos-latest
timeout-minutes: 30

steps:
- name: Checkout repository
Expand All @@ -39,21 +48,29 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.9'

- name: Install dependencies
run: |
pip install Pillow requests pyinstaller pyautogui
- name: Build for macOS
run: |
pyinstaller --onefile --noconsole --icon=assets/view_earth.ico --distpath=. Heroes3MapLiker.py
pyinstaller --onefile --noconsole --icon=assets/view_earth.ico --distpath=dist Heroes3MapLiker.py
- name: Run macOS Tests
run: python tests.py

- name: Upload mac artifact
uses: actions/upload-artifact@v2
with:
name: mac-binaries
path: dist/main
if: success()

build_and_test_linux:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- name: Checkout repository
Expand All @@ -62,16 +79,24 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.9'

- name: Install dependencies
run: |
sudo apt-get install python3-tk
sudo apt-get update
sudo apt-get install -y python3-tk
pip install Pillow requests pyinstaller pyautogui
- name: Build for Linux
run: |
pyinstaller --onefile --noconsole --icon=assets/view_earth.ico --distpath=. Heroes3MapLiker.py
pyinstaller --onefile --noconsole --icon=assets/view_earth.ico --distpath=dist Heroes3MapLiker.py
- name: Run Linux Tests
run: python tests.py

- name: Upload linux artifact
uses: actions/upload-artifact@v2
with:
name: linux-binaries
path: dist/main
if: success()
Binary file added assets/overworld.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/subterranean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 4 additions & 15 deletions display_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ def display_gui(root, SCREEN_WIDTH: int, SCREEN_HEIGHT: int, COLS: int, IMAGE_WI
progress_label = None
map_name_label = None

def set_background_image():
"""
set background image of GUI
Returns:
None
"""
# Create a label for the background image and place it behind other widgets
background_label = tk.Label(root, image=photo_images["page"])
background_label.place(relwidth=1, relheight=1)
# Ensure the background label stays behind other widgets
background_label.lower()
set_background_image()

def toggle_control_panel():
"""
Button to hide or show control panel triggers this function
Expand Down Expand Up @@ -199,6 +185,9 @@ def on_key_press(event):
canvas = tk.Canvas(root, width=SCREEN_WIDTH, height=SCREEN_HEIGHT)
canvas.grid(row=0, column=0, columnspan=2, sticky="nsew")

background_photo = ImageTk.PhotoImage(Image.open("assets/page.png").resize((SCREEN_WIDTH, SCREEN_HEIGHT)))
# canvas.create_image(0, 0, image=background_photo, anchor=tk.NW) - NOT SETTING BACKGROUND IMAGE NEEDS FIX

scrollbar = tk.Scrollbar(root, orient=tk.VERTICAL, command=canvas.yview)
scrollbar.grid(row=0, column=2, sticky="ns")
canvas.configure(yscrollcommand=scrollbar.set)
Expand All @@ -218,7 +207,7 @@ def on_mouse_wheel(event):
canvas.bind_all("<MouseWheel>", lambda event: on_mouse_wheel(event)) # bind event MouseWheel to function on_mouse_wheel

frame = tk.Frame(canvas)
canvas.create_window((0, 0), window=frame, anchor=tk.NW)
canvas.create_window((0, 0), window=frame, anchor=tk.NW) # by embedding a frame in the canvas window it becomes scrollable

load_images()

Expand Down

0 comments on commit 7228a81

Please sign in to comment.