Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional icons for server-side RUI announcements #883

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Northstar.Custom/mod/scripts/vscripts/sh_message_utils.gnut
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,14 @@ void function NSSendPopUpMessageToPlayer( entity player, string text )
ServerToClientStringCommand( player, "ServerHUDMessageShow " + eMessageType.POPUP )
}

void function NSSendAnnouncementMessageToPlayer( entity player, string title, string description, vector color, int priority, int style )
void function NSSendAnnouncementMessageToPlayer( entity player, string title, string description, vector color, int priority, int style, string image = "" )
{
ServerToClientStringCommand( player, "ServerHUDMessagePut " + eDataType.TITLE + " " + title )
ServerToClientStringCommand( player, "ServerHUDMessagePut " + eDataType.DESC + " " + description )
ServerToClientStringCommand( player, "ServerHUDMessagePut " + eDataType.COLOR + " " + color.x + " " + color.y + " " + color.z )
ServerToClientStringCommand( player, "ServerHUDMessagePut " + eDataType.PRIORITY + " " + priority )
ServerToClientStringCommand( player, "ServerHUDMessagePut " + eDataType.STYLE + " " + style )
ServerToClientStringCommand( player, "ServerHUDMessagePut " + eDataType.ASSET + " " + image )

ServerToClientStringCommand( player, "ServerHUDMessageShow " + eMessageType.ANNOUNCEMENT )
}
Expand Down Expand Up @@ -453,6 +454,7 @@ void function AnnouncementMessageHandler_Threaded()
Announcement_SetPriority( announcement, client.announcementQueue[0].priority )
Announcement_SetSoundAlias( announcement, SFX_HUD_ANNOUNCE_QUICK )
Announcement_SetStyle( announcement, client.announcementQueue[0].style )
Announcement_SetIcon( announcement, StringToAsset( strip( client.announcementQueue[0].image ) ) )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems weird that they are stored in the struct as a string and converted to asset here but eh, probably still the best way to do it

AnnouncementFromClass( GetLocalViewPlayer(), announcement )

wait 5
Expand Down
Loading