Skip to content

Commit

Permalink
Futher 3->4 fixes. Most tests can complete, even if they do not pass
Browse files Browse the repository at this point in the history
  • Loading branch information
menaechmi committed Sep 13, 2024
1 parent af1df15 commit a525aaa
Show file tree
Hide file tree
Showing 58 changed files with 584 additions and 483 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/gut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check out personal godot-tester repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: db0/godot-tester
path: ./.github/actions/godot-tester
# Runs a single command using the runners shell
- name: Godot Tester
uses: ./.github/actions/godot-tester
with:
version: 3.4.4
version: 4.2.1
# should be long enough for asset import files to get generated
import-time: 10
assert-check: true
max-fails: 0
# How long the test should be run before it's timed out and fails
test-timeout: 900
# Directory containing Gut tests
direct-scene: tests/cli/tests.tscn
direct-scene: tests/cli/tests.tscn
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ jobs:
name: Unit & Integration Tests
steps:
- name: "✔️ Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check out personal godot-tester repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: db0/godot-tester
path: ./.github/actions/godot-tester
# Runs a single command using the runners shell
- name: ⚙ Run Tests
uses: ./.github/actions/godot-tester
with:
version: 3.4.4
version: "4.2.1"
# should be long enough for asset import files to get generated
import-time: 300
assert-check: true
Expand All @@ -40,14 +40,14 @@ jobs:
needs: ["GUT"]
steps:
- name: "✔️ Checkout"
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "🤖 Export game"
uses: firebelley/godot-export@v3.0.0
uses: firebelley/godot-export@v5.2.1
with:
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/3.4/Godot_v3.4-stable_linux_headless.64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/3.4/Godot_v3.4-stable_export_templates.tpz
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/4.2.1/Godot_v4.2.1-stable_linux.x86_64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/4.2.1/Godot_v4.2.1-stable_export_templates.tpz
relative_project_path: ./
base_version: Demo
create_release: false
Expand Down
8 changes: 4 additions & 4 deletions src/core/Card/TargetingArrow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ func _ready() -> void:
default_color = CFConst.TARGETTING_ARROW_COLOUR
$ArrowHead.color = CFConst.TARGETTING_ARROW_COLOUR
# warning-ignore:return_value_discarded
$ArrowHead/Area2D.connect("area_entered", Callable(self, "_on_ArrowHead_area_entered"))
$ArrowHead/Area2D.connect("area_entered", _on_ArrowHead_area_entered)
# warning-ignore:return_value_discarded
$ArrowHead/Area2D.connect("area_exited", Callable(self, "_on_ArrowHead_area_exited"))
$ArrowHead/Area2D.connect("area_exited", _on_ArrowHead_area_exited)


func _process(_delta: float) -> void:
Expand Down Expand Up @@ -73,7 +73,7 @@ func complete_targeting() -> void:
#
# It takes care to highlight potential cards which can serve as targets.
func _on_ArrowHead_area_entered(area: Area2D) -> void:
if area.get_class() == 'Card' and not area in _potential_targets:
if (area is Card) and (not area in _potential_targets):
_potential_targets.append(area)
if 'highlight' in owner_object:
owner_object.highlight.highlight_potential_card(
Expand All @@ -85,7 +85,7 @@ func _on_ArrowHead_area_entered(area: Area2D) -> void:
#
# It clears potential highlights and adjusts potential cards as targets
func _on_ArrowHead_area_exited(area: Area2D) -> void:
if area.get_class() == 'Card' and area in _potential_targets:
if (area is Card) and (area in _potential_targets):
# We remove the card we stopped hovering from the _potential_targets
_potential_targets.erase(area)
# And we explicitly hide its cards focus since we don't care about it anymore
Expand Down
7 changes: 4 additions & 3 deletions src/core/CardContainer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ func _on_Control_mouse_entered() -> void:
# Ensures that buttons are not trying to disappear via previous animation
func _on_button_mouse_entered() -> void:
# We stop ongoing animations to avoid conflicts.
_tween.kill()
if _tween:
_tween.kill()
for button in get_all_manipulation_buttons():
button.modulate[3] = 1

Expand All @@ -150,8 +151,8 @@ func _on_viewport_resized() -> void:

func are_cards_still_animating() -> bool:
for c in get_all_cards():
var tt : Tween = c._tween
if tt: #is_running()
var tt := c._tween.get_ref() as Tween
if (tt and tt.is_running): #is_running()
return(true)
return(false)

Expand Down
Loading

0 comments on commit a525aaa

Please sign in to comment.