Fix not working MENU_DEBUG (#1506)

Replace g_Logger to logger for MENU_DEBUG
This commit is contained in:
Vladimir 2021-06-21 14:11:35 +03:00 committed by GitHub
parent 8075ce8371
commit 267eb90da5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 27 deletions

View File

@ -36,7 +36,7 @@
#include "MenuManager.h" #include "MenuManager.h"
#include "CellRecipientFilter.h" #include "CellRecipientFilter.h"
#if defined MENU_DEBUG #if defined MENU_DEBUG
#include "Logger.h" #include <bridge/include/ILogger.h>
#endif #endif
#include "logic_bridge.h" #include "logic_bridge.h"
#include "AutoHandleRooter.h" #include "AutoHandleRooter.h"
@ -59,7 +59,7 @@ Handle_t BaseMenuStyle::GetHandle()
void BaseMenuStyle::AddClientToWatch(int client) void BaseMenuStyle::AddClientToWatch(int client)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] AddClientToWatch(%d)", client); logger->LogMessage("[SM_MENU] AddClientToWatch(%d)", client);
#endif #endif
m_WatchList.push_back(client); m_WatchList.push_back(client);
} }
@ -67,7 +67,7 @@ void BaseMenuStyle::AddClientToWatch(int client)
void BaseMenuStyle::RemoveClientFromWatch(int client) void BaseMenuStyle::RemoveClientFromWatch(int client)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] RemoveClientFromWatch(%d)", client); logger->LogMessage("[SM_MENU] RemoveClientFromWatch(%d)", client);
#endif #endif
m_WatchList.remove(client); m_WatchList.remove(client);
} }
@ -75,7 +75,7 @@ void BaseMenuStyle::RemoveClientFromWatch(int client)
void BaseMenuStyle::_CancelClientMenu(int client, MenuCancelReason reason, bool bAutoIgnore/* =false */) void BaseMenuStyle::_CancelClientMenu(int client, MenuCancelReason reason, bool bAutoIgnore/* =false */)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] _CancelClientMenu() (client %d) (bAutoIgnore %d) (reason %d)", client, bAutoIgnore, reason); logger->LogMessage("[SM_MENU] _CancelClientMenu() (client %d) (bAutoIgnore %d) (reason %d)", client, bAutoIgnore, reason);
#endif #endif
CBaseMenuPlayer *player = GetMenuPlayer(client); CBaseMenuPlayer *player = GetMenuPlayer(client);
menu_states_t &states = player->states; menu_states_t &states = player->states;
@ -115,7 +115,7 @@ void BaseMenuStyle::_CancelClientMenu(int client, MenuCancelReason reason, bool
void BaseMenuStyle::CancelMenu(CBaseMenu *menu) void BaseMenuStyle::CancelMenu(CBaseMenu *menu)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] CancelMenu() (menu %p)", menu); logger->LogMessage("[SM_MENU] CancelMenu() (menu %p)", menu);
#endif #endif
int maxClients = g_Players.GetMaxClients(); int maxClients = g_Players.GetMaxClients();
for (int i=1; i<=maxClients; i++) for (int i=1; i<=maxClients; i++)
@ -135,7 +135,7 @@ void BaseMenuStyle::CancelMenu(CBaseMenu *menu)
bool BaseMenuStyle::CancelClientMenu(int client, bool autoIgnore) bool BaseMenuStyle::CancelClientMenu(int client, bool autoIgnore)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] CancelClientMenu() (client %d) (bAutoIgnore %d)", client, autoIgnore); logger->LogMessage("[SM_MENU] CancelClientMenu() (client %d) (bAutoIgnore %d)", client, autoIgnore);
#endif #endif
if (client < 1 || client > g_Players.MaxClients()) if (client < 1 || client > g_Players.MaxClients())
{ {
@ -191,7 +191,7 @@ MenuSource BaseMenuStyle::GetClientMenu(int client, void **object)
void BaseMenuStyle::OnClientDisconnected(int client) void BaseMenuStyle::OnClientDisconnected(int client)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] OnClientDisconnected(%d)", client); logger->LogMessage("[SM_MENU] OnClientDisconnected(%d)", client);
#endif #endif
CBaseMenuPlayer *player = GetMenuPlayer(client); CBaseMenuPlayer *player = GetMenuPlayer(client);
if (!player->bInMenu) if (!player->bInMenu)
@ -214,7 +214,7 @@ void BaseMenuStyle::ProcessWatchList()
} }
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("BaseMenuStyle::ProcessWatchList(%d,%d,%d,%d,%d,%p)", logger->LogMessage("BaseMenuStyle::ProcessWatchList(%d,%d,%d,%d,%d,%p)",
m_WatchList.m_Size, m_WatchList.m_Size,
m_WatchList.m_FirstLink, m_WatchList.m_FirstLink,
m_WatchList.m_FreeNodes, m_WatchList.m_FreeNodes,
@ -232,7 +232,7 @@ void BaseMenuStyle::ProcessWatchList()
#if defined MENU_DEBUG #if defined MENU_DEBUG
if (total) if (total)
{ {
g_Logger.LogMessage("[SM_MENU] ProcessWatchList() found %d clients", total); logger->LogMessage("[SM_MENU] ProcessWatchList() found %d clients", total);
} }
#endif #endif
@ -244,7 +244,7 @@ void BaseMenuStyle::ProcessWatchList()
client = do_lookup[i]; client = do_lookup[i];
player = GetMenuPlayer(client); player = GetMenuPlayer(client);
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] ProcessWatchList() (client %d) (bInMenu %d) (menuHoldTime %d) (curTime %f) (menuStartTime %f)", logger->LogMessage("[SM_MENU] ProcessWatchList() (client %d) (bInMenu %d) (menuHoldTime %d) (curTime %f) (menuStartTime %f)",
client, client,
player->bInMenu, player->bInMenu,
player->menuHoldTime, player->menuHoldTime,
@ -254,7 +254,7 @@ void BaseMenuStyle::ProcessWatchList()
if (!player->bInMenu || !player->menuHoldTime) if (!player->bInMenu || !player->menuHoldTime)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] ProcessWatchList() removing client %d", client); logger->LogMessage("[SM_MENU] ProcessWatchList() removing client %d", client);
#endif #endif
m_WatchList.remove(client); m_WatchList.remove(client);
continue; continue;
@ -269,7 +269,7 @@ void BaseMenuStyle::ProcessWatchList()
void BaseMenuStyle::ClientPressedKey(int client, unsigned int key_press) void BaseMenuStyle::ClientPressedKey(int client, unsigned int key_press)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] ClientPressedKey() (client %d) (key_press %d)", client, key_press); logger->LogMessage("[SM_MENU] ClientPressedKey() (client %d) (key_press %d)", client, key_press);
#endif #endif
CBaseMenuPlayer *player = GetMenuPlayer(client); CBaseMenuPlayer *player = GetMenuPlayer(client);
@ -412,7 +412,7 @@ void BaseMenuStyle::ClientPressedKey(int client, unsigned int key_press)
bool BaseMenuStyle::DoClientMenu(int client, IMenuPanel *menu, IMenuHandler *mh, unsigned int time) bool BaseMenuStyle::DoClientMenu(int client, IMenuPanel *menu, IMenuHandler *mh, unsigned int time)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] DoClientMenu() (client %d) (panel %p) (mh %p) (time %d)", logger->LogMessage("[SM_MENU] DoClientMenu() (client %d) (panel %p) (mh %p) (time %d)",
client, client,
menu, menu,
mh, mh,
@ -475,7 +475,7 @@ bool BaseMenuStyle::DoClientMenu(int client,
unsigned int time) unsigned int time)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] DoClientMenu() (client %d) (menu %p) (mh %p) (time %d)", logger->LogMessage("[SM_MENU] DoClientMenu() (client %d) (menu %p) (mh %p) (time %d)",
client, client,
menu, menu,
mh, mh,
@ -487,7 +487,7 @@ bool BaseMenuStyle::DoClientMenu(int client,
if (!pPlayer || pPlayer->IsFakeClient() || !pPlayer->IsInGame()) if (!pPlayer || pPlayer->IsFakeClient() || !pPlayer->IsInGame())
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] DoClientMenu(): Failed to display to client %d", client); logger->LogMessage("[SM_MENU] DoClientMenu(): Failed to display to client %d", client);
#endif #endif
mh->OnMenuCancel(menu, client, MenuCancel_NoDisplay); mh->OnMenuCancel(menu, client, MenuCancel_NoDisplay);
mh->OnMenuEnd(menu, MenuEnd_Cancelled); mh->OnMenuEnd(menu, MenuEnd_Cancelled);
@ -498,7 +498,7 @@ bool BaseMenuStyle::DoClientMenu(int client,
if (player->bAutoIgnore) if (player->bAutoIgnore)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] DoClientMenu(): Client %d is autoIgnoring", client); logger->LogMessage("[SM_MENU] DoClientMenu(): Client %d is autoIgnoring", client);
#endif #endif
mh->OnMenuCancel(menu, client, MenuCancel_NoDisplay); mh->OnMenuCancel(menu, client, MenuCancel_NoDisplay);
mh->OnMenuEnd(menu, MenuEnd_Cancelled); mh->OnMenuEnd(menu, MenuEnd_Cancelled);
@ -517,7 +517,7 @@ bool BaseMenuStyle::DoClientMenu(int client,
if (player->bInMenu) if (player->bInMenu)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] DoClientMenu(): Cancelling old menu to client %d", client); logger->LogMessage("[SM_MENU] DoClientMenu(): Cancelling old menu to client %d", client);
#endif #endif
_CancelClientMenu(client, MenuCancel_Interrupted, true); _CancelClientMenu(client, MenuCancel_Interrupted, true);
} }
@ -532,7 +532,7 @@ bool BaseMenuStyle::DoClientMenu(int client,
if (!display) if (!display)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] DoClientMenu(): Failed to render to client %d", client); logger->LogMessage("[SM_MENU] DoClientMenu(): Failed to render to client %d", client);
#endif #endif
player->bAutoIgnore = false; player->bAutoIgnore = false;
player->bInMenu = false; player->bInMenu = false;
@ -562,7 +562,7 @@ bool BaseMenuStyle::DoClientMenu(int client,
player->bAutoIgnore = false; player->bAutoIgnore = false;
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] DoClientMenu() finished successfully (client %d)", client); logger->LogMessage("[SM_MENU] DoClientMenu() finished successfully (client %d)", client);
#endif #endif
return true; return true;
@ -571,7 +571,7 @@ bool BaseMenuStyle::DoClientMenu(int client,
bool BaseMenuStyle::RedoClientMenu(int client, ItemOrder order) bool BaseMenuStyle::RedoClientMenu(int client, ItemOrder order)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] RedoClientMenu() (client %d) (order %d)", client, order); logger->LogMessage("[SM_MENU] RedoClientMenu() (client %d) (order %d)", client, order);
#endif #endif
CBaseMenuPlayer *player = GetMenuPlayer(client); CBaseMenuPlayer *player = GetMenuPlayer(client);
menu_states_t &states = player->states; menu_states_t &states = player->states;
@ -581,7 +581,7 @@ bool BaseMenuStyle::RedoClientMenu(int client, ItemOrder order)
if (!display) if (!display)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] RedoClientMenu(): Failed to render menu"); logger->LogMessage("[SM_MENU] RedoClientMenu(): Failed to render menu");
#endif #endif
if (player->menuHoldTime) if (player->menuHoldTime)
{ {
@ -598,7 +598,7 @@ bool BaseMenuStyle::RedoClientMenu(int client, ItemOrder order)
player->bAutoIgnore = false; player->bAutoIgnore = false;
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] RedoClientMenu(): Succeeded to client %d", client); logger->LogMessage("[SM_MENU] RedoClientMenu(): Succeeded to client %d", client);
#endif #endif
return true; return true;
@ -805,7 +805,7 @@ void CBaseMenu::Cancel()
} }
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] CBaseMenu::Cancel(%p) (m_bShouldDelete %d)", logger->LogMessage("[SM_MENU] CBaseMenu::Cancel(%p) (m_bShouldDelete %d)",
this, this,
m_bShouldDelete); m_bShouldDelete);
#endif #endif
@ -829,7 +829,7 @@ void CBaseMenu::Destroy(bool releaseHandle)
} }
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] CBaseMenu::Destroy(%p) (release %d) (m_bCancelling %d) (m_bShouldDelete %d)", logger->LogMessage("[SM_MENU] CBaseMenu::Destroy(%p) (release %d) (m_bCancelling %d) (m_bShouldDelete %d)",
this, this,
releaseHandle, releaseHandle,
m_bCancelling, m_bCancelling,

View File

@ -35,7 +35,7 @@
#include <IGameConfigs.h> #include <IGameConfigs.h>
#include "PlayerManager.h" #include "PlayerManager.h"
#if defined MENU_DEBUG #if defined MENU_DEBUG
#include "Logger.h" #include <bridge/include/ILogger.h>
#endif #endif
#include "logic_bridge.h" #include "logic_bridge.h"
@ -199,7 +199,7 @@ void CRadioStyle::OnUserMessageSent(int msg_id)
{ {
int client = g_last_clients[i]; int client = g_last_clients[i];
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] CRadioStyle got ShowMenu (client %d) (bInMenu %d)", logger->LogMessage("[SM_MENU] CRadioStyle got ShowMenu (client %d) (bInMenu %d)",
client, client,
m_players[client].bInExternMenu); m_players[client].bInExternMenu);
#endif #endif
@ -578,7 +578,7 @@ bool CRadioMenu::DisplayAtItem(int client,
IMenuHandler *alt_handler) IMenuHandler *alt_handler)
{ {
#if defined MENU_DEBUG #if defined MENU_DEBUG
g_Logger.LogMessage("[SM_MENU] CRadioMenu::Display(%p) (client %d) (time %d)", logger->LogMessage("[SM_MENU] CRadioMenu::Display(%p) (client %d) (time %d)",
this, this,
client, client,
time); time);