Skip to content

Commit e5ea94a

Browse files
authored
Merge pull request #8 from monkeyman192/update/146545
Add some extra data and checked patterns for 146545
2 parents f441fd0 + 1e56f79 commit e5ea94a

File tree

7 files changed

+607
-6
lines changed

7 files changed

+607
-6
lines changed

.github/workflows/pipeline.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ jobs:
3434
run: uv build
3535
- name: Lint and format code
3636
run: |
37-
uv run python -m twine check ./dist/*
3837
uv run ruff check ./nmspy
3938
uv run ruff format --check ./nmspy
4039
uv run python -m twine check ./dist/*
@@ -56,20 +55,24 @@ jobs:
5655
permissions:
5756
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
5857
steps:
58+
- name: Check whether to release
59+
uses: MathieuMoalic/action-python-package-new-version@v1.0.5
5960
- name: Download files for release
61+
if: env.PUBLISHING == 'true'
6062
uses: actions/download-artifact@v4
6163
with:
6264
name: python-package-distributions
6365
path: dist/
6466
- name: Publish package distributions to PyPI
67+
if: env.PUBLISHING == 'true'
6568
uses: pypa/gh-action-pypi-publish@release/v1
6669
with:
6770
attestations: true
6871

6972
test-release:
7073
name: Release NMSpy wheels and source build to test-PyPI
71-
# Release to the test PyPI if we have merged into master or if we have tagged.
72-
if: ${{ (github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags') }}
74+
# Only run this job if we merge into master. Addition check is added later.
75+
if: github.ref == 'refs/heads/master'
7376
needs:
7477
- build_test
7578
runs-on: ubuntu-latest
@@ -79,12 +82,16 @@ jobs:
7982
permissions:
8083
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
8184
steps:
85+
- name: Check whether to release
86+
uses: MathieuMoalic/action-python-package-new-version@v1.0.5
8287
- name: Download files for release
88+
if: env.PUBLISHING == 'true'
8389
uses: actions/download-artifact@v4
8490
with:
8591
name: python-package-distributions
8692
path: dist/
8793
- name: Publish package distributions to PyPI
94+
if: env.PUBLISHING == 'true'
8895
uses: pypa/gh-action-pypi-publish@release/v1
8996
with:
9097
repository-url: https://test.pypi.org/legacy/

nmspy/data/enums.py

Lines changed: 235 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from enum import IntEnum, Enum
1+
from enum import IntEnum, Enum, auto
22

33

44
class RespawnReason(IntEnum):
@@ -184,6 +184,240 @@ class GcInteractionType(IntEnum):
184184
BoneShop = 0x90
185185

186186

187+
class GcDamageType(IntEnum):
188+
Gun = 0x0
189+
Laser = 0x1
190+
Shotgun = 0x2
191+
Burst = 0x3
192+
Rail = 0x4
193+
Cannon = 0x5
194+
Explosion = 0x6
195+
Melee = 0x7
196+
ShipGun = 0x8
197+
ShipLaser = 0x9
198+
ShipShotgun = 0xA
199+
ShipMinigun = 0xB
200+
ShipRockets = 0xC
201+
ShipPlasma = 0xD
202+
VehicleGun = 0xE
203+
VehicleLaser = 0xF
204+
SentinelLaser = 0x10
205+
PlayerDamage = 0x11
206+
PlayerWeapons = 0x12
207+
ShipWeapons = 0x13
208+
VehicleWeapons = 0x14
209+
CombatEffects = 0x15
210+
Fiend = 0x16
211+
FreighterLaser = 0x17
212+
FreighterTorpedo = 0x18
213+
214+
215+
class GcStatsTypes(IntEnum):
216+
Unspecified = 0
217+
Weapon_Laser = auto()
218+
Weapon_Laser_Damage = auto()
219+
Weapon_Laser_Mining_Speed = auto()
220+
Weapon_Laser_HeatTime = auto()
221+
Weapon_Laser_Bounce = auto()
222+
Weapon_Laser_ReloadTime = auto()
223+
Weapon_Laser_Recoil = auto()
224+
Weapon_Laser_Drain = auto()
225+
Weapon_Laser_StrongLaser = auto()
226+
Weapon_Laser_ChargeTime = auto()
227+
Weapon_Laser_MiningBonus = auto()
228+
Weapon_Projectile = auto()
229+
Weapon_Projectile_Damage = auto()
230+
Weapon_Projectile_Range = auto()
231+
Weapon_Projectile_Rate = auto()
232+
Weapon_Projectile_ClipSize = auto()
233+
Weapon_Projectile_ReloadTime = auto()
234+
Weapon_Projectile_Recoil = auto()
235+
Weapon_Projectile_Bounce = auto()
236+
Weapon_Projectile_Homing = auto()
237+
Weapon_Projectile_Dispersion = auto()
238+
Weapon_Projectile_BulletsPerShot = auto()
239+
Weapon_Projectile_MinimumCharge = auto()
240+
Weapon_Projectile_MaximumCharge = auto()
241+
Weapon_Projectile_BurstCap = auto()
242+
Weapon_Projectile_BurstCooldown = auto()
243+
Weapon_ChargedProjectile = auto()
244+
Weapon_ChargedProjectile_ChargeTime = auto()
245+
Weapon_ChargedProjectile_CooldownDuration = auto()
246+
Weapon_ChargedProjectile_Drain = auto()
247+
Weapon_ChargedProjectile_ExtraSpeed = auto()
248+
Weapon_Rail = auto()
249+
Weapon_Shotgun = auto()
250+
Weapon_Burst = auto()
251+
Weapon_Flame = auto()
252+
Weapon_Cannon = auto()
253+
Weapon_Grenade = auto()
254+
Weapon_Grenade_Damage = auto()
255+
Weapon_Grenade_Radius = auto()
256+
Weapon_Grenade_Speed = auto()
257+
Weapon_Grenade_Bounce = auto()
258+
Weapon_Grenade_Homing = auto()
259+
Weapon_Grenade_Clusterbomb = auto()
260+
Weapon_TerrainEdit = auto()
261+
Weapon_SunLaser = auto()
262+
Weapon_SoulLaser = auto()
263+
Weapon_MineGrenade = auto()
264+
Weapon_FrontShield = auto()
265+
Weapon_Scope = auto()
266+
Weapon_Spawner = auto()
267+
Weapon_SpawnerAlt = auto()
268+
Weapon_Melee = auto()
269+
Weapon_StunGrenade = auto()
270+
Weapon_Stealth = auto()
271+
Weapon_Scan = auto()
272+
Weapon_Scan_Radius = auto()
273+
Weapon_Scan_Recharge_Time = auto()
274+
Weapon_Scan_Types = auto()
275+
Weapon_Scan_Binoculars = auto()
276+
Weapon_Scan_Discovery_Creature = auto()
277+
Weapon_Scan_Discovery_Flora = auto()
278+
Weapon_Scan_Discovery_Mineral = auto()
279+
Weapon_Scan_Secondary = auto()
280+
Weapon_Scan_Terrain_Resource = auto()
281+
Weapon_Scan_Surveying = auto()
282+
Weapon_Scan_BuilderReveal = auto()
283+
Weapon_Fish = auto()
284+
Weapon_Stun = auto()
285+
Weapon_Stun_Duration = auto()
286+
Weapon_Stun_Damage_Multiplier = auto()
287+
Weapon_FireDOT = auto()
288+
Weapon_FireDOT_Duration = auto()
289+
Weapon_FireDOT_DPS = auto()
290+
Weapon_FireDOT_Damage_Multiplier = auto()
291+
Suit_Armour_Health = auto()
292+
Suit_Armour_Shield = auto()
293+
Suit_Armour_Shield_Strength = auto()
294+
Suit_Energy = auto()
295+
Suit_Energy_Regen = auto()
296+
Suit_Protection = auto()
297+
Suit_Protection_Cold = auto()
298+
Suit_Protection_Heat = auto()
299+
Suit_Protection_Toxic = auto()
300+
Suit_Protection_Radiation = auto()
301+
Suit_Protection_Spook = auto()
302+
Suit_Protection_Pressure = auto()
303+
Suit_Underwater = auto()
304+
Suit_UnderwaterLifeSupport = auto()
305+
Suit_DamageReduce_Cold = auto()
306+
Suit_DamageReduce_Heat = auto()
307+
Suit_DamageReduce_Toxic = auto()
308+
Suit_DamageReduce_Radiation = auto()
309+
Suit_Protection_HeatDrain = auto()
310+
Suit_Protection_ColdDrain = auto()
311+
Suit_Protection_ToxDrain = auto()
312+
Suit_Protection_RadDrain = auto()
313+
Suit_Protection_WaterDrain = auto()
314+
Suit_Protection_SpookDrain = auto()
315+
Suit_Stamina_Strength = auto()
316+
Suit_Stamina_Speed = auto()
317+
Suit_Stamina_Recovery = auto()
318+
Suit_Jetpack = auto()
319+
Suit_Jetpack_Tank = auto()
320+
Suit_Jetpack_Drain = auto()
321+
Suit_Jetpack_Refill = auto()
322+
Suit_Jetpack_Ignition = auto()
323+
Suit_Jetpack_DoubleJump = auto()
324+
Suit_Jetpack_WaterEfficiency = auto()
325+
Suit_Jetpack_MidairRefill = auto()
326+
Suit_Refiner = auto()
327+
Suit_AutoTranslator = auto()
328+
Suit_Utility = auto()
329+
Suit_RocketLocker = auto()
330+
Suit_FishPlatform = auto()
331+
Suit_FoodUnit = auto()
332+
Suit_Denier = auto()
333+
Suit_Vehicle_Summon = auto()
334+
Ship_Weapons_Guns = auto()
335+
Ship_Weapons_Guns_Damage = auto()
336+
Ship_Weapons_Guns_Rate = auto()
337+
Ship_Weapons_Guns_HeatTime = auto()
338+
Ship_Weapons_Guns_CoolTime = auto()
339+
Ship_Weapons_Guns_Scale = auto()
340+
Ship_Weapons_Guns_BulletsPerShot = auto()
341+
Ship_Weapons_Guns_Dispersion = auto()
342+
Ship_Weapons_Guns_Range = auto()
343+
Ship_Weapons_Guns_Damage_Radius = auto()
344+
Ship_Weapons_Lasers = auto()
345+
Ship_Weapons_Lasers_Damage = auto()
346+
Ship_Weapons_Lasers_HeatTime = auto()
347+
Ship_Weapons_Missiles = auto()
348+
Ship_Weapons_Missiles_NumPerShot = auto()
349+
Ship_Weapons_Missiles_Speed = auto()
350+
Ship_Weapons_Missiles_Damage = auto()
351+
Ship_Weapons_Missiles_Size = auto()
352+
Ship_Weapons_Shotgun = auto()
353+
Ship_Weapons_MiniGun = auto()
354+
Ship_Weapons_Plasma = auto()
355+
Ship_Weapons_Rockets = auto()
356+
Ship_Weapons_ShieldLeech = auto()
357+
Ship_Armour_Shield = auto()
358+
Ship_Armour_Shield_Strength = auto()
359+
Ship_Armour_Health = auto()
360+
Ship_Scan = auto()
361+
Ship_Scan_EconomyFilter = auto()
362+
Ship_Scan_ConflictFilter = auto()
363+
Ship_Hyperdrive = auto()
364+
Ship_Hyperdrive_JumpDistance = auto()
365+
Ship_Hyperdrive_JumpsPerCell = auto()
366+
Ship_Hyperdrive_QuickWarp = auto()
367+
Ship_Launcher = auto()
368+
Ship_Launcher_TakeOffCost = auto()
369+
Ship_Launcher_AutoCharge = auto()
370+
Ship_PulseDrive = auto()
371+
Ship_PulseDrive_MiniJumpFuelSpending = auto()
372+
Ship_PulseDrive_MiniJumpSpeed = auto()
373+
Ship_Boost = auto()
374+
Ship_Maneuverability = auto()
375+
Ship_BoostManeuverability = auto()
376+
Ship_LifeSupport = auto()
377+
Ship_Drift = auto()
378+
Ship_Teleport = auto()
379+
Ship_CargoShield = auto()
380+
Ship_WaterLandingJet = auto()
381+
Freighter_Hyperdrive = auto()
382+
Freighter_Hyperdrive_JumpDistance = auto()
383+
Freighter_Hyperdrive_JumpsPerCell = auto()
384+
Freighter_MegaWarp = auto()
385+
Freighter_Teleport = auto()
386+
Freighter_Fleet_Boost = auto()
387+
Freighter_Fleet_Speed = auto()
388+
Freighter_Fleet_Fuel = auto()
389+
Freighter_Fleet_Combat = auto()
390+
Freighter_Fleet_Trade = auto()
391+
Freighter_Fleet_Explore = auto()
392+
Freighter_Fleet_Mine = auto()
393+
Vehicle_Boost = auto()
394+
Vehicle_Engine = auto()
395+
Vehicle_Scan = auto()
396+
Vehicle_EngineFuelUse = auto()
397+
Vehicle_EngineTopSpeed = auto()
398+
Vehicle_BoostSpeed = auto()
399+
Vehicle_BoostTanks = auto()
400+
Vehicle_Grip = auto()
401+
Vehicle_SkidGrip = auto()
402+
Vehicle_SubBoostSpeed = auto()
403+
Vehicle_Laser = auto()
404+
Vehicle_LaserDamage = auto()
405+
Vehicle_LaserHeatTime = auto()
406+
Vehicle_LaserStrongLaser = auto()
407+
Vehicle_Gun = auto()
408+
Vehicle_GunDamage = auto()
409+
Vehicle_GunHeatTime = auto()
410+
Vehicle_GunRate = auto()
411+
Vehicle_StunGun = auto()
412+
Vehicle_TerrainEdit = auto()
413+
Vehicle_FuelRegen = auto()
414+
Vehicle_AutoPilot = auto()
415+
Vehicle_Flame = auto()
416+
Vehicle_FlameDamage = auto()
417+
Vehicle_FlameHeatTime = auto()
418+
Vehicle_Refiner = auto()
419+
420+
187421
class GcAudioWwiseEvents(IntEnum):
188422
INVALID_EVENT = 0x0
189423
ABANDONED_DOOR_UNLOCK = 0x264BED2D

nmspy/data/nanovg.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Hello games uses nanovg (https://github.com/memononen/nanovg) for a lot of their UI rendering under the
2+
# hood.
3+
4+
# This file exposes a number of functions as hooks so that they can be used directly if needed.
5+
6+
import ctypes
7+
8+
from pymhf.core.hooking import static_function_hook
9+
10+
11+
class NVGcontext(ctypes.Structure):
12+
pass
13+
14+
15+
@static_function_hook("48 8B C4 48 89 58 ? 48 89 68 ? F3 0F 11 50")
16+
def nvgArc(
17+
ctx: ctypes._Pointer[NVGcontext],
18+
cx: ctypes.c_float,
19+
cy: ctypes.c_float,
20+
r: ctypes.c_float,
21+
a0: ctypes.c_float,
22+
a1: ctypes.c_float,
23+
dir: ctypes.c_int32,
24+
):
25+
"""Adds an arc segment at the corner defined by the last path point, and two specified points."""
26+
pass
27+
28+
29+
@static_function_hook(
30+
"48 8B C4 48 89 58 ? 48 89 70 ? 55 57 41 54 41 56 41 57 48 8D A8 ? ? ? ? 48 81 EC ? ? ? ? 0F 29 70 ? 48 8B F9"
31+
)
32+
def nvgText(
33+
ctx: ctypes._Pointer[NVGcontext],
34+
x: ctypes.c_float,
35+
y: ctypes.c_float,
36+
string: ctypes.c_char_p,
37+
end: ctypes.c_char_p,
38+
):
39+
"""Draws text string at specified location.
40+
If end is specified only the sub-string up to the end is drawn."""
41+
pass
42+
43+
44+
@static_function_hook("4C 8B DC 53 56 57 41 54 48 81 EC")
45+
def nvgTextBox(
46+
ctx: ctypes._Pointer[NVGcontext],
47+
x: ctypes.c_float,
48+
y: ctypes.c_float,
49+
breakRowWidth: ctypes.c_float,
50+
string: ctypes.c_char_p,
51+
end: ctypes.c_char_p,
52+
):
53+
"""
54+
Draws multi-line text string at specified location wrapped at the specified width.
55+
If end is specified only the sub-string up to the end is drawn.
56+
White space is stripped at the beginning of the rows, the text is split at word boundaries or when
57+
new-line characters are encountered.
58+
Words longer than the max width are slit at nearest character (i.e. no hyphenation).
59+
"""
60+
pass

0 commit comments

Comments
 (0)