diff --git a/Listener_cpp/ButtonListener.cpp b/Listener_cpp/ButtonListener.cpp deleted file mode 100644 index c02b555..0000000 --- a/Listener_cpp/ButtonListener.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "DataModelV2/BaseButtonInstance.h" -#include "Listener/ButtonListener.h" - - -ButtonListener::ButtonListener() -{ - doDelete = true; -} - -ButtonListener::~ButtonListener(void) -{ -} - -void ButtonListener::onButton1MouseClick(BaseButtonInstance* button) -{ -} - diff --git a/Listener_cpp/CameraButtonListener.cpp b/Listener_cpp/CameraButtonListener.cpp deleted file mode 100644 index 6007ef6..0000000 --- a/Listener_cpp/CameraButtonListener.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "Listener/CameraButtonListener.h" -#include "Globals.h" -#include "AudioPlayer.h" -#include "Application.h" - -void CameraButtonListener::onButton1MouseClick(BaseButtonInstance* button) -{ - AudioPlayer::playSound(cameraSound); - CoordinateFrame frame = g_usableApp->cameraController.getCamera()->getCoordinateFrame(); - if(button->name == "CenterCam" && g_dataModel->getSelectionService()->getSelection().size() > 0) - g_usableApp->cameraController.centerCamera(g_dataModel->getSelectionService()->getSelection()[0]); - else if(button->name == "ZoomIn") - g_usableApp->cameraController.Zoom(1); - else if(button->name == "ZoomOut") - g_usableApp->cameraController.Zoom(-1); - else if(button->name == "PanRight") - g_usableApp->cameraController.panRight(); - else if(button->name == "PanLeft") - g_usableApp->cameraController.panLeft(); - else if(button->name == "TiltUp") - g_usableApp->cameraController.tiltUp(); - else if(button->name == "TiltDown") - g_usableApp->cameraController.tiltDown(); -} \ No newline at end of file diff --git a/Listener_cpp/DeleteListener.cpp b/Listener_cpp/DeleteListener.cpp deleted file mode 100644 index d76de77..0000000 --- a/Listener_cpp/DeleteListener.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "Listener/DeleteListener.h" -#include "Globals.h" -#include "Application.h" - -void DeleteListener::onButton1MouseClick(BaseButtonInstance* button) -{ - g_usableApp->deleteInstance(); -} \ No newline at end of file diff --git a/Listener_cpp/GUDButtonListener.cpp b/Listener_cpp/GUDButtonListener.cpp deleted file mode 100644 index 53dbd0d..0000000 --- a/Listener_cpp/GUDButtonListener.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include -#include "Application.h" -#include "Globals.h" -#include "DataModelV2/SelectionService.h" -#include "Listener/GUDButtonListener.h" -#include "DataModelV2/SoundService.h" - -void GUDButtonListener::onButton1MouseClick(BaseButtonInstance* button) -{ - SelectionService* selectionService = g_dataModel->getSelectionService(); - SoundService* soundService = g_dataModel->getSoundService(); - - bool cont = false; - for(size_t i = 0; i < selectionService->getSelection().size(); i++) - if(selectionService->getSelection()[i]->canDelete) - { - cont = true; - break; - } - - if (cont) - { - if(button->disabled == false){ - soundService->playSound(soundService->findFirstChild("Ping")); - } - - if(button->name == "Duplicate") - { - std::vector newinst; - for(size_t i = 0; i < selectionService->getSelection().size(); i++) - { - if(selectionService->getSelection()[i]->canDelete) - { - Instance* tempinst = selectionService->getSelection()[i]; - - Instance* clonedInstance = selectionService->getSelection()[i]->clone(); - - if (clonedInstance->getClassName() == "PVInstance"){ - PartInstance* Part = dynamic_cast(clonedInstance); - Part->setPosition(Part->getPosition() + G3D::Vector3(0, Part->getSize().y, 0)); - } - - newinst.push_back(clonedInstance); - } - } - selectionService->clearSelection(); - selectionService->addSelected(newinst); - } - else if(button->name == "Group") - { - if (selectionService->getSelection().size() > 1){ - GroupInstance * inst = new GroupInstance(); - inst->setParent(g_dataModel->getWorkspace()); - for(size_t i = 0; i < selectionService->getSelection().size(); i++) - { - if(selectionService->getSelection()[i]->canDelete) - { - selectionService->getSelection()[i]->setParent(inst); - if(PartInstance* part = dynamic_cast(selectionService->getSelection()[i])) - { - inst->primaryPart = part; - } - } - } - selectionService->clearSelection(); - selectionService->addSelected(inst); - } - } - else if(button->name == "UnGroup") - { - std::vector newinst; - for(size_t i = 0; i < selectionService->getSelection().size(); i++) - { - Instance* selection = selectionService->getSelection()[i]; - - if(GroupInstance* model = dynamic_cast(selection)) - { - newinst = model->unGroup(); - model->setParent(NULL); - delete model; - model = NULL; - } - } - selectionService->clearSelection(); - selectionService->addSelected(newinst); - } - } -} \ No newline at end of file diff --git a/Listener_cpp/MenuButtonListener.cpp b/Listener_cpp/MenuButtonListener.cpp deleted file mode 100644 index ca9df6e..0000000 --- a/Listener_cpp/MenuButtonListener.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include "Listener/MenuButtonListener.h" -#include "DataModelV2/ToggleImageButtonInstance.h" -#include "Application.h" -#include "Globals.h" - -bool menuOpen = false; - -void MenuButtonListener::onButton1MouseClick(BaseButtonInstance* button) -{ - if(button->name == "go") - { - g_dataModel->toggleRun(); - ((ToggleImageButtonInstance*)button)->checked = g_dataModel->isRunning(); - } - else if(button->name == "file") - { - HMENU mainmenu = CreatePopupMenu(); - AppendMenu(mainmenu, MF_STRING, 100, "New"); - AppendMenu(mainmenu, MF_STRING, 101, "Open..."); - AppendMenu(mainmenu, MF_STRING, 102, "Close"); - AppendMenu(mainmenu, MF_SEPARATOR, 0, NULL); - - POINT p; - GetCursorPos(&p); - int menuClick = TrackPopupMenu(mainmenu, TPM_LEFTBUTTON | TPM_RETURNCMD, p.x, p.y, 0, Globals::mainHwnd, 0); - switch (menuClick) - { - case 100: - g_usableApp->clearInstances(); - g_usableApp->onInit(); - break; - case 101: - g_dataModel->getOpen(); - break; - case 102: - g_usableApp->QuitApp(); - break; - } - } - else if(button->name == "view") - { - HMENU mainmenu = CreatePopupMenu(); - AppendMenu(mainmenu, MF_STRING, 103, "Image Server Model View"); - - POINT p; - GetCursorPos(&p); - int menuClick = TrackPopupMenu(mainmenu, TPM_LEFTBUTTON | TPM_RETURNCMD, p.x, p.y, 0, Globals::mainHwnd, 0); - switch (menuClick) - { - case 103: - g_dataModel->getThumbnailGenerator()->click("PNG", 512, 512, true); - break; - } - } - else if (button->name == "insert"){ - HMENU mainmenu = CreatePopupMenu(); - AppendMenu(mainmenu, MF_STRING, 104, "Model..."); - - POINT p; - GetCursorPos(&p); - int menuClick = TrackPopupMenu(mainmenu, TPM_LEFTBUTTON | TPM_RETURNCMD, p.x, p.y, 0, Globals::mainHwnd, 0); - switch (menuClick) - { - case 104: - g_dataModel->getOpenModel(); - break; - } - } - else if (button->name == "MENU") - { - menuOpen = !menuOpen; - ShowWindow(g_usableApp->_propWindow->_hwndProp, menuOpen); - if(TextButtonInstance* textButton = dynamic_cast(button)) - { - if(menuOpen) - { - textButton->textColor = Color3(0,1,1); - textButton->textColorOvr = Color3(0,1,1); - } - else - { - textButton->textColor = Color3::white(); - textButton->textColorOvr = Color3::white(); - } - } - } -} \ No newline at end of file diff --git a/Listener_cpp/ModeSelectionListener.cpp b/Listener_cpp/ModeSelectionListener.cpp deleted file mode 100644 index 6ce4a63..0000000 --- a/Listener_cpp/ModeSelectionListener.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "Globals.h" -#include "DataModelV2/Instance.h" -#include "Listener/ModeSelectionListener.h" -#include "Application.h" -#include "Tool/ArrowTool.h" -#include "Tool/DraggerTool.h" - -void ModeSelectionListener::onButton1MouseClick(BaseButtonInstance* button) -{ - //CoordinateFrame frame = g_usableApp->g3dCamera.getCoordinateFrame(); - int mode = g_usableApp->getMode(); - - std::vector instances_2D = g_dataModel->getGuiRoot()->getAllChildren(); - for(size_t i = 0; i < instances_2D.size(); i++) - { - if(instances_2D.at(i)->name == "Cursor" || instances_2D.at(i)->name == "Resize" || instances_2D.at(i)->name == "Arrows") - { - BaseButtonInstance* button = (BaseButtonInstance*)instances_2D.at(i); - button->selected = false; - } - } - - button->selected = true; - if(button->name == "Cursor") - g_usableApp->changeTool(new ArrowTool()); - else if(button->name == "Resize") - { - g_usableApp->setMode(RESIZE); - } - else if(button->name == "Arrows") - { - g_usableApp->changeTool(new DraggerTool()); - g_usableApp->setMode(NULL); - } -} diff --git a/Listener_cpp/RotateButtonListener.cpp b/Listener_cpp/RotateButtonListener.cpp deleted file mode 100644 index 2c143bd..0000000 --- a/Listener_cpp/RotateButtonListener.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "DataModelV2/BaseButtonInstance.h" -#include "Listener/RotateButtonListener.h" -#include "Globals.h" -#include "AudioPlayer.h" - -void RotateButtonListener::onButton1MouseClick(BaseButtonInstance* button) -{ - if(g_dataModel->getSelectionService()->getSelection().size() > 0) - { - Instance* selectedInstance = g_dataModel->getSelectionService()->getSelection()[0]; - AudioPlayer::playSound(clickSound); - if(PartInstance* part = dynamic_cast(selectedInstance)) - { - if(button->name == "Tilt") - part->setCFrame(part->getCFrame()*Matrix3::fromEulerAnglesXYZ(0,0,toRadians(90))); - else if(button->name == "Rotate") - part->setCFrame(part->getCFrame()*Matrix3::fromEulerAnglesXYZ(0,toRadians(90),0)); - } - } - -} diff --git a/Listener_cpp/ToolbarListener.cpp b/Listener_cpp/ToolbarListener.cpp deleted file mode 100644 index 22cb981..0000000 --- a/Listener_cpp/ToolbarListener.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "Listener/ToolbarListener.h" -#include "Globals.h" -#include "StringFunctions.h" -#include "Application.h" - -void ToolbarListener::onButton1MouseClick(BaseButtonInstance* btn) -{ - if(TextButtonInstance* button = dynamic_cast(btn)) - { - for(size_t i = 0; i < btns.size(); i++) - btns[i]->selected = false; - button->selected = true; - if(button->title == "Model") g_usableApp->navigateToolbox("http://androdome.com/res/ClientToolbox.php"); - else if(button->title == "Surface") g_usableApp->navigateToolbox(GetFileInPath("/content/page/surface.html")); - else if(button->title == "Color") g_usableApp->navigateToolbox(GetFileInPath("/content/page/color.html")); - else if(button->title == "Controller") g_usableApp->navigateToolbox(GetFileInPath("/content/page/controller.html")); - else if(button->title == "Hopper") g_usableApp->navigateToolbox(GetFileInPath("/content/page/hopper.html")); - } -} -void ToolbarListener::addButtonRef(BaseButtonInstance* button) -{ - btns.push_back(button); -} \ No newline at end of file diff --git a/Listener_h/ButtonListener.h b/Listener_h/ButtonListener.h deleted file mode 100644 index f94453a..0000000 --- a/Listener_h/ButtonListener.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once -//#include "Application.h" -#include "DataModelV2/BaseButtonInstance.h" - -class BaseButtonInstance; - -class ButtonListener -{ - public: - ButtonListener(); - ~ButtonListener(void); - virtual void onButton1MouseClick(BaseButtonInstance*); - bool doDelete; - //virtual void onMouseOver(); //TODO - //virtual void onMouseOut(); //TODO - //virtual void onButton1MouseDown(); //TODO - //virtual void onButton1MouseUp(); //TODO - //virtual void onButton2MouseClick(); //TODO - //virtual void onButton2MouseDown(); //TODO - //virtual void onButton2MouseUp(); //TODO - //What to do now... -}; diff --git a/Listener_h/CameraButtonListener.h b/Listener_h/CameraButtonListener.h deleted file mode 100644 index 27a1aac..0000000 --- a/Listener_h/CameraButtonListener.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include "ButtonListener.h" - -class CameraButtonListener : public ButtonListener { -public: - void onButton1MouseClick(BaseButtonInstance*); -}; \ No newline at end of file diff --git a/Listener_h/DeleteListener.h b/Listener_h/DeleteListener.h deleted file mode 100644 index 4d355ef..0000000 --- a/Listener_h/DeleteListener.h +++ /dev/null @@ -1,6 +0,0 @@ -#include "ButtonListener.h" - -class DeleteListener : public ButtonListener { -public: - void onButton1MouseClick(BaseButtonInstance*); -}; \ No newline at end of file diff --git a/Listener_h/GUDButtonListener.h b/Listener_h/GUDButtonListener.h deleted file mode 100644 index d151e2c..0000000 --- a/Listener_h/GUDButtonListener.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include "ButtonListener.h" - -class GUDButtonListener : public ButtonListener { -public: - void onButton1MouseClick(BaseButtonInstance*); -}; diff --git a/Listener_h/MenuButtonListener.h b/Listener_h/MenuButtonListener.h deleted file mode 100644 index 8216961..0000000 --- a/Listener_h/MenuButtonListener.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include "buttonlistener.h" -class MenuButtonListener : - public ButtonListener -{ -public: - void onButton1MouseClick(BaseButtonInstance*); -}; diff --git a/Listener_h/ModeSelectionListener.h b/Listener_h/ModeSelectionListener.h deleted file mode 100644 index 2c33d73..0000000 --- a/Listener_h/ModeSelectionListener.h +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once -#include "ButtonListener.h" - -#define CURSOR 0 -#define ARROWS 1 -#define RESIZE 2 - -class ModeSelectionListener : public ButtonListener { -public: - void onButton1MouseClick(BaseButtonInstance*); -}; diff --git a/Listener_h/RotateButtonListener.h b/Listener_h/RotateButtonListener.h deleted file mode 100644 index 3209702..0000000 --- a/Listener_h/RotateButtonListener.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once -#include "ButtonListener.h" - -class RotateButtonListener : public ButtonListener { -public: - void onButton1MouseClick(BaseButtonInstance*); -}; \ No newline at end of file diff --git a/Listener_h/ToolbarListener.h b/Listener_h/ToolbarListener.h deleted file mode 100644 index 21079a4..0000000 --- a/Listener_h/ToolbarListener.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once -#include "buttonlistener.h" -#pragma once -#include - -class ToolbarListener : public ButtonListener -{ -public: - void onButton1MouseClick(BaseButtonInstance* button); - void addButtonRef(BaseButtonInstance* button); -private: - std::vector btns; -};