Browse Source

Platform Info UI

Josh Engebretson 10 years ago
parent
commit
8037778bcf

+ 31 - 1
Data/AtomicEditor/Resources/EditorData/AtomicEditor/editor/skin/skin.tb.txt

@@ -81,6 +81,9 @@ elements
 		bitmap item_separator_x.png
 		bitmap item_separator_x.png
 		type Stretch Image
 		type Stretch Image
 
 
+	LogoWindows
+		bitmap logo_windows.png
+
 	LogoAndroid
 	LogoAndroid
 		bitmap logo_android.png
 		bitmap logo_android.png
 
 
@@ -93,8 +96,35 @@ elements
 	LogoMac
 	LogoMac
 		bitmap logo_mac.png
 		bitmap logo_mac.png
 
 
-	LogoWindows
+	LogoWindows-Small
+		bitmap logo_windows.png
+		width 48
+		height 48
+
+	LogoAndroid-Small
+		bitmap logo_android.png
+		width 48
+		height 48
+
+	LogoHTML5-Small
+		bitmap logo_html5.png
+		width 48
+		height 48
+
+	LogoIOS-Small
+		bitmap logo_ios.png
+		width 48
+		height 48
+
+	LogoMac-Small
+		bitmap logo_mac.png
+		width 48
+		height 48
+
+	LogoWindows-Small
 		bitmap logo_windows.png
 		bitmap logo_windows.png
+		width 48
+		height 48
 
 
 	LogoAtomic64
 	LogoAtomic64
 		bitmap logo_atomic_64.png
 		bitmap logo_atomic_64.png

+ 9 - 4
Data/AtomicEditor/Resources/EditorData/AtomicEditor/editor/ui/platformsinfo.tb.txt

@@ -1,9 +1,14 @@
 TBLayout: axis: y, distribution: gravity
 TBLayout: axis: y, distribution: gravity
 	TBEditField: multiline: 1, styling: 1, gravity: all, id: info, readonly: 1
 	TBEditField: multiline: 1, styling: 1, gravity: all, id: info, readonly: 1
-		text: "There are no platform deployments available\n\n" \
-				"You will be able to preview gameplay in the Atomic Editor.\n" \
-				"A platform license is required to deploy apps.\n\n"
-		lp: min-width: 480, min-height: 100
+		font: size: 14
+		text: "There are no platform deployment licenses installed.\n\n" \
+				"A platform license is required to deploy apps.\n\n" \
+				"<color #D4FB79>You will be able to preview gameplay in the Atomic Editor.</color>\n\n" \
+				"<color #76D6FF>Available platform licenses:</color>\n\n" \
+				"<widget TBSkinImage: skin: 'LogoMac-Small'> <widget TBSkinImage: skin: 'LogoWindows-Small'> " \
+				"<widget TBSkinImage: skin: 'LogoHTML5-Small'> <widget TBSkinImage: skin: 'LogoAndroid-Small'> " \
+				"<widget TBSkinImage: skin: 'LogoIOS-Small'>" 
+		lp: min-width: 480, min-height: 240
 	TBSeparator: gravity: left right, skin: AESeparator
 	TBSeparator: gravity: left right, skin: AESeparator
 	TBLayout:
 	TBLayout:
 		TBButton: text: OK, id: ok
 		TBButton: text: OK, id: ok

+ 13 - 2
Source/AtomicEditor/Source/License/UIActivationSuccess.cpp

@@ -21,6 +21,7 @@
 #include "../Project/AEProject.h"
 #include "../Project/AEProject.h"
 #include "../Project/ProjectUtils.h"
 #include "../Project/ProjectUtils.h"
 
 
+
 #include "UIActivationSuccess.h"
 #include "UIActivationSuccess.h"
 #include "AELicenseSystem.h"
 #include "AELicenseSystem.h"
 
 
@@ -45,8 +46,6 @@ UIActivationSuccess::~UIActivationSuccess()
 
 
 }
 }
 
 
-
-
 bool UIActivationSuccess::OnEvent(const TBWidgetEvent &ev)
 bool UIActivationSuccess::OnEvent(const TBWidgetEvent &ev)
 {
 {
     UIModalOps* ops = GetSubsystem<UIModalOps>();
     UIModalOps* ops = GetSubsystem<UIModalOps>();
@@ -55,6 +54,18 @@ bool UIActivationSuccess::OnEvent(const TBWidgetEvent &ev)
     {
     {
         if (ev.target->GetID() == TBIDC("ok"))
         if (ev.target->GetID() == TBIDC("ok"))
         {
         {
+
+            LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>();
+
+            if (!licenseSystem->HasPlatformLicense())
+            {
+                SharedPtr<UIActivationSuccess> keepAlive(this);
+                UIModalOps* ops = GetSubsystem<UIModalOps>();
+                ops->Hide();
+                ops->ShowPlatformsInfo();
+                return true;
+            }
+
             ops->Hide();
             ops->Hide();
             return true;
             return true;
         }
         }

+ 18 - 2
Source/AtomicEditor/Source/UI/Modal/UIBuildSettings.cpp

@@ -17,6 +17,10 @@
 
 
 #include "UIBuildSettings.h"
 #include "UIBuildSettings.h"
 
 
+// BEGIN LICENSE MANAGEMENT
+#include "License/AELicenseSystem.h"
+// END LICENSE MANAGEMENT
+
 namespace AtomicEditor
 namespace AtomicEditor
 {
 {
 
 
@@ -237,8 +241,7 @@ void UIBuildSettings::StoreSettings()
 }
 }
 
 
 bool UIBuildSettings::OnEvent(const TBWidgetEvent &ev)
 bool UIBuildSettings::OnEvent(const TBWidgetEvent &ev)
-{
-    Editor* editor = GetSubsystem<Editor>();
+{    
     UIModalOps* ops = GetSubsystem<UIModalOps>();
     UIModalOps* ops = GetSubsystem<UIModalOps>();
 
 
     if (ev.type == EVENT_TYPE_CLICK)
     if (ev.type == EVENT_TYPE_CLICK)
@@ -265,9 +268,22 @@ bool UIBuildSettings::OnEvent(const TBWidgetEvent &ev)
         }
         }
         else if (ev.target->GetID() == TBIDC("set_current_platform"))
         else if (ev.target->GetID() == TBIDC("set_current_platform"))
         {
         {
+// BEGIN LICENSE MANAGEMENT
+
+            LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>();
+            if (!licenseSystem->HasPlatformLicense())
+            {
+                SharedPtr<UIBuildSettings> keepAlive(this);
+                UIModalOps* ops = GetSubsystem<UIModalOps>();
+                ops->Hide();
+                ops->ShowPlatformsInfo();
+                return true;
+            }
+
             TBID id = platformSelect_->GetSelectedItemID();
             TBID id = platformSelect_->GetSelectedItemID();
             RequestPlatformChange(id);
             RequestPlatformChange(id);
             return true;
             return true;
+// END LICENSE MANAGEMENT
 
 
         }
         }
         else if (ev.target->GetID() == TBIDC("ok"))
         else if (ev.target->GetID() == TBIDC("ok"))

+ 1 - 1
Source/AtomicEditor/Source/UI/Modal/UIPlatformsInfo.cpp

@@ -34,7 +34,7 @@ PlatformsInfo::PlatformsInfo(Context* context):
     Project* project = editor->GetProject();
     Project* project = editor->GetProject();
 
 
     TBUI* tbui = GetSubsystem<TBUI>();
     TBUI* tbui = GetSubsystem<TBUI>();
-    window_->SetText("Platform Information");
+    window_->SetText("Platform License Required");
 
 
     tbui->LoadResourceFile(window_->GetContentRoot(), "AtomicEditor/editor/ui/platformsinfo.tb.txt");
     tbui->LoadResourceFile(window_->GetContentRoot(), "AtomicEditor/editor/ui/platformsinfo.tb.txt");