Skip to content

Commit

Permalink
Add support for SL2 nearrect, dismiss, and areapicker.
Browse files Browse the repository at this point in the history
  • Loading branch information
CensoredUsername committed Feb 19, 2024
1 parent 6eec595 commit 2b3abda
Showing 1 changed file with 31 additions and 28 deletions.
59 changes: 31 additions & 28 deletions decompiler/sl2decompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,42 +286,45 @@ def print_displayable(self, ast, has_block=False):
self.print_keyword_or_child(line)

displayable_names = {
(behavior.OnEvent, None): ("on", 0),
(behavior.OnEvent, 0): ("on", 0),
(behavior.AreaPicker, "default"): ("areapicker", 1),
(behavior.Button, "button"): ("button", 1),
(behavior.DismissBehavior, "default"): ("dismiss", 0),
(behavior.Input, "input"): ("input", 0),
(behavior.MouseArea, 0): ("mousearea", 0),
(behavior.MouseArea, None): ("mousearea", 0),
(ui._add, None): ("add", 0),
(sld.sl2add, None): ("add", 0),
(ui._hotbar, "hotbar"): ("hotbar", 0),
(sld.sl2vbar, None): ("vbar", 0),
(sld.sl2bar, None): ("bar", 0),
(ui._label, "label"): ("label", 0),
(ui._textbutton, 0): ("textbutton", 0),
(ui._textbutton, "button"): ("textbutton", 0),
(ui._imagebutton, "image_button"): ("imagebutton", 0),
(im.image, "default"): ("image", 0),
(behavior.Input, "input"): ("input", 0),
(behavior.OnEvent, 0): ("on", 0),
(behavior.OnEvent, None): ("on", 0),
(behavior.Timer, "default"): ("timer", 0),
(ui._key, None): ("key", 0),
(text.Text, "text"): ("text", 0),
(layout.Null, "default"): ("null", 0),
(dragdrop.Drag, None): ("drag", 1),
(dragdrop.Drag, "drag"): ("drag", 1),
(motion.Transform, "transform"): ("transform", 1),
(transform.Transform, "transform"):("transform", 1),
(ui._hotspot, "hotspot"): ("hotspot", 1),
(sld.sl2viewport, "viewport"): ("viewport", 1),
(behavior.Button, "button"): ("button", 1),
(layout.Window, "frame"): ("frame", 1),
(layout.Window, "window"): ("window", 1),
(dragdrop.Drag, None): ("drag", 1),
(dragdrop.DragGroup, None): ("draggroup", 'many'),
(ui._imagemap, "imagemap"): ("imagemap", 'many'),
(layout.Side, "side"): ("side", 'many'),
(im.image, "default"): ("image", 0),
(layout.Grid, "grid"): ("grid", 'many'),
(sld.sl2vpgrid, "vpgrid"): ("vpgrid", 'many'),
(layout.MultiBox, "fixed"): ("fixed", 'many'),
(layout.MultiBox, "hbox"): ("hbox", 'many'),
(layout.MultiBox, "vbox"): ("vbox", 'many'),
(layout.MultiBox, "hbox"): ("hbox", 'many')
(layout.NearRect, "default"): ("nearrect", 1),
(layout.Null, "default"): ("null", 0),
(layout.Side, "side"): ("side", 'many'),
(layout.Window, "frame"): ("frame", 1),
(layout.Window, "window"): ("window", 1),
(motion.Transform, "transform"): ("transform", 1),
(sld.sl2add, None): ("add", 0),
(sld.sl2bar, None): ("bar", 0),
(sld.sl2vbar, None): ("vbar", 0),
(sld.sl2viewport, "viewport"): ("viewport", 1),
(sld.sl2vpgrid, "vpgrid"): ("vpgrid", 'many'),
(text.Text, "text"): ("text", 0),
(transform.Transform, "transform"):("transform", 1),
(ui._add, None): ("add", 0),
(ui._hotbar, "hotbar"): ("hotbar", 0),
(ui._hotspot, "hotspot"): ("hotspot", 1),
(ui._imagebutton, "image_button"): ("imagebutton", 0),
(ui._imagemap, "imagemap"): ("imagemap", 'many'),
(ui._key, None): ("key", 0),
(ui._label, "label"): ("label", 0),
(ui._textbutton, "button"): ("textbutton", 0),
(ui._textbutton, 0): ("textbutton", 0),
}

def sort_keywords_and_children(self, node, immediate_block=False, ignore_children=False):
Expand Down

0 comments on commit 2b3abda

Please sign in to comment.