LennardF1989 / BF2042-Portal-Extensions

Browser extensions to add additional functionality to the BF2042 Portal Rules Editor.
https://bf2042-portal-extensions.lennardf1989.com/
GNU General Public License v3.0
20 stars 11 forks source link

Copy to Clipboard Issue #30

Open andy6170 opened 1 year ago

andy6170 commented 1 year ago

When copying to clipboard the mutation is now missing.

Example of old copy: <block type="SetVariable" x="5684" y="3748"><value name="VALUE-0"><block type="variableReferenceBlock"><mutation isObjectVar="true"></mutation><field name="OBJECTTYPE">Player</field><field name="VAR" id=".1~L+5yj2frDus(~IK#H" variabletype="Player">switchTeamCounter</field><value name="OBJECT"><block type="EventPlayer"></block></value></block></value><value name="VALUE-1"><block type="Number"><field name="NUM">0</field></block></value></block>

Current version of copy: <block type="SetVariable" x="5684" y="3748"><value name="VALUE-0"><block type="variableReferenceBlock"><field name="OBJECTTYPE">Player</field><field name="VAR" id=".1~L+5yj2frDus(~IK#H" variabletype="Player">switchTeamCounter</field><value name="OBJECT"><block type="EventPlayer"></block></value></block></value><value name="VALUE-1"><block type="Number"><field name="NUM">0</field></block></value></block>

As a result when pasting the code it is defaulting the blocks and missing the object variables and also has the same affect on Rules.

image

The0zzy commented 1 year ago

Migration Guide from XML to JSON Serialization https://docs.google.com/document/d/1wv5ORrO4icVHeU15FLSn37mdNLyJpQbMTo7mmTqsGl0/edit

p0lygun commented 1 year ago

Blocks

image

json

Click to show ```json { "type": "subroutineBlock", "id": "991Z^}*#2WiB.MJ_Q.[1", "extraState": { "subroutineName": "test_boi", "parameters": [] }, "fields": { "SUBROUTINE_NAME": "test_boi" }, "inputs": { "ACTIONS": { "block": { "type": "SetVariable", "id": ".@|%|~Jt)gcPYYccdNt]", "inputs": { "VALUE-0": { "block": { "type": "variableReferenceBlock", "id": "Aqu;GWblLC@$5+`O/c6Q", "extraState": { "isObjectVar": false }, "fields": { "OBJECTTYPE": "Global", "VAR": { "id": "i9Hbb3OYw@)$+K}O6e!B", "name": "test", "type": "Global" } } } } }, "next": { "block": { "type": "SetVariable", "id": "WL0uBCW7SC$$a}o-2x~o", "inputs": { "VALUE-0": { "block": { "type": "variableReferenceBlock", "id": ";G/t8[/u9FUfH~mY.CpF", "extraState": { "isObjectVar": true }, "fields": { "OBJECTTYPE": "Player", "VAR": { "id": "2kQ.)|a4BTY,ZuTE=SFi", "name": "test_player", "type": "Player" } }, "inputs": { "OBJECT": { "block": { "type": "EventPlayer", "id": "drR[C#e469lX8U!t{+kq" } } } } } }, "next": { "block": { "type": "SetVariable", "id": "q:vq=rL`d[{40oy*0hvj", "inputs": { "VALUE-0": { "block": { "type": "variableReferenceBlock", "id": "oiF8SL/}oRVAdApL%|gU", "extraState": { "isObjectVar": true }, "fields": { "OBJECTTYPE": "TeamId", "VAR": { "id": "a9Hl)bdum@M,]Ma:$YJD", "name": "test_team", "type": "TeamId" } }, "inputs": { "OBJECT": { "block": { "type": "EventTeam", "id": "+bJgBa$ALi^M)c4JBTcX" } } } } } } } } } } } } } } ```

XML

Click to show ```xml test_boi Global test Player test_player TeamId test_team ```
LennardF1989 commented 1 year ago

Should be fixed in 2.0.0-pr, please test and report.