Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Palek
Wanderer


Joined: 28 Sep 2005
Posts: 55

PostPosted: Wed Oct 21, 2009 7:05 am   

[3.10a] Countdown Alarm negates Menu Button operations.
 
I use a 1 second alarm for a countdown timer, when the timer is active menu buttons will not work. The following steps will recreate the issue:

1. Create Button with this xml:
Code:
  <?xml version="1.0" encoding="ISO-8859-1" ?>
- <cmud>
- <button type="Menu" priority="40">
  <caption>Test</caption>
  <value>TestClass</value>
  </button>
  </cmud>


2. Create Class and Speed Menu items with this xml:
Code:
  <?xml version="1.0" encoding="ISO-8859-1" ?>
- <cmud>
- <class name="TestClass" submenu="true">
- <menu priority="60">
  <caption>1</caption>
  <value>#VAR TestVar 1</value>
  </menu>
- <menu priority="60">
  <caption>2</caption>
  <value>#VAR TestVar 2</value>
  </menu>
- <menu priority="60">
  <caption>3</caption>
  <value>#VAR TestVar 3</value>
  </menu>
  </class>
  </cmud>


3. Create Trigger with this xml:
Code:
  <?xml version="1.0" encoding="ISO-8859-1" ?>
- <cmud>
- <trigger name="Countdown" type="Alarm" priority="7600" enabled="false">
  <pattern>*1</pattern>
  <value>#IF (@CountdownTime<=0) {#T- Countdown} {#ADD CountdownTime -1}</value>
  </trigger>
  </cmud>


4. Create trigger with this xml:
Code:
  <?xml version="1.0" encoding="ISO-8859-1" ?>
- <cmud>
- <trigger priority="3290">
  <pattern>Let's get started.</pattern>
  <value>#VAR CountdownTime {120} #T+ Countdown</value>
  </trigger>
  </cmud>


5. Create gauge with this xml:
Code:
  <?xml version="1.0" encoding="ISO-8859-1" ?>
- <cmud>
- <button type="Gauge" color="#FF6600" gaugelowcol="red" gaugebackcol="#ECE9D8" priority="90">
  <caption>Test Gauge</caption>
  <expr>@CountdownTime</expr>
  <gaugemax>120</gaugemax>
  <gaugelow>20</gaugelow>
  </button>
  </cmud>


6. Click the test button and select 1, the variable TestVar is created and set to 1.

7. Click the test button and select 2, the variable TestVar changes to 2.

8. send #SHOW Let's get started. The gauge fills and begins counting down.

9. While the gauge is counting down click the Test button and select 3, the variable TestVar stay at 2.

10. Once the gauge is finished counting down the Test button resumes working.
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Wed Oct 21, 2009 12:58 pm   
 
I can kinda confirm this, changed a few things, 1 the menu button scripts I changed to #print, changing a variable isn't obvious that it changed, 2 your start trigger threw errors, it needs a cdata tag, and a semicolon.

If you change the alarm to 10 seconds, and the #add to -10, things work fine, if your lucky, and fast with 1 second timer you can make the menu button work, i think the gauge is "stealing" the focus away from the menu.
_________________
"To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Oct 21, 2009 10:35 pm   
 
Anything in Windows that changes the keyboard/mouse focus will take it away from the popup menu. This is normal Windows behavior. The issue is that the Gauge is actually a button, so it is allowed to have keyboard/mouse focus. When CMUD updates the gauge, this temporarily takes the focus, which causes the popup window to close.

I'll add this to the bug list, but it won't be fixed for v3.11 because messing with the underlying Windows focus behavior is really tricky and can easily cause all sorts of unwanted side effects.
Reply with quote
Palek
Wanderer


Joined: 28 Sep 2005
Posts: 55

PostPosted: Thu Oct 22, 2009 1:31 am   
 
This is with the alarm not the gauge, even if you remove the gauge and just have the alarm update the variable the menu button still does not work.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Oct 22, 2009 2:44 am   
 
I was not able to reproduce any problem with just an alarm that updates a variable value. Make sure you don't have any other script that is being run, or any other button or gauge that depends upon the variable you are updating.

Also, in the future, please copy/paste the XML directly from the XML tab in the CMUD settings editor so that you don't get the extra - characters at the beginning of the line. Also, you had a syntax error in your "Let's get started" trigger (Missing ; between the two commands). Here is the full script that I used:
Code:
<class name="TestClass" submenu="true" id="1">
  <menu priority="60" id="2">
    <caption>1</caption>
    <value>#VAR TestVar 1</value>
  </menu>
  <menu priority="60" id="3">
    <caption>2</caption>
    <value>#VAR TestVar 2</value>
  </menu>
  <menu priority="60" id="4">
    <caption>3</caption>
    <value>#VAR TestVar 3</value>
  </menu>
  <button type="Menu" priority="40" id="5">
    <caption>Test</caption>
    <value>TestClass</value>
  </button>
  <trigger name="Countdown" type="Alarm" priority="7600" id="7">
    <pattern>*1</pattern>
    <value>#IF (@CountdownTime<=0) {#T- Countdown} {#ADD CountdownTime -1}</value>
  </trigger>
  <trigger priority="3290" id="8">
    <pattern>Let's get started.</pattern>
    <value>#VAR CountdownTime {120};#T+ Countdown</value>
  </trigger>
</class>

This is with all of your code except the gauge. And without the gauge, I'm not having any problem using the menu button.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net