diff --git a/.gitignore b/.gitignore index d6f1ca6..a3a28c4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,9 @@ .godot/ # Android build template directory generated by the editor -android/ +# (the .gdignore file is kept; everything else under android/ is build output) +android/* +!android/.gdignore export.cfg diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..a231bea --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,171 @@ +# Puzzle Quest + +Hidden-object game built with **Godot 4.6** (single renderer: Forward+). +Branched from a Godot 3.3 codebase — migration is recent, expect leftover +Godot-3-isms to occasionally surface. + +## Run + +``` +godot --editor # open project in the editor +godot # run the main scene (scenes/Main.tscn) +``` + +The system package `godot` (Arch `extra/godot`) is the project's Godot. There +is no in-repo Godot binary. + +## Architecture + +**Autoloads** (declared in `project.godot [autoload]`, loaded in this order): + +| Name | Source | Role | +|------------------|---------------------------------------|-------------------------------------------------------------------| +| `Loading` | `scenes/UI/loading/Loading.tscn` | Full-screen transition overlay (BG + animated border + progress) | +| `Global` | `scripts/Global.gd` | Async scene loader (`goto_scene(path)`) + `database` reference | +| `Setting` | `scripts/Setting.gd` | Reads/writes the settings table; applies locale/resolution/fullscreen | +| `Event` | `scripts/Event.gd` | Static handlers connected to scene buttons (Warcraft / Home / reset / back) | +| `GlobalAnimation`| `scripts/Animation.gd` | Tween-based dissolve + HUD slide/warning animations | + +**Database (`scripts/Database.gd`)** + +- Plain JSON at `db/ahog.json`. Three tables: `settings`, `levels`, `scenes`. +- On Android the file is copied once to `user://database.json` and written + there (game saves modify lock state per item). +- `Global.database` is a `Database.DB` instance exposing + `get_table_by_name(name)` and `save_db()`. Each `Table` exposes + `get_data_at_row_idx(row_id)`, `edit_data(prop_id, row_id, value)`, + `m_rows_count`, `get_data_by_prop_name_and_data(prop_name, value)`, + `get_dictionary_by_prop_name_and_data(prop_name, value)`. +- `db/M*.gd` are typed accessors (MBase / MScene / MLevel / MSetting) that + read rows via the API above — extend these, not the JSON shape directly. + +**Scene transitions** (`Global.goto_scene(path)`) + +Uses `ResourceLoader.load_threaded_request` + `load_threaded_get_status` + +`load_threaded_get` (Godot 4 API; the original `load_interactive`/`poll()` +was removed). The Loading overlay (autoload) plays `BorderAnim` while the +new scene loads in a background thread; `Event._loading_is_started/finished` +flip `Global.loaded` so the poll only runs once the entry animation has set +the boolean. Don't call `current_scene.queue_free()` outside this function +— it will leak the resource and break the loader state. + +**Levels.tscn / level scenes** + +`scenes/levels/Levels.tscn` is the shared shell; concrete levels +(`warcraft/WarCraft.tscn`, `home/Home.tscn`) inherit from it. Each scene +has a `HiddenObjectsItems/` `MeshInstance3D` with an `Area3D` +collision shape; clicking it triggers `Levels._check_collider` → +`_start_dissolve(name)` → `GlobalAnimation.start_dissolve(mesh, material)` +which runs the dissolve shader on `material.dissolve_amount`. + +The runtime hidden-object list lives under +`scenes/levels/parts/ListObjects.tscn` and is populated dynamically from +the `scenes` table for the current `Global.current_scene_int`. + +## Migration notes (Godot 3 → 4) + +The conversion is mostly done but a few classes of mistake keep surfacing +because `godot --convert-3to4` does not handle them: + +- **Label**: `align/valign` → `horizontal_alignment/vertical_alignment`. +- **Button**: `pressed` (property) → `button_pressed`; `set_pressed()` → + assignment to `button_pressed`. The `pressed` *signal* still exists. +- **ScrollContainer**: `scroll_horizontal_enabled = false` → + `horizontal_scroll_mode = 0` (and same for vertical). ScrollContainer + also ships a non-empty default panel style in Godot 4 — set + `theme_override_styles/panel = StyleBoxEmpty` if you need transparency. +- **TextureRect / TextureButton**: `expand = true` → `expand_mode = 1`. + `stretch_mode` enum values **shifted down by 1** between 3 and 4 (the + deprecated "Scale on Expand" at index 0 was removed): G3's Tile (2) is + G4's Tile (1), G3's Keep (3) is G4's Keep (2), etc. +- **Environment**: `background_mode` enum changed (G3 3=Sky → G4 2=Sky; + G4 3 is Canvas which renders black). `background_sky` → `sky`; + `background_energy` → `background_energy_multiplier`; + `fog_color` → `fog_light_color`; `fog_height_min` → `fog_height`; + `fog_mode = 1` (Depth) needed to keep `fog_depth_*` semantics, otherwise + Godot 4 falls back to dense `fog_density` exponential fog. +- **AnimationPlayer**: `add_animation(name, anim)` removed — go through + `get_animation_library("")` (create one with `add_animation_library("")` + if it returns null) and call `lib.add_animation(name, anim)`. +- **Tween**: no longer a Node — call `create_tween()` from any Node and use + `tween.tween_method(...)`. Delete any `[node type="Tween"]` from older + `.tscn` files (the loader will crash otherwise). +- **PhysicsRayQuery**: `space_state.intersect_ray(from, to, ...)` → + `PhysicsRayQueryParameters3D.create(from, to)`, set fields, then + `space_state.intersect_ray(query)`. +- **PackedScene.instance()** → `instantiate()`. +- **String / cast operators**: `String(x)` constructor doesn't exist — use + `str(x)`. `x as int/String/bool` does **not** parse strings — use + `int(s)`, `str(x)`, `bool(int(s))`. +- **Internationalization**: project setting is `[internationalization] + locale/translations=...`, not `[locale] translations=...`. Locale codes + must match `.po` filenames exactly (`fr.po` → `"fr"`; G3-style `fr_FR` + no longer auto-falls-back). +- **Inherited scenes**: nodes from an instanced child scene need + `layout_mode = 1` + `anchors_preset = 15` explicitly set in the parent + scene file, otherwise Godot 4 treats them as Position-mode and zeroes + the anchors. Watch for stale per-Label `layout_mode = 0` / + `anchor_right = 0` overrides in Main.tscn-style parent scenes. + +## Plugins + +- `addons/lod/` — Calinou's Level-of-Detail plugin (Spatial / OmniLight / + SpotLight / Particles → 3D variants). Class declarations use the Godot 4 + form (`@icon("...") class_name X` + `extends Node3D` separately). +- `addons/godot_db_manager/` — **removed during migration**. Don't restore + it; it relies on `WindowDialog`/`Tabs`/`PopupPanel` which were dropped in + Godot 4. The replacement is `scripts/Database.gd` (see above). + +## Custom shaders / materials + +Drop-in shaders live in `.material` resources (binary `RSCC` format) next +to each prop. `scripts/migrate_shaders.gd` is a one-shot tool that walks +`assets/` and rewrites the embedded shader code (Godot 3 → 4 keyword +renames: `depth_draw_alpha_prepass`, `hint_color`, `NORMALMAP`). Re-run it +with `godot --headless --script scripts/migrate_shaders.gd` after adding +new materials authored in Godot 3. + +`assets/fonts/text_outline.material` is a VisualShader graph from Godot 3 +that doesn't connect cleanly in 4 (out-of-bounds `p_from_port` errors, +COLOR never written). It has been detached from the Summary menu labels; +re-author it with Godot 4's built-in `theme_override_constants/outline_size` ++ `theme_override_colors/font_outline_color` instead. + +## Known visual issues to revisit + +- **Baked lightmap is gone.** `scenes/levels/warcraft/WarCraft.lmbake` is + in Godot 3's binary format (incompatible). The `LightmapGI` node still + exists in `WarCraft.tscn` but its `light_data` reference is cleared. + Open the scene in the editor and re-bake (Scene → Bake Lightmaps). +- **`assets/ui/themes/tab_select/UI-level-btn-shadow.png`** is 83% opaque + black with feathered edges (a drop-shadow texture). In Godot 4 it + renders stretched and opaque, which looked like a black square below + each level tile, so its `BackgroundTile` TextureRect is currently + `visible = false`. Replace with a proper 9-patch / shader if the shadow + effect is wanted. +- `developers/aurelien/` is a sandbox — files there (`ui_scrolls.tscn`, + `ui_tile.tscn`, `CheckLightmap.tscn`) still use Godot-3 property names + in places. Not on the main flow, low priority. + +## CI + +Build pipeline is in `releases/.drone.yml`. The Docker images still pin +`barichello/godot-ci:3.3.2` and a custom `devcrea/godot-ci:3.3.2-android` +— **bump these to a 4.x image** before relying on CI builds again. Butler +push targets `dev-crea/ahog:windows|android|linux|mac` on itch.io. + +Branches: default `dev`, releases from `main`. Long-running migration work +on `feature/godot-migration`. + +## Conventions + +- Don't commit `db/ahog.json` runtime mutations (lock progress saved + during play). The README documents using `git update-index --skip-worktree` + but the cleaner alternative is just to `git checkout db/ahog.json` + before staging. +- `android/`, `.godot/`, and `releases/` are in `.gitignore`. The + `.import` sidecars next to assets **are** committed (they carry the + stable UIDs Godot 4 generates). +- Commit messages: imperative, English, explain the *why* (especially for + migration commits — the next person reading the diff won't have the + Godot 3 context). diff --git a/addons/lod/lod_cpu_particles.gd b/addons/lod/lod_cpu_particles.gd index fe031f1..9470191 100644 --- a/addons/lod/lod_cpu_particles.gd +++ b/addons/lod/lod_cpu_particles.gd @@ -23,7 +23,7 @@ var refresh_rate := 0.25 # Positive values will decrease the detail level and improve performance. # Negative values will improve visual appearance at the cost of performance. # This can overridden by setting the project setting `lod/bias`. -var lod_bias := 0.0 +var lod_distance_bias := 0.0 # The internal refresh timer. var timer := 0.0 @@ -31,7 +31,7 @@ var timer := 0.0 func _ready() -> void: if ProjectSettings.has_setting("lod/particle_bias"): - lod_bias = ProjectSettings.get_setting("lod/particle_bias") + lod_distance_bias = ProjectSettings.get_setting("lod/particle_bias") if ProjectSettings.has_setting("lod/refresh_rate"): refresh_rate = ProjectSettings.get_setting("lod/refresh_rate") @@ -56,5 +56,5 @@ func _physics_process(delta: float) -> void: timer = 0.0 - var distance := camera.global_transform.origin.distance_to(global_transform.origin) + lod_bias + var distance := camera.global_transform.origin.distance_to(global_transform.origin) + lod_distance_bias emitting = distance < max_emit_distance diff --git a/addons/lod/lod_omni_light.gd b/addons/lod/lod_omni_light.gd index 956677d..36ebab3 100644 --- a/addons/lod/lod_omni_light.gd +++ b/addons/lod/lod_omni_light.gd @@ -36,7 +36,7 @@ var refresh_rate := 0.05 # Positive values will decrease the detail level and improve performance. # Negative values will improve visual appearance at the cost of performance. # This can overridden by setting the project setting `lod/bias`. -var lod_bias := 0.0 +var lod_distance_bias := 0.0 # The internal refresh timer. var timer := 0.0 @@ -47,7 +47,7 @@ var base_light_energy := light_energy func _ready() -> void: if ProjectSettings.has_setting("lod/light_bias"): - lod_bias = ProjectSettings.get_setting("lod/light_bias") + lod_distance_bias = ProjectSettings.get_setting("lod/light_bias") if ProjectSettings.has_setting("lod/light_refresh_rate"): refresh_rate = ProjectSettings.get_setting("lod/light_refresh_rate") @@ -72,7 +72,7 @@ func _physics_process(delta: float) -> void: timer = 0.0 - var distance := camera.global_transform.origin.distance_to(global_transform.origin) + lod_bias + var distance := camera.global_transform.origin.distance_to(global_transform.origin) + lod_distance_bias visible = distance < light_max_distance var light_fade_start_distance := light_max_distance * light_fade_start @@ -83,11 +83,3 @@ func _physics_process(delta: float) -> void: light_energy = base_light_energy shadow_enabled = distance < shadow_max_distance - var shadow_fade_start_distance := shadow_max_distance * shadow_fade_start - var shadow_value: float - if distance > shadow_fade_start_distance: - shadow_value = min(1, (distance - shadow_fade_start_distance) / (shadow_max_distance - shadow_fade_start_distance)) - else: - # We're close enough to the light to show its shadow at full darkness. - shadow_value = 0.0 - shadow_color = Color(shadow_value, shadow_value, shadow_value) diff --git a/addons/lod/lod_particles.gd b/addons/lod/lod_particles.gd index 78067ac..66c05df 100644 --- a/addons/lod/lod_particles.gd +++ b/addons/lod/lod_particles.gd @@ -23,7 +23,7 @@ var refresh_rate := 0.25 # Positive values will decrease the detail level and improve performance. # Negative values will improve visual appearance at the cost of performance. # This can overridden by setting the project setting `lod/bias`. -var lod_bias := 0.0 +var lod_distance_bias := 0.0 # The internal refresh timer. var timer := 0.0 @@ -31,7 +31,7 @@ var timer := 0.0 func _ready() -> void: if ProjectSettings.has_setting("lod/particle_bias"): - lod_bias = ProjectSettings.get_setting("lod/particle_bias") + lod_distance_bias = ProjectSettings.get_setting("lod/particle_bias") if ProjectSettings.has_setting("lod/refresh_rate"): refresh_rate = ProjectSettings.get_setting("lod/refresh_rate") @@ -56,5 +56,5 @@ func _physics_process(delta: float) -> void: timer = 0.0 - var distance := camera.global_transform.origin.distance_to(global_transform.origin) + lod_bias + var distance := camera.global_transform.origin.distance_to(global_transform.origin) + lod_distance_bias emitting = distance < max_emit_distance diff --git a/addons/lod/lod_spatial.gd b/addons/lod/lod_spatial.gd index 3edb136..1170cab 100644 --- a/addons/lod/lod_spatial.gd +++ b/addons/lod/lod_spatial.gd @@ -30,7 +30,7 @@ var refresh_rate := 0.25 # Positive values will decrease the detail level and improve performance. # Negative values will improve visual appearance at the cost of performance. # This can overridden by setting the project setting `lod/bias`. -var lod_bias := 0.0 +var lod_distance_bias := 0.0 # The internal refresh timer. var timer := 0.0 @@ -38,7 +38,7 @@ var timer := 0.0 func _ready() -> void: if ProjectSettings.has_setting("lod/spatial_bias"): - lod_bias = ProjectSettings.get_setting("lod/spatial_bias") + lod_distance_bias = ProjectSettings.get_setting("lod/spatial_bias") if ProjectSettings.has_setting("lod/refresh_rate"): refresh_rate = ProjectSettings.get_setting("lod/refresh_rate") @@ -64,7 +64,7 @@ func _physics_process(delta: float) -> void: timer = 0.0 - var distance := camera.global_transform.origin.distance_to(global_transform.origin) + lod_bias + var distance := camera.global_transform.origin.distance_to(global_transform.origin) + lod_distance_bias # The LOD level to choose (lower is more detailed). var lod: int if distance < lod_0_max_distance: diff --git a/addons/lod/lod_spot_light.gd b/addons/lod/lod_spot_light.gd index 982a5a7..172b508 100644 --- a/addons/lod/lod_spot_light.gd +++ b/addons/lod/lod_spot_light.gd @@ -36,7 +36,7 @@ var refresh_rate := 0.05 # Positive values will decrease the detail level and improve performance. # Negative values will improve visual appearance at the cost of performance. # This can overridden by setting the project setting `lod/bias`. -var lod_bias := 0.0 +var lod_distance_bias := 0.0 # The internal refresh timer. var timer := 0.0 @@ -47,7 +47,7 @@ var base_light_energy := light_energy func _ready() -> void: if ProjectSettings.has_setting("lod/light_bias"): - lod_bias = ProjectSettings.get_setting("lod/light_bias") + lod_distance_bias = ProjectSettings.get_setting("lod/light_bias") if ProjectSettings.has_setting("lod/light_refresh_rate"): refresh_rate = ProjectSettings.get_setting("lod/light_refresh_rate") @@ -72,7 +72,7 @@ func _physics_process(delta: float) -> void: timer = 0.0 - var distance := camera.global_transform.origin.distance_to(global_transform.origin) + lod_bias + var distance := camera.global_transform.origin.distance_to(global_transform.origin) + lod_distance_bias visible = distance < light_max_distance var light_fade_start_distance := light_max_distance * light_fade_start @@ -83,11 +83,3 @@ func _physics_process(delta: float) -> void: light_energy = base_light_energy shadow_enabled = distance < shadow_max_distance - var shadow_fade_start_distance := shadow_max_distance * shadow_fade_start - var shadow_value: float - if distance > shadow_fade_start_distance: - shadow_value = min(1, (distance - shadow_fade_start_distance) / (shadow_max_distance - shadow_fade_start_distance)) - else: - # We're close enough to the light to show its shadow at full darkness. - shadow_value = 0.0 - shadow_color = Color(shadow_value, shadow_value, shadow_value) diff --git a/android/.gdignore b/android/.gdignore new file mode 100644 index 0000000..e69de29 diff --git a/assets/materials/green.tres b/assets/materials/green.tres index 96106b5..80835a3 100644 --- a/assets/materials/green.tres +++ b/assets/materials/green.tres @@ -31,7 +31,6 @@ void light() { } " -graph_offset = Vector2( -278, -353.75 ) nodes/fragment/5/node = SubResource( 1 ) nodes/fragment/5/position = Vector2( 180, 140 ) nodes/fragment/connections = PackedInt32Array( 5, 0, 0, 0 ) diff --git a/assets/materials/red.tres b/assets/materials/red.tres index e9fe4ba..a81af51 100644 --- a/assets/materials/red.tres +++ b/assets/materials/red.tres @@ -31,7 +31,6 @@ void light() { } " -graph_offset = Vector2( -278, -353.75 ) nodes/fragment/5/node = SubResource( 1 ) nodes/fragment/5/position = Vector2( 180, 140 ) nodes/fragment/connections = PackedInt32Array( 5, 0, 0, 0 ) diff --git a/assets/props/apple/sm_apple.mesh b/assets/props/apple/sm_apple.mesh index cfaac6f..5714e2f 100644 Binary files a/assets/props/apple/sm_apple.mesh and b/assets/props/apple/sm_apple.mesh differ diff --git a/assets/props/book/sm_book_lod0.mesh b/assets/props/book/sm_book_lod0.mesh index 5b80f3b..3984c14 100644 Binary files a/assets/props/book/sm_book_lod0.mesh and b/assets/props/book/sm_book_lod0.mesh differ diff --git a/assets/props/book/sm_book_lod1.mesh b/assets/props/book/sm_book_lod1.mesh index aa53a33..60a8342 100644 Binary files a/assets/props/book/sm_book_lod1.mesh and b/assets/props/book/sm_book_lod1.mesh differ diff --git a/assets/props/book/sm_book_lod2.mesh b/assets/props/book/sm_book_lod2.mesh index 1a44e0c..ae1a880 100644 Binary files a/assets/props/book/sm_book_lod2.mesh and b/assets/props/book/sm_book_lod2.mesh differ diff --git a/assets/props/book/sm_book_paper_lod0.mesh b/assets/props/book/sm_book_paper_lod0.mesh index b23af07..05146bb 100644 Binary files a/assets/props/book/sm_book_paper_lod0.mesh and b/assets/props/book/sm_book_paper_lod0.mesh differ diff --git a/assets/props/book/sm_book_paper_lod1.mesh b/assets/props/book/sm_book_paper_lod1.mesh index 743fb33..408db87 100644 Binary files a/assets/props/book/sm_book_paper_lod1.mesh and b/assets/props/book/sm_book_paper_lod1.mesh differ diff --git a/assets/props/book/sm_book_paper_lod2.mesh b/assets/props/book/sm_book_paper_lod2.mesh index 4f7b115..2b38dab 100644 Binary files a/assets/props/book/sm_book_paper_lod2.mesh and b/assets/props/book/sm_book_paper_lod2.mesh differ diff --git a/assets/props/candle/sm_candle_a_lod0.mesh b/assets/props/candle/sm_candle_a_lod0.mesh index 0ce4caa..0cdc7c2 100644 Binary files a/assets/props/candle/sm_candle_a_lod0.mesh and b/assets/props/candle/sm_candle_a_lod0.mesh differ diff --git a/assets/props/candle/sm_candle_a_lod1.mesh b/assets/props/candle/sm_candle_a_lod1.mesh index fe1bc2e..825c5cd 100644 Binary files a/assets/props/candle/sm_candle_a_lod1.mesh and b/assets/props/candle/sm_candle_a_lod1.mesh differ diff --git a/assets/props/candle/sm_candle_a_lod2.mesh b/assets/props/candle/sm_candle_a_lod2.mesh index 2718671..c22882d 100644 Binary files a/assets/props/candle/sm_candle_a_lod2.mesh and b/assets/props/candle/sm_candle_a_lod2.mesh differ diff --git a/assets/props/candle/sm_candle_b_lod0.mesh b/assets/props/candle/sm_candle_b_lod0.mesh index 031c99b..4a76518 100644 Binary files a/assets/props/candle/sm_candle_b_lod0.mesh and b/assets/props/candle/sm_candle_b_lod0.mesh differ diff --git a/assets/props/candle/sm_candle_b_lod1.mesh b/assets/props/candle/sm_candle_b_lod1.mesh index 9d3cebf..244a402 100644 Binary files a/assets/props/candle/sm_candle_b_lod1.mesh and b/assets/props/candle/sm_candle_b_lod1.mesh differ diff --git a/assets/props/candle/sm_candle_b_lod2.mesh b/assets/props/candle/sm_candle_b_lod2.mesh index 33dc07f..beed520 100644 Binary files a/assets/props/candle/sm_candle_b_lod2.mesh and b/assets/props/candle/sm_candle_b_lod2.mesh differ diff --git a/assets/props/candle/sm_candle_c_lod0.mesh b/assets/props/candle/sm_candle_c_lod0.mesh index fcca9c9..6b9776c 100644 Binary files a/assets/props/candle/sm_candle_c_lod0.mesh and b/assets/props/candle/sm_candle_c_lod0.mesh differ diff --git a/assets/props/candle/sm_candle_c_lod1.mesh b/assets/props/candle/sm_candle_c_lod1.mesh index 7fa98e2..e94bdc8 100644 Binary files a/assets/props/candle/sm_candle_c_lod1.mesh and b/assets/props/candle/sm_candle_c_lod1.mesh differ diff --git a/assets/props/candle/sm_candle_c_lod2.mesh b/assets/props/candle/sm_candle_c_lod2.mesh index 137bdc9..0f2c01f 100644 Binary files a/assets/props/candle/sm_candle_c_lod2.mesh and b/assets/props/candle/sm_candle_c_lod2.mesh differ diff --git a/assets/props/candle/sm_candle_d_lod0.mesh b/assets/props/candle/sm_candle_d_lod0.mesh index 399c561..3f70f2a 100644 Binary files a/assets/props/candle/sm_candle_d_lod0.mesh and b/assets/props/candle/sm_candle_d_lod0.mesh differ diff --git a/assets/props/candle/sm_candle_d_lod1.mesh b/assets/props/candle/sm_candle_d_lod1.mesh index aa57077..d49561d 100644 Binary files a/assets/props/candle/sm_candle_d_lod1.mesh and b/assets/props/candle/sm_candle_d_lod1.mesh differ diff --git a/assets/props/candle/sm_candle_d_lod2.mesh b/assets/props/candle/sm_candle_d_lod2.mesh index 80da56a..29d2513 100644 Binary files a/assets/props/candle/sm_candle_d_lod2.mesh and b/assets/props/candle/sm_candle_d_lod2.mesh differ diff --git a/assets/props/candle/sm_candle_top_lod0.mesh b/assets/props/candle/sm_candle_top_lod0.mesh index fe08537..ec2d055 100644 Binary files a/assets/props/candle/sm_candle_top_lod0.mesh and b/assets/props/candle/sm_candle_top_lod0.mesh differ diff --git a/assets/props/candle/sm_candle_top_lod1.mesh b/assets/props/candle/sm_candle_top_lod1.mesh index 6b8d569..84e0c6f 100644 Binary files a/assets/props/candle/sm_candle_top_lod1.mesh and b/assets/props/candle/sm_candle_top_lod1.mesh differ diff --git a/assets/props/candle/sm_candle_top_lod2.mesh b/assets/props/candle/sm_candle_top_lod2.mesh index 7db8f0a..26d2779 100644 Binary files a/assets/props/candle/sm_candle_top_lod2.mesh and b/assets/props/candle/sm_candle_top_lod2.mesh differ diff --git a/assets/props/candle/sm_candlestick_lod0.mesh b/assets/props/candle/sm_candlestick_lod0.mesh index fb9cb34..8de958b 100644 Binary files a/assets/props/candle/sm_candlestick_lod0.mesh and b/assets/props/candle/sm_candlestick_lod0.mesh differ diff --git a/assets/props/candle/sm_candlestick_lod1.mesh b/assets/props/candle/sm_candlestick_lod1.mesh index 2b2dbb3..aa3a944 100644 Binary files a/assets/props/candle/sm_candlestick_lod1.mesh and b/assets/props/candle/sm_candlestick_lod1.mesh differ diff --git a/assets/props/candle/sm_candlestick_lod2.mesh b/assets/props/candle/sm_candlestick_lod2.mesh index bc3e679..4bb37b2 100644 Binary files a/assets/props/candle/sm_candlestick_lod2.mesh and b/assets/props/candle/sm_candlestick_lod2.mesh differ diff --git a/assets/props/column/sm_column.mesh b/assets/props/column/sm_column.mesh index 673b684..5b8297c 100644 Binary files a/assets/props/column/sm_column.mesh and b/assets/props/column/sm_column.mesh differ diff --git a/assets/props/dagger/dagger.mesh b/assets/props/dagger/dagger.mesh index 83c1731..2fa94d8 100644 Binary files a/assets/props/dagger/dagger.mesh and b/assets/props/dagger/dagger.mesh differ diff --git a/assets/props/dagger/dagger_Dagger_BC.png.import b/assets/props/dagger/dagger_Dagger_BC.png.import index 26e0ff8..2b4d2d7 100644 --- a/assets/props/dagger/dagger_Dagger_BC.png.import +++ b/assets/props/dagger/dagger_Dagger_BC.png.import @@ -3,19 +3,20 @@ importer="texture" type="CompressedTexture2D" uid="uid://dvoars6va7511" -path="res://.godot/imported/dagger_Dagger_BC.png-6deff32a41940f92bbdb14bc9b47beb3.ctex" +path.s3tc="res://.godot/imported/dagger_Dagger_BC.png-6deff32a41940f92bbdb14bc9b47beb3.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://assets/props/dagger/dagger_Dagger_BC.png" -dest_files=["res://.godot/imported/dagger_Dagger_BC.png-6deff32a41940f92bbdb14bc9b47beb3.ctex"] +dest_files=["res://.godot/imported/dagger_Dagger_BC.png-6deff32a41940f92bbdb14bc9b47beb3.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/uastc_level=0 @@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -37,4 +38,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/assets/props/dagger/dagger_Dagger_NM.png.import b/assets/props/dagger/dagger_Dagger_NM.png.import index 04e80f3..12e4531 100644 --- a/assets/props/dagger/dagger_Dagger_NM.png.import +++ b/assets/props/dagger/dagger_Dagger_NM.png.import @@ -3,30 +3,31 @@ importer="texture" type="CompressedTexture2D" uid="uid://cfhmpp3pitqbi" -path="res://.godot/imported/dagger_Dagger_NM.png-16adfa9ec4fd4455ed9dd788fbba2519.ctex" +path.s3tc="res://.godot/imported/dagger_Dagger_NM.png-16adfa9ec4fd4455ed9dd788fbba2519.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://assets/props/dagger/dagger_Dagger_NM.png" -dest_files=["res://.godot/imported/dagger_Dagger_NM.png-16adfa9ec4fd4455ed9dd788fbba2519.ctex"] +dest_files=["res://.godot/imported/dagger_Dagger_NM.png-16adfa9ec4fd4455ed9dd788fbba2519.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/uastc_level=0 compress/rdo_quality_loss=0.0 compress/hdr_compression=1 -compress/normal_map=0 +compress/normal_map=1 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 -roughness/mode=0 -roughness/src_normal="" +roughness/mode=1 +roughness/src_normal="res://assets/props/dagger/dagger_Dagger_NM.png" process/channel_remap/red=0 process/channel_remap/green=1 process/channel_remap/blue=2 @@ -37,4 +38,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/assets/props/dagger/dagger_dagger_E.png.import b/assets/props/dagger/dagger_dagger_E.png.import index e249fa0..23f7447 100644 --- a/assets/props/dagger/dagger_dagger_E.png.import +++ b/assets/props/dagger/dagger_dagger_E.png.import @@ -3,19 +3,20 @@ importer="texture" type="CompressedTexture2D" uid="uid://b5jfvsejxruax" -path="res://.godot/imported/dagger_dagger_E.png-f59a7c6d2e36ce0df3488a3ad845f982.ctex" +path.s3tc="res://.godot/imported/dagger_dagger_E.png-f59a7c6d2e36ce0df3488a3ad845f982.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://assets/props/dagger/dagger_dagger_E.png" -dest_files=["res://.godot/imported/dagger_dagger_E.png-f59a7c6d2e36ce0df3488a3ad845f982.ctex"] +dest_files=["res://.godot/imported/dagger_dagger_E.png-f59a7c6d2e36ce0df3488a3ad845f982.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/uastc_level=0 @@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -37,4 +38,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/assets/props/dagger/dagger_dagger_ORM.png.import b/assets/props/dagger/dagger_dagger_ORM.png.import index a2351a4..b57f5a1 100644 --- a/assets/props/dagger/dagger_dagger_ORM.png.import +++ b/assets/props/dagger/dagger_dagger_ORM.png.import @@ -3,19 +3,20 @@ importer="texture" type="CompressedTexture2D" uid="uid://b2yaxbeog0iiq" -path="res://.godot/imported/dagger_dagger_ORM.png-d6cee18aee3cb84d78327e37eda49e85.ctex" +path.s3tc="res://.godot/imported/dagger_dagger_ORM.png-d6cee18aee3cb84d78327e37eda49e85.s3tc.ctex" metadata={ -"vram_texture": false +"imported_formats": ["s3tc_bptc"], +"vram_texture": true } [deps] source_file="res://assets/props/dagger/dagger_dagger_ORM.png" -dest_files=["res://.godot/imported/dagger_dagger_ORM.png-d6cee18aee3cb84d78327e37eda49e85.ctex"] +dest_files=["res://.godot/imported/dagger_dagger_ORM.png-d6cee18aee3cb84d78327e37eda49e85.s3tc.ctex"] [params] -compress/mode=0 +compress/mode=2 compress/high_quality=false compress/lossy_quality=0.7 compress/uastc_level=0 @@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -37,4 +38,4 @@ process/normal_map_invert_y=false process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 -detect_3d/compress_to=1 +detect_3d/compress_to=0 diff --git a/assets/props/fiole/sm_fiole.mesh b/assets/props/fiole/sm_fiole.mesh index 9d8525d..7033bb1 100644 Binary files a/assets/props/fiole/sm_fiole.mesh and b/assets/props/fiole/sm_fiole.mesh differ diff --git a/assets/props/fiole/sm_fiole_socle.mesh b/assets/props/fiole/sm_fiole_socle.mesh index 1134bed..5ef6090 100644 Binary files a/assets/props/fiole/sm_fiole_socle.mesh and b/assets/props/fiole/sm_fiole_socle.mesh differ diff --git a/assets/props/fireplace/sm_fireplace.mesh b/assets/props/fireplace/sm_fireplace.mesh index 40095a1..8726472 100644 Binary files a/assets/props/fireplace/sm_fireplace.mesh and b/assets/props/fireplace/sm_fireplace.mesh differ diff --git a/assets/props/godet/sm_godet_lod0.mesh b/assets/props/godet/sm_godet_lod0.mesh index f994faa..25a4e47 100644 Binary files a/assets/props/godet/sm_godet_lod0.mesh and b/assets/props/godet/sm_godet_lod0.mesh differ diff --git a/assets/props/godet/sm_godet_lod1.mesh b/assets/props/godet/sm_godet_lod1.mesh index 1fda005..69b8581 100644 Binary files a/assets/props/godet/sm_godet_lod1.mesh and b/assets/props/godet/sm_godet_lod1.mesh differ diff --git a/assets/props/godet/sm_godet_lod2.mesh b/assets/props/godet/sm_godet_lod2.mesh index 94bbb3a..1ab4b6a 100644 Binary files a/assets/props/godet/sm_godet_lod2.mesh and b/assets/props/godet/sm_godet_lod2.mesh differ diff --git a/assets/props/growler/sm_growler_lod0.mesh b/assets/props/growler/sm_growler_lod0.mesh index 4a1d027..675197b 100644 Binary files a/assets/props/growler/sm_growler_lod0.mesh and b/assets/props/growler/sm_growler_lod0.mesh differ diff --git a/assets/props/growler/sm_growler_lod1.mesh b/assets/props/growler/sm_growler_lod1.mesh index 3906010..ed71cc0 100644 Binary files a/assets/props/growler/sm_growler_lod1.mesh and b/assets/props/growler/sm_growler_lod1.mesh differ diff --git a/assets/props/growler/sm_growler_lod2.mesh b/assets/props/growler/sm_growler_lod2.mesh index 2269bd0..42c2f30 100644 Binary files a/assets/props/growler/sm_growler_lod2.mesh and b/assets/props/growler/sm_growler_lod2.mesh differ diff --git a/assets/props/misc/plane.mesh b/assets/props/misc/plane.mesh index 9ef0b5c..c6916a2 100644 Binary files a/assets/props/misc/plane.mesh and b/assets/props/misc/plane.mesh differ diff --git a/assets/props/misc/sm_gabarit_male.mesh b/assets/props/misc/sm_gabarit_male.mesh index 6f291c9..b3603ab 100644 Binary files a/assets/props/misc/sm_gabarit_male.mesh and b/assets/props/misc/sm_gabarit_male.mesh differ diff --git a/assets/props/parchment/sm_paperparchment_lod0.mesh b/assets/props/parchment/sm_paperparchment_lod0.mesh index 4e3dc0d..7e99a72 100644 Binary files a/assets/props/parchment/sm_paperparchment_lod0.mesh and b/assets/props/parchment/sm_paperparchment_lod0.mesh differ diff --git a/assets/props/parchment/sm_wood_parchment_lod0.mesh b/assets/props/parchment/sm_wood_parchment_lod0.mesh index 2268273..0f8064f 100644 Binary files a/assets/props/parchment/sm_wood_parchment_lod0.mesh and b/assets/props/parchment/sm_wood_parchment_lod0.mesh differ diff --git a/assets/props/parchment/sm_wood_parchment_lod1.mesh b/assets/props/parchment/sm_wood_parchment_lod1.mesh index 8b0d22a..eecca2d 100644 Binary files a/assets/props/parchment/sm_wood_parchment_lod1.mesh and b/assets/props/parchment/sm_wood_parchment_lod1.mesh differ diff --git a/assets/props/parchment/sm_wood_parchment_lod2.mesh b/assets/props/parchment/sm_wood_parchment_lod2.mesh index 0f1e967..b3091f5 100644 Binary files a/assets/props/parchment/sm_wood_parchment_lod2.mesh and b/assets/props/parchment/sm_wood_parchment_lod2.mesh differ diff --git a/assets/props/pinte beer/sm_pinte_beer.mesh b/assets/props/pinte beer/sm_pinte_beer.mesh index c829c42..a8fac2a 100644 Binary files a/assets/props/pinte beer/sm_pinte_beer.mesh and b/assets/props/pinte beer/sm_pinte_beer.mesh differ diff --git a/assets/props/rock floor/sm_floor_lod0.mesh b/assets/props/rock floor/sm_floor_lod0.mesh index 0a8b00f..14abb8a 100644 Binary files a/assets/props/rock floor/sm_floor_lod0.mesh and b/assets/props/rock floor/sm_floor_lod0.mesh differ diff --git a/assets/props/rock floor/sm_floor_lod1.mesh b/assets/props/rock floor/sm_floor_lod1.mesh index e27ff46..f886ef6 100644 Binary files a/assets/props/rock floor/sm_floor_lod1.mesh and b/assets/props/rock floor/sm_floor_lod1.mesh differ diff --git a/assets/props/rock floor/sm_floor_lod2.mesh b/assets/props/rock floor/sm_floor_lod2.mesh index 5f5a981..15940a2 100644 Binary files a/assets/props/rock floor/sm_floor_lod2.mesh and b/assets/props/rock floor/sm_floor_lod2.mesh differ diff --git a/assets/props/spyglass/sm_spyglass_lod0.mesh b/assets/props/spyglass/sm_spyglass_lod0.mesh index 3b6a1be..8ab2755 100644 Binary files a/assets/props/spyglass/sm_spyglass_lod0.mesh and b/assets/props/spyglass/sm_spyglass_lod0.mesh differ diff --git a/assets/props/spyglass/sm_spyglass_lod1.mesh b/assets/props/spyglass/sm_spyglass_lod1.mesh index 732077a..a72bfa3 100644 Binary files a/assets/props/spyglass/sm_spyglass_lod1.mesh and b/assets/props/spyglass/sm_spyglass_lod1.mesh differ diff --git a/assets/props/spyglass/sm_spyglass_lod2.mesh b/assets/props/spyglass/sm_spyglass_lod2.mesh index 9907cba..87385d1 100644 Binary files a/assets/props/spyglass/sm_spyglass_lod2.mesh and b/assets/props/spyglass/sm_spyglass_lod2.mesh differ diff --git a/assets/props/stack gold/sm_stackgold.mesh b/assets/props/stack gold/sm_stackgold.mesh index 5e4b168..4114b5d 100644 Binary files a/assets/props/stack gold/sm_stackgold.mesh and b/assets/props/stack gold/sm_stackgold.mesh differ diff --git a/assets/props/stool b/sm_stool_2_lod0.mesh b/assets/props/stool b/sm_stool_2_lod0.mesh index 5b7e294..32ccfe7 100644 Binary files a/assets/props/stool b/sm_stool_2_lod0.mesh and b/assets/props/stool b/sm_stool_2_lod0.mesh differ diff --git a/assets/props/stool b/sm_stool_2_lod1.mesh b/assets/props/stool b/sm_stool_2_lod1.mesh index 8a77d83..c2da3d3 100644 Binary files a/assets/props/stool b/sm_stool_2_lod1.mesh and b/assets/props/stool b/sm_stool_2_lod1.mesh differ diff --git a/assets/props/stool b/sm_stool_2_lod2.mesh b/assets/props/stool b/sm_stool_2_lod2.mesh index f68d9e2..71ef871 100644 Binary files a/assets/props/stool b/sm_stool_2_lod2.mesh and b/assets/props/stool b/sm_stool_2_lod2.mesh differ diff --git a/assets/props/table/sm_table_lod0.mesh b/assets/props/table/sm_table_lod0.mesh index bd5c961..c4f098c 100644 Binary files a/assets/props/table/sm_table_lod0.mesh and b/assets/props/table/sm_table_lod0.mesh differ diff --git a/assets/props/table/sm_table_lod1.mesh b/assets/props/table/sm_table_lod1.mesh index c58e7ea..134aac0 100644 Binary files a/assets/props/table/sm_table_lod1.mesh and b/assets/props/table/sm_table_lod1.mesh differ diff --git a/assets/props/table/sm_table_lod2.mesh b/assets/props/table/sm_table_lod2.mesh index 72e012d..9e0dad7 100644 Binary files a/assets/props/table/sm_table_lod2.mesh and b/assets/props/table/sm_table_lod2.mesh differ diff --git a/assets/props/weapon gun/sm_weapon_gun.mesh b/assets/props/weapon gun/sm_weapon_gun.mesh index b2741d3..0741773 100644 Binary files a/assets/props/weapon gun/sm_weapon_gun.mesh and b/assets/props/weapon gun/sm_weapon_gun.mesh differ diff --git a/db/MScene.gd b/db/MScene.gd index 55bb91a..337938d 100644 --- a/db/MScene.gd +++ b/db/MScene.gd @@ -44,8 +44,8 @@ func label_counter(): func lock(): return m_lock -func set_lock(value): - m_lock = _set_data(LOCK_ID, m_row_id, value) +func set_lock(p_value): + m_lock = _set_data(LOCK_ID, m_row_id, p_value) func mesh(): return m_mesh @@ -53,20 +53,20 @@ func mesh(): func tween(): return m_mesh + "/Tween" -func set_mesh(value): - m_mesh = value +func set_mesh(p_value): + m_mesh = p_value func tick_reference(): return m_tick_reference -func set_tick_reference(value): - m_tick_reference = value +func set_tick_reference(p_value): + m_tick_reference = p_value func value(): return m_value -func set_value(value): - m_value = value +func set_value(p_value): + m_value = p_value func audio_sound(): var stream = load("res://assets/sounds/objects/" + label() + ".ogg") diff --git a/scenes/UI/choose_scenes/ChooseScene.gd b/scenes/UI/choose_scenes/ChooseScene.gd index f41de9a..7b1ae44 100644 --- a/scenes/UI/choose_scenes/ChooseScene.gd +++ b/scenes/UI/choose_scenes/ChooseScene.gd @@ -18,17 +18,17 @@ func _apply_scene(level, index): configure_reset(level, node, index, false) configure_counter(level, node) -func _load_scene(name): +func _load_scene(p_name): var template_instance = template.instantiate() - template_instance.set_name(name) - + template_instance.set_name(p_name) + return template_instance -func _build_path(name): - return "MarginContainer/"+name +func _build_path(p_name): + return "MarginContainer/" + p_name -func _build_method(name): - return "_on_"+name.to_lower()+"_pressed" +func _build_method(p_name): + return "_on_" + p_name.to_lower() + "_pressed" func _load_texture(thumbnail): return load(thumbnail) diff --git a/scenes/UI/choose_scenes/parts/Template.tscn b/scenes/UI/choose_scenes/parts/Template.tscn index c36cb49..832a921 100644 --- a/scenes/UI/choose_scenes/parts/Template.tscn +++ b/scenes/UI/choose_scenes/parts/Template.tscn @@ -12,22 +12,12 @@ [sub_resource type="Animation" id=1] resource_name = "SlideReset" tracks/0/type = "bezier" -tracks/0/path = NodePath("MarginContainer/CenterAlign/MainButton/TabAlign/ButtonReset:position:x") +tracks/0/path = NodePath("MarginContainer/CenterAlign/MainButton/TabAlign/ButtonReset:position:y") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/imported = false tracks/0/enabled = true tracks/0/keys = { -"points": PackedFloat32Array( ), -"times": PackedFloat32Array( ) -} -tracks/1/type = "bezier" -tracks/1/path = NodePath("MarginContainer/CenterAlign/MainButton/TabAlign/ButtonReset:position:y") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/keys = { "points": PackedFloat32Array( 0, -0.25, 0, 0.506539, 0.5, -40, -0.236722, -22.5, 0.25, 0 ), "times": PackedFloat32Array( 0, 1 ) } diff --git a/scenes/UI/loading/Loading.tscn b/scenes/UI/loading/Loading.tscn index f10bb74..1f5bc21 100644 --- a/scenes/UI/loading/Loading.tscn +++ b/scenes/UI/loading/Loading.tscn @@ -7,32 +7,22 @@ [sub_resource type="Animation" id=1] resource_name = "BorderAnim" tracks/0/type = "bezier" -tracks/0/path = NodePath("LoadingTopBorder:position:x") +tracks/0/path = NodePath("LoadingTopBorder:position:y") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/imported = false tracks/0/enabled = true tracks/0/keys = { -"points": PackedFloat32Array( ), -"times": PackedFloat32Array( ) +"points": PackedFloat32Array( -768, -0.25, 0, 1.01154, 306.838, -160.174, -1.02203, -283.071, 0.439946, 60.9141, -27.6065, -0.45336, -19.562, 0.536352, 17.1993, 0.362091, -0.538766, -0.968613, 0.25, 0 ), +"times": PackedFloat32Array( 0.1, 0.3, 0.6, 0.9 ) } tracks/1/type = "bezier" -tracks/1/path = NodePath("LoadingTopBorder:position:y") +tracks/1/path = NodePath("LoadingBare:modulate:a") tracks/1/interp = 1 tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"points": PackedFloat32Array( -768, -0.25, 0, 1.01154, 306.838, -160.174, -1.02203, -283.071, 0.439946, 60.9141, -27.6065, -0.45336, -19.562, 0.536352, 17.1993, 0.362091, -0.538766, -0.968613, 0.25, 0 ), -"times": PackedFloat32Array( 0.1, 0.3, 0.6, 0.9 ) -} -tracks/2/type = "bezier" -tracks/2/path = NodePath("LoadingBare:modulate:a") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { "points": PackedFloat32Array( 0, -0.25, 0, 1.10651, 0.716757, 1, -1.59408, -0.0328361, 0.25, 0 ), "times": PackedFloat32Array( 0, 0.4 ) } diff --git a/scenes/UI/summary/Summary.tscn b/scenes/UI/summary/Summary.tscn index 9da11e2..570167f 100644 --- a/scenes/UI/summary/Summary.tscn +++ b/scenes/UI/summary/Summary.tscn @@ -5,7 +5,6 @@ [ext_resource path="res://assets/fonts/kirsty/kirsty_base.tres" type="FontFile" id=3] [ext_resource path="res://assets/fonts/kirsty/kirsty_title.tres" type="FontFile" id=4] [ext_resource path="res://assets/ui/icones/treasure.png" type="Texture2D" id=5] -[ext_resource path="res://assets/fonts/text_outline.material" type="Material" id=6] [ext_resource path="res://assets/ui/icones/treasure-hover.png" type="Texture2D" id=7] [ext_resource path="res://assets/ui/themes/bck-vert-grd.png" type="Texture2D" id=8] [ext_resource path="res://assets/ui/themes/wood-tile.jpg" type="Texture2D" id=9] @@ -129,7 +128,6 @@ void light() { } " -graph_offset = Vector2( -1049.92, -110.97 ) mode = 1 flags/light_only = false nodes/fragment/0/position = Vector2( 2300, 540 ) @@ -163,7 +161,6 @@ nodes/fragment/22/node = SubResource( 8 ) nodes/fragment/22/position = Vector2( 1260, 780 ) nodes/fragment/23/node = SubResource( 9 ) nodes/fragment/23/position = Vector2( 1080, 1080 ) -nodes/fragment/connections = PackedInt32Array( 8, 0, 5, 1, 7, 1, 8, 0, 7, 0, 5, 0, 5, 0, 4, 0, 3, 0, 11, 0, 6, 0, 11, 1, 11, 0, 7, 0, 14, 0, 15, 0, 4, 0, 17, 0, 15, 1, 17, 2, 4, 0, 19, 1, 18, 0, 19, 0, 19, 0, 17, 1, 4, 0, 22, 0, 20, 0, 0, 0, 15, 1, 23, 0, 22, 0, 20, 0, 15, 1, 20, 2, 17, 0, 20, 1 ) [sub_resource type="ShaderMaterial" id=17] shader = SubResource( 16 ) diff --git a/scenes/levels/Levels.gd b/scenes/levels/Levels.gd index b9f43ef..5e8f526 100644 --- a/scenes/levels/Levels.gd +++ b/scenes/levels/Levels.gd @@ -70,16 +70,16 @@ func _load_ambient_sound(): func _create_button_info(scene, counter, label_counter): var button = _search_button_to_use(counter) - var name = scene.label() - + var label_name = scene.label() + if label_counter != null and label_counter == scene.label_counter(): - name = last_button.get_node("Label").text + " " + str(scene.counter()) - _configure_button_object(last_button, scene, name) - _create_animation_warning(_get_node_animated().get_node("Label"), name) + label_name = last_button.get_node("Label").text + " " + str(scene.counter()) + _configure_button_object(last_button, scene, label_name) + _create_animation_warning(_get_node_animated().get_node("Label"), label_name) else: $ListObjects/ListContainer.add_child(button) - _configure_button_object(button, scene, name) - _create_animation_slide(_get_node_animated(), name) + _configure_button_object(button, scene, label_name) + _create_animation_slide(_get_node_animated(), label_name) last_button = button @@ -101,19 +101,19 @@ func _configure_button_object(button, scene, label): button.set_meta("counter", scene.counter()) button.set_meta("counted", 0) -func _create_animation_slide(node, name): - _add_animation_to_player(name, GlobalAnimation.level_hud_slide(node)) +func _create_animation_slide(node, p_name): + _add_animation_to_player(p_name, GlobalAnimation.level_hud_slide(node)) -func _create_animation_warning(node, name): - _add_animation_to_player(name, GlobalAnimation.level_hud_warning(node)) +func _create_animation_warning(node, p_name): + _add_animation_to_player(p_name, GlobalAnimation.level_hud_warning(node)) -func _add_animation_to_player(name: String, anim: Animation) -> void: +func _add_animation_to_player(p_name: String, anim: Animation) -> void: var player = $ListObjects/AnimationPlayer var lib = player.get_animation_library("") if lib == null: lib = AnimationLibrary.new() player.add_animation_library("", lib) - lib.add_animation(name, anim) + lib.add_animation(p_name, anim) func _process(_delta): _check_dissolve_mesh() @@ -233,8 +233,7 @@ func _node_to_area(key): func _node_object_list(key): var animation_played = null - var name = null - + for child in $ListObjects/ListContainer.get_children(): if child.has_meta("name"): if child.get_meta("name") == meshes[key].label(): diff --git a/scenes/levels/parts/ListObjects.tscn b/scenes/levels/parts/ListObjects.tscn index 7e1deee..de74307 100644 --- a/scenes/levels/parts/ListObjects.tscn +++ b/scenes/levels/parts/ListObjects.tscn @@ -30,16 +30,6 @@ tracks/0/keys = { "points": PackedFloat32Array( 0, -0.25, 0, 0.0305311, 190.492, 170, -0.349132, 2.57608, 0.25, 0 ), "times": PackedFloat32Array( 0, 1 ) } -tracks/1/type = "bezier" -tracks/1/path = NodePath("ListContainer/TextureButtonLast:position:y") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/keys = { -"points": PackedFloat32Array( ), -"times": PackedFloat32Array( ) -} [node name="Control" type="MarginContainer"] anchor_left = 1.0 diff --git a/scenes/levels/warcraft/WarCraft.tscn b/scenes/levels/warcraft/WarCraft.tscn index 150d5e4..a5b2c7f 100644 --- a/scenes/levels/warcraft/WarCraft.tscn +++ b/scenes/levels/warcraft/WarCraft.tscn @@ -40,7 +40,6 @@ [ext_resource path="res://assets/props/fireplace/sm_fireplace.mesh" type="ArrayMesh" id=38] [ext_resource path="res://assets/materials/gray.tres" type="Material" id=39] [ext_resource path="res://assets/props/rock floor/materials/MA_rock_floor.material" type="Material" id=40] -[ext_resource path="res://scenes/levels/warcraft/WarCraft.lmbake" type="LightmapGIData" id=41] [sub_resource type="Sky" id=1] panorama = ExtResource( 11 ) diff --git a/scripts/migrate_misc.gd b/scripts/migrate_misc.gd new file mode 100644 index 0000000..1058cea --- /dev/null +++ b/scripts/migrate_misc.gd @@ -0,0 +1,52 @@ +@tool +extends SceneTree + +# One-shot cleanup: +# 1. Reset VisualShader.graph_offset to default on every .material so the +# deprecated property no longer triggers a warning at load. +# 2. Re-save every .mesh whose surface format is the old (Godot 3) variant +# so Godot 4 stops nagging. + +func _init() -> void: + var changed := 0 + + for path in _find_resources("res://assets", [".material", ".tres"]): + var res = ResourceLoader.load(path, "", ResourceLoader.CACHE_MODE_IGNORE) + if res is ShaderMaterial and res.shader is VisualShader: + var vs: VisualShader = res.shader + if vs.graph_offset != Vector2.ZERO: + vs.graph_offset = Vector2.ZERO + if ResourceSaver.save(res, path) == OK: + changed += 1 + print("CLEARED graph_offset on ", path) + + for path in _find_resources("res://assets", [".mesh"]): + var mesh = ResourceLoader.load(path, "", ResourceLoader.CACHE_MODE_IGNORE) + if mesh is ArrayMesh: + # Just re-saving rewrites the file using the current surface format. + if ResourceSaver.save(mesh, path) == OK: + changed += 1 + print("RESAVED mesh ", path) + + print("Done. changed=", changed) + quit() + +func _find_resources(dir_path: String, exts: Array) -> Array: + var result := [] + var dir = DirAccess.open(dir_path) + if dir == null: + return result + dir.list_dir_begin() + var name = dir.get_next() + while name != "": + if name != "." and name != "..": + var sub = dir_path + "/" + name + if dir.current_is_dir(): + result.append_array(_find_resources(sub, exts)) + else: + for ext in exts: + if name.ends_with(ext): + result.append(sub) + break + name = dir.get_next() + return result diff --git a/scripts/migrate_misc.gd.uid b/scripts/migrate_misc.gd.uid new file mode 100644 index 0000000..ecacfd9 --- /dev/null +++ b/scripts/migrate_misc.gd.uid @@ -0,0 +1 @@ +uid://be5t0j47tufka