Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor global and related scripts #119

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

juliohq
Copy link
Contributor

@juliohq juliohq commented Sep 3, 2023

This PR refactors some things in the global autoload script:

  • Remove editor hint check (Engine.is_editor_hint), because the global autoload is not a tool script.
  • Move gameplay controls input handling (reload current scene, etc.) to the Game script.
  • Rename the Game script mentioned above to World in order to better match its node name in the World.tscn scene.
  • Save factions as resources (.tres files), which is handy to edit properties in the editor (name, emblem and color).

Copy link
Contributor

@artism90 artism90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall it looks fine. Merging the faction parts into one resource seems reasonable as well as renaming Game to World (this wasn't possible in Godot 3 as World was a built-in resource).

Assets/World/Global.gd Outdated Show resolved Hide resolved
Assets/Player/PlayerCamera.gd Show resolved Hide resolved
Assets/World/Factions/Faction.gd Outdated Show resolved Hide resolved
@artism90 artism90 added the code Programming code and game logic label Sep 3, 2023
Copy link
Contributor

@artism90 artism90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Please squash all commits to a single readable one before merging.

@artism90 artism90 changed the title Refactor global script Refactor global and related scripts Sep 16, 2023
@artism90 artism90 merged commit 844ace7 into unknown-horizons:develop Sep 16, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code Programming code and game logic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants