core: Fix button action with multiple conditions not firing (fix #195)
If a button event had both a keyPress condition and another condition: on(release, keyPress "A") { } these actions would not fire on click, because it would still check if the key was down (which doesn't apply to clicks!) Fixes #195.
This commit is contained in:
parent
9211c7ac05
commit
2f0963fa6c
|
@ -320,7 +320,10 @@ impl<'gc> ButtonData<'gc> {
|
||||||
) {
|
) {
|
||||||
if let Some(parent) = self.base.parent {
|
if let Some(parent) = self.base.parent {
|
||||||
for action in &self.static_data.read().actions {
|
for action in &self.static_data.read().actions {
|
||||||
if action.condition == condition && action.key_code == key_code {
|
if action.condition == condition
|
||||||
|
&& (action.condition != swf::ButtonActionCondition::KeyPress
|
||||||
|
|| action.key_code == key_code)
|
||||||
|
{
|
||||||
// Note that AVM1 buttons run actions relative to their parent, not themselves.
|
// Note that AVM1 buttons run actions relative to their parent, not themselves.
|
||||||
context.action_queue.queue_actions(
|
context.action_queue.queue_actions(
|
||||||
parent,
|
parent,
|
||||||
|
|
Loading…
Reference in New Issue