changeset 28:13e53b74aed7

More drag and drop work
author koryspansel
date Mon, 19 Sep 2011 11:27:34 -0700
parents 5656c8e382fc
children 4bb3bcee0601
files LightClone/LightClone.vcproj LightClone/Source/World.cpp LightClone/Source/World.h LightClone/ToDo.txt
diffstat 4 files changed, 234 insertions(+), 155 deletions(-) [+]
line wrap: on
line diff
--- a/LightClone/LightClone.vcproj	Fri Sep 16 18:21:36 2011 -0700
+++ b/LightClone/LightClone.vcproj	Mon Sep 19 11:27:34 2011 -0700
@@ -181,18 +181,10 @@
 				>
 			</File>
 			<File
-				RelativePath=".\Source\Camera.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\CameraController.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\Source\Clock.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\Code.cpp"
 				>
 			</File>
@@ -201,38 +193,10 @@
 				>
 			</File>
 			<File
-				RelativePath=".\Source\Core.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\Environment.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\Source\Event.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\EventSink.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\EventSource.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\EventSystem.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\GraphicsDevice.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\InputManager.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\Loader.cpp"
 				>
 			</File>
@@ -245,34 +209,14 @@
 				>
 			</File>
 			<File
-				RelativePath=".\Source\RenderContext.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\ResourceManager.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\Tower.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\Source\Util.cpp"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\VertexTypes.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\VirtualMachine.cpp"
 				>
 			</File>
 			<File
-				RelativePath=".\Source\Window.cpp"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\World.cpp"
 				>
 			</File>
@@ -312,6 +256,66 @@
 					>
 				</File>
 			</Filter>
+			<Filter
+				Name="Core"
+				>
+				<File
+					RelativePath=".\Source\Camera.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\Clock.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\Core.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\Event.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\EventSink.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\EventSource.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\EventSystem.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\GraphicsDevice.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\InputManager.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\RenderContext.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\ResourceManager.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\Util.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\VertexTypes.cpp"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\Window.cpp"
+					>
+				</File>
+			</Filter>
 		</Filter>
 		<Filter
 			Name="Header Files"
@@ -319,26 +323,14 @@
 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
 			>
 			<File
-				RelativePath=".\Source\ArrayList.h"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\Bot.h"
 				>
 			</File>
 			<File
-				RelativePath=".\Source\Camera.h"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\CameraController.h"
 				>
 			</File>
 			<File
-				RelativePath=".\Source\Clock.h"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\Code.h"
 				>
 			</File>
@@ -347,50 +339,10 @@
 				>
 			</File>
 			<File
-				RelativePath=".\Source\Core.h"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\Environment.h"
 				>
 			</File>
 			<File
-				RelativePath=".\Source\Event.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\EventSink.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\EventSource.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\EventSystem.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\FixedString.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\GraphicsDevice.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\HashMap.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\HashMapIterator.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\InputManager.h"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\Loader.h"
 				>
 			</File>
@@ -399,38 +351,14 @@
 				>
 			</File>
 			<File
-				RelativePath=".\Source\RenderContext.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\ResourceManager.h"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\Tower.h"
 				>
 			</File>
 			<File
-				RelativePath=".\Source\Types.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\Util.h"
-				>
-			</File>
-			<File
-				RelativePath=".\Source\VertexTypes.h"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\VirtualMachine.h"
 				>
 			</File>
 			<File
-				RelativePath=".\Source\Window.h"
-				>
-			</File>
-			<File
 				RelativePath=".\Source\World.h"
 				>
 			</File>
@@ -474,6 +402,86 @@
 					>
 				</File>
 			</Filter>
+			<Filter
+				Name="Core"
+				>
+				<File
+					RelativePath=".\Source\ArrayList.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\Camera.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\Clock.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\Core.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\Event.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\EventSink.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\EventSource.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\EventSystem.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\FixedString.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\GraphicsDevice.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\HashMap.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\HashMapIterator.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\InputManager.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\RenderContext.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\ResourceManager.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\Types.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\Util.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\VertexTypes.h"
+					>
+				</File>
+				<File
+					RelativePath=".\Source\Window.h"
+					>
+				</File>
+			</Filter>
 		</Filter>
 		<Filter
 			Name="Resource Files"
--- a/LightClone/Source/World.cpp	Fri Sep 16 18:21:36 2011 -0700
+++ b/LightClone/Source/World.cpp	Mon Sep 19 11:27:34 2011 -0700
@@ -281,34 +281,77 @@
 	ErrorCode eCode = kInterface.Initialize(pResourceManager, pInputManager);
 	if(eCode == Error_Success)
 	{
-		GuiImage* pBackground = new GuiImage();
+		pBackground = new GuiImage();
 		pBackground->Initialize(pResourceManager);
 		pBackground->SetTexture("Data\\Textures\\Background01.tga", true);
 		pBackground->SetPosition(ScreenSizeX - pBackground->GetWidth(), 0.0f);
 
-		//GuiImage* pToolbar = new GuiImage();
+		pToolbar = new GuiImage();
+		pToolbar->Initialize(pResourceManager);
+		pToolbar->SetTexture("Data\\Textures\\Panel.tga", true);
+		pToolbar->SetPosition(1000.0f, 100.0f);
+
+		for(uint32 i = 0; i < sizeof(pToolbarSlot) / sizeof(pToolbarSlot[0]); ++i)
+		{
+			//TODO: Use correct toolbar images
+			pToolbarSlot[i] = new GuiImage();
+			pToolbarSlot[i]->Initialize(pResourceManager);
+			pToolbarSlot[i]->SetTexture("Data\\Textures\\Slot.tga", true);
+			pToolbarSlot[i]->SetPosition(1000.0f, 100.0f);	//TODO: Setup correct rows & columns
+
+			pToolbar->Add(pToolbarSlot[i]);
+		}
+
+		pFunctionMain = new GuiImage();
+		pFunctionMain->Initialize(pResourceManager);
+		pFunctionMain->SetTexture("Data\\Textures\\Panel.tga", true);
+		pFunctionMain->SetPosition(1000.0f, 100.0f);
 
-		GuiButton* pButtonPlay = new GuiButton();
+		for(uint32 i = 0; i < sizeof(pToolbarSlot) / sizeof(pToolbarSlot[0]); ++i)
+		{
+			pFunctionMainSlot[i] = new GuiImage();
+			pFunctionMainSlot[i]->Initialize(pResourceManager);
+			pFunctionMainSlot[i]->SetTexture("Data\\Textures\\Slot.tga", true);
+			pFunctionMainSlot[i]->SetPosition(1000.0f, 100.0f);	//TODO: Setup correct rows & columns
+
+			pFunctionMain->Add(pFunctionMainSlot[i]);
+		}
+
+		pFunctionA = new GuiImage();
+		pFunctionA->Initialize(pResourceManager);
+		pFunctionA->SetTexture("Data\\Textures\\Panel.tga", true);
+		pFunctionA->SetPosition(1000.0f, 400.0f);
+
+		//TODO: Add slots for function a
+
+		pFunctionB = new GuiImage();
+		pFunctionB->Initialize(pResourceManager);
+		pFunctionB->SetTexture("Data\\Textures\\Panel.tga", true);
+		pFunctionB->SetPosition(1000.0f, 600.0f);
+
+		//TODO: Add slots for function b
+
+		pButtonPlay = new GuiButton();
 		pButtonPlay->Initialize(pResourceManager);
 		pButtonPlay->SetTexture(GuiButtonState_Normal, "Data\\Textures\\Play.tga", true);
 		pButtonPlay->SetPosition(1023.0f + 0.0f * 54.0f, 640.0f);
 		pButtonPlay->Subscribe(GuiButton::EventClick, &World::OnPlay, this);
 
-		GuiButton* pButtonStop = new GuiButton();
+		pButtonStop = new GuiButton();
 		pButtonStop->Initialize(pResourceManager);
 		pButtonStop->SetTexture(GuiButtonState_Normal, "Data\\Textures\\Stop.tga", true);
 		pButtonStop->SetPosition(1023.0f + 1.0f * 54.0f, 640.0f);
 		pButtonStop->Subscribe(GuiButton::EventClick, &World::OnStop, this);
 
 		/*
-		GuiButton* pButtonReset = new GuiButton();
+		pButtonReset = new GuiButton();
 		pButtonReset->Initialize(pResourceManager);
 		pButtonReset->SetTexture(GuiButtonState_Normal, "Data\\Textures\\Reset.tga", true);
 		pButtonReset->SetPosition(1023.0f + 2.0f * 54.0f, 640.0f.0f);
 		pButtonReset->Subscribe(GuiButton::EventClick, &World::OnReset, this);
 		*/
 
-		GuiButton* pButtonExit = new GuiButton();
+		pButtonExit = new GuiButton();
 		pButtonExit->Initialize(pResourceManager);
 		pButtonExit->SetTexture(GuiButtonState_Normal, "Data\\Textures\\Exit.tga", true);
 		pButtonExit->SetPosition(1023.0f + 3.0f * 54.0f, 640.0f);
--- a/LightClone/Source/World.h	Fri Sep 16 18:21:36 2011 -0700
+++ b/LightClone/Source/World.h	Mon Sep 19 11:27:34 2011 -0700
@@ -14,10 +14,7 @@
 #include "Code.h"
 #include "Loader.h"
 #include "CameraController.h"
-//#include "DragController.h"
 #include "InputManager.h"
-//#include "ButtonPane.h"
-//#include "Dialog.h"
 #include "GuiInterface.h"
 #include "GuiImage.h"
 #include "GuiButton.h"
@@ -88,39 +85,69 @@
 	GuiInterface kInterface;
 
 	/*
-	 * kToolbar
+	 * pBackground
 	 */
-	//ButtonPane kToolbar;
+	GuiImage* pBackground;
+
+	/*
+	 * pButtonPlay
+	 */
+	GuiButton* pButtonPlay;
 
 	/*
-	 * kMain
+	 * pButtonStop
 	 */
-	//ButtonPane kMain;
+	GuiButton* pButtonStop;
 
 	/*
-	 * kFunction
+	 * pButtonReset
+	 */
+	GuiButton* pButtonReset;
+
+	/*
+	 * pButtonExit
 	 */
-	//ButtonPane kFunction;
+	GuiButton* pButtonExit;
+
+	/*
+	 * pToolbar
+	 */
+	GuiImage* pToolbar;
 
 	/*
-	 * kArrowBounds
+	 * pToolbarSlot
+	 */
+	GuiImage* pToolbarSlot[8];
+
+	/*
+	 * pFunctionMain
 	 */
-	//Rectangle2 kArrowBounds[2];
+	GuiImage* pFunctionMain;
+
+	/*
+	 * pFunctionMainSlot
+	 */
+	GuiImage* pFunctionMainSlot[16];
 
 	/*
-	 * kDialog1Bounds
+	 * pFunctionA
 	 */
-	//Rectangle2 kDialog1Bounds[1];
+	GuiImage* pFunctionA;
 
 	/*
-	 * kDialog2Bounds
+	 * pFunctionASlot
 	 */
-	//Rectangle2 kDialog2Bounds[2];
+	GuiImage* pFunctionASlot[16];
 
 	/*
-	 * kDialog
+	 * pFunctionB
 	 */
-	//Dialog kDialog;
+	GuiImage* pFunctionB;
+
+	/*
+	 * pFunctionBSlot
+	 */
+	GuiImage* pFunctionBSlot[16];
 
 	/*
 	 * pLevelDialog
--- a/LightClone/ToDo.txt	Fri Sep 16 18:21:36 2011 -0700
+++ b/LightClone/ToDo.txt	Mon Sep 19 11:27:34 2011 -0700
@@ -9,4 +9,5 @@
 9.	Add button to clear code panes
 10. Implement drag and drop
 	a.	Add drag and drop interface to GuiInterface and move handling into subclasses
+	b.	Support creating a new element when dragging and destroying it when done
 11. Implement gui batching
\ No newline at end of file