Update of bug #14550 (project wesnoth):

                  Status:                    None => Wont Fix               

    _______________________________________________________

Follow-up Comment #2:

1.13 supports a new tag [sync_variable] that can manually sync the position
and makes it possible to implement common usecases of needs_select= with
[sync_variable] instead of needs_select= :
For example instead of

[event]
    name=start
    [set_menu_item]
        id=move_unit
        description= _ "Move!"
        image=buttons/WML-custom.png
        needs_select=yes
        [command]
            {MOVE_UNIT x,y=$moving_unit_x,$moving_unit_y $x1 $y1}
            {VARIABLE moving_unit_x $x1}
            {VARIABLE moving_unit_y $y1}
        [/command]
    [/set_menu_item]
[/event]
[event]
    name=select
    first_time_only=no
    {VARIABLE moving_unit_x $unit.x}
    {VARIABLE moving_unit_y $unit.y}
[/event]

you can now write:

[event]
    name=start
    [set_menu_item]
        id=move_unit
        description= _ "Move!"
        image=buttons/WML-custom.png
        [command]
            [sync_variable]
                name=moving_unit_x,moving_unit_y
            [sync_variable]
            {MOVE_UNIT x,y=$moving_unit_x,$moving_unit_y $x1 $y1}
            {VARIABLE moving_unit_x $x1}
            {VARIABLE moving_unit_y $y1}
        [/command]
    [/set_menu_item]
[/event]

[event]
    name=select
    first_time_only=no
    {VARIABLE moving_unit_x $unit.x}
    {VARIABLE moving_unit_y $unit.y}
[/event]

To become independent from the location it is now also possible to idently the
selected unit by id and write instead:

[event]
    name=start
    [set_menu_item]
        id=move_unit
        description= _ "Move!"
        image=buttons/WML-custom.png
        [command]
            [sync_variable]
                name=moving_unit_id
            [sync_variable]
            {MOVE_UNIT id=$moving_unit_id $x1 $y1}
        [/command]
    [/set_menu_item]
[/event]

[event]
    name=select
    first_time_only=no
    {VARIABLE moving_unit_id $unit.id}
[/event]



    _______________________________________________________

Reply to this item at:

  <http://gna.org/bugs/?14550>

_______________________________________________
  Nachricht gesendet von/durch Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to