Skip to content

Commit

Permalink
enable interactive mode by default; disabled for docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisCris committed Apr 26, 2024
1 parent d58dcc1 commit 59f2c59
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- release
tags:
- "v*.*.*"
- "v*"

jobs:
dev-release:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- release
tags:
- "v*.*.*"
- "v*"

jobs:
build-and-push:
Expand Down
4 changes: 2 additions & 2 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ chown -R pn:pn /app



cmd="./setup_and_run.sh"
cmd="./setup_and_run.sh --nocli"

# Check each environment variable and append it to the command if it exists
if [ -n "$APP_LANG" ]; then cmd="$cmd --lang=\"$APP_LANG\""; fi
if [ -n "$APP_PORT" ]; then cmd="$cmd --port=$APP_PORT"; fi
if [ -n "$MODE" ]; then cmd="$cmd --mode=\"$MODE\""; fi
if [ -n "$SAVE_PATH" ]; then cmd="$cmd --path=\"$SAVE_PATH\""; fi
if [ -n "$PASSWORD" ]; then cmd="$cmd --password=\"$PASSWORD\""; fi
if [ -n "$INTERACTIVE" ]; then cmd="$cmd --interactive"; fi
# if [ -n "$INTERACTIVE" ]; then cmd="$cmd --interactive"; fi

echo "Launching: $cmd"

Expand Down
13 changes: 7 additions & 6 deletions src/palworld_pal_editor/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ def setup_config_from_args():
parser = argparse.ArgumentParser(description="Palworld Pal Editor, developed by _connlost with ❤.")

parser.add_argument('--lang', type=str, help=f'Language for the application. options: {", ".join(DataProvider.get_i18n_options())}', default=Config.i18n)
parser.add_argument('--debug', action='store_true', help='The debug option, only for VSCode debug launch.')
parser.add_argument('--path', type=str, help='Path to the save folder.', default=Config.path)
parser.add_argument('--mode', type=str, help='Running Mode, options: cli, gui, web', default=Config.mode)
parser.add_argument('--port', type=int, help='Port used for WebUI mode.', default=Config.port)
parser.add_argument('--password', type=str, help='Password for WebUI.', default=Config.password)
parser.add_argument('--interactive', action='store_true', help='Enable Interactive CLI.')

parser.add_argument('--debug', action='store_true', help='The debug option, only for VSCode debug launch. (Never saved to config.json)')
parser.add_argument('--nocli', action='store_true', help='Disable Interactive CLI on GUI/WEB mode. (Never saved to config.json)')

args = parser.parse_args()
try:
Config.set_configs({
"debug": Config.debug or args.debug, # True value in config overrides the cli arg.
"interactive": Config.interactive or args.interactive,
"debug": args.debug, # never saved to config.json
"nocli": args.nocli, # never saved to config.json
"path": args.path,
"mode": args.mode,
"port": args.port,
Expand Down Expand Up @@ -62,10 +63,10 @@ def main():
match Config.mode:
case "cli": cli_main()
case "gui":
if Config.interactive: InteractThread.load()
if not Config.nocli: InteractThread.load()
gui_main()
case "web":
if Config.interactive: InteractThread.load()
if not Config.nocli: InteractThread.load()
webui_main()

if __name__ == "__main__":
Expand Down
14 changes: 0 additions & 14 deletions src/palworld_pal_editor/api/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,6 @@ def get_active_skills():
return reply(0, {"dict": atk_dict, "arr": atk_arr})


# def displayElement(element):
# elementEmojis = {
# 'Water': "💧",
# 'Fire': "🔥",
# 'Dragon': "🐉",
# 'Grass': "☘️",
# 'Ground': "🪨",
# 'Ice': "❄️",
# 'Electric': "⚡",
# 'Neutral': "😐",
# 'Dark': "🌑"
# }
# return elementEmojis.get(element) or "❓"

@save_blueprint.route("/i18n", methods=["PATCH"])
# @jwt_required()
def update_i18n():
Expand Down
2 changes: 1 addition & 1 deletion src/palworld_pal_editor/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Config:
debug: bool = False
path: str = None
password: str = None
interactive: bool = False
nocli: bool = False
_password_hash: str = None
JWT_SECRET_KEY: str = "X2Nvbm5sb3N0"

Expand Down

0 comments on commit 59f2c59

Please sign in to comment.