Skip to content

Commit

Permalink
fix: compile errors when running exported game
Browse files Browse the repository at this point in the history
fixes #74
  • Loading branch information
derkork committed Jan 29, 2024
1 parent df3aa26 commit 83dd4cb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [Unreleased]
### Fixed
- The editor debugger should no longer cause compile errors when the game is exported. These errors were actually harmless but would give the impression that something is broken ([#74](https://github.com/derkork/godot-statecharts/issues/74)).


## [0.12.0] - 2024-01-12
### Added
- The inspector for transitions now provides a list of all events currently used in the state chart from which an event can be selected. This minimizes the risk of typos when entering event names ([#72](https://github.com/derkork/godot-statecharts/issues/72)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ var _ignore_transitions:bool = true
## The editor settings for storing all the settings across sessions
var _settings:EditorSettings = null

## The current session
var _session:EditorDebuggerSession = null
## The current session (EditorDebuggerSession)
## this does not exist in exported games, so this is deliberately not
## typed, to avoid compile errors after exporting
var _session = null

## Dictionary of all state charts and their states. Key is the path to the
## state chart, value is a dictionary of states. Key is the path to the state,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ static func transition_pending(chart:StateChart, source:State, transition:Transi
EngineDebugger.send_message(TRANSITION_PENDING_MESSAGE, [Engine.get_process_frames(), chart.get_path(), chart.get_path_to(source), chart.get_path_to(transition), pending_transition_time])

## Sends a settings updated message
static func settings_updated(session:EditorDebuggerSession, chart:NodePath, ignore_events:bool, ignore_transitions:bool) -> void:
## session is an EditorDebuggerSession but this does not exist after export
## so its not statically typed here. This code won't run after export anyways.
static func settings_updated(session, chart:NodePath, ignore_events:bool, ignore_transitions:bool) -> void:
# print("Sending settings updated message: ", SETTINGS_UPDATED_MESSAGE + str(chart) + ":updated")
session.send_message(SETTINGS_UPDATED_MESSAGE + str(chart) + ":updated", [ignore_events, ignore_transitions])
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ config_version=5
[application]

config/name="godot-state-charts"
run/main_scene="res://godot_state_charts_examples/ant_hill/ant_hill_demo.tscn"
run/main_scene="res://godot_state_charts_examples/platformer/platformer_demo.tscn"
config/features=PackedStringArray("4.0", "C#", "Forward Plus")
config/icon="res://icon.svg"

Expand Down

0 comments on commit 83dd4cb

Please sign in to comment.