diff --git a/Parts.png b/Parts.png new file mode 100644 index 0000000..6a0cafe Binary files /dev/null and b/Parts.png differ diff --git a/content/sounds/clickfast.wav b/content/sounds/clickfast.wav new file mode 100644 index 0000000..08cbbf7 Binary files /dev/null and b/content/sounds/clickfast.wav differ diff --git a/content/sounds/flashbulb.wav b/content/sounds/flashbulb.wav new file mode 100644 index 0000000..5fa5536 Binary files /dev/null and b/content/sounds/flashbulb.wav differ diff --git a/src/include/Enum.h b/src/include/Enum.h index 0643d95..62b009c 100644 --- a/src/include/Enum.h +++ b/src/include/Enum.h @@ -37,7 +37,7 @@ namespace Enum enum Value { NoSound = 0, Victory = 1, Boing = 2, Bomb = 3, Ping = 4, Break = 5, Splat = 6, Swoosh = 7, - Snap = 8, Page = 9 + Snap = 8, Page = 9, Click = 10, Clock = 11, Step = 12, StepOn = 13, }; } } \ No newline at end of file diff --git a/src/source/Application.cpp b/src/source/Application.cpp index 2d92505..838adcc 100644 --- a/src/source/Application.cpp +++ b/src/source/Application.cpp @@ -8,6 +8,7 @@ #include "DataModelV2/ImageButtonInstance.h" #include "DataModelV2/DataModelInstance.h" #include "DataModelV2/GuiRootInstance.h" +#include "DataModelV2/SoundService.h" #include "XplicitNgine/XplicitNgine.h" #include "CameraController.h" #include "AudioPlayer.h" @@ -512,7 +513,7 @@ void Application::onMouseWheel(int x,int y,short delta) if (mouseOnScreen==true) if (cameraController.onMouseWheel(x, y, delta)) { - AudioPlayer::playSound(cameraSound); + _dataModel->getSoundService()->playSound(_dataModel->getSoundService()->findFirstChild("Step")); } tool->onMouseScroll(mouse); } diff --git a/src/source/DataModelV2/DataModelInstance.cpp b/src/source/DataModelV2/DataModelInstance.cpp index 8fe3380..5c25dc1 100644 --- a/src/source/DataModelV2/DataModelInstance.cpp +++ b/src/source/DataModelV2/DataModelInstance.cpp @@ -593,7 +593,7 @@ bool DataModelInstance::getOpen() of.lpstrFile = szFile ; of.lpstrFile[0]='\0'; of.nMaxFile=500; - of.lpstrTitle="Hello"; + of.lpstrTitle="Open"; of.Flags = OFN_FILEMUSTEXIST; ShowCursor(TRUE); BOOL file = GetOpenFileName(&of); @@ -616,7 +616,7 @@ bool DataModelInstance::getOpenModel() of.lpstrFile = szFile ; of.lpstrFile[0]='\0'; of.nMaxFile=500; - of.lpstrTitle="Hello"; + of.lpstrTitle="Open"; of.Flags = OFN_FILEMUSTEXIST; ShowCursor(TRUE); BOOL file = GetOpenFileName(&of); diff --git a/src/source/DataModelV2/GuiRootInstance.cpp b/src/source/DataModelV2/GuiRootInstance.cpp index 63e9d2a..6e2f46c 100644 --- a/src/source/DataModelV2/GuiRootInstance.cpp +++ b/src/source/DataModelV2/GuiRootInstance.cpp @@ -6,6 +6,7 @@ #include "DataModelV2/ImageButtonInstance.h" #include "DataModelV2/ToggleImageButtonInstance.h" #include "DataModelV2/GuiRootInstance.h" +#include "DataModelV2/SelectionService.h" #include "DataModelV2/ImageButtonInstance.h" #include "Globals.h" #include "StringFunctions.h" @@ -502,6 +503,9 @@ void GuiRootInstance::update() Instance * obj3 = this->findFirstChild("UnGroup"); Instance * obj4 = this->findFirstChild("Rotate"); Instance * obj5 = this->findFirstChild("Tilt"); + + SelectionService* SelectionSvc = g_dataModel->getSelectionService(); + if(obj != NULL && obj2 != NULL && obj3 != NULL && obj4 !=NULL && obj5 != NULL && obj6 != NULL) { BaseButtonInstance* button = (BaseButtonInstance*)obj; @@ -516,8 +520,8 @@ void GuiRootInstance::update() button4->disabled = true; button5->disabled = true; button6->disabled = true; - for(size_t i = 0; i < g_dataModel->getSelectionService()->getSelection().size(); i++) - if(g_dataModel->getSelectionService()->getSelection()[i]->canDelete) + for(size_t i = 0; i < SelectionSvc->getSelection().size(); i++) + if(SelectionSvc->getSelection()[i]->canDelete) { button->disabled = false; button4->disabled = false; @@ -525,11 +529,11 @@ void GuiRootInstance::update() button6->disabled = false; - if (g_dataModel->getSelectionService()->getSelection().size() > 1){ + if (SelectionSvc->getSelection().size() > 1){ button2->disabled = false; } - if (g_dataModel->getSelectionService()->getSelection()[i]->getClassName() == "GroupInstance"){ + if (dynamic_cast(SelectionSvc->getSelection()[i])){ button3->disabled = false; } diff --git a/src/source/DataModelV2/PartInstance.cpp b/src/source/DataModelV2/PartInstance.cpp index 8463f2b..fce479e 100644 --- a/src/source/DataModelV2/PartInstance.cpp +++ b/src/source/DataModelV2/PartInstance.cpp @@ -495,6 +495,14 @@ static TCHAR* strSoundType(int option) return "Swoosh"; case Enum::Sound::Page: return "Page"; + case Enum::Sound::Click: + return "Click"; + case Enum::Sound::Clock: + return "Clock"; + case Enum::Sound::Step: + return "Step"; + case Enum::Sound::StepOn: + return "StepOn"; } return "NoSound"; } @@ -521,6 +529,14 @@ static Enum::Sound::Value EnumOnTouchSoundType(TCHAR* option) return Enum::Sound::Ping; if(strcmp("Snap", option) == 0) return Enum::Sound::Snap; + if(strcmp("Click", option) == 0) + return Enum::Sound::Click; + if(strcmp("Clock", option) == 0) + return Enum::Sound::Clock; + if(strcmp("Step", option) == 0) + return Enum::Sound::Step; + if(strcmp("StepOn", option) == 0) + return Enum::Sound::StepOn; return Enum::Sound::NoSound; } @@ -585,6 +601,18 @@ void PartInstance::onTouch() case Enum::Sound::Swoosh: sndService->playSound(sndService->findFirstChild("Swoosh")); break; + case Enum::Sound::Click: + sndService->playSound(sndService->findFirstChild("Click")); + break; + case Enum::Sound::Clock: + sndService->playSound(sndService->findFirstChild("Clock")); + break; + case Enum::Sound::Step: + sndService->playSound(sndService->findFirstChild("Step")); + break; + case Enum::Sound::StepOn: + sndService->playSound(sndService->findFirstChild("StepOn")); + break; } } @@ -728,7 +756,7 @@ std::vector PartInstance::getProperties() "What sound plays when touched", (LPARAM)strSoundType(OnTouchSound), PIT_COMBO, - TEXT("NoSound\0Victory\0Boing\0Break\0Snap\0Bomb\0Splat\0Page\0Ping\0Swoosh\0") + TEXT("NoSound\0Victory\0Boing\0Break\0Snap\0Bomb\0Splat\0Page\0Ping\0Swoosh\0Click\0Clock\0Step\0StepOn") )); sprintf_s(changeScoreTxt, "%d", changeScore); diff --git a/src/source/DataModelV2/SoundService.cpp b/src/source/DataModelV2/SoundService.cpp index bd26307..7a6b3b8 100644 --- a/src/source/DataModelV2/SoundService.cpp +++ b/src/source/DataModelV2/SoundService.cpp @@ -67,6 +67,30 @@ SoundService::SoundService() stockSound->setName("Page"); stockSound->setSoundId("/content/sounds/pageturn.wav"); stockSound->setParent(this); + + // Click + stockSound = new SoundInstance(); + stockSound->setName("Click"); + stockSound->setSoundId("/content/sounds/switch.wav"); + stockSound->setParent(this); + + // Clock + stockSound = new SoundInstance(); + stockSound->setName("Clock"); + stockSound->setSoundId("/content/sounds/clickfast.wav"); + stockSound->setParent(this); + + // Step + stockSound = new SoundInstance(); + stockSound->setName("Step"); + stockSound->setSoundId("/content/sounds/SWITCH3.wav"); + stockSound->setParent(this); + + // StepOn + stockSound = new SoundInstance(); + stockSound->setName("StepOn"); + stockSound->setSoundId("/content/sounds/flashbulb.wav"); + stockSound->setParent(this); } SoundService::~SoundService(void)