From 20e5fe9b4dbb06942ca15fb1e78a76806137a0f0 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Tue, 5 Mar 2019 21:56:47 +0100 Subject: [PATCH] Fix Godot 3.0 compatibility. --- SS14.Client/Graphics/Drawing/StyleBox.cs | 5 ++++- SS14.Client/UserInterface/Controls/Container.cs | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/SS14.Client/Graphics/Drawing/StyleBox.cs b/SS14.Client/Graphics/Drawing/StyleBox.cs index 65df271b8..7df8b0ec0 100644 --- a/SS14.Client/Graphics/Drawing/StyleBox.cs +++ b/SS14.Client/Graphics/Drawing/StyleBox.cs @@ -510,7 +510,10 @@ namespace SS14.Client.Graphics.Drawing public Texture Texture { - get => _texture ?? (GameController.OnGodot ? new GodotTextureSource(gdStyleBox.Texture) : null); + // In Godot 3.0, StyleBoxTexture.Texture is a plain resource. + // So we need this cast. + // ReSharper disable once RedundantCast + get => _texture ?? (GameController.OnGodot ? new GodotTextureSource((Godot.Texture)gdStyleBox.Texture) : null); // Woo implicit casts. set { diff --git a/SS14.Client/UserInterface/Controls/Container.cs b/SS14.Client/UserInterface/Controls/Container.cs index bc10b774c..0e26808c9 100644 --- a/SS14.Client/UserInterface/Controls/Container.cs +++ b/SS14.Client/UserInterface/Controls/Container.cs @@ -14,7 +14,9 @@ namespace SS14.Client.UserInterface.Controls { } - internal Container(Godot.Container sceneControl) : base(sceneControl) + // So for SOME REASON Godot.TabContainer wasn't a Container until 3.1. + // ??? + internal Container(Godot.Control sceneControl) : base(sceneControl) { }