Josh Engebretson 10 years ago
parent
commit
390e138bce

+ 27 - 5
Data/AtomicEditor/Resources/EditorData/AtomicEditor/editor/ui/about.tb.txt

@@ -1,6 +1,28 @@
-TBLayout: axis: y, distribution: gravity, position: left
-	TBLayout: 
-		TBTextField: text: "About:"
-		TBTextField: text: "The Atomic Game Engine"
-	TBSeparator: gravity: left right, skin: AESeparator
+TBLayout: axis: y
+	TBTabContainer
+		gravity all
+		id tabcontainer
+		tabs
+			TBButton: text: "About"
+			TBButton: text: "Atomic Game Engine License"
+			TBButton: text: "Third Party Licenses"
+			TBButton: text: "External Tool Licenses"
+		TBEditField: multiline: 1, styling: 1, gravity: all, id: about_text, readonly: 1, adapt-to-content: 0
+			font: size: 12
+			lp: max-width: 800, min-width: 800, min-height: 512, max-height: 512
+			text: "..."
+		TBEditField: multiline: 1, styling: 1, gravity: all, id: age_license, readonly: 1, adapt-to-content: 0
+			font: size: 12
+			lp: max-width: 800, min-width: 800, min-height: 512, max-height: 512
+			text: "..."
+		TBEditField: multiline: 1, styling: 1, gravity: all, id: thirdparty_license, readonly: 1, adapt-to-content: 0
+			font: size: 12
+			lp: max-width: 800, min-width: 800, min-height: 512, max-height: 512
+			text: "..."
+		TBEditField: multiline: 1, styling: 1, gravity: all, id: externaltool_license, readonly: 1, adapt-to-content: 0
+			font: size: 12
+			lp: max-width: 800, min-width: 800, min-height: 512, max-height: 512
+			text: "..."			
 	TBButton: text: OK, id: ok
+		lp: min-width: 128, min-height: 48
+

+ 3 - 3
Data/AtomicEditor/Resources/EditorData/AtomicEditor/editor/ui/eulaagreement.tb.txt

@@ -7,15 +7,15 @@ TBLayout: axis: y
 			TBButton: text: "Third Party Licenses"
 			TBButton: text: "External Tool Licenses"
 		TBEditField: multiline: 1, styling: 1, gravity: all, id: age_license, readonly: 1, adapt-to-content: 0
-			font: size: 14
+			font: size: 12
 			lp: max-width: 800, min-width: 800, min-height: 512, max-height: 512
 			text: "..."
 		TBEditField: multiline: 1, styling: 1, gravity: all, id: thirdparty_license, readonly: 1, adapt-to-content: 0
-			font: size: 14
+			font: size: 12
 			lp: max-width: 800, min-width: 800, min-height: 512, max-height: 512
 			text: "..."
 		TBEditField: multiline: 1, styling: 1, gravity: all, id: externaltool_license, readonly: 1, adapt-to-content: 0
-			font: size: 14
+			font: size: 12
 			lp: max-width: 800, min-width: 800, min-height: 512, max-height: 512
 			text: "..."			
 	TBLayout: axis: y

+ 2 - 2
Data/AtomicEditor/Resources/EditorData/AtomicEditor/eulas/atomic_external_tools_eula.txt

@@ -1,6 +1,6 @@
-ATOMIC GAME ENGINE EXTERNAL TOOL LICENSE INFORMATION
+<color #D4FB79>Atomic Game Engine External Tool License Information</color>
 
-<color #D4FB79>Several external tools are distributed with the Atomic Game Engine Editor</color>
+Several external tools are distributed with the Atomic Game Engine Editor
 
 <color #76D6FF><u>Tiled Map Editor</u></color>
 

+ 2 - 2
Data/AtomicEditor/Resources/EditorData/AtomicEditor/eulas/atomic_thirdparty_eula.txt

@@ -1,6 +1,6 @@
-THIRD PARTY TECHNOLOGY LICENSES AND COPYRIGHTS
+<color #D4FB79>Third Party Technology Licenses And Copyrights</color>
 
-<color #D4FB79>This file contains information for third party technology used in the Atomic Game Engine</color>
+This file contains information for third party technology used in the Atomic Game Engine
 
 <color #76D6FF><u>Urho3D License</u></color>
 

+ 80 - 6
Source/AtomicEditor/Source/UI/Modal/UIAbout.cpp

@@ -9,33 +9,65 @@
 #include <TurboBadger/tb_editfield.h>
 
 #include <Atomic/Core/Context.h>
+#include <Atomic/IO/File.h>
+#include <Atomic/Resource/ResourceCache.h>
+#include <Atomic/Input/InputEvents.h>
 #include <Atomic/UI/TBUI.h>
 
 #include "Resources/AEResourceOps.h"
 #include "AEPreferences.h"
 
+#include "AEVersion.h"
 #include "AEEditor.h"
 #include "AEEvents.h"
 #include "Project/AEProject.h"
 #include "Project/ProjectUtils.h"
 
+#include "License/AELicenseSystem.h"
 #include "UIAbout.h"
 
 namespace AtomicEditor
 {
 
-// UIBuildSettings------------------------------------------------
-
 UIAbout::UIAbout(Context* context):
     UIModalOpWindow(context)
 {
-    Editor* editor = GetSubsystem<Editor>();
-    Project* project = editor->GetProject();
-
     TBUI* tbui = GetSubsystem<TBUI>();
-    window_->SetText("About the Atomic Game Engine");
+    window_->SetText("License Agreement");
     tbui->LoadResourceFile(window_->GetContentRoot(), "AtomicEditor/editor/ui/about.tb.txt");
 
+    TBEditField* age_license = window_->GetWidgetByIDAndType<TBEditField>(TBIDC("age_license"));
+    assert(age_license);
+
+    TBEditField* thirdparty_license = window_->GetWidgetByIDAndType<TBEditField>(TBIDC("thirdparty_license"));
+    assert(thirdparty_license);
+
+    TBEditField* externaltool_license = window_->GetWidgetByIDAndType<TBEditField>(TBIDC("externaltool_license"));
+    assert(externaltool_license);
+
+    TBEditField* about_text = window_->GetWidgetByIDAndType<TBEditField>(TBIDC("about_text"));
+    assert(about_text);
+
+
+    ResourceCache* cache = GetSubsystem<ResourceCache>();
+
+    SharedPtr<File> file = cache->GetFile("AtomicEditor/eulas/atomic_game_engine_eula.txt");
+    String text;
+    file->ReadText(text);
+    age_license->SetText(text.CString());
+
+    file = cache->GetFile("AtomicEditor/eulas/atomic_thirdparty_eula.txt");
+    file->ReadText(text);
+    thirdparty_license->SetText(text.CString());
+
+    file = cache->GetFile("AtomicEditor/eulas/atomic_external_tools_eula.txt");
+    file->ReadText(text);
+    externaltool_license->SetText(text.CString());
+
+    GenerateAboutText(text);
+
+    about_text->SetText(text.CString());
+
     window_->ResizeToFitContent();
     Center();
 }
@@ -43,13 +75,55 @@ UIAbout::UIAbout(Context* context):
 
 UIAbout::~UIAbout()
 {
+
+}
+
+void UIAbout::GenerateAboutText(String& text)
+{
+    LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>();
+    text.Clear();
+
+    text += "<widget TBImageWidget: filename: 'AtomicEditor/editor/images/atomic_logo.png'>\n";
+    text.AppendWithFormat("<color #D4FB79>Version  %i.%i.p%i</color>\n", ATOMIC_EDITOR_VERSION_MAJOR, ATOMIC_EDITOR_VERSION_MINOR, ATOMIC_EDITOR_VERSION_PATCH);
+    text += "(c) 2014-2015 THUNDERBEAST GAMES LLC\n\n";
+
+    text += "<color #76D6FF>Installed platform licenses:</color>\n\n";
+
+    if (licenseSystem->HasPlatformLicense())
+    {
+        text += "    <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'>\n\n";
+    }
+    else
+    {
+        text += "<color #FF2600>    No platform licenses installed</color>\n\n";
+    }
+
+    text += "<color #76D6FF>Credits:</color>\n\n";
+    text += "    Technical Director: Josh Engebretson\n\n";
+    text += "    Producer: Lara Engebretson\n\n";
+
+    text += "<color #76D6FF>Special Thanks:</color>\n\n";
+    text += "    The Urho3D Project - http://urho3d.github.io\n\n";
+    text += "    Sami Vaarala - http://www.duktape.org";
 }
 
 bool UIAbout::OnEvent(const TBWidgetEvent &ev)
 {
+    if (ev.type == EVENT_TYPE_CLICK)
+    {
+        if (ev.target->GetID() == TBIDC("ok"))
+        {
+            GetSubsystem<UIModalOps>()->Hide();
+            return true;
+        }
 
+    }
 
     return false;
 }
 
 }
+
+

+ 6 - 3
Source/AtomicEditor/Source/UI/Modal/UIAbout.h

@@ -4,10 +4,9 @@
 
 #pragma once
 
-#include "UIModalOps.h"
+#include "UI/Modal/UIModalOps.h"
 
-#include <TurboBadger/tb_select.h>
-#include <TurboBadger/tb_select_item.h>
+#include <TurboBadger/tb_widgets_common.h>
 
 namespace AtomicEditor
 {
@@ -24,6 +23,10 @@ public:
 
 private:
 
+    void GenerateAboutText(String& text);
+
+
 };
 
 }
+