Skip to content

Commit

Permalink
Revert "Allow sending panels to SourceTV client via settings"
Browse files Browse the repository at this point in the history
This reverts commit 93bb5eb.
  • Loading branch information
A1mDev committed Dec 30, 2024
1 parent 93bb5eb commit 22116be
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 45 deletions.
14 changes: 1 addition & 13 deletions core/MenuStyle_Base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,19 +419,7 @@ bool BaseMenuStyle::DoClientMenu(int client, IMenuPanel *menu, IMenuHandler *mh,
time);
#endif
CPlayer *pPlayer = g_Players.GetPlayerByIndex(client);
if (!pPlayer || !pPlayer->IsInGame())
{
return false;
}

if (pPlayer->IsSourceTV())
{
if (!menu->IsAllowSendToSourceTV())
{
return false;
}
}
else if (pPlayer->IsFakeClient())
if (!pPlayer || pPlayer->IsFakeClient() || !pPlayer->IsInGame())
{
return false;
}
Expand Down
11 changes: 0 additions & 11 deletions core/MenuStyle_Radio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ void CRadioDisplay::Reset()
m_Title.assign("");
m_NextPos = 1;
keys = 0;
m_SendToSourceTV = false;
}

bool CRadioDisplay::DirectSet(const char *str)
Expand Down Expand Up @@ -360,16 +359,6 @@ bool CRadioDisplay::SetCurrentKey(unsigned int key)
return true;
}

bool CRadioDisplay::IsAllowSendToSourceTV()
{
return m_SendToSourceTV;
}

void CRadioDisplay::SetSendToSourceTV(bool type)
{
m_SendToSourceTV = type;
}

bool CRadioDisplay::SendDisplay(int client, IMenuHandler *handler, unsigned int time)
{
return g_RadioMenuStyle.DoClientMenu(client, this, handler, time);
Expand Down
3 changes: 0 additions & 3 deletions core/MenuStyle_Radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,11 @@ class CRadioDisplay : public IMenuPanel
int GetAmountRemaining();
unsigned int GetApproxMemUsage();
bool DirectSet(const char *str);
bool IsAllowSendToSourceTV();
void SetSendToSourceTV(bool type);
private:
String m_BufferText;
String m_Title;
unsigned int m_NextPos;
int keys;
bool m_SendToSourceTV;
};

class CRadioMenu : public CBaseMenu
Expand Down
2 changes: 0 additions & 2 deletions core/MenuStyle_Valve.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ class CValveMenuDisplay : public IMenuPanel
int GetAmountRemaining();
unsigned int GetApproxMemUsage();
bool DirectSet(const char *str) { return false; }
bool IsAllowSendToSourceTV() { return false; }
void SetSendToSourceTV(bool type) {}
private:
KeyValues *m_pKv;
unsigned int m_NextPos;
Expand Down
2 changes: 0 additions & 2 deletions core/logic/smn_menus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1308,8 +1308,6 @@ static cell_t SendPanelToClient(IPluginContext *pContext, const cell_t *params)
}

CPanelHandler *handler = g_MenuHelpers.GetPanelHandler(pFunction);
panel->SetSendToSourceTV((params[0] >= 5) ? params[5] : false);

if (!panel->SendDisplay(params[2], handler, params[4]))
{
g_MenuHelpers.FreePanelHandler(handler);
Expand Down
3 changes: 1 addition & 2 deletions plugins/include/menus.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1061,11 +1061,10 @@ native bool SetPanelKeys(Handle panel, int keys);
* @param client A client to draw to.
* @param handler The MenuHandler function to catch actions with.
* @param time Time to hold the menu for.
* @param sendToSTV Allow this menu to be sent to SourceTV
* @return True on success, false on failure.
* @error Invalid Handle.
*/
native bool SendPanelToClient(Handle panel, int client, MenuHandler handler, int time, bool sendToSTV = false);
native bool SendPanelToClient(Handle panel, int client, MenuHandler handler, int time);

/**
* @brief Returns the amount of text the menu can still hold. If this is
Expand Down
12 changes: 0 additions & 12 deletions public/IMenuManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,6 @@ namespace SourceMod
* @return True if supported, otherwise false.
*/
virtual bool DirectSet(const char *str) =0;

/**
* @brief Enabled or disabled sending menus to SourceTV
*
* @return True if enabled, otherwise false.
*/
virtual bool IsAllowSendToSourceTV() = 0;

/**
* @brief Enable or disable sending menus to SourceTV
*/
virtual void SetSendToSourceTV(bool type) = 0;
};

/**
Expand Down

0 comments on commit 22116be

Please sign in to comment.