added key selection setting

fixed amb309

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40825
This commit is contained in:
David Anderson
2007-05-21 01:11:37 +00:00
parent 98374f2ce6
commit daceab19cd
7 changed files with 53 additions and 1 deletions
+8 -1
View File
@@ -286,6 +286,8 @@ void CRadioDisplay::SendRawDisplay(int client, unsigned int time)
cell_t players[1] = {client};
int _sel_keys = (keys == 0) ? (1<<9) : keys;
char *ptr = buffer;
char save = 0;
while (true)
@@ -296,7 +298,7 @@ void CRadioDisplay::SendRawDisplay(int client, unsigned int time)
ptr[240] = '\0';
}
bf_write *buffer = g_UserMsgs.StartMessage(g_ShowMenuId, players, 1, 0);
buffer->WriteWord(keys);
buffer->WriteWord(_sel_keys);
buffer->WriteChar(time ? time : -1);
buffer->WriteByte( (len > 240) ? 1 : 0 );
buffer->WriteString(ptr);
@@ -317,6 +319,11 @@ void CRadioDisplay::DeleteThis()
delete this;
}
bool CRadioDisplay::SetSelectableKeys(unsigned int keymap)
{
keys = (signed)keymap;
}
CRadioMenu::CRadioMenu(IMenuHandler *pHandler, IdentityToken_t *pOwner) :
CBaseMenu(pHandler, &g_RadioMenuStyle, pOwner)
{
+1
View File
@@ -78,6 +78,7 @@ public: //IMenuPanel
bool SendDisplay(int client, IMenuHandler *handler, unsigned int time);
void DeleteThis();
void SendRawDisplay(int client, unsigned int time);
bool SetSelectableKeys(unsigned int keymap);
private:
String m_BufferText;
String m_Title;
+5
View File
@@ -305,6 +305,11 @@ bool CValveMenuDisplay::SendDisplay(int client, IMenuHandler *handler, unsigned
return g_ValveMenuStyle.DoClientMenu(client, this, handler, time);
}
bool CValveMenuDisplay::SetSelectableKeys(unsigned int keymap)
{
return false;
}
CValveMenu::CValveMenu(IMenuHandler *pHandler, IdentityToken_t *pOwner) :
CBaseMenu(pHandler, &g_ValveMenuStyle, pOwner),
m_IntroColor(255, 0, 0, 255)
+1
View File
@@ -82,6 +82,7 @@ public:
bool CanDrawItem(unsigned int drawFlags);
void SendRawDisplay(int client, int priority, unsigned int time);
void DeleteThis();
bool SetSelectableKeys(unsigned int keymap);
private:
KeyValues *m_pKv;
unsigned int m_NextPos;
+15
View File
@@ -855,6 +855,20 @@ static cell_t SendPanelToClient(IPluginContext *pContext, const cell_t *params)
return 1;
}
static cell_t SetPanelKeys(IPluginContext *pContext, const cell_t *params)
{
Handle_t hndl = (Handle_t)params[1];
HandleError err;
IMenuPanel *panel;
if ((err=ReadPanelHandle(hndl, &panel)) != HandleError_None)
{
return pContext->ThrowNativeError("Menu handle %x is invalid (error %d)", hndl, err);
}
return panel->SetSelectableKeys(params[2]);
}
REGISTER_NATIVES(menuNatives)
{
{"AddMenuItem", AddMenuItem},
@@ -885,5 +899,6 @@ REGISTER_NATIVES(menuNatives)
{"SetMenuPagination", SetMenuPagination},
{"SetMenuTitle", SetMenuTitle},
{"SetPanelTitle", SetPanelTitle},
{"SetPanelKeys", SetPanelKeys},
{NULL, NULL},
};