dynamic casting, extra sounds, fixes
This commit is contained in:
BIN
content/sounds/clickfast.wav
Normal file
BIN
content/sounds/clickfast.wav
Normal file
Binary file not shown.
BIN
content/sounds/flashbulb.wav
Normal file
BIN
content/sounds/flashbulb.wav
Normal file
Binary file not shown.
@@ -37,7 +37,7 @@ namespace Enum
|
|||||||
enum Value {
|
enum Value {
|
||||||
NoSound = 0, Victory = 1, Boing = 2, Bomb = 3,
|
NoSound = 0, Victory = 1, Boing = 2, Bomb = 3,
|
||||||
Ping = 4, Break = 5, Splat = 6, Swoosh = 7,
|
Ping = 4, Break = 5, Splat = 6, Swoosh = 7,
|
||||||
Snap = 8, Page = 9
|
Snap = 8, Page = 9, Click = 10, Clock = 11, Step = 12, StepOn = 13,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "DataModelV2/ImageButtonInstance.h"
|
#include "DataModelV2/ImageButtonInstance.h"
|
||||||
#include "DataModelV2/DataModelInstance.h"
|
#include "DataModelV2/DataModelInstance.h"
|
||||||
#include "DataModelV2/GuiRootInstance.h"
|
#include "DataModelV2/GuiRootInstance.h"
|
||||||
|
#include "DataModelV2/SoundService.h"
|
||||||
#include "XplicitNgine/XplicitNgine.h"
|
#include "XplicitNgine/XplicitNgine.h"
|
||||||
#include "CameraController.h"
|
#include "CameraController.h"
|
||||||
#include "AudioPlayer.h"
|
#include "AudioPlayer.h"
|
||||||
@@ -512,7 +513,7 @@ void Application::onMouseWheel(int x,int y,short delta)
|
|||||||
if (mouseOnScreen==true)
|
if (mouseOnScreen==true)
|
||||||
if (cameraController.onMouseWheel(x, y, delta))
|
if (cameraController.onMouseWheel(x, y, delta))
|
||||||
{
|
{
|
||||||
AudioPlayer::playSound(cameraSound);
|
_dataModel->getSoundService()->playSound(_dataModel->getSoundService()->findFirstChild("Step"));
|
||||||
}
|
}
|
||||||
tool->onMouseScroll(mouse);
|
tool->onMouseScroll(mouse);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -593,7 +593,7 @@ bool DataModelInstance::getOpen()
|
|||||||
of.lpstrFile = szFile ;
|
of.lpstrFile = szFile ;
|
||||||
of.lpstrFile[0]='\0';
|
of.lpstrFile[0]='\0';
|
||||||
of.nMaxFile=500;
|
of.nMaxFile=500;
|
||||||
of.lpstrTitle="Hello";
|
of.lpstrTitle="Open";
|
||||||
of.Flags = OFN_FILEMUSTEXIST;
|
of.Flags = OFN_FILEMUSTEXIST;
|
||||||
ShowCursor(TRUE);
|
ShowCursor(TRUE);
|
||||||
BOOL file = GetOpenFileName(&of);
|
BOOL file = GetOpenFileName(&of);
|
||||||
@@ -616,7 +616,7 @@ bool DataModelInstance::getOpenModel()
|
|||||||
of.lpstrFile = szFile ;
|
of.lpstrFile = szFile ;
|
||||||
of.lpstrFile[0]='\0';
|
of.lpstrFile[0]='\0';
|
||||||
of.nMaxFile=500;
|
of.nMaxFile=500;
|
||||||
of.lpstrTitle="Hello";
|
of.lpstrTitle="Open";
|
||||||
of.Flags = OFN_FILEMUSTEXIST;
|
of.Flags = OFN_FILEMUSTEXIST;
|
||||||
ShowCursor(TRUE);
|
ShowCursor(TRUE);
|
||||||
BOOL file = GetOpenFileName(&of);
|
BOOL file = GetOpenFileName(&of);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "DataModelV2/ImageButtonInstance.h"
|
#include "DataModelV2/ImageButtonInstance.h"
|
||||||
#include "DataModelV2/ToggleImageButtonInstance.h"
|
#include "DataModelV2/ToggleImageButtonInstance.h"
|
||||||
#include "DataModelV2/GuiRootInstance.h"
|
#include "DataModelV2/GuiRootInstance.h"
|
||||||
|
#include "DataModelV2/SelectionService.h"
|
||||||
#include "DataModelV2/ImageButtonInstance.h"
|
#include "DataModelV2/ImageButtonInstance.h"
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "StringFunctions.h"
|
#include "StringFunctions.h"
|
||||||
@@ -502,6 +503,9 @@ void GuiRootInstance::update()
|
|||||||
Instance * obj3 = this->findFirstChild("UnGroup");
|
Instance * obj3 = this->findFirstChild("UnGroup");
|
||||||
Instance * obj4 = this->findFirstChild("Rotate");
|
Instance * obj4 = this->findFirstChild("Rotate");
|
||||||
Instance * obj5 = this->findFirstChild("Tilt");
|
Instance * obj5 = this->findFirstChild("Tilt");
|
||||||
|
|
||||||
|
SelectionService* SelectionSvc = g_dataModel->getSelectionService();
|
||||||
|
|
||||||
if(obj != NULL && obj2 != NULL && obj3 != NULL && obj4 !=NULL && obj5 != NULL && obj6 != NULL)
|
if(obj != NULL && obj2 != NULL && obj3 != NULL && obj4 !=NULL && obj5 != NULL && obj6 != NULL)
|
||||||
{
|
{
|
||||||
BaseButtonInstance* button = (BaseButtonInstance*)obj;
|
BaseButtonInstance* button = (BaseButtonInstance*)obj;
|
||||||
@@ -516,8 +520,8 @@ void GuiRootInstance::update()
|
|||||||
button4->disabled = true;
|
button4->disabled = true;
|
||||||
button5->disabled = true;
|
button5->disabled = true;
|
||||||
button6->disabled = true;
|
button6->disabled = true;
|
||||||
for(size_t i = 0; i < g_dataModel->getSelectionService()->getSelection().size(); i++)
|
for(size_t i = 0; i < SelectionSvc->getSelection().size(); i++)
|
||||||
if(g_dataModel->getSelectionService()->getSelection()[i]->canDelete)
|
if(SelectionSvc->getSelection()[i]->canDelete)
|
||||||
{
|
{
|
||||||
button->disabled = false;
|
button->disabled = false;
|
||||||
button4->disabled = false;
|
button4->disabled = false;
|
||||||
@@ -525,11 +529,11 @@ void GuiRootInstance::update()
|
|||||||
button6->disabled = false;
|
button6->disabled = false;
|
||||||
|
|
||||||
|
|
||||||
if (g_dataModel->getSelectionService()->getSelection().size() > 1){
|
if (SelectionSvc->getSelection().size() > 1){
|
||||||
button2->disabled = false;
|
button2->disabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_dataModel->getSelectionService()->getSelection()[i]->getClassName() == "GroupInstance"){
|
if (dynamic_cast<GroupInstance*>(SelectionSvc->getSelection()[i])){
|
||||||
button3->disabled = false;
|
button3->disabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -495,6 +495,14 @@ static TCHAR* strSoundType(int option)
|
|||||||
return "Swoosh";
|
return "Swoosh";
|
||||||
case Enum::Sound::Page:
|
case Enum::Sound::Page:
|
||||||
return "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";
|
return "NoSound";
|
||||||
}
|
}
|
||||||
@@ -521,6 +529,14 @@ static Enum::Sound::Value EnumOnTouchSoundType(TCHAR* option)
|
|||||||
return Enum::Sound::Ping;
|
return Enum::Sound::Ping;
|
||||||
if(strcmp("Snap", option) == 0)
|
if(strcmp("Snap", option) == 0)
|
||||||
return Enum::Sound::Snap;
|
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;
|
return Enum::Sound::NoSound;
|
||||||
}
|
}
|
||||||
@@ -585,6 +601,18 @@ void PartInstance::onTouch()
|
|||||||
case Enum::Sound::Swoosh:
|
case Enum::Sound::Swoosh:
|
||||||
sndService->playSound(sndService->findFirstChild("Swoosh"));
|
sndService->playSound(sndService->findFirstChild("Swoosh"));
|
||||||
break;
|
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<PROPGRIDITEM> PartInstance::getProperties()
|
|||||||
"What sound plays when touched",
|
"What sound plays when touched",
|
||||||
(LPARAM)strSoundType(OnTouchSound),
|
(LPARAM)strSoundType(OnTouchSound),
|
||||||
PIT_COMBO,
|
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);
|
sprintf_s(changeScoreTxt, "%d", changeScore);
|
||||||
|
|||||||
@@ -67,6 +67,30 @@ SoundService::SoundService()
|
|||||||
stockSound->setName("Page");
|
stockSound->setName("Page");
|
||||||
stockSound->setSoundId("/content/sounds/pageturn.wav");
|
stockSound->setSoundId("/content/sounds/pageturn.wav");
|
||||||
stockSound->setParent(this);
|
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)
|
SoundService::~SoundService(void)
|
||||||
|
|||||||
Reference in New Issue
Block a user