mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-03 13:01:33 +02:00
Fixed sound on object pickup with dialog
This commit is contained in:
parent
d918621d66
commit
e9534603c2
@ -22,6 +22,7 @@
|
|||||||
#include "../lib/Connection.h"
|
#include "../lib/Connection.h"
|
||||||
#include "../lib/CSpellHandler.h"
|
#include "../lib/CSpellHandler.h"
|
||||||
#include "../lib/CTownHandler.h"
|
#include "../lib/CTownHandler.h"
|
||||||
|
#include "../lib/mapObjects/CObjectClassesHandler.h" // For displaying correct UI when interacting with objects
|
||||||
#include "../lib/BattleState.h"
|
#include "../lib/BattleState.h"
|
||||||
#include "../lib/JsonNode.h"
|
#include "../lib/JsonNode.h"
|
||||||
#include "CMusicHandler.h"
|
#include "CMusicHandler.h"
|
||||||
@ -1519,6 +1520,9 @@ void CPlayerInterface::objectRemoved( const CGObjectInstance *obj )
|
|||||||
{
|
{
|
||||||
const CGHeroInstance *h = static_cast<const CGHeroInstance*>(obj);
|
const CGHeroInstance *h = static_cast<const CGHeroInstance*>(obj);
|
||||||
heroKilled(h);
|
heroKilled(h);
|
||||||
|
} else if (VLC->objtypeh->getObjectHandlerName(obj->ID) == "pickable") {
|
||||||
|
waitWhileDialog();
|
||||||
|
CCS->soundh->playSoundFromSet(CCS->soundh->pickupSounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -318,6 +318,11 @@ std::string CObjectClassesHandler::getObjectName(si32 type, si32 subtype) const
|
|||||||
return getObjectName(type);
|
return getObjectName(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string CObjectClassesHandler::getObjectHandlerName(si32 type) const
|
||||||
|
{
|
||||||
|
return objects.at(type)->handlerName;
|
||||||
|
}
|
||||||
|
|
||||||
void AObjectTypeHandler::setType(si32 type, si32 subtype)
|
void AObjectTypeHandler::setType(si32 type, si32 subtype)
|
||||||
{
|
{
|
||||||
this->type = type;
|
this->type = type;
|
||||||
|
@ -222,6 +222,9 @@ public:
|
|||||||
std::string getObjectName(si32 type) const;
|
std::string getObjectName(si32 type) const;
|
||||||
std::string getObjectName(si32 type, si32 subtype) const;
|
std::string getObjectName(si32 type, si32 subtype) const;
|
||||||
|
|
||||||
|
/// Returns handler string describing the handler (for use in client)
|
||||||
|
std::string getObjectHandlerName(si32 type) const;
|
||||||
|
|
||||||
template <typename Handler> void serialize(Handler &h, const int version)
|
template <typename Handler> void serialize(Handler &h, const int version)
|
||||||
{
|
{
|
||||||
h & objects;
|
h & objects;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user