Skip to content

feat: Add HUD message queue natives - #391

Open
lozatto wants to merge 7 commits into
rehlds:masterfrom
lozatto:master
Open

feat: Add HUD message queue natives#391
lozatto wants to merge 7 commits into
rehlds:masterfrom
lozatto:master

Conversation

@lozatto

@lozatto lozatto commented Sep 3, 2026

Copy link
Copy Markdown

🚀 Summary

This Pull Request integrates ReAPI with the new HUD Message Queue system recently created in ReGameDLL_CS, preventing multiple on-screen messages from overlapping or flickering improperly.

Additionally, this PR fixes GitHub Actions compilation failures that occurred when the repository lacked configured GPG/PFX keys in its secrets.

🛠️ What was done?

1. HUD Message Queue (natives_misc.cpp & reapi_gamedll.inc)
To accommodate all developer profiles and avoid the classic "global state" issues of the old set_hudmessage, the integration was created using two approaches:

  • Modern Mode (All-in-One): Created the core rg_send_hudmessage C++ native. It bundles colors, positions, effects, and the message execution in a single call, bringing better performance and safety.
  • Backwards-compatible Mode: For those who just want to update legacy plugins without rewriting everything into a single line, the rg_set_hudmessage and rg_show_hudmessage stocks were added. They perfectly simulate the old behavior, but format and route the payload under the hood directly to the new Native Queue.

2. CI/CD Workflow Fix (build.yml)

  • The GPG (Linux) and PFX (Windows) key import steps now conditionally check for the existence of the secret keys before attempting to process them. If the keys are missing, the system will just print skipping signature and finish the build successfully.

💻 Usage Examples (Pawn)

🔸 Modern Approach (Recommended)

Fast, clean, and immune to global state issues. Everything is sent in a single line:

#include <amxmodx>
#include <reapi>

public client_putinserver(id) {
    // rg_send_hudmessage(index, message[], red, green, blue, x, y, effects, fxtime, holdtime, fadeintime, fadeouttime, channel)
    
    rg_send_hudmessage(id, "Welcome to the server!", 
        .red = 0, .green = 255, .blue = 0, 
        .x = -1.0, .y = 0.25, 
        .effects = 1, .holdtime = 5.0
    );
}

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.

1 participant