[Scummvm-tracker] [ScummVM] #10772: QFG4: Rations icon persists in toolbar after all are eaten
Vhati
trac at scummvm.org
Sat Dec 22 22:23:45 CET 2018
#10772: QFG4: Rations icon persists in toolbar after all are eaten
--------------------------------+----------------------------
Reporter: Vhati | Owner: (none)
Type: defect | Status: new
Priority: low | Component: Engine: SCI
Resolution: | Keywords: SCI32 original
Game: Quest for Glory 4 |
--------------------------------+----------------------------
Comment (by Vhati):
"ScriptID 36 1" is invItem, a View that resides on mainIconBar and takes
the appearance of whichever item is active.
It's a little odd that nearly all the code that hides invItem manipulates
signal directly and calls DeleteScreenItem().
{{{
(= temp0 (ScriptID 36 1))
(temp0 signal: (| (temp0 signal?) $0008))
(DeleteScreenItem temp0)
}}}
There's already a method to do that.
\\
\\
script 64998 - View::hide()
{{{
(method (hide)
(if (self isNotHidden:)
(= signal (| signal $0008))
(DeleteScreenItem self)
(= -info- (& -info- $ffef))
)
)
}}}
\\
\\
The one exception is when restarting.
\\
\\
script 0 - Glory::restart()
{{{
(not (& ((= temp2 (ScriptID 36 1)) signal?) $0008))
(temp2 hide:)
)
}}}
Even that is redundant. The signal test is built into hide().
\\
\\
script 64998 - View::isNotHidden()
{{{
(method (isNotHidden)
(return (not (& signal $0008)))
)
}}}
I don't see that -info- is doing anything.
Nothing to avoid. Certainly not dangerous. It's show/hide!
\\
\\
[https://wiki.scummvm.org/index.php/SCI/Specifications/SCI_virtual_machine/Introduction#Object_segments
Article]: ScummVM Wiki - SCI Intro, Object segments
> Info typically has one of the following values (although this does not
appear to be relevant for SCI)
\\
\\
Whereas, all the code that shows invItem, always calls show().
\\
\\
script 64998 - View::show()
{{{
(method (show)
(if (not (self isNotHidden:))
(= signal (& signal $fff7))
(AddScreenItem self)
(= -info- (| -info- $0010))
)
)
}}}
\\
\\
Switching to hide() makes for a shorter patch.
--
Ticket URL: <https://bugs.scummvm.org/ticket/10772#comment:5>
ScummVM <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list