mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 01:46:42 +00:00
STARK: Add an opcode to check if the inventory is open
This commit is contained in:
parent
d936bc11fc
commit
6bcdff8b17
@ -221,6 +221,8 @@ Command *Command::execute(uint32 callMode, Script *script) {
|
||||
return opIsAnimAtTime(_arguments[2].referenceValue, _arguments[3].intValue);
|
||||
case kIsLocation2D:
|
||||
return opIsLocation2D();
|
||||
case kIsInventoryOpen:
|
||||
return opIsInventoryOpen();
|
||||
default:
|
||||
warning("Unimplemented command %d - %s", _subType, _name.c_str());
|
||||
printData();
|
||||
@ -1104,6 +1106,12 @@ Command *Command::opIsLocation2D() {
|
||||
return nextCommandIf(!location->has3DLayer());
|
||||
}
|
||||
|
||||
Command *Command::opIsInventoryOpen() {
|
||||
bool invOpen = StarkUserInterface->isInventoryOpen();
|
||||
|
||||
return nextCommandIf(invOpen);
|
||||
}
|
||||
|
||||
Command *Command::nextCommand() {
|
||||
assert(!_arguments.empty());
|
||||
assert(_arguments[0].type == Argument::kTypeInteger1);
|
||||
|
@ -157,7 +157,8 @@ public:
|
||||
kIsItemNearPlace = 183,
|
||||
|
||||
kIsAnimAtTime = 185,
|
||||
kIsLocation2D = 186
|
||||
kIsLocation2D = 186,
|
||||
kIsInventoryOpen = 187
|
||||
};
|
||||
|
||||
struct Argument {
|
||||
@ -263,6 +264,7 @@ protected:
|
||||
Command *opIsItemActivity(const ResourceReference &itemRef, int32 value);
|
||||
Command *opIsAnimAtTime(const ResourceReference &animRef, int32 time);
|
||||
Command *opIsLocation2D();
|
||||
Command *opIsInventoryOpen();
|
||||
|
||||
Common::Array<Argument> _arguments;
|
||||
};
|
||||
|
@ -164,6 +164,10 @@ bool UserInterface::isInGameScreen() const {
|
||||
return _currentScreen == kScreenGame;
|
||||
}
|
||||
|
||||
bool UserInterface::isInventoryOpen() const {
|
||||
return _inventoryWindow->isVisible();
|
||||
}
|
||||
|
||||
void UserInterface::skipFMV() {
|
||||
if (_currentScreen == kScreenFMV) {
|
||||
_fmvPlayer->stop();
|
||||
|
@ -82,6 +82,9 @@ public:
|
||||
/** Is the game screen currently displayed? */
|
||||
bool isInGameScreen() const;
|
||||
|
||||
/** Is the inventory panel being displayed? */
|
||||
bool isInventoryOpen() const;
|
||||
|
||||
/** Can the player interact with the game world? */
|
||||
bool isInteractive() const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user