Skip to content

Commit

Permalink
Fix #1799: Add a special warning if BEE is installed directly into th…
Browse files Browse the repository at this point in the history
…e game folder.
  • Loading branch information
TeamSpen210 committed Jul 10, 2022
1 parent 7ff17b2 commit fd829b5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/BEE2_launch.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ if __name__ == '__main__':
import localisation
localisation.setup(LOGGER)

if app_name == 'bee2':
# Check early on for a common mistake - putting the BEE2 folder directly in Portal 2 means
# when we export we'll try and overwrite ourself. Use Steam's appid file as a marker.
if utils.install_path('../steam_appid.txt').exists() and utils.install_path('.').name.casefold() == 'bee2':
from app import gameMan
gameMan.app_in_game_error()
sys.exit()

elif app_name == 'bee2':
from app import BEE2
BEE2.start_main()
elif app_name == 'backup':
Expand Down
14 changes: 14 additions & 0 deletions src/app/gameMan.py
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,20 @@ def logic_pos() -> Iterator[Vec]:
)


def app_in_game_error() -> None:
"""Display a message warning about the issues with placing the BEE folder directly in P2."""
messagebox.showerror(
message=gettext(
"It appears that the BEE2 application was installed directly in a game directory. "
"The bee2/ folder name is used for exported resources, so this will cause issues.\n\n"
"Move the application folder elsewhere, then re-run."
),
parent=TK_ROOT,
title='BEE2',
)
return None


def save() -> None:
for gm in all_games:
gm.save()
Expand Down

0 comments on commit fd829b5

Please sign in to comment.