-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c7aa3d
commit af3a451
Showing
34 changed files
with
7,985 additions
and
2,014 deletions.
There are no files selected for viewing
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,19 @@ | ||
import simpleMenu as menu | ||
|
||
codPath = 'D:/Program Files/Steam/steamapps/common/Call of Duty Modern Warfare 3' | ||
|
||
menuFiles = menu.fastLoad() | ||
menuFiles.precache_gsc_path = f'{codPath}/zonetool/mod/maps/mp/gametypes/_menus.gsc' | ||
menuFiles.mod_csv_path = f'{codPath}/zone_source/mod.csv' | ||
menuFiles.scriptmenus_folder_path = f'{codPath}/zonetool/mod/ui_mp/scriptmenus' | ||
|
||
menuName = 'custom_dynamic_menu' | ||
newMenu = menu.defaultMultiplayerMenu(menuName) | ||
newMenu.createOptions( | ||
'dvarstring( "menu_title" )', | ||
[f'dvarstring( "menu_option{i}" )' for i in range(20)], | ||
[True for i in range(20)], | ||
True) | ||
menuFiles.loadMenuFiles(menuName, newMenu) | ||
|
||
menuFiles.loadMod(codPath, 'zonetool.exe', 'lb_server') |
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,78 @@ | ||
#include common_scripts\utility; | ||
#include maps\mp\_utility; | ||
|
||
_openMenu(menu) | ||
{ | ||
self closeMenus(); | ||
if (menu != "") self openpopupMenu(menu); | ||
} | ||
|
||
menuInit() | ||
{ | ||
self setClientDvar("ui_startIndex", -1); | ||
self setClientDvar("menu_title", ""); | ||
self.pers["menu_pages"] = []; | ||
} | ||
|
||
getMenu(count) | ||
{ | ||
count = isDefined(count) ? count + 1 : 1; | ||
return self.pers["menu_pages"][self.pers["menu_pages"].size - count]; | ||
} | ||
|
||
pushMenu(title, table, startIndex, range) | ||
{ | ||
menu = []; | ||
menu["title"] = title; | ||
menu["table"] = table; | ||
menu["startIndex"] = startIndex; | ||
menu["range"] = range; | ||
|
||
self.pers["menu_pages"][self.pers["menu_pages"].size] = menu; | ||
self openDynamicMenu(); | ||
} | ||
|
||
popMenu() | ||
{ | ||
if (!isDefined(self.pers["menu_pages"]) || self.pers["menu_pages"].size < 1) return; | ||
|
||
newMenuPages = []; | ||
for (i = 0; i < self.pers["menu_pages"].size - 1; i++) | ||
newMenuPages[i] = self.pers["menu_pages"][i]; | ||
|
||
self.pers["menu_pages"] = newMenuPages; | ||
self openDynamicMenu(); | ||
} | ||
|
||
openDynamicMenu() | ||
{ | ||
menu = self getMenu(); | ||
self setClientDvar("menu_title", "@" + menu["title"]); | ||
|
||
for(i = 0; i < 20; i++) | ||
{ | ||
self setClientDvar("optionType" + i, 1); | ||
if(i < menu["range"]) self setClientDvar("menu_option" + i, "@" + tableLookup("mp/" + menu["table"] + ".csv", 0, i + menu["startIndex"], 2)); | ||
else self setClientDvar("menu_option" + i, ""); | ||
} | ||
self _openMenu("custom_dynamic_menu"); | ||
} | ||
|
||
setOptionType(type, table, startIndex, range, target) | ||
{ | ||
for(i = 0; i < range; i++) | ||
if(target == tableLookup("mp/"+ table + ".csv", 0, i + startIndex, 1)) | ||
{ | ||
self setClientDvar("optionType" + i, type); | ||
break; | ||
} | ||
} | ||
|
||
setOptionsType(type, table, startIndex, range, targets) | ||
{ | ||
for(i = 0; i < range; i++) | ||
{ | ||
val = tableLookup("mp/"+ table + ".csv", 0, i + startIndex, 1); | ||
if(maps\mp\_lb_utility::contains(targets, val)) self setClientDvar("optionType" + i, type); | ||
} | ||
} |
Oops, something went wrong.