CensoredUsername / unrpyc

A ren'py script decompiler
Other
864 stars 157 forks source link

Order of keywords is lost inside screen #20

Closed jackmcbarn closed 9 years ago

jackmcbarn commented 9 years ago

Minimal test case:

screen testScreen:
    modal False
    window:
        text "foo":
            style "settings_link"
            xalign 0.5
            yalign 0.08
            color "#ffffff"

When compiled, here's the relevant part of its dump:

<renpy.sl2.slast.SLDisplayable 
  .child_or_fixed = False,
  .children = [],
  .default_keywords = {},
  .displayable = <class renpy.text.text.Text>,
  .imagemap = False,
  .keyword = [
      (
          u'style',
          u'"settings_link"'
      ),
      (
          u'xalign',
          u'0.5'
      ),
      (
          u'yalign',
          u'0.08'
      ),
      (
          u'color',
          u'"#ffffff"'
      )
  ],
  .pass_context = False,
  .positional = [u'"foo"'],
  .replaces = True,
  .scope = True,
  .serial = 254,
  .style = 'text'
>

Note that at this point, "style", "xalign", "yalign", and "color" are still in the original order. Here's the decompiled .rpy:

screen testScreen:
    modal False
    window:
        text "foo":
            color "#ffffff"
            xalign 0.5
            style "settings_link"
            yalign 0.08

Now, the ordering of "style", "xalign", "yalign", and "color" has been lost.

CensoredUsername commented 9 years ago

Thanks for the tip. This is only fixed in screen language 2 though, in screen language 1 ren'py doesn't remember the proper order.