OpenDream icon indicating copy to clipboard operation
OpenDream copied to clipboard

Not setting `macro` causes an exception

Open ike709 opened this issue 1 year ago • 0 comments

This is from Eternia:

window "main"
    elem "main"
        type = MAIN
        pos = 281,0
        size = 1487x714
        anchor1 = -1,-1
        anchor2 = -1,-1
        is-default = true
        saved-params = "pos;size"
        on-size = "WindowResize"
        statusbar = false
        icon = 'icons\\interface\\titlescreen\\images\\meranthe_logo.png'

macro defaulting to an empty string causes a KeyNotFound exception in ControlWindow.cs: public InterfaceMacroSet Macro => _interfaceManager.MacroSets[WindowDescriptor.Macro.AsRaw()];

According to the ref, it seems this field is optional so we just need to support it being null or empty.

https://www.byond.com/docs/ref/#/{skin}/param/macro

ike709 avatar Sep 29 '24 01:09 ike709