Skip to content

Hud display#47

Merged
MathisGredt merged 9 commits intomainfrom
hudDisplay
May 8, 2025
Merged

Hud display#47
MathisGredt merged 9 commits intomainfrom
hudDisplay

Conversation

@Giovanniricotta2002
Copy link
Member

This pull request introduces a new HUD overlay system for rendering custom graphical overlays in the game, alongside related utility classes and updates. The changes include the creation of a modular overlay framework, the addition of specific overlays (e.g., helmet condition, radiation effects, and event-based text), and the refactoring of existing code to integrate the new system. Below are the most important changes grouped by theme:

New HUD Overlay Framework

  • Added the HudOverlay interface defining the contract for all HUD overlays, including methods for rendering, priority management, and activation checks (src/main/java/net/nuclearteam/createnuclear/foundation/events/HudOverlay.java).
  • Introduced HudOverlayRegistry to manage the registration and retrieval of all HUD overlays (src/main/java/net/nuclearteam/createnuclear/foundation/events/HudOverlayRegistry.java).
  • Implemented EasingHudOverlay, an abstract class providing smooth fade-in/out effects for overlays (src/main/java/net/nuclearteam/createnuclear/foundation/events/EasingHudOverlay.java).

New HUD Overlays

  • Added HelmetOverlay to display helmet durability and condition, dynamically adjusting priority and rendering based on the helmet's state (src/main/java/net/nuclearteam/createnuclear/foundation/events/overlay/HelmetOverlay.java).
  • Created RadiationOverlay, which shows a radiation effect when the player is irradiated, using dynamic coverage scaling and smooth transitions (src/main/java/net/nuclearteam/createnuclear/foundation/events/overlay/RadiationOverlay.java).
  • Introduced EventTextOverlay to display localized text messages triggered by specific events (src/main/java/net/nuclearteam/createnuclear/foundation/events/overlay/EventTextOverlay.java).

Refactoring and Integration

  • Refactored CNClientEvent to handle the rendering of overlays using the new framework, ensuring overlays are sorted and rendered based on priority (src/main/java/net/nuclearteam/createnuclear/foundation/events/CNClientEvent.java).
  • Removed the obsolete CommentEventClients class as its functionality was integrated into the new system (src/main/java/net/nuclearteam/createnuclear/foundation/events/CommentEventClients.java).

Utility Enhancements

  • Added RenderHelper, a utility class for rendering full-screen textures with optional scaling and transparency, optimized with caching to avoid redundant rendering (src/main/java/net/nuclearteam/createnuclear/foundation/utility/RenderHelper.java).

Minor Fixes

  • Corrected a variable name typo in CNCOnfiguredFeatures from stoneOreReplaceables to stoneOreReplaceable (src/main/java/net/nuclearteam/createnuclear/infrastructure/worldgen/CNCOnfiguredFeatures.java).

@MathisGredt MathisGredt merged commit 0da15a7 into main May 8, 2025
@MathisGredt MathisGredt deleted the hudDisplay branch May 8, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants