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

RFC: MSTACK Toasts #1361

Open
EntranceJew opened this issue Feb 4, 2024 · 0 comments
Open

RFC: MSTACK Toasts #1361

EntranceJew opened this issue Feb 4, 2024 · 0 comments
Labels
type/rework Big changes or overhaul of an existing feature

Comments

@EntranceJew
Copy link
Contributor

Is your feature request related to a problem? Please describe.

  • MSTACK spams a lot of messages which disappear relatively quickly.
  • Counter-intuitively, it also quickly fills the screen with information that can limit visibility.
  • The MSTACK should have an ability to refresh existing notifications to minimize noise.

Describe the solution you'd like

Goal

  • The player gets a notification on a subject.
  • When a new notification on the same subject arrives, it "refreshes" the message timer and visually moves up the stack.

Implementation

An API similar to:

local uuid = MSTACK:AddMessage("win_showreport")

-- some time in the future:
MSTACK:UpdateMessage(uuid, "round_begintime")

-- further still:
MSTACK:UpdateMessage(uuid, "round_selected")
MSTACK:UpdateMessage(uuid, "round_started")

or something like:

-- completely hypothetical server-sided code:
notif.Push("round_state", "round_begintime")

-- later:
notif.Push("round_state", "round_selected")
notif.Push("round_state", "round_started")

which on the client, would manifest as:

MSTACK.keys = {}

local function notif()
  local key = net.ReadString()
  local msg = net.ReadString()
  local uuid = MSTACK.keys[key]
  if uuid then
    MSTACK:UpdateMessage(uuid, msg)
  else
    MSTACK.keys[key] = MSTACK:AddMessage(msg)
  end
end
net.Receive("ttt2_notif_push", notif)

or more likely something to do with MSTACK.msgs

Describe alternatives you've considered

  • ripping out things and replacing it with netmessages

Additional context

More difficult, as most of the MSTACK stuff has it, traces through exclusively client code:

EndRound
LANG.Msg
LANG.ProcessMsg
LANG.ShowStyledMsg
LANG.Styles

Which, as an aside, makes it extremely difficult to send a client a message in their native language which includes parameter tokens that are also interpreted from their native language (e.g. a weapon name inside a notification regarding the weapon they're trying to lift originating from the server, referring to another language string -- this requires a lot of single-purpose netmessages that serve the same goal).

@Histalek Histalek added keepalive type/rework Big changes or overhaul of an existing feature labels Feb 4, 2024
@Histalek Histalek added this to the Feature Backlog milestone May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/rework Big changes or overhaul of an existing feature
Projects
None yet
Development

No branches or pull requests

2 participants