Raised This Month: $ Target: $400
 0% 

[TF2] Hud Messages (tf2hudmsg)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
reBane
Senior Member
Join Date: May 2020
Plugin ID:
7755
Plugin Version:
23w45b
Plugin Category:
Technical/Development
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Show messages in additional HUD UI | CursorAnnotation and HudMessageCustom
    Old 08-12-2021 , 14:06   [TF2] Hud Messages (tf2hudmsg)
    Reply With Quote #1

    Library for hud message stuff in TF2.

    This plugins exists mainly because CursorAnnotations, the thing e.g. Annotations, Gravestone Markers and ChatBubbles use, require a server wide unique id for their cursor annotations from how I understand. Not only does this library track and manage those ids, but it also provides nice natives in form of a methodmap to manage, show and hide those annotations again.

    I also provide natives for HudMessageCustom, a small element centered in the lower half of the Hud. The only thing you should consider with this is, that cl_hud_minmode 1 or tf_hud_notification_duration 0 hides this element, so it probably shouldn't display critical information. The HudMessageCustom natives have an option to strip morecolors color values, so if you display messages that would normally be colored in chat do not print color formats in the hud.

    Requires morecolors.inc (1.9.1) to compile.

    You can view the Source and latest Release on GitHub

    Changelog
    Attached Files
    File Type: inc tf2hudmsg.inc (8.2 KB, 76 views)
    File Type: sp Get Plugin or Get Source (tf2hudmsg.sp - 57 views - 21.0 KB)
    File Type: smx tf2hudmsg.smx (22.9 KB, 69 views)

    Last edited by reBane; 11-13-2023 at 13:10. Reason: Update to 23w45b
    reBane is offline
    reBane
    Senior Member
    Join Date: May 2020
    Old 08-17-2021 , 09:23   Re: [TF2] Hud Messages (tf2hudmsg)
    Reply With Quote #2

    OK, so recently I learned that CurorAnnotations use EditorPanel, and those would use the supplied text to search for localizations (resource/tf_language.txt).
    That alone wouldn't be too bad, but that also means that it tries to replace %parameters and that can lead to strange results and bleeding strings, so I added a method to handle that:

    Update to 21w33a
    • Added EscapeVGUILocalization in case CursorAnnotation's VGUI EditablePanel are not supposed to look up keys and placeholders.
      - will prefix ^#?\w*$ strings with \x1f to prevent key lookup
      - will replace % with % (\xEF\xBC\x85) to prevent placeholder bind errors
    reBane is offline
    reBane
    Senior Member
    Join Date: May 2020
    Old 09-06-2021 , 05:24   Re: [TF2] Hud Messages (tf2hudmsg)
    Reply With Quote #3

    Update to 21w35a
    • Added autoClose to CursorAnnotations for "fire and forget" usage:
      Code:
      CursorAnnotation annotation = CursorAnnotation();
      annotation.SetLifetime(5.0);
      annotation.AutoClose = true;
      ...
      annotation.Update();
      // annotation.Close() is not required
    • Manipulating CursorAnnotations now requires the ID to be used (aka you can't just use view_as on random IDs)
    reBane is offline
    reBane
    Senior Member
    Join Date: May 2020
    Old 11-10-2023 , 13:24   Re: [TF2] Hud Messages (tf2hudmsg)
    Reply With Quote #4

    Update to 23w45a
    • Increased message length limit to 512
    • Exposed ShowDistance
    • Improved annotation tracking
    • Added support for 100 players
    • Lifetime can now be set negative for infinite
    • You can now initialize arrays with `INVALID_ANNOTATION`
    Should be compatible with older versions
    __________________
    Plugins & LibrariesListingGitHubDosMikeTools ▶ ToDo
    reBane is offline
    reBane
    Senior Member
    Join Date: May 2020
    Old 11-13-2023 , 13:10   Re: [TF2] Hud Messages (tf2hudmsg)
    Reply With Quote #5

    Update 23w45b
    • Fixed client visibility bitfield
    • Fixed follow entity only taking indices
    __________________
    Plugins & LibrariesListingGitHubDosMikeTools ▶ ToDo
    reBane is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 21:04.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode