batframework 1.0.8a1__py3-none-any.whl → 1.0.8a3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- batFramework/action.py +30 -14
- batFramework/actionContainer.py +5 -3
- batFramework/audioManager.py +0 -1
- batFramework/camera.py +29 -24
- batFramework/cutscene.py +2 -4
- batFramework/entity.py +9 -2
- batFramework/enums.py +11 -2
- batFramework/fontManager.py +1 -1
- batFramework/gui/__init__.py +3 -1
- batFramework/gui/button.py +5 -2
- batFramework/gui/clickableWidget.py +42 -29
- batFramework/gui/constraints/constraints.py +269 -57
- batFramework/gui/container.py +39 -21
- batFramework/gui/debugger.py +18 -11
- batFramework/gui/dialogueBox.py +20 -17
- batFramework/gui/draggableWidget.py +7 -5
- batFramework/gui/image.py +27 -15
- batFramework/gui/indicator.py +1 -4
- batFramework/gui/interactiveWidget.py +91 -30
- batFramework/gui/label.py +44 -35
- batFramework/gui/layout.py +115 -43
- batFramework/gui/meter.py +3 -8
- batFramework/gui/radioButton.py +47 -25
- batFramework/gui/root.py +50 -25
- batFramework/gui/shape.py +14 -19
- batFramework/gui/slider.py +70 -44
- batFramework/gui/style.py +10 -0
- batFramework/gui/styleManager.py +48 -0
- batFramework/gui/textInput.py +25 -22
- batFramework/gui/toggle.py +42 -29
- batFramework/gui/widget.py +176 -115
- batFramework/object.py +9 -10
- batFramework/renderGroup.py +7 -2
- batFramework/scene.py +70 -49
- batFramework/sceneManager.py +15 -20
- batFramework/scrollingSprite.py +5 -3
- batFramework/sprite.py +20 -14
- batFramework/stateMachine.py +1 -2
- batFramework/tileset.py +5 -5
- batFramework/utils.py +12 -10
- {batframework-1.0.8a1.dist-info → batframework-1.0.8a3.dist-info}/METADATA +1 -1
- batframework-1.0.8a3.dist-info/RECORD +58 -0
- {batframework-1.0.8a1.dist-info → batframework-1.0.8a3.dist-info}/WHEEL +1 -1
- batframework-1.0.8a1.dist-info/RECORD +0 -56
- {batframework-1.0.8a1.dist-info → batframework-1.0.8a3.dist-info}/LICENCE +0 -0
- {batframework-1.0.8a1.dist-info → batframework-1.0.8a3.dist-info}/top_level.txt +0 -0
batFramework/scene.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
from __future__ import annotations
|
2
2
|
import re
|
3
3
|
from typing import TYPE_CHECKING, Any
|
4
|
+
from collections import OrderedDict
|
5
|
+
import itertools
|
4
6
|
|
5
7
|
if TYPE_CHECKING:
|
6
8
|
from .manager import Manager
|
@@ -28,8 +30,8 @@ class Scene:
|
|
28
30
|
self.manager: Manager | None = None
|
29
31
|
self.active = False
|
30
32
|
self.visible = False
|
31
|
-
self.world_entities:
|
32
|
-
self.hud_entities:
|
33
|
+
self.world_entities: OrderedDict[bf.Entity, None] = OrderedDict()
|
34
|
+
self.hud_entities: OrderedDict[bf.Entity, None] = OrderedDict()
|
33
35
|
self.actions: bf.ActionContainer = bf.ActionContainer()
|
34
36
|
self.early_actions: bf.ActionContainer = bf.ActionContainer()
|
35
37
|
self.camera: bf.Camera = bf.Camera(convert_alpha=world_convert_alpha)
|
@@ -44,12 +46,14 @@ class Scene:
|
|
44
46
|
|
45
47
|
def get_hud_entity_count(self) -> int:
|
46
48
|
n = 0
|
49
|
+
|
47
50
|
def adder(e):
|
48
51
|
nonlocal n
|
49
52
|
n += len(e.children)
|
53
|
+
|
50
54
|
self.root.visit(adder)
|
51
55
|
|
52
|
-
return len(self.hud_entities) + n
|
56
|
+
return len(self.hud_entities) + n
|
53
57
|
|
54
58
|
def set_scene_index(self, index: int):
|
55
59
|
"""Set the scene index."""
|
@@ -124,40 +128,43 @@ class Scene:
|
|
124
128
|
"""Get the name of the scene."""
|
125
129
|
return self.name
|
126
130
|
|
127
|
-
def add_world_entity(self, *
|
131
|
+
def add_world_entity(self, *entities: bf.Entity):
|
128
132
|
"""Add world entities to the scene."""
|
129
|
-
for e in
|
130
|
-
self.world_entities
|
131
|
-
|
132
|
-
|
133
|
+
for e in entities:
|
134
|
+
if e not in self.world_entities:
|
135
|
+
self.world_entities[e] = None
|
136
|
+
e.parent_scene = self
|
137
|
+
e.do_when_added()
|
133
138
|
self.sort_entities()
|
134
139
|
|
135
|
-
def remove_world_entity(self, *
|
140
|
+
def remove_world_entity(self, *entities: bf.Entity):
|
136
141
|
"""Remove world entities from the scene."""
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
142
|
+
removed = False
|
143
|
+
for e in entities:
|
144
|
+
if e in self.world_entities:
|
145
|
+
e.do_when_removed()
|
146
|
+
e.parent_scene = None
|
147
|
+
del self.world_entities[e]
|
148
|
+
removed = True
|
149
|
+
return removed
|
144
150
|
|
145
|
-
def add_hud_entity(self, *
|
151
|
+
def add_hud_entity(self, *entities: bf.Entity):
|
146
152
|
"""Add HUD entities to the scene."""
|
147
|
-
for e in
|
148
|
-
self.hud_entities
|
149
|
-
|
150
|
-
|
153
|
+
for e in entities:
|
154
|
+
if e not in self.hud_entities:
|
155
|
+
self.hud_entities[e] = None
|
156
|
+
e.parent_scene = self
|
157
|
+
e.do_when_added()
|
151
158
|
self.sort_entities()
|
152
159
|
return True
|
153
160
|
|
154
|
-
def remove_hud_entity(self, *
|
161
|
+
def remove_hud_entity(self, *entities: bf.Entity):
|
155
162
|
"""Remove HUD entities from the scene."""
|
156
|
-
for e in
|
163
|
+
for e in entities:
|
157
164
|
if e in self.hud_entities:
|
158
165
|
e.do_when_removed()
|
159
166
|
e.parent_scene = None
|
160
|
-
self.hud_entities
|
167
|
+
del self.hud_entities[e]
|
161
168
|
|
162
169
|
def add_actions(self, *action):
|
163
170
|
"""Add actions to the scene."""
|
@@ -171,7 +178,9 @@ class Scene:
|
|
171
178
|
"""Get entities by their tags."""
|
172
179
|
res = [
|
173
180
|
entity
|
174
|
-
for entity in
|
181
|
+
for entity in itertools.chain(
|
182
|
+
self.world_entities.keys(), self.hud_entities.keys()
|
183
|
+
)
|
175
184
|
if any(entity.has_tags(t) for t in tags)
|
176
185
|
]
|
177
186
|
res.extend(list(self.root.get_by_tags(*tags)))
|
@@ -179,7 +188,9 @@ class Scene:
|
|
179
188
|
|
180
189
|
def get_by_uid(self, uid) -> bf.Entity | None:
|
181
190
|
"""Get an entity by its unique identifier."""
|
182
|
-
res = self._find_entity_by_uid(
|
191
|
+
res = self._find_entity_by_uid(
|
192
|
+
uid, itertools.chain(self.world_entities.keys(), self.hud_entities.keys())
|
193
|
+
)
|
183
194
|
if res is None:
|
184
195
|
res = self._recursive_search_by_uid(uid, self.root)
|
185
196
|
return res
|
@@ -203,11 +214,10 @@ class Scene:
|
|
203
214
|
|
204
215
|
return None
|
205
216
|
|
206
|
-
# propagates event to all entities
|
207
217
|
def process_event(self, event: pygame.Event):
|
208
218
|
"""
|
209
219
|
Propagates event while it is not consumed.
|
210
|
-
In order :
|
220
|
+
In order :
|
211
221
|
-do_early_handle_event()
|
212
222
|
-scene early_actions
|
213
223
|
-propagate to scene entities (hud then world)
|
@@ -215,20 +225,27 @@ class Scene:
|
|
215
225
|
-scene actions
|
216
226
|
at each step, if the event is consumed the propagation stops
|
217
227
|
"""
|
218
|
-
if event.consumed
|
228
|
+
if event.consumed:
|
229
|
+
return
|
219
230
|
self.do_early_handle_event(event)
|
220
|
-
if event.consumed
|
231
|
+
if event.consumed:
|
232
|
+
return
|
221
233
|
self.early_actions.process_event(event)
|
222
|
-
if event.consumed
|
223
|
-
|
234
|
+
if event.consumed:
|
235
|
+
return
|
236
|
+
for entity in itertools.chain(
|
237
|
+
self.hud_entities.keys(), self.world_entities.keys()
|
238
|
+
):
|
224
239
|
entity.process_event(event)
|
225
|
-
if event.consumed
|
240
|
+
if event.consumed:
|
241
|
+
return
|
226
242
|
self.do_handle_event(event)
|
227
|
-
if event.consumed
|
243
|
+
if event.consumed:
|
244
|
+
return
|
228
245
|
self.actions.process_event(event)
|
229
246
|
|
230
247
|
# called before process event
|
231
|
-
def do_early_handle_event(self, event: pygame.Event)
|
248
|
+
def do_early_handle_event(self, event: pygame.Event):
|
232
249
|
"""Called early in event propagation"""
|
233
250
|
pass
|
234
251
|
|
@@ -238,7 +255,9 @@ class Scene:
|
|
238
255
|
|
239
256
|
def update(self, dt):
|
240
257
|
"""Update the scene. Do NOT override"""
|
241
|
-
for entity in
|
258
|
+
for entity in itertools.chain(
|
259
|
+
self.hud_entities.keys(), self.world_entities.keys()
|
260
|
+
):
|
242
261
|
entity.update(dt)
|
243
262
|
self.do_update(dt)
|
244
263
|
self.camera.update(dt)
|
@@ -266,26 +285,21 @@ class Scene:
|
|
266
285
|
|
267
286
|
def sort_entities(self) -> None:
|
268
287
|
"""Sort entities within the scene based on their rendering order."""
|
269
|
-
self.world_entities
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
# Draw outlines for world entities if required
|
276
|
-
if debugMode == bf.debugMode.OUTLINES:
|
277
|
-
[self.debug_entity(e, camera) for e in entity_list]
|
278
|
-
|
288
|
+
self.world_entities = OrderedDict(
|
289
|
+
sorted(self.world_entities.items(), key=lambda e: e[0].render_order)
|
290
|
+
)
|
291
|
+
self.hud_entities = OrderedDict(
|
292
|
+
sorted(self.hud_entities.items(), key=lambda e: e[0].render_order)
|
293
|
+
)
|
279
294
|
|
280
295
|
def draw(self, surface: pygame.Surface):
|
281
|
-
|
282
296
|
self.camera.clear()
|
283
297
|
self.hud_camera.clear()
|
284
298
|
|
285
299
|
# Draw all world entities
|
286
|
-
self._draw_camera(self.camera, self.world_entities)
|
300
|
+
self._draw_camera(self.camera, self.world_entities.keys())
|
287
301
|
# Draw all HUD entities
|
288
|
-
self._draw_camera(self.hud_camera, self.hud_entities)
|
302
|
+
self._draw_camera(self.hud_camera, self.hud_entities.keys())
|
289
303
|
|
290
304
|
self.do_early_draw(surface)
|
291
305
|
self.camera.draw(surface)
|
@@ -293,6 +307,13 @@ class Scene:
|
|
293
307
|
self.hud_camera.draw(surface)
|
294
308
|
self.do_final_draw(surface)
|
295
309
|
|
310
|
+
def _draw_camera(self, camera: bf.Camera, entity_list):
|
311
|
+
_ = [entity.draw(camera) for entity in entity_list]
|
312
|
+
debugMode = self.manager.debug_mode
|
313
|
+
# Draw outlines for world entities if required
|
314
|
+
if debugMode == bf.debugMode.OUTLINES:
|
315
|
+
[self.debug_entity(e, camera) for e in entity_list]
|
316
|
+
|
296
317
|
def do_early_draw(self, surface: pygame.Surface):
|
297
318
|
pass
|
298
319
|
|
batFramework/sceneManager.py
CHANGED
@@ -2,6 +2,7 @@ import batFramework as bf
|
|
2
2
|
import pygame
|
3
3
|
from typing import Self
|
4
4
|
|
5
|
+
|
5
6
|
def swap(lst, index1, index2):
|
6
7
|
lst[index1], lst[index2] = lst[index2], lst[index1]
|
7
8
|
|
@@ -18,9 +19,7 @@ class SceneManager:
|
|
18
19
|
self.debug_mode: bf.enums.debugMode = bf.debugMode.HIDDEN
|
19
20
|
self.current_transitions: dict[str, bf.transition.Transition] = {}
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
def init_scenes(self,*initial_scenes):
|
22
|
+
def init_scenes(self, *initial_scenes):
|
24
23
|
for index, s in enumerate(initial_scenes):
|
25
24
|
s.set_scene_index(index)
|
26
25
|
for s in reversed(initial_scenes):
|
@@ -29,7 +28,7 @@ class SceneManager:
|
|
29
28
|
self.set_scene(initial_scenes[0].get_name())
|
30
29
|
self.update_scene_states()
|
31
30
|
|
32
|
-
def set_shared_event(self,event:pygame.Event)->None:
|
31
|
+
def set_shared_event(self, event: pygame.Event) -> None:
|
33
32
|
"""
|
34
33
|
Add an event that will be propagated to all active scenes, not just the one on top.
|
35
34
|
"""
|
@@ -41,7 +40,7 @@ class SceneManager:
|
|
41
40
|
"""
|
42
41
|
print("-" * 40)
|
43
42
|
print(
|
44
|
-
|
43
|
+
"\n".join(
|
45
44
|
f" {s.name:<30}\t{'Active' if s.active else 'Inactive'}\t{'Visible' if s.visible else 'Invisible'}\tindex= {s.scene_index}"
|
46
45
|
for s in self.scenes
|
47
46
|
)
|
@@ -63,7 +62,7 @@ class SceneManager:
|
|
63
62
|
"""
|
64
63
|
Get a shared variable
|
65
64
|
"""
|
66
|
-
return self.shared_variables.get(name,error_value)
|
65
|
+
return self.shared_variables.get(name, error_value)
|
67
66
|
|
68
67
|
def get_current_scene_name(self) -> str:
|
69
68
|
"""get the name of the current scene"""
|
@@ -108,14 +107,10 @@ class SceneManager:
|
|
108
107
|
index: int = 0,
|
109
108
|
):
|
110
109
|
target_scene = self.get_scene(scene_name)
|
111
|
-
if not target_scene
|
110
|
+
if not target_scene:
|
112
111
|
print(f"Scene '{scene_name}' does not exist")
|
113
112
|
return
|
114
|
-
if (
|
115
|
-
len(self.scenes) == 0
|
116
|
-
or index >= len(self.scenes)
|
117
|
-
or index < 0
|
118
|
-
):
|
113
|
+
if len(self.scenes) == 0 or index >= len(self.scenes) or index < 0:
|
119
114
|
return
|
120
115
|
source_surface = bf.const.SCREEN.copy()
|
121
116
|
dest_surface = bf.const.SCREEN.copy()
|
@@ -137,28 +132,28 @@ class SceneManager:
|
|
137
132
|
self.set_sharedVar("player_has_control", False)
|
138
133
|
|
139
134
|
def _end_transition(self, scene_name, index):
|
140
|
-
self.set_scene(scene_name, index)
|
135
|
+
self.set_scene(scene_name, index, True)
|
141
136
|
self.set_sharedVar("player_has_control", True)
|
142
137
|
self.current_transitions.clear()
|
143
138
|
|
144
|
-
def set_scene(self, scene_name, index=0):
|
139
|
+
def set_scene(self, scene_name, index=0, ignore_early: bool = False):
|
145
140
|
target_scene = self.get_scene(scene_name)
|
146
|
-
if not target_scene
|
141
|
+
if not target_scene:
|
147
142
|
print(f"'{scene_name}' does not exist")
|
148
143
|
return
|
149
|
-
if (
|
150
|
-
len(self.scenes) == 0
|
151
|
-
or index >= len(self.scenes)
|
152
|
-
or index < 0
|
153
|
-
):
|
144
|
+
if len(self.scenes) == 0 or index >= len(self.scenes) or index < 0:
|
154
145
|
return
|
155
146
|
|
156
147
|
# switch
|
148
|
+
if not ignore_early:
|
149
|
+
self.scenes[index].do_on_exit_early()
|
157
150
|
self.scenes[index].on_exit()
|
158
151
|
# re-insert scene at index 0
|
159
152
|
self.scenes.remove(target_scene)
|
160
153
|
self.scenes.insert(index, target_scene)
|
161
154
|
_ = [s.set_scene_index(i) for i, s in enumerate(self.scenes)]
|
155
|
+
if not ignore_early:
|
156
|
+
self.scenes[index].do_on_enter_early()
|
162
157
|
target_scene.on_enter()
|
163
158
|
|
164
159
|
def cycle_debug_mode(self):
|
batFramework/scrollingSprite.py
CHANGED
@@ -61,11 +61,13 @@ class ScrollingSprite(bf.Sprite):
|
|
61
61
|
|
62
62
|
def set_size(self, size: tuple[int | None, int | None]) -> Self:
|
63
63
|
size = list(size)
|
64
|
-
if size[0] is None:
|
65
|
-
|
64
|
+
if size[0] is None:
|
65
|
+
size[0] = self.rect.w
|
66
|
+
if size[1] is None:
|
67
|
+
size[1] = self.rect.h
|
66
68
|
|
67
69
|
self.surface = pygame.Surface(size).convert_alpha()
|
68
|
-
self.rect = self.surface.get_frect(
|
70
|
+
self.rect = self.surface.get_frect(topleft=self.rect.topleft)
|
69
71
|
return self
|
70
72
|
|
71
73
|
def _get_mosaic_rect_list(self) -> Iterator[pygame.Rect]:
|
batFramework/sprite.py
CHANGED
@@ -12,24 +12,29 @@ class Sprite(bf.Entity):
|
|
12
12
|
):
|
13
13
|
self.original_surface: pygame.Surface = None
|
14
14
|
|
15
|
-
super().__init__(convert_alpha
|
15
|
+
super().__init__(convert_alpha=convert_alpha)
|
16
16
|
if path is not None:
|
17
17
|
self.from_path(path)
|
18
18
|
if size is not None and self.original_surface:
|
19
19
|
self.set_size(self.original_surface.get_size())
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
def set_size(self, size: tuple[float, float]) -> Self:
|
22
|
+
if size == self.rect.size:
|
23
|
+
return self
|
24
24
|
self.rect.size = size
|
25
|
-
self.surface = pygame.Surface(
|
26
|
-
|
27
|
-
|
28
|
-
self.
|
25
|
+
self.surface = pygame.Surface(
|
26
|
+
(int(self.rect.w), int(self.rect.h)), self.surface_flags
|
27
|
+
)
|
28
|
+
if self.convert_alpha:
|
29
|
+
self.surface = self.surface.convert_alpha()
|
30
|
+
self.surface.fill((0, 0, 0, 0 if self.convert_alpha else 255))
|
31
|
+
self.surface.blit(
|
32
|
+
pygame.transform.scale(self.original_surface, self.rect.size), (0, 0)
|
33
|
+
)
|
29
34
|
return self
|
30
|
-
|
31
|
-
def from_path(self,path:str)->Self:
|
32
|
-
tmp = bf.ResourceManager().get_image(path,self.convert_alpha)
|
35
|
+
|
36
|
+
def from_path(self, path: str) -> Self:
|
37
|
+
tmp = bf.ResourceManager().get_image(path, self.convert_alpha)
|
33
38
|
if tmp is None:
|
34
39
|
return self
|
35
40
|
self.original_surface = tmp
|
@@ -37,9 +42,10 @@ class Sprite(bf.Entity):
|
|
37
42
|
self.set_size(size)
|
38
43
|
return self
|
39
44
|
|
40
|
-
def from_surface(self,surface: pygame.Surface)->Self:
|
41
|
-
if surface is None
|
45
|
+
def from_surface(self, surface: pygame.Surface) -> Self:
|
46
|
+
if surface is None:
|
47
|
+
return self
|
42
48
|
self.original_surface = surface
|
43
49
|
size = self.original_surface.get_size()
|
44
50
|
self.set_size(size)
|
45
|
-
return self
|
51
|
+
return self
|
batFramework/stateMachine.py
CHANGED
batFramework/tileset.py
CHANGED
@@ -3,7 +3,6 @@ from .resourceManager import ResourceManager
|
|
3
3
|
import batFramework as bf
|
4
4
|
|
5
5
|
|
6
|
-
|
7
6
|
class Tileset:
|
8
7
|
def __init__(self, source: pygame.Surface, tilesize: tuple[int, int]) -> None:
|
9
8
|
self.surface = source
|
@@ -27,15 +26,15 @@ class Tileset:
|
|
27
26
|
self.tile_dict[coord] = {}
|
28
27
|
self.tile_dict[coord][flip_state] = tile
|
29
28
|
|
30
|
-
|
31
|
-
def __str__(self)->str:
|
29
|
+
def __str__(self) -> str:
|
32
30
|
num_tiles = 0
|
33
31
|
if self.tile_dict:
|
34
32
|
num_tiles = len(self.tile_dict.values())
|
35
33
|
return f"{num_tiles} tiles | Tile size : {self.tile_size}"
|
36
34
|
|
37
|
-
def get_tile(
|
38
|
-
|
35
|
+
def get_tile(
|
36
|
+
self, x: int, y: int, flipX=False, flipY=False
|
37
|
+
) -> pygame.Surface | None:
|
39
38
|
if flipX:
|
40
39
|
x = self.tile_width - 1 - x
|
41
40
|
if flipY:
|
@@ -43,4 +42,5 @@ class Tileset:
|
|
43
42
|
tile_data = self.tile_dict.get((x, y), None)
|
44
43
|
if tile_data is None:
|
45
44
|
return None
|
45
|
+
|
46
46
|
return tile_data.get((flipX, flipY), None)
|
batFramework/utils.py
CHANGED
@@ -5,6 +5,8 @@ import batFramework as bf
|
|
5
5
|
import json
|
6
6
|
from .enums import *
|
7
7
|
import re
|
8
|
+
|
9
|
+
|
8
10
|
class Singleton(type):
|
9
11
|
_instances = {}
|
10
12
|
|
@@ -18,12 +20,12 @@ class Utils:
|
|
18
20
|
|
19
21
|
@staticmethod
|
20
22
|
def split_surface(
|
21
|
-
surface
|
23
|
+
surface: pygame.Surface, split_size: tuple[int, int], func=None
|
22
24
|
) -> dict[tuple[int, int], pygame.Surface]:
|
23
25
|
"""
|
24
26
|
Splits a surface into subsurfaces and returns a dictionnary of them
|
25
27
|
with their tuple coordinates as keys.
|
26
|
-
Exemple : '(0,0) : Surface'
|
28
|
+
Exemple : '(0,0) : Surface'
|
27
29
|
"""
|
28
30
|
if surface is None:
|
29
31
|
return None
|
@@ -39,19 +41,19 @@ class Utils:
|
|
39
41
|
res[(ix, iy)] = sub
|
40
42
|
|
41
43
|
return res
|
42
|
-
|
44
|
+
|
43
45
|
@staticmethod
|
44
46
|
def filter_text(text_mode: textMode):
|
45
47
|
if text_mode == textMode.ALPHABETICAL:
|
46
|
-
pattern = re.compile(r
|
48
|
+
pattern = re.compile(r"[^a-zA-Z]")
|
47
49
|
elif text_mode == textMode.NUMERICAL:
|
48
|
-
pattern = re.compile(r
|
50
|
+
pattern = re.compile(r"[^0-9]")
|
49
51
|
elif text_mode == textMode.ALPHANUMERICAL:
|
50
|
-
pattern = re.compile(r
|
52
|
+
pattern = re.compile(r"[^a-zA-Z0-9]")
|
51
53
|
else:
|
52
54
|
raise ValueError("Unsupported text mode")
|
53
|
-
|
55
|
+
|
54
56
|
def filter_function(s: str) -> str:
|
55
|
-
return pattern.sub(
|
56
|
-
|
57
|
-
return filter_function
|
57
|
+
return pattern.sub("", s)
|
58
|
+
|
59
|
+
return filter_function
|
@@ -0,0 +1,58 @@
|
|
1
|
+
batFramework/__init__.py,sha256=5KS96Y0uDx8sue3NyDl2HTFh-CqEZc9otmnUXRCHXws,2189
|
2
|
+
batFramework/action.py,sha256=919IVYKviLyVYDtQL7oZvlVuE_aodjJCuwz6fGi5sCk,8420
|
3
|
+
batFramework/actionContainer.py,sha256=qy6-YY3iX26KJ8NqFMSYo6JExohD8HFk0sC1qhb7qA8,2602
|
4
|
+
batFramework/animatedSprite.py,sha256=1KmhUCX8q2JTyOr0ClLovJ21i6c2SkllTtqygmDSZvo,5168
|
5
|
+
batFramework/audioManager.py,sha256=BnfJz5GMMhvyL05mMRM9AyWtyHjyt7lIxScbzY2lmVQ,3873
|
6
|
+
batFramework/camera.py,sha256=u1EPSitZ9mEEa32yQB7K6ywnWgWCSumbhrc4HRjimEY,9406
|
7
|
+
batFramework/constants.py,sha256=5PyZQZ4fCcLA8k_Upby9KGVF-3pnV2ZZ6t26CxiocPM,1102
|
8
|
+
batFramework/cutscene.py,sha256=0gdGJZTslv0d9JcF-brVgjk56jZeDa-ZTgG5DR47y_c,3888
|
9
|
+
batFramework/cutsceneBlocks.py,sha256=Uezggx1XgmLvXW1GnuVkGj3tOM8AOxXYx1F9nFGvL-w,4788
|
10
|
+
batFramework/dynamicEntity.py,sha256=zp5ShM6fQ-a_hXTHA6UthbInfJl2XazsN6C2hll9nK8,665
|
11
|
+
batFramework/easingController.py,sha256=4N8GIp1fsaWBUlDxXx3SMwOq1Mrhn10MZZIO51_CRnk,1677
|
12
|
+
batFramework/entity.py,sha256=34gYC6uEMmLkqWtoTG9bgMWRmHRSxhQfxXZKzWS7H2o,2127
|
13
|
+
batFramework/enums.py,sha256=Iee21l4BajM7PXXrZF8SWAURX4qwMqKpQ7f12btqIbM,2077
|
14
|
+
batFramework/fontManager.py,sha256=VX3HmtyeiOBtv64XZjjJrvk29w6lawHKLfCGBwAa-4g,2242
|
15
|
+
batFramework/manager.py,sha256=YRKKv5qWVUs7D8ZqP8ZkfUeTCc3lHxfCfJSYdO5Ep8A,2375
|
16
|
+
batFramework/object.py,sha256=SnwnAmfC-7_QTGomQVpBQGSMQjN5NngZoNuvGdqHUrE,3021
|
17
|
+
batFramework/particle.py,sha256=yGGKjGtwzL-m48akGNsReLM82IPV1DzrsDy5SN_kMAw,2672
|
18
|
+
batFramework/renderGroup.py,sha256=_VDvmP4iB-XarFJo_Uh5YKwWq1cazHmOBmTXZkqKk40,2020
|
19
|
+
batFramework/resourceManager.py,sha256=8ysiVDMVRKOGo_kNRH2BiqiUj07kddgi04iNcTt9T-Q,3094
|
20
|
+
batFramework/scene.py,sha256=4KHzaIU2fIU2IfXUE8fTX_nlI_iXkylW3B09c3e79KE,11158
|
21
|
+
batFramework/sceneManager.py,sha256=BBEd0ngCO42nPxWnBPSTpHmzV4sBTKBrcd4uX7hna98,7151
|
22
|
+
batFramework/scrollingSprite.py,sha256=WYVCzuqGTQP7qauT_thzAtghPXnLsZFYNTD0KzYVxp8,4185
|
23
|
+
batFramework/sprite.py,sha256=t_kSyUXGOSXQbSBwrKgBUTp5mITeFQbAKNzugjL5SgY,1625
|
24
|
+
batFramework/stateMachine.py,sha256=tDQIfQH_4cVZyVNYJ2APe8-yhos3uGk5uSMo_XvktdQ,1335
|
25
|
+
batFramework/tileset.py,sha256=3AJBWHx90PC43BdLYCBFm811XBrMvWoB-nsUgyo6s-I,1728
|
26
|
+
batFramework/time.py,sha256=IGRIY_g9kpdJxR5wt1lOnLsY9gMReuBJZqnpWRyR-CQ,3963
|
27
|
+
batFramework/transition.py,sha256=ioxT5KQQmgSY5yPXDV1CEAj6J_62D6YVU5NUk_Fude0,6442
|
28
|
+
batFramework/triggerZone.py,sha256=ikOOlJT1KIND0MO2xiilCHuKlb1eQhkCMEhZTi1btsI,586
|
29
|
+
batFramework/utils.py,sha256=esMCG8Yh1MT1V0QsBAPaulCr3pthvxDi2-S_dUJs-3k,1699
|
30
|
+
batFramework/gui/__init__.py,sha256=17ij7mrCBCoehqCq1PV6MSXPOfMoLPmrV_G8d6ax4Tk,687
|
31
|
+
batFramework/gui/button.py,sha256=Ozs6VKHf9FCQXQODDiLQywGN3hwfXtQ6s2I-rzdjnQg,429
|
32
|
+
batFramework/gui/clickableWidget.py,sha256=t7U2m2TSS0cjTjca86xFn0v7C0PtfBV9m8cpecFnRnI,6976
|
33
|
+
batFramework/gui/container.py,sha256=wXjuhwCJc71KKSgY2cYgoRscAKB_hIw5N4njJk3Z9lk,5925
|
34
|
+
batFramework/gui/debugger.py,sha256=XogxF3J31GO-DZZn6YBrgwpYA5WjadzEfHkQHeMLU7o,3925
|
35
|
+
batFramework/gui/dialogueBox.py,sha256=3Z76l9obrpQImI8hjoBS_8G9sY3UILj2d3nJsaxtaI4,3221
|
36
|
+
batFramework/gui/draggableWidget.py,sha256=SKG7oMInZ_GTnrbv2T0aqlppuiuLX1tkVSCQJtRMlk8,1392
|
37
|
+
batFramework/gui/image.py,sha256=3J1v_YGDPUE_5CwD0ca9PXhHYOdItxUbXakovDjKms4,1750
|
38
|
+
batFramework/gui/indicator.py,sha256=leCvxsGxt00-oTn0N5MTmLstLH9uLG3RjQ02KlXtZCQ,1549
|
39
|
+
batFramework/gui/interactiveWidget.py,sha256=gcJnMhd4o74oEwZ6AVfxFwLUdNoCaK24ZPFriwh-ld0,5303
|
40
|
+
batFramework/gui/label.py,sha256=O48qjfeihyBiGKuHqwQ88ur0YZArXKS4YZHre70o0gg,10636
|
41
|
+
batFramework/gui/layout.py,sha256=sslcKULrWKZzaJw_fyb3f9A3PTT3Bm85C8-RbMHeDzo,8377
|
42
|
+
batFramework/gui/meter.py,sha256=-5FwPpwWJm3nn8_SoWJNrOqIZ2wiHHTWmpkJyNNaCCY,2282
|
43
|
+
batFramework/gui/radioButton.py,sha256=MAlu1_EiPzbvm6TyQ-IITWR6Mv38W2qEOaOKu1MArNQ,2406
|
44
|
+
batFramework/gui/root.py,sha256=7yfO4u-21bEL3jiK1ITuTGk8RMFZLZ0vjau0mBuxFfQ,4811
|
45
|
+
batFramework/gui/shape.py,sha256=t-DOLYO2V2f85QS0aI6fUZEZKPe1W8J8nvzNoo6Lk-Y,9657
|
46
|
+
batFramework/gui/slider.py,sha256=6n4tr3XpF2fGMpxcts16nXq0bxFrBXbjUyKokyrruJw,8587
|
47
|
+
batFramework/gui/style.py,sha256=OeLbft0RkIslQ2IcZpBeF6TaQDONIoBcAHj_Bkh9gFw,131
|
48
|
+
batFramework/gui/styleManager.py,sha256=rALKJ-AmRbDAiyu8hVAYRAlkQxw677DiPoNKJZ4xtJ4,1245
|
49
|
+
batFramework/gui/textInput.py,sha256=Vy-wxED1rk1h_VavCd6lCOpm5aYgFUDfnkv-i4AsHV4,4633
|
50
|
+
batFramework/gui/toggle.py,sha256=l-N5koIPp2HYQ0WEGzI2SdZrISe84KhD8MCQIJkZJNA,4410
|
51
|
+
batFramework/gui/widget.py,sha256=8zLLoLyyXzb99So-gnl8ovh9ZxVOYgIuAlFvn0JMllE,12608
|
52
|
+
batFramework/gui/constraints/__init__.py,sha256=qqXE8nnSrEvCSeHdqY8UYPZLetqdubFPI7IdZuh35QE,26
|
53
|
+
batFramework/gui/constraints/constraints.py,sha256=IUcq0jY5--pt9S-GgmXE-79yoPnww3UGjS19iC-8A2U,20004
|
54
|
+
batframework-1.0.8a3.dist-info/LICENCE,sha256=A65iXbMDbOxQLDNOODJLqA7o5RxszYlEqIgNSzBQRf4,1073
|
55
|
+
batframework-1.0.8a3.dist-info/METADATA,sha256=dFBMbRPDXT-skce0UxDZd-Y2jh-SOsMzzaZorp2Mgbw,2501
|
56
|
+
batframework-1.0.8a3.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
|
57
|
+
batframework-1.0.8a3.dist-info/top_level.txt,sha256=vxAKBIk1oparFTxeXGBrgfIO7iq_YR5Fv1JvPVAIwmA,13
|
58
|
+
batframework-1.0.8a3.dist-info/RECORD,,
|
@@ -1,56 +0,0 @@
|
|
1
|
-
batFramework/__init__.py,sha256=5KS96Y0uDx8sue3NyDl2HTFh-CqEZc9otmnUXRCHXws,2189
|
2
|
-
batFramework/action.py,sha256=vVr4LjlIHnA6I1_OM6IXM8DGCeruDcdHLIU9pfrQy3Q,7950
|
3
|
-
batFramework/actionContainer.py,sha256=TVmfyBYILCkAKUnNsCIIaCXezffNZ_VK5H207ab1r3I,2587
|
4
|
-
batFramework/animatedSprite.py,sha256=1KmhUCX8q2JTyOr0ClLovJ21i6c2SkllTtqygmDSZvo,5168
|
5
|
-
batFramework/audioManager.py,sha256=BxSWDYqYy3IgNA9sBaJFspdjcUJWudBSV0OpCNR92Is,3886
|
6
|
-
batFramework/camera.py,sha256=ZgASlCwXGDU8-hljAz5WlVU3v4XPQ5mU0--kaOsRun0,9331
|
7
|
-
batFramework/constants.py,sha256=5PyZQZ4fCcLA8k_Upby9KGVF-3pnV2ZZ6t26CxiocPM,1102
|
8
|
-
batFramework/cutscene.py,sha256=WX2yXawR3NjL8db09SsRXtJtdJU_xlcHYtntRcJhtKs,3896
|
9
|
-
batFramework/cutsceneBlocks.py,sha256=Uezggx1XgmLvXW1GnuVkGj3tOM8AOxXYx1F9nFGvL-w,4788
|
10
|
-
batFramework/dynamicEntity.py,sha256=zp5ShM6fQ-a_hXTHA6UthbInfJl2XazsN6C2hll9nK8,665
|
11
|
-
batFramework/easingController.py,sha256=4N8GIp1fsaWBUlDxXx3SMwOq1Mrhn10MZZIO51_CRnk,1677
|
12
|
-
batFramework/entity.py,sha256=L3koW9q35Dpwsz9h9YWMuGal4PkowqsWklKZpZj7hM8,2003
|
13
|
-
batFramework/enums.py,sha256=lywBwvxsUTOXUhHCoau5P9LC9UNIx_E6hjvx3Zba-iw,2069
|
14
|
-
batFramework/fontManager.py,sha256=_pVcTmf1c42HPHfWZwvkEsAY46MljsTYFvl6h4f7Q8E,2240
|
15
|
-
batFramework/manager.py,sha256=YRKKv5qWVUs7D8ZqP8ZkfUeTCc3lHxfCfJSYdO5Ep8A,2375
|
16
|
-
batFramework/object.py,sha256=ErR1XxqIlI5jv_kZnDrt3jkyRZSba3aVGuMBNwExIq0,3045
|
17
|
-
batFramework/particle.py,sha256=yGGKjGtwzL-m48akGNsReLM82IPV1DzrsDy5SN_kMAw,2672
|
18
|
-
batFramework/renderGroup.py,sha256=DZCtO6cRO4qkIcVACexvitIcAaPdW6PZFhQX7XYUIeo,1979
|
19
|
-
batFramework/resourceManager.py,sha256=8ysiVDMVRKOGo_kNRH2BiqiUj07kddgi04iNcTt9T-Q,3094
|
20
|
-
batFramework/scene.py,sha256=66Xoy-7mq6WuFzAiJXicspbo0xH_ZbL_idYZuyV8wL4,10543
|
21
|
-
batFramework/sceneManager.py,sha256=hTqn_RCken49oDg21ZVybk0wwgmw693CgSiAB_4Oj9E,7053
|
22
|
-
batFramework/scrollingSprite.py,sha256=vNPWJV6QOf-wbuAgv-eLv1kiaOZiXt_2pqt6EEfg2Vk,4159
|
23
|
-
batFramework/sprite.py,sha256=nSfdhn6oH6Zm2y9XyzBR1vPlHrPiyLIqBds9sxy0jVA,1543
|
24
|
-
batFramework/stateMachine.py,sha256=er7WB7I4V81jgUrd-9ftfyYczKpPsEbgdWRXzYl6e9k,1339
|
25
|
-
batFramework/tileset.py,sha256=Iu32btkBs0_kkQjN5FKX76WmRnEIQGDY4OfoaOtGelc,1704
|
26
|
-
batFramework/time.py,sha256=IGRIY_g9kpdJxR5wt1lOnLsY9gMReuBJZqnpWRyR-CQ,3963
|
27
|
-
batFramework/transition.py,sha256=ioxT5KQQmgSY5yPXDV1CEAj6J_62D6YVU5NUk_Fude0,6442
|
28
|
-
batFramework/triggerZone.py,sha256=ikOOlJT1KIND0MO2xiilCHuKlb1eQhkCMEhZTi1btsI,586
|
29
|
-
batFramework/utils.py,sha256=GZMWNhkOcCuvmfTHVAbrXttU9LrwEdCp-kKM-2t2L08,1718
|
30
|
-
batFramework/gui/__init__.py,sha256=__IMtrybY8qFKvvv9lEEra2wLzfbDrDPyJucnc8q4zo,622
|
31
|
-
batFramework/gui/button.py,sha256=W5mKG-41F3J6hjrqhoTIRXyWPMk7hxFWK_g_XgjFfdU,354
|
32
|
-
batFramework/gui/clickableWidget.py,sha256=pG2UAGYATDH6ugEexiCL_XYstCaCVcNm4nwGwLk0QpU,6810
|
33
|
-
batFramework/gui/container.py,sha256=k3ExxMiJzhzdCVzhdvupJhB7LiALt5HbCUjlSFdeNVM,5315
|
34
|
-
batFramework/gui/debugger.py,sha256=1_QlUF1YRQqNSyM3UtLkYzjOL5iXkwg4PD3tVYF4--Q,3921
|
35
|
-
batFramework/gui/dialogueBox.py,sha256=8nHGlhznO2WL8pQilH0lzlAIMpnKGRSCaYPJrsoj1xk,3172
|
36
|
-
batFramework/gui/draggableWidget.py,sha256=iAZ1gGELOG5dmuA01SW8qw-hE4VdYQGQfDpuPqrood0,1358
|
37
|
-
batFramework/gui/image.py,sha256=fSyRaJH1D_yCohk-b7ZWl_eZ1o8uULjDQG1gCk3fofc,1513
|
38
|
-
batFramework/gui/indicator.py,sha256=Q_vbkHbTODwrk0WUytygnuHdXdqlORKBEfh_4DjRT4o,1561
|
39
|
-
batFramework/gui/interactiveWidget.py,sha256=-X9aCFOtwG7EdOdooH6QzcxiZGavyCIhavZoijLxJBU,3317
|
40
|
-
batFramework/gui/label.py,sha256=0NqzBQ_lBWnBgMuiFa4jnGEpWt6v8WllKC5N5EC34EA,10525
|
41
|
-
batFramework/gui/layout.py,sha256=mcYbXbQQmOqjGVWSb6PXAaPBBkYcod5B4fCl4aYIhoc,6201
|
42
|
-
batFramework/gui/meter.py,sha256=F8xVvFopIoqCQn0Qyj1LgSCAEupXdWOzZtcsIZ74UuY,2321
|
43
|
-
batFramework/gui/radioButton.py,sha256=ORfV242Iadn86y2uKzSFOhOWZIpnT2_Idn6ACGF8vcA,1976
|
44
|
-
batFramework/gui/root.py,sha256=_WtCwY3J51MdUDEVZc-grGJflDH959uApxVxiiSU8MM,4122
|
45
|
-
batFramework/gui/shape.py,sha256=54rFVur9xXc0v_0r3JNc9XAJJ92U0N0Ei3YBYFeCFkU,9702
|
46
|
-
batFramework/gui/slider.py,sha256=g0hfzxunLV5W-R39DT08__72pq1hzZSdKwaRDx1-Rmg,8199
|
47
|
-
batFramework/gui/textInput.py,sha256=SWJMvhtqKhGEDL2xlvfNehaz4DhHnJGUQ7FBp7jheTI,4569
|
48
|
-
batFramework/gui/toggle.py,sha256=UVBdRixgJwo4FsgWCitrIDrtc9ECa4u_ulPAqjHSGeo,4251
|
49
|
-
batFramework/gui/widget.py,sha256=9LYsSHy8FhzKyikDZG84cQdW9LMctaBIRDMXinZ9eWQ,11154
|
50
|
-
batFramework/gui/constraints/__init__.py,sha256=qqXE8nnSrEvCSeHdqY8UYPZLetqdubFPI7IdZuh35QE,26
|
51
|
-
batFramework/gui/constraints/constraints.py,sha256=TShcFnelbmNKWAJnpxAbLyKC6qMllo54fWjQPUbbvIs,13756
|
52
|
-
batframework-1.0.8a1.dist-info/LICENCE,sha256=A65iXbMDbOxQLDNOODJLqA7o5RxszYlEqIgNSzBQRf4,1073
|
53
|
-
batframework-1.0.8a1.dist-info/METADATA,sha256=yavYY6taCina5Brp4PEQVHp8k4tRu_WrDw5Cb-n1oAo,2501
|
54
|
-
batframework-1.0.8a1.dist-info/WHEEL,sha256=cpQTJ5IWu9CdaPViMhC9YzF8gZuS5-vlfoFihTBC86A,91
|
55
|
-
batframework-1.0.8a1.dist-info/top_level.txt,sha256=vxAKBIk1oparFTxeXGBrgfIO7iq_YR5Fv1JvPVAIwmA,13
|
56
|
-
batframework-1.0.8a1.dist-info/RECORD,,
|
File without changes
|
File without changes
|