ID:1511825
 
BYOND Version:506.1237
Operating System:Windows 7 Home Premium 64-bit
Web Browser:Firefox 27.0
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:

When using the skin reference's example for creating macros at runtime you'll be unable to create any macros unless at least one window has the 'parent' of the new macro set to its 'macro' value.

Numbered Steps to Reproduce Problem:

1) Attempt to use
winset(src,"buttonA","parent='my_macros';name='a';command='TestVerb'")


2) If the interface has the 'my_macros' set you'd expect this to work.

3) Error "Cannot insert new element buttonA: parent element my_macros was not found."

4) Set any window's macro set to 'my_macros' the code will work fine, otherwise it'll error out regardless.

Code Snippet (if applicable) to Reproduce Problem:
client
verb
TestMacro()
winset(src,"buttonA","parent='my_macros';name='a';command='Test'")


Expected Results:

Macros to be created for the set, regardless of if any windows are using that set.

Actual Results:

The above error, unless a window has it set.

Does the problem occur:
Every time? Or how often? Every time.
In other games? N/A
In other user accounts? Yes
On other computers? Yes

When does the problem NOT occur?

When using the 'my_macros' set somewhere.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Looks like it's been happening since runtime macros were added.

Workarounds:

Set a window's macro set to 'my_macros' before attempting to add to it, then back afterwards.