Skip to content

Commit 46629e5

Browse files
authored
Merge pull request #201 from Andrene/dialog-control-event
Dialog control event
2 parents a7778d0 + 702f781 commit 46629e5

File tree

6 files changed

+499
-352
lines changed

6 files changed

+499
-352
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- checkout
1919
- run: python --version ; pip --version ; pwd ; ls -l
2020
- run: pip install black codespell ruff
21-
- run: codespell -L queenland,uint
21+
- run: codespell -L queenland,uint,assertin
2222
- run: ruff .
2323
- run: black . --check
2424

examples/sc2autosave.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,16 @@
7777
keeps the script from looking into the 'Saved' subdirectory.
7878
7979
sc2autosave \
80-
--source ~/My\\ Documents/Starcraft\\ II/Accounts/.../Mutliplayer \
81-
--dest ~/My\\ Documents/Starcraft\\ II/Accounts/.../Multiplater/Saved \
80+
--source ~/My\\ Documents/Starcraft\\ II/Accounts/.../Multiplayer \
81+
--dest ~/My\\ Documents/Starcraft\\ II/Accounts/.../Multiplayer/Saved \
8282
--period 10 \
8383
--depth 0
8484
8585
This next configuration runs in batch mode using the default renaming format.
8686
8787
sc2autosave \
88-
--source ~/My\\ Documents/Starcraft\\ II/Accounts/.../Mutliplayer \
89-
--dest ~/My\\ Documents/Starcraft\\ II/Accounts/.../Multiplater/Saved \
88+
--source ~/My\\ Documents/Starcraft\\ II/Accounts/.../Multiplayer \
89+
--dest ~/My\\ Documents/Starcraft\\ II/Accounts/.../Multiplayer/Saved \
9090
--rename
9191
9292
(ZvP) Lost Temple: ShadesofGray(Z) vs Trisfall(P).SC2Replay
@@ -96,8 +96,8 @@
9696
by replay format and favors ShadesofGray in the player and team orderings.
9797
9898
sc2autosave \
99-
--source ~/My\\ Documents/Starcraft\\ II/Accounts/.../Mutliplayer \
100-
--dest ~/My\\ Documents/Starcraft\\ II/Accounts/.../Multiplater/Saved \
99+
--source ~/My\\ Documents/Starcraft\\ II/Accounts/.../Multiplayer \
100+
--dest ~/My\\ Documents/Starcraft\\ II/Accounts/.../Multiplayer/Saved \
101101
--rename "{:format}/{:matchup} on {:map}: {:teams}" \
102102
--player-format "{:name}({:play_race})" \
103103
--team-order-by number \
@@ -112,8 +112,8 @@
112112
length to show both minutes and seconds.
113113
114114
sc2autosave \
115-
--source ~/My\\ Documents/Starcraft\\ II/Accounts/.../Mutliplayer \
116-
--dest ~/My\\ Documents/Starcraft\\ II/Accounts/.../Multiplater/Saved \
115+
--source ~/My\\ Documents/Starcraft\\ II/Accounts/.../Multiplayer \
116+
--dest ~/My\\ Documents/Starcraft\\ II/Accounts/.../Multiplayer/Saved \
117117
--rename "{:matchup}/({:length}) {:map}: {:teams}" \
118118
--player-format "{:name}({:play_race})" \
119119
--team-order-by number \

sc2reader/engine/plugins/creeptracker.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class creep_tracker:
105105
def __init__(self, replay):
106106
# if the debug option is selected, minimaps will be printed to a file
107107
##and a stringIO containing the minimap image will be saved for
108-
##every minite in the game and the minimap with creep highlighted
108+
##every minute in the game and the minimap with creep highlighted
109109
## will be printed out.
110110
self.debug = replay.opt["debug"]
111111
##This list contains creep spread area for each player
@@ -123,9 +123,9 @@ def __init__(self, replay):
123123
self.unit_name_to_radius = {"CreepTumor": 10, "Hatchery": 8, "NydusCanal": 5}
124124
self.radius_to_coordinates = dict()
125125
for x in self.unit_name_to_radius:
126-
self.radius_to_coordinates[
127-
self.unit_name_to_radius[x]
128-
] = self.radius_to_map_positions(self.unit_name_to_radius[x])
126+
self.radius_to_coordinates[self.unit_name_to_radius[x]] = (
127+
self.radius_to_map_positions(self.unit_name_to_radius[x])
128+
)
129129
# Get map information
130130
replayMap = replay.map
131131
# extract image from replay package

sc2reader/events/game.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,3 +765,22 @@ def __init__(self, frame, pid, data):
765765

766766
#: Information on the users hijacking the game
767767
self.user_infos = data["user_infos"]
768+
769+
770+
@loggable
771+
class DialogControlEvent(GameEvent):
772+
"""
773+
Generated when a dialog is interacted with.
774+
"""
775+
776+
def __init__(self, frame, pid, data):
777+
super().__init__(frame, pid)
778+
779+
#: Identifier for the dialog
780+
self.control_id = data["control_id"]
781+
782+
#: How dialog was interacted with
783+
self.event_type = data["event_type"]
784+
785+
#: Data specific to event type such as changes or clicks
786+
self.event_data = data["event_data"]

0 commit comments

Comments
 (0)