| 78 | } |
| 79 | |
| 80 | void ValveMenuStyle::HookCreateMessage(edict_t *pEdict, |
| 81 | DIALOG_TYPE type, |
| 82 | KeyValues *kv, |
| 83 | IServerPluginCallbacks *plugin) |
| 84 | { |
| 85 | if (type != DIALOG_MENU) |
| 86 | { |
| 87 | return; |
| 88 | } |
| 89 | |
| 90 | int client = IndexOfEdict(pEdict); |
| 91 | if (client < 1 || client > 256) |
| 92 | { |
| 93 | return; |
| 94 | } |
| 95 | |
| 96 | CValveMenuPlayer *player = &m_players[client]; |
| 97 | |
| 98 | /* We don't care if the player is in a menu because, for all intents and purposes, |
| 99 | * the menu is completely private. Instead, we just figure out the level we'll need |
| 100 | * in order to override it. |
| 101 | */ |
| 102 | player->curPrioLevel = kv->GetInt("level", player->curPrioLevel); |
| 103 | |
| 104 | /* Oh no! What happens if we got a menu that overwrites ours?! */ |
| 105 | if (player->bInMenu) |
| 106 | { |
| 107 | /* Okay, let the external menu survive for now. It may live another |
| 108 | * day to avenge its grandfather, killed in the great Menu Interruption |
| 109 | * battle. |
| 110 | */ |
| 111 | _CancelClientMenu(client, MenuCancel_Interrupted, true); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | IMenuPanel *ValveMenuStyle::CreatePanel() |
| 116 | { |
nothing calls this directly
no test coverage detected