From 36f679f5394f56ec0c1b2ee03cd990757e0bd1f6 Mon Sep 17 00:00:00 2001 From: Areloch Date: Tue, 8 Nov 2016 23:39:07 -0600 Subject: [PATCH] Sanity check for if the GuiPlatformGenericMenuBar class is valid before trying to load a menubar that uses it, in the event that SDL isn't enabled, or other similar circumstances. --- .../tools/gui/guiPlatformGenericMenubar.ed.cs | 20 ++++++++++++++++++- .../tools/gui/guiPlatformGenericMenubar.ed.cs | 20 ++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/Templates/Empty/game/tools/gui/guiPlatformGenericMenubar.ed.cs b/Templates/Empty/game/tools/gui/guiPlatformGenericMenubar.ed.cs index 327a50205..089b0b8fa 100644 --- a/Templates/Empty/game/tools/gui/guiPlatformGenericMenubar.ed.cs +++ b/Templates/Empty/game/tools/gui/guiPlatformGenericMenubar.ed.cs @@ -1 +1,19 @@ -exec("./guiPlatformGenericMenubar.ed.gui"); \ No newline at end of file +if(isClass(GuiPlatformGenericMenuBar)) +{ + exec("./guiPlatformGenericMenubar.ed.gui"); +} +else +{ + %guiContent = new GuiControl(PlatformGenericMenubar) { + profile = "GuiModelessDialogProfile"; + + new GuiControl() + { + internalName = "menubar"; + extent = "1024 20"; + minExtent = "320 20"; + horizSizing = "width"; + profile = "GuiMenuBarProfile"; + }; + }; +} \ No newline at end of file diff --git a/Templates/Full/game/tools/gui/guiPlatformGenericMenubar.ed.cs b/Templates/Full/game/tools/gui/guiPlatformGenericMenubar.ed.cs index 327a50205..089b0b8fa 100644 --- a/Templates/Full/game/tools/gui/guiPlatformGenericMenubar.ed.cs +++ b/Templates/Full/game/tools/gui/guiPlatformGenericMenubar.ed.cs @@ -1 +1,19 @@ -exec("./guiPlatformGenericMenubar.ed.gui"); \ No newline at end of file +if(isClass(GuiPlatformGenericMenuBar)) +{ + exec("./guiPlatformGenericMenubar.ed.gui"); +} +else +{ + %guiContent = new GuiControl(PlatformGenericMenubar) { + profile = "GuiModelessDialogProfile"; + + new GuiControl() + { + internalName = "menubar"; + extent = "1024 20"; + minExtent = "320 20"; + horizSizing = "width"; + profile = "GuiMenuBarProfile"; + }; + }; +} \ No newline at end of file