Skip to content

Commit

Permalink
feat: demo export supporting first two puzzle sets
Browse files Browse the repository at this point in the history
Pandora and feature tags made this really easy!

- Duplicates the existing windows/linux/web exports, renames them 'demo',
adds a feature tag 'demo', and gives them proper dist/dothop-demo-* directories.
- adds a new property to the puzzle sets: allowed_in_demo
- filters puzzles by allowed_in_demo in Store/State when first loading,
but only when the allowed_in_demo feature tag is set
  • Loading branch information
russmatney committed Feb 23, 2024
1 parent 012c345 commit 900604e
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 2 deletions.
21 changes: 20 additions & 1 deletion data.pandora
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@
"_index": 0,
"_name": "One",
"_property_overrides": {
"allowed_in_demo": {
"type": "bool",
"value": true
},
"display_name": {
"type": "string",
"value": "Them Dots"
Expand Down Expand Up @@ -337,6 +341,10 @@
"_index": 0,
"_name": "Two",
"_property_overrides": {
"allowed_in_demo": {
"type": "bool",
"value": false
},
"display_name": {
"type": "string",
"value": "Get Outer Here"
Expand Down Expand Up @@ -656,6 +664,10 @@
"_index": 0,
"_name": "Five",
"_property_overrides": {
"allowed_in_demo": {
"type": "bool",
"value": true
},
"display_name": {
"type": "string",
"value": "A Spring in your Hop"
Expand Down Expand Up @@ -1006,12 +1018,19 @@
"_id": "62",
"_name": "music_tracks",
"_type": "array"
},
{
"_category_id": "1",
"_default_value": false,
"_id": "63",
"_name": "allowed_in_demo",
"_type": "bool"
}
]
},
"_id_generator": {
"_ids_by_context": {
"default": 62
"default": 63
}
}
}
141 changes: 141 additions & 0 deletions export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,144 @@ open \"{temp_dir}/{exe_name}.app\" --args {cmd_args}"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
kill $(pgrep -x -f \"{temp_dir}/{exe_name}.app/Contents/MacOS/{exe_name} {cmd_args}\")
rm -rf \"{temp_dir}\""

[preset.4]

name="Demo - Linux"
platform="Linux/X11"
runnable=false
dedicated_server=false
custom_features="demo"
export_filter="all_resources"
include_filter="data.pandora, *.txt"
exclude_filter=""
export_path="dist/dothop-demo-linux/dothop.x86_64"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false

[preset.4.options]

custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=false
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
binary_format/architecture="x86_64"
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="#!/usr/bin/env bash
export DISPLAY=:0
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
\"{temp_dir}/{exe_name}\" {cmd_args}"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
rm -rf \"{temp_dir}\""

[preset.5]

name="Demo - Web"
platform="Web"
runnable=false
dedicated_server=false
custom_features="demo"
export_filter="all_resources"
include_filter="data.pandora, *.txt"
exclude_filter=""
export_path="dist/dothop-demo-web/index.html"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false

[preset.5.options]

custom_template/debug=""
custom_template/release=""
variant/extensions_support=false
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=true
html/export_icon=true
html/custom_html_shell=""
html/head_include=""
html/canvas_resize_policy=2
html/focus_canvas_on_start=true
html/experimental_virtual_keyboard=false
progressive_web_app/enabled=true
progressive_web_app/offline_page=""
progressive_web_app/display=1
progressive_web_app/orientation=0
progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color(0, 0, 0, 1)

[preset.6]

name="Demo - Windows Desktop"
platform="Windows Desktop"
runnable=false
dedicated_server=false
custom_features="demo"
export_filter="all_resources"
include_filter="data.pandora, *.txt"
exclude_filter=""
export_path="dist/dothop-demo-windows/dothop.exe"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false

[preset.6.options]

custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=false
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
binary_format/architecture="x86_64"
codesign/enable=false
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PackedStringArray()
application/modify_resources=true
application/icon="res://assets/boxart/client-icon_64.png"
application/console_wrapper_icon=""
application/icon_interpolation=4
application/file_version=""
application/product_version=""
application/company_name="Russell Matney"
application/product_name="Dot Hop"
application/file_description=""
application/copyright="Russell Matney"
application/trademarks=""
application/export_angle=0
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
$trigger = New-ScheduledTaskTrigger -Once -At 00:00
$settings = New-ScheduledTaskSettingsSet
$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
Start-ScheduledTask -TaskName godot_remote_debug
while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force '{temp_dir}'"
3 changes: 3 additions & 0 deletions src/PuzzleSet.gd
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ func is_completed() -> bool:
func is_unlocked() -> bool:
return get_bool("is_unlocked")

func allowed_in_demo() -> bool:
return get_bool("allowed_in_demo")

func get_next_puzzle_set() -> PuzzleSet:
return get_reference("next_set")

Expand Down
6 changes: 5 additions & 1 deletion src/State.gd
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ func apply_event(event):
func initial_puzzle_sets() -> Array[PuzzleSet]:
var ent = Pandora.get_entity(PuzzleSetIDs.ONE)
var pss = Pandora.get_all_entities(Pandora.get_category(ent._category_id))\
.map(func(e): return e.instantiate())
.map(func(e): return e.instantiate())\
.filter(func(e):
if OS.has_feature("demo"):
return e.allowed_in_demo()
return true)
var ps: Array[PuzzleSet] = []
ps.assign(pss)
ps.sort_custom(func(a, b): return a.get_sort_order() < b.get_sort_order())
Expand Down

0 comments on commit 900604e

Please sign in to comment.