PAL INFO CUSTOM HUD v0.8.2.1 - PLAYER TARGET SAFETY HOTFIX

PLAYER TARGET SAFETY HOTFIX (v0.8.2.1)

- Player-controlled characters are ignored before any position or Pal/NPC data is read.
- This includes the local player, remote multiplayer characters, and replication-transition fallbacks.
- Pal and human NPC detection remains unchanged.
- This hotfix is based directly on the stable v0.8.2 code.

=================================================

HUD-DRIVEN PERFORMANCE (v0.8.2)

- No recurring target scan timer runs while the player is not aiming.
- No periodic ExecuteInGameThread request is used during gameplay.
- The existing ReceiveDrawHUD event performs one lightweight real aim-state check.
- Target refresh and all Pal-data reads run only while aim is held.
- The old Card Detection Delay option is no longer used or displayed.

=================================================

DESCRIPTION
-----------
Pal Info Custom HUD displays a custom information card above the Pal or human NPC you are aiming at.

The mod includes a built-in F6 settings menu and can also integrate with DekModConfigMenu when it is installed.

MAIN FEATURES
-------------
- Automatic Pal and human NPC detection
- Name, level, gender, and elements
- Current and maximum HP
- Permanent black outline around the HP number
- Attack, Defense, and Work Speed
- HP, Attack, and Defense IV values
- Compact Work Suitability icons with rank values
- Equipped Active Skills, up to three
- Localized Active Skill names
- Stability-safe Active Skill name display
- Drop items with quantity range and drop chance
- Localized Passive Skill names
- Positive, negative, mixed, neutral, and unknown Passive indicators
- Configurable position, scale, background color, and transparency
- Built-in settings menu
- Optional DekModConfigMenu synchronization
- Automatic English, Simplified Chinese, Russian, Brazilian Portuguese, and Spanish interface localization
- Performance-oriented target scanning and HUD hook management

REQUIREMENTS
------------
- Palworld for Windows
- UE4SS

DekModConfigMenu is optional. The built-in menu works without it.

INSTALLATION
------------
1. Extract the PalInfoCustomHUD folder into:

   Palworld\Pal\Binaries\Win64\ue4ss\Mods

2. Keep the included empty enabled.txt inside the PalInfoCustomHUD folder.

3. Start the game. UE4SS activates the mod automatically; mods.txt does not need to be edited.


LOCALIZATION
------------
The mod interface always follows Palworld's active language automatically.
There is no manual language option in F6 or DekModConfigMenu.

Supported interface languages:
- English
- Simplified Chinese
- Russian
- Brazilian Portuguese
- Spanish

Pal names, Active Skill names, Passive names, and Drop item names are requested from Palworld in the game's current language. Unsupported interface cultures safely fall back to English.

BUILT-IN SETTINGS MENU
----------------------
Press F6 to open or close the settings menu.

While the menu is open:

- F1: Select the previous setting
- F2: Select the next setting
- F3: Decrease the selected value
- F4: Increase the selected value
- F5: Reset the selected setting
- F7: Restore all settings to their defaults

Available settings:

- Horizontal Position
- Vertical Position
- Card Scale
- Background Opacity
- Background Red
- Background Green
- Background Blue

Changes are applied immediately and saved automatically to:

   PalInfoCustomHUD\PalInfoCustomHUD.userconfig.lua

DEKMODCONFIGMENU SUPPORT
------------------------
When DekModConfigMenu is installed, Pal Info Custom HUD also appears in its menu.

Both configuration systems are synchronized:

- Changes made through F6 update the DekMCM configuration file.
- Changes saved through DekMCM update the built-in configuration file.
- The current settings remain available even if DekMCM is later removed.

DekModConfigMenu is not included with this download.

OTHER CONTROL
-------------
- F8: Enable or disable the Pal information overlay

ACTIVE SKILLS
-------------
The card displays up to three Active Skills currently equipped by the targeted Pal.

Each row shows the localized Active Skill name.

Skill power and element metadata are intentionally not queried in v0.7.15.
Palworld 1.0 with some experimental UE4SS builds can crash natively while
reading PalWazaDatabaseRaw table rows or FindWazaForBP output structs.
The unsafe metadata route is disabled instead of displaying a question-mark badge.

HP READABILITY
--------------
The current and maximum HP text always uses a black outline.

This outline remains active with opaque, translucent, and fully transparent card backgrounds.

TRANSPARENT BACKGROUND
----------------------
Set Background Opacity to 0.00.

The card background and header will not be drawn. The border, text, HP bar, IV badges, Active Skills, and Passive indicators remain visible.

PERFORMANCE
-----------
ReceiveDrawHUD is registered once per game session when the in-game HUD begins play. The mod does not run a separate recurring timer or periodic game-thread polling request.

While the player is not aiming, the existing HUD callback performs only a lightweight ShooterComponent aim-state check and returns before target, skill, passive, localization, drop, IV, or database work.

While aim is held, target refresh runs at a short interval from the same HUD callback. Static Pal information, Active Skill names, IVs, Passive Skills, Drops, and Work Suitability are rebuilt only when the target changes.

Pal element and Work Suitability textures are cached after their first use.

DROP ITEMS
----------
The Drops section reads Palworld's DropItemDataTable and displays up to six entries for the targeted Pal.

Each row includes:

- Localized item name
- Minimum/maximum quantity
- Drop chance percentage

The table is scanned only once and converted into plain Lua values. No temporary Unreal row structures are retained.

KNOWN LIMITATIONS
-----------------
The following features remain disabled because the tested native access routes can cause instability or crashes:

- Capture Chance
- Caught count
- PalBox count

UNINSTALLATION
--------------
Remove the PalInfoCustomHUD folder from ue4ss\Mods.

The mod does not edit save files and can be removed from an existing campaign.



V0.7.3 CHANGES
- Active Skills now use Palworld's own element icon textures.
- Suitability now uses only compact Palworld work icons plus the rank number.
- Passive polarity now prefers Palworld's rank/effect table before name-based fallbacks.
- Neutral Passive traits use an = marker instead of being shown as unknown.


COMPILE FIX
-----------
This build reorganizes the compact icon and passive-classification helpers to remain below UE4SS Lua's 200-local-variable limit. No v0.7.3 feature was removed.


V0.7.4 CHANGES
- Adjusted Active Skill and Suitability icon vertical alignment.
- Added an experimental Drops section with localized item names, quantity ranges, and percentages.
- Drop data is read directly from DropItemDataTable and cached as plain Lua values.


VERSION 0.7.5
- Displays up to six drops in a compact two-column grid.
- Keeps drop quantity and percentage visible in each column.
- Increases Active Skill element icons and Suitability work icons.

Version 0.7.6 performance notes
- Drop icons were removed to reduce Canvas texture draws.
- Up to six drops are shown in two columns.
- Idle target scans run once every 2 seconds.
- Dynamic attributes refresh once every 0.75 seconds while the card is visible.
- The DekMCM file fallback is checked once every 5 seconds; the Save hook remains immediate.


AUTOMATIC LANGUAGE DETECTION
----------------------------
At startup, the mod reads Palworld's active Unreal language/culture, which normally follows the Steam game-language setting. The HUD interface automatically selects English, Simplified Chinese, Russian, Brazilian Portuguese, or Spanish. Other cultures use English as a safe fallback.

The language cannot be changed from the mod menu; change Palworld's language instead.

CARD DETECTION DELAY REMOVED
----------------------------
The old Card Detection Delay option is ignored and no longer appears in F6 or DekMCM. Aim detection now follows the existing HUD draw event, so there is no separate idle scan interval to configure.


AUTO LANGUAGE FIX (v0.7.8a)
-----------------------------
Auto language detection now correctly converts UE4SS FString values returned by
Palworld's internationalization library. The mod also rechecks the active game
culture after startup in case localization initializes after the Lua mod.


## Work Suitability Icons

Work Suitability levels and icons are read separately. Version 0.7.8b corrects the game-specific mapping between EPalWorkSuitability IDs and the original T_icon_palwork_00-12 textures, including Oil Extraction and Medicine Production.



Localization safety note (v0.7.8f+)
Active Skill and Drop item names do not force transient Unreal FText conversion or scan localization tables at runtime. Some experimental UE4SS builds can crash natively on those routes. The mod uses compatibility-first game text when safely exposed and falls back to internal English names when necessary. Localization results remain cached per language for the current session.

STEAM WORKSHOP SETTINGS
-----------------------
When installed through Steam Workshop, the mod can be loaded from a path such as:

Steam\steamapps\workshop\content\1623730\<WorkshopItemID>

F6 settings are stored separately in:

%LOCALAPPDATA%\Pal\Saved\PalInfoCustomHUD\PalInfoCustomHUD.userconfig.lua

This prevents Workshop updates from resetting the player configuration. Existing settings from older versions are migrated automatically.

TARGET SCAN WATCHDOG AND VERSION DISPLAY (v0.7.10)

To avoid delayed native UE4SS assertions, the mod no longer repeatedly registers and unregisters ReceiveDrawHUD. The hook is registered once and stays idle when nothing is visible. The F6 settings title always shows the exact installed mod version.


TARGET SCAN RECOVERY (v0.7.10)
--------------------------------
- Fixed the Pal information card stopping after the mod had been running for a while.
- Added recovery for game-thread scan requests that are dropped during loading or HUD/world recreation.
- Added a low-frequency HUD watchdog that restarts a lost target-scan timer chain.
- Opening/closing the F6 menu and re-enabling the HUD with F8 now reset and restart target detection safely.
- The ReceiveDrawHUD hook remains registered once and is never unregistered during the session.




PAL NAME / NICKNAME FIX (v0.7.24)
--------------------------------------
- Every Pal card now keeps a visible localized species or variant name.
- A nickname replaces that name only when GetNickname contains a distinct player-created nickname.
- Empty, default, internal-ID, and malformed nickname values are ignored.
- Human and special NPC display-name behavior is preserved.


PASSIVE NAME + RANK COLOR RULES (v0.7.18)
------------------------------------
- Internal CharacterID codenames are now converted through a broad verified display-name fallback table.
- FlyingManta is displayed as Celaray, matching the visible Pal name instead of the internal blueprint/enum name.
- Game/database values identical to the internal codename are rejected before drawing the HUD title.
- A player-created nickname is still appended in the format Celaray (nickname).

PASSIVE RANK ICON UV FIX (v0.7.16)
-----------------------------------
- Fixed the original rank-arrow texture being repeated/tiled inside its row.
- The full texture now uses normalized UV coordinates and is drawn exactly once.
- Positive/negative direction and rank magnitude remain unchanged.

ACTIVE SKILL NATIVE-CRASH SAFETY (v0.7.15)
------------------------------------------------
- Disabled runtime scans of the Waza data table.
- Disabled FindWazaForBP output-struct inspection.
- These UE4SS routes could access an invalid PalWazaDatabaseRaw wrapper and crash the game natively.
- Active Skill names remain visible.
- Power badges and element icons are hidden when the metadata cannot be obtained safely.
- Target-scan recovery, Workshop settings, localization, Drops, IVs, Passives, and Suitability remain enabled.


VERSION 0.7.13 NOTES
--------------------
- Restored Active Skill Power and Element icons through a one-time direct-field cache.
- The unsafe Get/unwrap path on temporary Waza table rows remains disabled.
- Passive Skills now use Palworld's original rank-arrow textures instead of + / - / ~ markers whenever rank data is available.
- Rank values are read during the existing passive-table cache build, without an additional scan.

UE4SS LOCALIZATION OUT-PARAMETER FIX (v0.7.24)

- GetWazaName, GetItemName, GetNickname, GetDisplayNickName, and GetLocalizedCharacterName now receive the explicit Lua out table required by UE4SS 3.x.
- The FText stored in the out table is converted with GetDisplayString(), allowing game-provided Simplified Chinese names to be displayed correctly.
- Legacy calls without the out argument are no longer used because native UFunction parameter errors can bypass Lua pcall and terminate the game.
- Internal English names remain only as a safe fallback when Palworld does not return localized text.

ELEMENT ICONS, CRASH SAFETY, CLEAN LOG (v0.7.24)

- Correct element texture mapping for all nine Palworld elements.
- Grass/Electric and Earth/Dragon icons are no longer swapped.
- Active Skill element icons are slightly larger and better aligned with the skill row.
- PassiveSkillList is read directly from SaveParameter instead of calling GetPassiveSkillList().
- Target validity is checked between each static-data section.
- UE4SS log output is limited to one load line and real errors.


ACTIVE SKILL ELEMENT REFERENCE + ALIGNMENT (v0.7.29)

- All 384 skills from the supplied PalDB Active Skills reference have an explicit canonical element.
- Element texture IDs now follow Palworld's actual UI order.
- The per-skill reference overrides ambiguous or reordered enum values.
- The 23 px skill element icon is drawn 3 px lower for better baseline alignment.
- Localization out-parameter safety, passive-list crash protection, and clean logging remain enabled.
