-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from hx-w/dev-1.3.0
Dev 1.3.0 pre release
- Loading branch information
Showing
10 changed files
with
561 additions
and
257 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
|
||
void GetAllProMatchStat(client) { | ||
new Handle:menuhandle = CreateMenu(ProMatchInfoMenuCallback); | ||
SetMenuTitle(menuhandle, "职业比赛合集"); | ||
|
||
for (new idx = 0; idx < g_aProMatchInfo.Length; idx++) { | ||
char team1[LENGTH_NAME], team2[LENGTH_NAME], time[LENGTH_NAME]; | ||
char matchId[LENGTH_NAME]; | ||
JSON_Object arrval = g_aProMatchInfo.GetObject(idx); | ||
JSON_Object teamInfo_1 = arrval.GetObject("team1"); | ||
JSON_Object teamInfo_2 = arrval.GetObject("team2"); | ||
teamInfo_1.GetString("name", team1, sizeof(team1)); | ||
teamInfo_2.GetString("name", team2, sizeof(team2)); | ||
int score1 = teamInfo_1.GetInt("result"); | ||
int score2 = teamInfo_2.GetInt("result"); | ||
arrval.GetString("time", time, sizeof(time)); | ||
arrval.GetString("matchId", matchId, sizeof(matchId)); | ||
char msg[LENGTH_NAME * 4]; | ||
Format(msg, sizeof(msg), "[%s] %d : %d [%s] (%s)", team1, score1, score2, team2, time); | ||
AddMenuItem(menuhandle, matchId, msg); | ||
} | ||
SetMenuPagination(menuhandle, 7); | ||
SetMenuExitBackButton(menuhandle, true); | ||
SetMenuExitButton(menuhandle, true); | ||
DisplayMenu(menuhandle, client, MENU_TIME_FOREVER); | ||
} | ||
|
||
|
||
public ProMatchInfoMenuCallback(Handle:menuhandle, MenuAction:action, client, Position) { | ||
if (MenuAction_Select == action) { | ||
decl String:matchId[LENGTH_NAME]; | ||
GetMenuItem(menuhandle, Position, matchId, sizeof(matchId)); | ||
|
||
// set index | ||
for (new idx = 0; idx < g_aProMatchInfo.Length; idx++) { | ||
char _matchId[LENGTH_NAME]; | ||
JSON_Object arrval = g_aProMatchInfo.GetObject(idx); | ||
arrval.GetString("matchId", _matchId, sizeof(_matchId)); | ||
if (StrEqual(matchId, _matchId)) { | ||
g_aProMatchIndex[client] = idx; | ||
break; | ||
} | ||
} | ||
ClientCommand(client, "sm_wikipro"); | ||
} | ||
else if (MenuAction_Cancel == action) { | ||
ClientCommand(client, "sm_m"); | ||
} | ||
} | ||
|
||
public Action:Command_Option(client, args) { | ||
Panel panel = new Panel(); | ||
|
||
panel.SetTitle("个人设置") | ||
|
||
panel.DrawItem("道具开启自动投掷:开", ITEMDRAW_DISABLED); | ||
panel.DrawItem("快捷道具上传(双击E):开", ITEMDRAW_DISABLED); | ||
panel.DrawItem("qq聊天触发方式:单次触发", ITEMDRAW_DISABLED); | ||
panel.DrawItem("职业道具场次选择"); | ||
panel.DrawItem(" ", ITEMDRAW_SPACER); | ||
panel.DrawItem(" ", ITEMDRAW_SPACER); | ||
panel.DrawItem("返回", ITEMDRAW_CONTROL); | ||
panel.DrawItem("退出", ITEMDRAW_CONTROL); | ||
|
||
panel.Send(client, OptionPanelHandler, MENU_TIME_FOREVER); | ||
|
||
delete panel; | ||
return Plugin_Handled; | ||
} | ||
|
||
public OptionPanelHandler(Handle:menu, MenuAction:action, client, Position) { | ||
if (action == MenuAction_Select) { | ||
switch(Position) { | ||
case 1: PrintToChat(client, "%s \x0E功能未开放,敬请期待...", PREFIX), ClientCommand(client, "sm_option"); | ||
case 2: PrintToChat(client, "%s \x0E功能未开放,敬请期待...", PREFIX), ClientCommand(client, "sm_option"); | ||
case 3: PrintToChat(client, "%s \x0E功能未开放,敬请期待...", PREFIX), ClientCommand(client, "sm_option"); | ||
case 4: GetAllProMatchStat(client); | ||
case 7: ClientCommand(client, "sm_m"); | ||
case 8: CloseHandle(menu); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// csgowiki operator tools | ||
|
||
public Action:Command_Wikiop(client, args) { | ||
Panel panel = new Panel(); | ||
|
||
panel.SetTitle("CSGOWiki管理员工具") | ||
|
||
if (GetConVarBool(g_hCSGOWikiEnable)) | ||
panel.DrawItem("CSGOWiki总开关:开"); | ||
else | ||
panel.DrawItem("CSGOWiki总开关:关"); | ||
|
||
new Flag = ITEMDRAW_DEFAULT; | ||
if (!GetConVarBool(g_hCSGOWikiEnable)) | ||
Flag = ITEMDRAW_DISABLED; | ||
|
||
if (GetConVarBool(g_hOnUtilitySubmit)) | ||
panel.DrawItem("道具上传功能:开", Flag); | ||
else | ||
panel.DrawItem("道具上传功能:关", Flag); | ||
|
||
if (GetConVarBool(g_hOnUtilityWiki)) | ||
panel.DrawItem("道具学习功能:开", Flag); | ||
else | ||
panel.DrawItem("道具学习功能:关", Flag); | ||
|
||
if (GetConVarBool(g_hChannelEnable)) | ||
panel.DrawItem("QQ聊天功能:开", Flag); | ||
else | ||
panel.DrawItem("QQ聊天功能:关", Flag); | ||
|
||
panel.DrawText(" "); | ||
panel.DrawItem("第三方插件设置", ITEMDRAW_DISABLED); | ||
|
||
panel.DrawItem(" ", ITEMDRAW_SPACER); | ||
panel.DrawItem("返回", ITEMDRAW_CONTROL); | ||
panel.DrawItem("退出", ITEMDRAW_CONTROL); | ||
|
||
panel.Send(client, WikiopPanelHandler, MENU_TIME_FOREVER); | ||
|
||
delete panel; | ||
return Plugin_Handled; | ||
} | ||
|
||
|
||
public WikiopPanelHandler(Handle:menu, MenuAction:action, client, Position) { | ||
if (action == MenuAction_Select) { | ||
switch(Position) { | ||
case 1: SetConVarBool(g_hCSGOWikiEnable, !GetConVarBool(g_hCSGOWikiEnable), true, true), ClientCommand(client, "sm_wikiop"); | ||
case 2: SetConVarBool(g_hOnUtilitySubmit, !GetConVarBool(g_hOnUtilitySubmit), true, true), ClientCommand(client, "sm_wikiop"); | ||
case 3: SetConVarBool(g_hOnUtilityWiki, !GetConVarBool(g_hOnUtilityWiki), true, true), ClientCommand(client, "sm_wikiop"); | ||
case 4: SetConVarBool(g_hChannelEnable, !GetConVarBool(g_hChannelEnable), true, true), ClientCommand(client, "sm_wikiop"); | ||
case 5: PrintToChat(client, "%s \x0E功能未开放,敬请期待...", PREFIX), ClientCommand(client, "sm_wikiop"); | ||
case 7: ClientCommand(client, "sm_m"); | ||
case 8: CloseHandle(menu); | ||
} | ||
} | ||
} |
Oops, something went wrong.