Skip to content

Commit f012566

Browse files
committed
Fixes #165, properly parse mouse click events.
1 parent 94263a5 commit f012566

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

sc2reader/readers.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ def trigger_mouse_clicked_event(self, data):
936936
position_world=dict(
937937
x=data.read_bits(20),
938938
y=data.read_bits(20),
939-
z=data.read_uint32()-2147483648,
939+
z=data.read_uint32() - 2147483648,
940940
),
941941
)
942942

@@ -1421,15 +1421,15 @@ def trigger_mouse_clicked_event(self, data):
14211421
button=data.read_uint32(),
14221422
down=data.read_bool(),
14231423
position_ui=dict(
1424-
x=data.read_uint32(),
1425-
y=data.read_uint32(),
1424+
x=data.read_bits(11),
1425+
y=data.read_bits(11),
14261426
),
14271427
position_world=dict(
1428-
x=data.read_uint32()-2147483648,
1429-
y=data.read_uint32()-2147483648,
1430-
z=data.read_uint32()-2147483648,
1428+
x=data.read_bits(20) - 2147483648,
1429+
y=data.read_bits(20) - 2147483648,
1430+
z=data.read_uint32() - 2147483648,
14311431
),
1432-
flags=data.read_uint8()-128,
1432+
flags=data.read_uint8() - 128,
14331433
)
14341434

14351435
def trigger_mouse_moved_event(self, data):
@@ -1441,9 +1441,9 @@ def trigger_mouse_moved_event(self, data):
14411441
position_world=dict(
14421442
x=data.read_bits(20),
14431443
y=data.read_bits(20),
1444-
z=data.read_uint32()-2147483648,
1444+
z=data.read_uint32() - 2147483648,
14451445
),
1446-
flags=data.read_uint8()-128,
1446+
flags=data.read_uint8() - 128,
14471447
)
14481448

14491449

0 commit comments

Comments
 (0)