mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
PINK: added deserialization of Peril PDA Commands
This commit is contained in:
@@ -36,8 +36,22 @@ void PDAButtonActor::deserialize(Archive &archive) {
|
||||
_opaque = (bool)archive.readDWORD();
|
||||
|
||||
int type = archive.readDWORD();
|
||||
assert(type != 0);
|
||||
_command.type = (Command::CommandType) type;
|
||||
assert(type != 0 && type != Command::kIncrementFrame && type != Command::kDecrementFrame);
|
||||
if (_page->getGame()->isPeril()) {
|
||||
_command.type = (Command::CommandType) type;
|
||||
} else {
|
||||
switch (type) {
|
||||
case 1:
|
||||
_command.type = Command::kGoToPage;
|
||||
break;
|
||||
case 2:
|
||||
_command.type = Command::kClose;
|
||||
break;
|
||||
default:
|
||||
_command.type = Command::kNull;
|
||||
break;
|
||||
}
|
||||
}
|
||||
_command.arg = archive.readString();
|
||||
}
|
||||
|
||||
@@ -53,7 +67,7 @@ void PDAButtonActor::onLeftClickMessage() {
|
||||
}
|
||||
|
||||
void PDAButtonActor::onMouseOver(const Common::Point point, CursorMgr *mgr) {
|
||||
if (_command.type == Command::Unk || !isActive())
|
||||
if (_command.type == Command::kNull || !isActive())
|
||||
mgr->setCursor(kPDADefaultCursor, point, Common::String());
|
||||
else
|
||||
mgr->setCursor(kPDAClickableFirstFrameCursor, point, Common::String());
|
||||
|
||||
@@ -28,11 +28,21 @@
|
||||
namespace Pink {
|
||||
|
||||
struct Command {
|
||||
// commands in peril are different
|
||||
/*enum PerilCommandType {Null, GoToPage, GoToPreviousPage, GoToDomain, GoToHelp,
|
||||
NavigateToDomain, IncrementCountry, DecrementCountry, IncrementDomain,
|
||||
DecrementDomain, Close, IncrementFrame, DecrementFrame};*/
|
||||
enum CommandType {Null = 0, GoToPage = 1, Close = 2, Unk = 3};
|
||||
enum CommandType {
|
||||
kGoToPage = 1,
|
||||
kGoToPreviousPage,
|
||||
kGoToDomain,
|
||||
kGoToHelp, // won't be supported
|
||||
kNavigateToDomain,
|
||||
kIncrementCountry,
|
||||
kDecrementCountry,
|
||||
kIncrementDomain,
|
||||
kDecrementDomain,
|
||||
kClose,
|
||||
kIncrementFrame, // not used
|
||||
kDecrementFrame, // not used
|
||||
kNull
|
||||
};
|
||||
|
||||
CommandType type;
|
||||
Common::String arg;
|
||||
|
||||
@@ -40,10 +40,10 @@ void PDAMgr::saveState(Archive &archive) {
|
||||
|
||||
void PDAMgr::execute(const Command &command) {
|
||||
switch (command.type) {
|
||||
case Command::GoToPage:
|
||||
case Command::kGoToPage:
|
||||
goToPage(command.arg);
|
||||
break;
|
||||
case Command::Close:
|
||||
case Command::kClose:
|
||||
close();
|
||||
break;
|
||||
default:
|
||||
|
||||
+2
-2
@@ -102,6 +102,8 @@ public:
|
||||
|
||||
void changeScene();
|
||||
|
||||
bool isPeril();
|
||||
|
||||
void setVariable(Common::String &variable, Common::String &value);
|
||||
bool checkValueOfVariable(Common::String &variable, Common::String &value);
|
||||
|
||||
@@ -124,8 +126,6 @@ private:
|
||||
void addModule(const Common::String &moduleName);
|
||||
void removeModule();
|
||||
|
||||
bool isPeril();
|
||||
|
||||
private:
|
||||
Console *_console;
|
||||
Common::RandomSource _rnd;
|
||||
|
||||
Reference in New Issue
Block a user