Skip to content
I Can't Believe It's Not HUDMessage!
Branch: master
Clone or download
MajorCooke and OrdinaryMagician Indefinite Duration Support + Saves fixes (#2)
* Added support for -1 (forever) hold duration. This includes fading in before holding indefinitely.

- Pass in names instead of fonts through functions. Names are serializable and Font.GetFont can accept names.
- Replaced HUDFont with regular Font instead. HUDFont is apparently an abstract class that causes saves to immediately abort when loading.
- Added a safety check for PlainMsg and WaggleMsg which prints if the font cannot be found, and will abort attempting to make a message.

* Apply indefinite holding for anything with a hold duration < 0 rather than just -1.
Latest commit 298c33e Jan 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
Message.txt
README.md Already part of stable GZDoom (and QZDoom) Jul 11, 2018
zmapinfo.txt Initial commit. Mar 6, 2018
zscript.txt

README.md

I Can't Believe It's Not HUDMessage

This is an example API for GZDoom's ZScript HUDMessage interface.

Hopefully it shouldn't be as ugly as ACS HUDMessage.

The API

The main handler deals with queued messages every tick on play and ui sides.

Each notHudMessage class should have a companion QueuedMsg class. There are two ways to create a message:

From play scope:

  1. Call the static function Create() of the notHudMessage to get a QueuedMsg.
  2. Call the static function notHudMessageHandler.QueueMsg() with the created message.

From ui scope:

  1. Creation is the same as on play.
  2. Call AddSelf() on the created message.

Creating new messages

To implement new messages, you should create both a subclass of notHudMessage and a subclass of QueuedMsg. Virtual functions to take into account are:

  • notHudMessage.Setup() : For initializing variables on creation. Parent class function must be called.
  • notHudMessage.DrawLine() : Called for each line that has to be drawn.
  • notHudMessage.DoTick() : Called each tic. Return true to mark the message as expired. Parent class function must be called.
  • QueuedMsg.AddSelf() : For adding the message to the Status Bar.

In addition, each subclass of notHudMessage must implement its own static clearscope Create() function, with its own set of parameters and return type, to create an instance of its QueuedMsg subclass. Note that this is NOT a virtual function, so there's no overrides to set or anything.

Included message types

  • notHudMessage : The standard, plain message. Will have fade in and fade out in the future.
  • notHudMessageTypeon : (TODO) The text "types" itself character by character. Fade-in is handled per-character. Once the text is complete, it'll wait for the hold time then fade out as normal.
  • notHudMessageWaggle : Example new effect. The text waggles in a wavy pattern.
You can’t perform that action at this time.