trainerbase 4.4.1__tar.gz → 4.5.0__tar.gz

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.
Files changed (39) hide show
  1. {trainerbase-4.4.1 → trainerbase-4.5.0}/PKG-INFO +1 -1
  2. {trainerbase-4.4.1 → trainerbase-4.5.0}/pyproject.toml +1 -1
  3. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/gui/teleport.py +38 -6
  4. {trainerbase-4.4.1 → trainerbase-4.5.0}/.gitignore +0 -0
  5. {trainerbase-4.4.1 → trainerbase-4.5.0}/LICENSE +0 -0
  6. {trainerbase-4.4.1 → trainerbase-4.5.0}/README.md +0 -0
  7. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/__init__.py +0 -0
  8. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/abc.py +0 -0
  9. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/codeinjection.py +0 -0
  10. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/common/__init__.py +0 -0
  11. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/common/abc.py +0 -0
  12. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/common/helpers.py +0 -0
  13. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/common/keyboard.py +0 -0
  14. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/common/rainbow.py +0 -0
  15. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/common/tapper.py +0 -0
  16. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/common/teleport.py +0 -0
  17. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/config.py +0 -0
  18. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/gameobject.py +0 -0
  19. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/gui/__init__.py +0 -0
  20. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/gui/helpers.py +0 -0
  21. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/gui/injections.py +0 -0
  22. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/gui/misc.py +0 -0
  23. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/gui/objects.py +0 -0
  24. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/gui/rainbow.py +0 -0
  25. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/gui/scripts.py +0 -0
  26. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/gui/speedhack.py +0 -0
  27. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/gui/tapper.py +0 -0
  28. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/gui/types.py +0 -0
  29. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/logger.py +0 -0
  30. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/main.py +0 -0
  31. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/memory.py +0 -0
  32. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/process.py +0 -0
  33. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/py.typed +0 -0
  34. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/scriptengine.py +0 -0
  35. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/speedhack.py +0 -0
  36. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase/tts.py +0 -0
  37. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase_vendor/FASM.EXE +0 -0
  38. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase_vendor/speedhack32.dll +0 -0
  39. {trainerbase-4.4.1 → trainerbase-4.5.0}/trainerbase_vendor/speedhack64.dll +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: trainerbase
3
- Version: 4.4.1
3
+ Version: 4.5.0
4
4
  Summary: Framework for creating game trainers/mods
5
5
  Project-URL: Homepage, https://gitlab.com/python-trainers/
6
6
  Project-URL: Repository, https://gitlab.com/python-trainers/trainer-base
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "trainerbase"
3
- version = "4.4.1"
3
+ version = "4.5.0"
4
4
  description = "Framework for creating game trainers/mods"
5
5
  license = "MIT"
6
6
  authors = [
@@ -16,6 +16,9 @@ from trainerbase.tts import say
16
16
  class TeleportUI(AbstractUIComponent):
17
17
  DPG_TAG_TELEPORT_LABELS = "__teleport_labels"
18
18
  DPG_TAG_TELEPORT_LABEL_FILTER_INPUT = "__dpg_tag_teleport_label_filter_input"
19
+ POSITION_ID_MANUAL_PRIMARY = "__position_id_manual_primary"
20
+ POSITION_ID_MANUAL_SECONDARY = "__position_id_manual_secondary"
21
+ POSITION_ID_BEFORE_DASH = "__position_id_before_dash"
19
22
 
20
23
  def __init__(
21
24
  self,
@@ -24,6 +27,7 @@ class TeleportUI(AbstractUIComponent):
24
27
  hotkey_set_saved_position: str | None = "Home",
25
28
  hotkey_dash: str | None = "End",
26
29
  hotkey_secondary_position_modifier: str = "Shift",
30
+ hotkey_dash_rollback: str = "Shift+End",
27
31
  *,
28
32
  tts_on_hotkey: bool = True,
29
33
  ):
@@ -32,6 +36,7 @@ class TeleportUI(AbstractUIComponent):
32
36
  self.hotkey_set_saved_position = hotkey_set_saved_position
33
37
  self.hotkey_secondary_position_modifier = hotkey_secondary_position_modifier
34
38
  self.hotkey_dash = hotkey_dash
39
+ self.hotkey_dash_rollback = hotkey_dash_rollback
35
40
  self.tts_on_hotkey = tts_on_hotkey
36
41
 
37
42
  @override
@@ -69,10 +74,19 @@ class TeleportUI(AbstractUIComponent):
69
74
 
70
75
  @suppress_memory_exceptions
71
76
  def on_hotkey_dash_press(self):
77
+ self.tp.save_position(self.POSITION_ID_BEFORE_DASH)
72
78
  self.tp.dash()
79
+
73
80
  if self.tts_on_hotkey:
74
81
  say("Dash!")
75
82
 
83
+ @suppress_memory_exceptions
84
+ def on_hotkey_dash_rollback_press(self):
85
+ self.tp.restore_saved_position(self.POSITION_ID_BEFORE_DASH)
86
+
87
+ if self.tts_on_hotkey:
88
+ say("Dash Rollback!")
89
+
76
90
  @suppress_memory_exceptions
77
91
  def on_goto_label(self):
78
92
  self.tp.goto(dpg.get_value(self.DPG_TAG_TELEPORT_LABELS))
@@ -81,8 +95,14 @@ class TeleportUI(AbstractUIComponent):
81
95
  if self.hotkey_save_position is None or self.hotkey_set_saved_position is None:
82
96
  return
83
97
 
84
- add_hotkey(self.hotkey_save_position, partial(self.on_hotkey_save_position_press, 0))
85
- add_hotkey(self.hotkey_set_saved_position, partial(self.on_hotkey_set_saved_position_press, 0))
98
+ add_hotkey(
99
+ self.hotkey_save_position,
100
+ partial(self.on_hotkey_save_position_press, self.POSITION_ID_MANUAL_PRIMARY),
101
+ )
102
+ add_hotkey(
103
+ self.hotkey_set_saved_position,
104
+ partial(self.on_hotkey_set_saved_position_press, self.POSITION_ID_MANUAL_PRIMARY),
105
+ )
86
106
 
87
107
  hotkey_secondary_position_hint = ""
88
108
  if self.hotkey_secondary_position_modifier:
@@ -91,8 +111,14 @@ class TeleportUI(AbstractUIComponent):
91
111
  f"{self.hotkey_secondary_position_modifier} + {self.hotkey_set_saved_position}"
92
112
  )
93
113
  hotkey_secondary_position_hint = f"[{self.hotkey_secondary_position_modifier} +] "
94
- add_hotkey(hotkey_save_secondary_position, partial(self.on_hotkey_save_position_press, 1))
95
- add_hotkey(hotkey_set_secondary_saved_position, partial(self.on_hotkey_set_saved_position_press, 1))
114
+ add_hotkey(
115
+ hotkey_save_secondary_position,
116
+ partial(self.on_hotkey_save_position_press, self.POSITION_ID_MANUAL_SECONDARY),
117
+ )
118
+ add_hotkey(
119
+ hotkey_set_secondary_saved_position,
120
+ partial(self.on_hotkey_set_saved_position_press, self.POSITION_ID_MANUAL_SECONDARY),
121
+ )
96
122
 
97
123
  dpg.add_text(f"[{hotkey_secondary_position_hint}{self.hotkey_save_position}] Save Position")
98
124
  dpg.add_text(f"[{hotkey_secondary_position_hint}{self.hotkey_set_saved_position}] Restore Position")
@@ -101,9 +127,15 @@ class TeleportUI(AbstractUIComponent):
101
127
  if self.hotkey_dash is None:
102
128
  return
103
129
 
104
- add_hotkey(self.hotkey_dash, self.on_hotkey_dash_press)
130
+ with dpg.group(horizontal=True):
131
+ add_hotkey(self.hotkey_dash, self.on_hotkey_dash_press)
132
+ dpg.add_text(f"[{self.hotkey_dash}] Dash")
133
+
134
+ if self.hotkey_dash_rollback is None:
135
+ return
105
136
 
106
- dpg.add_text(f"[{self.hotkey_dash}] Dash")
137
+ add_hotkey(self.hotkey_dash_rollback, self.on_hotkey_dash_rollback_press)
138
+ dpg.add_text(f"/ [{self.hotkey_dash_rollback}] Dash Rollback")
107
139
 
108
140
  def _tp_add_labels_if_needed(self):
109
141
  if not self.tp.labels:
File without changes
File without changes
File without changes