MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / Radio_Init

Method Radio_Init

core/MenuStyle_Radio.cpp:459–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459void CRadioMenuPlayer::Radio_Init(int keys, const char *title, const char *text)
460{
461 if (title[0] != '\0')
462 {
463 display_len = ke::SafeSprintf(display_pkt,
464 sizeof(display_pkt),
465 "%s\n%s",
466 title,
467 text);
468 }
469 else
470 {
471 display_len = ke::SafeStrcpy(display_pkt,
472 sizeof(display_pkt),
473 text);
474 }
475
476 // Some games have implemented CHudMenu::SelectMenuItem to close the menu
477 // even if an invalid slot has been selected, which causes us a problem as
478 // we'll never get any notification from the client and we'll keep the menu
479 // alive on our end indefinitely. For these games, pretend that every slot
480 // is valid for selection so we're guaranteed to get a menuselect command.
481 // We don't want to do this for every game as the common SelectMenuItem
482 // implementation ignores invalid selections and keeps the menu open, which
483 // is a much nicer user experience.
484 display_keys = s_RadioClosesOnInvalidSlot ? 0x7ff : keys;
485}
486
487void CRadioMenuPlayer::Radio_Refresh()
488{

Callers 1

SendRawDisplayMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected