Qualify Godot.Engine: the tools compile test has an Engine namespace
This commit is contained in:
1 parent
657353b959
commit
5c399b150d
4 files changed
+6
-6
No files matched your search
@@ -58,7 +58,7 @@ namespace Cthangover.Mods.Rpg
|
|||||||
|
|
||||||
private static SceneManager FindSceneManager()
|
private static SceneManager FindSceneManager()
|
||||||
{
|
{
|
||||||
var tree = Engine.GetMainLoop() as SceneTree;
|
var tree = Godot.Engine.GetMainLoop() as SceneTree;
|
||||||
return tree?.Root?.GetNodeOrNull<SceneManager>("SceneManager");
|
return tree?.Root?.GetNodeOrNull<SceneManager>("SceneManager");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ namespace Cthangover.Mods.Rpg
|
|||||||
}
|
}
|
||||||
|
|
||||||
RpgState.Instance.Place(mapId, target.X, target.Y, target.Dir);
|
RpgState.Instance.Place(mapId, target.X, target.Y, target.Dir);
|
||||||
var sceneManager = (Engine.GetMainLoop() as SceneTree)?.Root?.GetNodeOrNull<SceneManager>("SceneManager");
|
var sceneManager = (Godot.Engine.GetMainLoop() as SceneTree)?.Root?.GetNodeOrNull<SceneManager>("SceneManager");
|
||||||
if (sceneManager == null)
|
if (sceneManager == null)
|
||||||
{
|
{
|
||||||
GameLogger.Log("RPG", $"teleport to '{mapId}': SceneManager not found", LogLevel.Error);
|
GameLogger.Log("RPG", $"teleport to '{mapId}': SceneManager not found", LogLevel.Error);
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ namespace Cthangover.Mods.Rpg.Tests
|
|||||||
Check(View.FindEvent("elder_quest")?.Visible == false && View.FindEvent("elder_thanks")?.Visible == true, "a story flag swaps the elder's events at once");
|
Check(View.FindEvent("elder_quest")?.Visible == false && View.FindEvent("elder_thanks")?.Visible == true, "a story flag swaps the elder's events at once");
|
||||||
ScenarioCondition.SetFlag("rpg_wolf_dead", "0");
|
ScenarioCondition.SetFlag("rpg_wolf_dead", "0");
|
||||||
Check(RpgBattleService.Start("rpg_slime", WinFlag), "a battle starts from the map");
|
Check(RpgBattleService.Start("rpg_slime", WinFlag), "a battle starts from the map");
|
||||||
Engine.TimeScale = 4;
|
Godot.Engine.TimeScale = 4;
|
||||||
Next();
|
Next();
|
||||||
return;
|
return;
|
||||||
case 13:
|
case 13:
|
||||||
@@ -185,7 +185,7 @@ namespace Cthangover.Mods.Rpg.Tests
|
|||||||
case 15:
|
case 15:
|
||||||
if (View?.Map?.ID != House || GodotSceneService.IsTransitioning)
|
if (View?.Map?.ID != House || GodotSceneService.IsTransitioning)
|
||||||
return;
|
return;
|
||||||
Engine.TimeScale = 1;
|
Godot.Engine.TimeScale = 1;
|
||||||
Check(View.Player.Cell == new Vector2I(6, 8), $"the battle returns to the same cell, got {View.Player.Cell}");
|
Check(View.Player.Cell == new Vector2I(6, 8), $"the battle returns to the same cell, got {View.Player.Cell}");
|
||||||
Check(GameData.Instance.Runtime.Flags.TryGetValue(WinFlag, out var won) && won == "1", "the win flag is set after the victory");
|
Check(GameData.Instance.Runtime.Flags.TryGetValue(WinFlag, out var won) && won == "1", "the win flag is set after the victory");
|
||||||
Finish();
|
Finish();
|
||||||
@@ -250,7 +250,7 @@ namespace Cthangover.Mods.Rpg.Tests
|
|||||||
private void Finish()
|
private void Finish()
|
||||||
{
|
{
|
||||||
step = -1;
|
step = -1;
|
||||||
Engine.TimeScale = 1;
|
Godot.Engine.TimeScale = 1;
|
||||||
GameLogger.Log("TEST", $"[TEST_RESULT] name=rpg_walk passed={passed} failed={failures.Count}");
|
GameLogger.Log("TEST", $"[TEST_RESULT] name=rpg_walk passed={passed} failed={failures.Count}");
|
||||||
GetTree().Quit(failures.Count == 0 ? 0 : 1);
|
GetTree().Quit(failures.Count == 0 ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace Cthangover.Mods.Rpg.Tests
|
|||||||
.Select(a => a.Substring("--shots=".Length))
|
.Select(a => a.Substring("--shots=".Length))
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
GameLogger.Log("TEST", $"RpgWalkTestInitializer: activating rpg_walk, shots={shots ?? "off"}");
|
GameLogger.Log("TEST", $"RpgWalkTestInitializer: activating rpg_walk, shots={shots ?? "off"}");
|
||||||
(Engine.GetMainLoop() as SceneTree)?.Root?.CallDeferred("add_child", new RpgWalkTestDriver(shots));
|
(Godot.Engine.GetMainLoop() as SceneTree)?.Root?.CallDeferred("add_child", new RpgWalkTestDriver(shots));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user