Josh Engebretson 10 years ago
parent
commit
d3b1489785

+ 20 - 12
Data/AtomicEditor/ExampleInfo/Examples.json

@@ -1,46 +1,54 @@
 {
 	"Examples" : [
-			{
-				"name": "ToonTown",
-				"desc" : "Town, Terrain, Day/Night Cycles",
-				"screenshot" : "ToonTown.png",
-				"folder" : "ToonTown"
-			},	
 			{
 				"name": "Physics Platformer 2D",
 				"desc" : "Moving platforms, vines, and neat 2D lighting",
 				"screenshot" : "PhysicsPlatformer2D.png",
-				"folder" : "PhysicsPlatformer"
+				"folder" : "PhysicsPlatformer",
+				"module" : "2D"
 			},
+			{
+				"name": "ToonTown",
+				"desc" : "Town, Terrain, Day/Night Cycles",
+				"screenshot" : "ToonTown.png",
+				"folder" : "ToonTown",
+				"module" : "3D"
+			},			
 			{
 				"name": "Roboman 3D",
 				"desc" : "A 3D physics example featuring Roboman!",
 				"screenshot" : "Roboman3D.png",
-				"folder" : "RoboMan3D"
+				"folder" : "RoboMan3D",
+				"module" : "3D"
 			},
 			{
 				"name": "SpaceGame",
 				"desc" : "A 2D Arcade Space Game",
 				"screenshot" : "SpaceGame.png",
-				"folder" : "SpaceGame"
+				"folder" : "SpaceGame",
+				"module" : "2D"
+
 			},
 			{
 				"name": "Character Animation 3D",
 				"desc" : "Example of controlling a skeletally animated character",
 				"screenshot" : "CharacterAnimation3D.png",
-				"folder" : "CharacterAnimation3D"
+				"folder" : "CharacterAnimation3D",
+				"module" : "3D"
 			},
 			{
 				"name": "Light 2D",
 				"desc" : "An example of realtime 2D lights with shadows",
 				"screenshot" : "Light2D.png",
-				"folder" : "Light2DExample"
+				"folder" : "Light2DExample",
+				"module" : "2D"
 			},
 			{
 				"name": "UI Example",
 				"desc" : "A basic UI example showing responding to a click",
 				"screenshot" : "UIExample.png",
-				"folder" : "UIExample"
+				"folder" : "UIExample",
+				"module" : "2D"
 			}
 
 	] 

+ 1 - 0
Source/AtomicEditor/Source/License/UIActivation.cpp

@@ -35,6 +35,7 @@ UIActivation::UIActivation(Context* context):
     licenseKey_(0)
 {
     TBUI* tbui = GetSubsystem<TBUI>();
+    window_->DisableCloseButton();
     window_->SetText("Product Activation");
     tbui->LoadResourceFile(window_->GetContentRoot(), "AtomicEditor/editor/ui/activation.tb.txt");
 

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

@@ -55,6 +55,7 @@ bool UIActivationSuccess::OnEvent(const TBWidgetEvent &ev)
         if (ev.target->GetID() == TBIDC("ok"))
         {
 
+            /*
             LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>();
 
             if (licenseSystem->IsStarterLicense())
@@ -65,6 +66,7 @@ bool UIActivationSuccess::OnEvent(const TBWidgetEvent &ev)
                 ops->ShowPlatformsInfo();
                 return true;
             }
+            */
 
             ops->Hide();
             return true;

+ 1 - 0
Source/AtomicEditor/Source/License/UIEulaAgreement.cpp

@@ -37,6 +37,7 @@ UIEulaAgreement::UIEulaAgreement(Context* context):
     UIModalOpWindow(context)
 {
     TBUI* tbui = GetSubsystem<TBUI>();
+    window_->DisableCloseButton();
     window_->SetText("License Agreement");
     tbui->LoadResourceFile(window_->GetContentRoot(), "AtomicEditor/editor/ui/eulaagreement.tb.txt");
 

+ 2 - 2
Source/AtomicEditor/Source/UI/Modal/UIAbout.cpp

@@ -87,8 +87,8 @@ 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 += "<widget TBImageWidget: filename: 'AtomicEditor/editor/images/atomic_logo.png'>\n\n";
+    text.AppendWithFormat("<color #D4FB79>Version  %i.%i.p%i</color>\n\n", ATOMIC_EDITOR_VERSION_MAJOR, ATOMIC_EDITOR_VERSION_MINOR, ATOMIC_EDITOR_VERSION_PATCH);
     text += "(c) 2014-2015 THUNDERBEAST GAMES LLC\n\n";
 
     text += "<color #D4FB79>Installed platforms and modules:</color>\n\n";

+ 15 - 0
Source/AtomicEditor/Source/UI/Modal/UINewProject.cpp

@@ -11,6 +11,8 @@
 #include <Atomic/Core/Context.h>
 #include <Atomic/UI/TBUI.h>
 
+#include "License/AELicenseSystem.h"
+
 #include "Resources/AEResourceOps.h"
 #include "AEPreferences.h"
 
@@ -129,6 +131,19 @@ bool UINewProject::OnEvent(const TBWidgetEvent &ev)
         }
         else if (ev.target->GetID() == TBIDC("project_3d"))
         {
+// BEGIN LICENSE MANAGEMENT
+            LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>();
+
+            if (licenseSystem->IsStarterLicense())
+            {
+                SharedPtr<UINewProject>(this);
+                UIModalOps* ops = GetSubsystem<UIModalOps>();
+                ops->Hide();
+                ops->ShowInfoModule3D();
+                return true;
+            }
+// END LICENSE MANAGEMENT
+
             projectType = 2;
         }
 

+ 1 - 0
Source/AtomicEditor/Source/UI/Modal/UIProgressModal.cpp

@@ -32,6 +32,7 @@ ProgressModal::ProgressModal(Context* context, const String &title, const String
     dimmer_ = new TBDimmer();
 
     window_ = new TBWindow();
+    window_->DisableCloseButton();
     tbui->LoadResourceFile(window_->GetContentRoot(), "AtomicEditor/editor/ui/progressmodal.tb.txt");
 
     window_->ResizeToFitContent();

+ 27 - 5
Source/AtomicEditor/Source/UI/UIWelcomeFrame.cpp

@@ -21,6 +21,8 @@ using namespace rapidjson;
 
 #include <Atomic/UI/TBUI.h>
 
+#include "License/AELicenseSystem.h"
+
 #include "../Project/ProjectUtils.h"
 #include "../AEPreferences.h"
 #include "../AEEditor.h"
@@ -63,7 +65,7 @@ WelcomeFrame::~WelcomeFrame()
 
 }
 
-void WelcomeFrame::AddExample(const String& name, const String& desc, const String& screenshot, const String& folder)
+void WelcomeFrame::AddExample(const String& name, const String& desc, const String& screenshot, const String& folder, const String& module)
 {
     TBLayout* exlayout = delegate_->GetWidgetByIDAndType<TBLayout>(TBIDC("examples_layout"));
     assert(exlayout);
@@ -156,6 +158,7 @@ void WelcomeFrame::AddExample(const String& name, const String& desc, const Stri
     info.name = name;
     info.folder = folder;
     info.id = id;
+    info.module = module;
 
     exampleInfo_.Push(info);
 
@@ -199,14 +202,19 @@ void WelcomeFrame::FillExamples()
         const Value::Member* desc = (*itr).FindMember("desc");
         const Value::Member* screenshot = (*itr).FindMember("screenshot");
         const Value::Member* folder = (*itr).FindMember("folder");
+        const Value::Member* module = (*itr).FindMember("module");
 
-        if (!name || !desc || !screenshot || !folder)
+        if (!name || !desc || !screenshot || !folder || !module)
             continue;
 
-        if (!name->value.IsString() || !desc->value.IsString() || !screenshot->value.IsString() || !folder->value.IsString())
+        if (!name->value.IsString() || !desc->value.IsString() || !screenshot->value.IsString()
+                                    || !folder->value.IsString() || !module->value.IsString())
+        {
             continue;
+        }
 
-        AddExample(name->value.GetString(), desc->value.GetString(), screenshot->value.GetString(), folder->value.GetString());
+        AddExample(name->value.GetString(), desc->value.GetString(),
+                   screenshot->value.GetString(), folder->value.GetString(), module->value.GetString());
     }
 
 }
@@ -218,7 +226,7 @@ bool WelcomeFrame::HandleExampleCopy(const String& name, const String& exampleFo
     String fullProjectPath = GetSubsystem<ProjectUtils>()->NewProjectFileDialog();
 
     if (!fullProjectPath.Length())
-        return true;
+        return false;
 
     String projectPath;
     String fileName;
@@ -332,6 +340,20 @@ bool WelcomeFrame::OnEvent(const TBWidgetEvent &ev)
                     {
                         if (ev.target->GetID() == (*itr).id)
                         {
+
+// BEGIN LICENSE MANAGEMENT
+                            LicenseSystem* licenseSystem = GetSubsystem<LicenseSystem>();
+                            if (licenseSystem->IsStarterLicense())
+                            {
+                                if ((*itr).module == "3D")
+                                {
+                                    UIModalOps* ops = GetSubsystem<UIModalOps>();
+                                    ops->ShowInfoModule3D();
+                                    return true;
+                                }
+                            }
+// END LICENSE MANAGEMENT
+
                             String projectPath;
                             if (HandleExampleCopy((*itr).name, (*itr).folder, projectPath))
                             {

+ 2 - 1
Source/AtomicEditor/Source/UI/UIWelcomeFrame.h

@@ -37,10 +37,11 @@ private:
     {
         String name;
         String folder;
+        String module;
         TBID id;
     };
 
-    void AddExample(const String& name, const String& desc, const String& screenshot, const String &folder);
+    void AddExample(const String& name, const String& desc, const String& screenshot, const String &folder, const String &module);
     void FillExamples();
     bool HandleExampleCopy(const String& name, const String& exampleFolder, String &atomicProjectFile);    
 

+ 2 - 0
Source/ThirdParty/TurboBadger/tb_window.h

@@ -91,6 +91,8 @@ public:
 		shouldn't have any title bar) */
 	int GetTitleHeight();
 
+    void DisableCloseButton() { m_close_button.SetVisibilility(WIDGET_VISIBILITY_GONE); }
+
 	virtual TBRect GetPaddingRect();
 	virtual PreferredSize OnCalculatePreferredSize(const SizeConstraints &constraints);