mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-09 03:18:25 +00:00
use shavit-mapchooser list for some shavit-stats stuff
This commit is contained in:
parent
d45429127a
commit
c89e1d4400
@ -2315,10 +2315,10 @@ void DebugPrint(const char[] message, any ...)
|
|||||||
|
|
||||||
public any Native_GetMapsArrayList(Handle plugin, int numParams)
|
public any Native_GetMapsArrayList(Handle plugin, int numParams)
|
||||||
{
|
{
|
||||||
return g_aMapList;
|
return CloneHandle(g_aMapList, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
public any Native_GetMapsStringMap(Handle plugin, int numParams)
|
public any Native_GetMapsStringMap(Handle plugin, int numParams)
|
||||||
{
|
{
|
||||||
return g_mMapList;
|
return CloneHandle(g_mMapList, plugin);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -757,6 +757,29 @@ Action OpenStatsMenu(int client, int steamid, int style = 0, int item = 0)
|
|||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gB_CanOpenMenu[client] = false;
|
||||||
|
|
||||||
|
DataPack data = new DataPack();
|
||||||
|
data.WriteCell(GetClientSerial(client));
|
||||||
|
data.WriteCell(item);
|
||||||
|
|
||||||
|
if (gB_Mapchooser && gCV_UseMapchooser.BoolValue)
|
||||||
|
{
|
||||||
|
char sQuery[2048];
|
||||||
|
FormatEx(sQuery, sizeof(sQuery),
|
||||||
|
"SELECT ",
|
||||||
|
);
|
||||||
|
|
||||||
|
gH_SQL.Query(OpenStatsMenu_Mapchooser_Callback, sQuery, data, DBPrio_Low);
|
||||||
|
|
||||||
|
return Plugin_Handled;
|
||||||
|
}
|
||||||
|
|
||||||
|
return OpenStatsMenu_Main(client, steamid, style, item, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
Action OpenStatsMenu_Main(int client, int steamid, int style, int item, DataPack data)
|
||||||
|
{
|
||||||
// big ass query, looking for optimizations TODO
|
// big ass query, looking for optimizations TODO
|
||||||
char sQuery[2048];
|
char sQuery[2048];
|
||||||
|
|
||||||
@ -788,12 +811,6 @@ Action OpenStatsMenu(int client, int steamid, int style = 0, int item = 0)
|
|||||||
"LIMIT 1;", gS_MySQLPrefix, steamid, style, gS_MySQLPrefix, gS_MySQLPrefix, steamid, style, gS_MySQLPrefix, steamid, gS_MySQLPrefix, steamid, style, gS_MySQLPrefix, gS_MySQLPrefix, steamid, style, gS_MySQLPrefix, steamid, style);
|
"LIMIT 1;", gS_MySQLPrefix, steamid, style, gS_MySQLPrefix, gS_MySQLPrefix, steamid, style, gS_MySQLPrefix, steamid, gS_MySQLPrefix, steamid, style, gS_MySQLPrefix, gS_MySQLPrefix, steamid, style, gS_MySQLPrefix, steamid, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
gB_CanOpenMenu[client] = false;
|
|
||||||
|
|
||||||
DataPack data = new DataPack();
|
|
||||||
data.WriteCell(GetClientSerial(client));
|
|
||||||
data.WriteCell(item);
|
|
||||||
|
|
||||||
gH_SQL.Query(OpenStatsMenuCallback, sQuery, data, DBPrio_Low);
|
gH_SQL.Query(OpenStatsMenuCallback, sQuery, data, DBPrio_Low);
|
||||||
|
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
@ -1092,21 +1109,20 @@ public void ShowMapsCallback(Database db, DBResultSet results, const char[] erro
|
|||||||
|
|
||||||
Menu menu = new Menu(MenuHandler_ShowMaps);
|
Menu menu = new Menu(MenuHandler_ShowMaps);
|
||||||
|
|
||||||
if(gI_MapType[client] == MAPSDONE)
|
StringMap mapchooser_maps = gCV_UseMapchooser.BoolValue ? Shavit_GetMapsStringMap() : null;
|
||||||
{
|
|
||||||
menu.SetTitle("%T (%s)", "MapsDoneFor", client, gS_StyleStrings[gI_Style[client]].sShortName, gS_TargetName[client], rows, sTrack);
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
menu.SetTitle("%T (%s)", "MapsLeftFor", client, gS_StyleStrings[gI_Style[client]].sShortName, gS_TargetName[client], rows, sTrack);
|
|
||||||
}
|
|
||||||
|
|
||||||
while(results.FetchRow())
|
while(results.FetchRow())
|
||||||
{
|
{
|
||||||
char sMap[PLATFORM_MAX_PATH];
|
char sMap[PLATFORM_MAX_PATH];
|
||||||
results.FetchString(0, sMap, sizeof(sMap));
|
results.FetchString(0, sMap, sizeof(sMap));
|
||||||
|
|
||||||
|
bool x;
|
||||||
|
if (mapchooser_maps && !mapchooser_maps.GetValue(sMap, x))
|
||||||
|
{
|
||||||
|
--rows;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
char sRecordID[PLATFORM_MAX_PATH];
|
char sRecordID[PLATFORM_MAX_PATH];
|
||||||
char sDisplay[PLATFORM_MAX_PATH];
|
char sDisplay[PLATFORM_MAX_PATH];
|
||||||
|
|
||||||
@ -1157,6 +1173,17 @@ public void ShowMapsCallback(Database db, DBResultSet results, const char[] erro
|
|||||||
menu.AddItem(sRecordID, sDisplay);
|
menu.AddItem(sRecordID, sDisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete mapchooser_maps;
|
||||||
|
|
||||||
|
if(gI_MapType[client] == MAPSDONE)
|
||||||
|
{
|
||||||
|
menu.SetTitle("%T (%s)", "MapsDoneFor", client, gS_StyleStrings[gI_Style[client]].sShortName, gS_TargetName[client], rows, sTrack);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
menu.SetTitle("%T (%s)", "MapsLeftFor", client, gS_StyleStrings[gI_Style[client]].sShortName, gS_TargetName[client], rows, sTrack);
|
||||||
|
}
|
||||||
|
|
||||||
if(menu.ItemCount == 0)
|
if(menu.ItemCount == 0)
|
||||||
{
|
{
|
||||||
char sMenuItem[64];
|
char sMenuItem[64];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user