Repository navigation
start go-to mode on left button long press, execute go-to on left button release - #1142
Open
mikes-wandering wants to merge 2 commits into
Open
mikes-wandering wants to merge 2 commits into
mikes-wandering wants to merge 2 commits into
Conversation
…ton release - DoubleClickHandler.cs extended to handle all left click actions, renamed LeftClickHandler.cs - event logic in MouseAction.cs and tests in MouseActionTest.cs - event handling in Game.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The original Civ3 lets you start go-to mode with a left button long press. It executes the go-to when the left button is released. This request implements this functionality.
DoubleClickHandler.cs has been extended to handle all sequences arising from left click actions, and therefore renamed as LeftClickHandler.cs.
This uses the Godot _Process method to measure elapsed times. This method is called by Godot about 60 times / second and provides a simple mechanism to measure time, accurately enough for mouse actions, without managing Timers.
The logic to determine mouse events is placed in MouseAction.cs, with tests in MouseActionTest.cs. The logic is complex enough that I wanted tests for it. These classes are in C7Engine and EngineTests, because Godot and xUnit don't play nicely without an additional test framework. I put them in new folders called GameAction, because they didn't seem to fit in any existing folders, but I can put them elsewhere if you want.