alternative primary weapons menu preparation

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7226 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2013-02-17 10:25:25 +00:00
parent 9455218790
commit ef4cbe73a5
2 changed files with 67 additions and 17 deletions
+53 -6
View File
@@ -12,15 +12,62 @@ menuitem [Misc settings] [ showmenu Misc ]
menuitem [] -1
menuitem [Reset all settings] [ showmenu [Reset settings] ]
const isprimary [ return (|| (|| (|| (= $arg1 $SNIPER) (= $arg1 $SHOTGUN)) (|| (= $arg1 $AR) (= $arg1 $SMG))) (= $arg1 $CARBINE)) ]
const getcustomprimarydirs [
customprimarydirs = []
loop gcp $NUM_WEAPONS [
if (! (isprimary $gcp)) [ add2list customprimarydirs (addpunct [ ]) ] [
add2list customprimarydirs (at $ALTERNATIVE_WEAPONS (+ (* $gcp 3) 2))
]
]
return $customprimarydirs
]
const loadcustomprimary [
nargs = $numargs
if (> $nargs 0) [
li = $arg1
if (isprimary $li) [
tmp = (getalias (at $WEAPONS $li))
customphud = (format modmdlweap%1 $tmp)
custompwld = (format modmdlvwep%1 $tmp)
if (> $nargs 1) [ // revert to default primary HUD model if any 2nd argument is given
delalias $customphud; delalias $custompwld
] [ // else try loading the custom primary models
cdirlist = (getcustomprimarydirs)
if (listlen $cdirlist) [
dirtotry = (at $cdirlist $li)
if (strlen $dirtotry) [
$customphud = $dirtotry
$custompwld = $dirtotry
]
]
]
]
]
]
newmenu Weapons
menumdl weapons/assault/menu mapmodel 75 12
menuitem [MTP-57 Assault Rifle] [ nextprimary 6; echo MTP-57 Assault Rifle selected ] [ chmenumdl Weapons weapons/assault/menu mapmodel 75 12 ]
menuitem [A-ARD/10 Submachine Gun] [ nextprimary 4; echo A-ARD/10 Submachine Gun selected ] [ chmenumdl Weapons weapons/subgun/menu mapmodel 75 12 ]
menuitem [Precision Tech AD-81 Sniper Rifle] [ nextprimary 5; echo Precision Tech AD-81 Sniper Rifle selected ] [ chmenumdl Weapons weapons/sniper/menu mapmodel 75 12 ]
menuitem [V-19 Combat Shotgun] [ nextprimary 3; echo V-19 Combat Shotgun selected ] [ chmenumdl Weapons weapons/shotgun/menu mapmodel 75 12 ]
menuitem [TMP-M&A Carbine] [ nextprimary 2; echo TMP-M&A Carbine selected ] [ chmenumdl Weapons weapons/carbine/menu mapmodel 75 12 ]
// menuitem [Combat Pistol] [ nextprimary 7; echo Combat Pistol selected ] [ chmenumdl Weapons weapons/cpistol/menu mapmodel 75 12 ]
menuitem [MTP-57 Assault Rifle] [ nextprimary $AR; loadcustomprimary $AR 0; echo MTP-57 Assault Rifle selected ] [ chmenumdl Weapons weapons/assault/menu mapmodel 75 12 ]
menuitem [A-ARD/10 Submachine Gun] [ nextprimary $SMG; loadcustomprimary $SMG 0; echo A-ARD/10 Submachine Gun selected ] [ chmenumdl Weapons weapons/subgun/menu mapmodel 75 12 ]
menuitem [Precision Tech AD-81 Sniper Rifle] [ nextprimary $SNIPER; loadcustomprimary $SNIPER 0; echo Precision Tech AD-81 Sniper Rifle selected ] [ chmenumdl Weapons weapons/sniper/menu mapmodel 75 12 ]
menuitem [V-19 Combat Shotgun] [ nextprimary $SHOTGUN; loadcustomprimary $SHOTGUN 0; echo V-19 Combat Shotgun selected ] [ chmenumdl Weapons weapons/shotgun/menu mapmodel 75 12 ]
menuitem [TMP-M&A Carbine] [ nextprimary $CARBINE; loadcustomprimary $CARBINE 0; echo TMP-M&A Carbine selected ] [ chmenumdl Weapons weapons/carbine/menu mapmodel 75 12 ]
// menuitem [Combat Pistol] [ nextprimary $CPISTOL; loadcustomprimary $CPISTOL 0; echo Combat Pistol selected ] [ chmenumdl Weapons weapons/cpistol/menu mapmodel 75 12 ]
// menuitem [] -1
// menuitem [Alternative weapons...] [ showmenu [Alternative Weapons] ]
// newmenu [Alternative Weapons]
// menumdl weapons/assault2/menu mapmodel 75 12
// menuitem [AR-15 Assault Rifle] [ nextprimary $AR; loadcustomprimary $AR; echo AR-15 Assault Rifle selected ] [ chmenumdl [Alternative Weapons] weapons/assault2/menu mapmodel 75 12 ]
// menuitem [Mac11 Submachine Gun] [ nextprimary $SMG; loadcustomprimary $SMG; echo Mac11 Submachine Gun selected ] [ chmenumdl [Alternative Weapons] weapons/subgun2/menu mapmodel 75 12 ]
// menuitem [Dragunov SVD Sniper Rifle] [ nextprimary $SNIPER; loadcustomprimary $SNIPER; echo Dragunov SVD Sniper Rifle ] [ chmenumdl [Alternative Weapons] weapons/sniper2/menu mapmodel 75 12 ]
// menuitem [Sawed-off Shotgun] [ nextprimary $SHOTGUN; loadcustomprimary $SHOTGUN; echo Sawed-off Shotgun selected ] [ chmenumdl [Alternative Weapons] weapons/shotgun2/menu mapmodel 75 12 ]
// menuitem [Marlin Guide Carbine 1895] [ nextprimary $CARBINE; loadcustomprimary $CARBINE; echo Marlin Guide Carbine 1895 selected ] [ chmenumdl [Alternative Weapons] weapons/carbine2/menu mapmodel 75 12 ]
newmenu CLA
+14 -11
View File
@@ -9,17 +9,20 @@ const on_quit_aliases [
_demofile __fontsetting __screenshottype
acc1 acc2 acc3
badargs cc1 cc2
cc3 cmapp cs_sets
cs_newsets gametimestart i
len modifier needsswitch
numcla numrvsf preload_music
r s sbdesc
sbdns sbport tmpCCO
tmp_botmap tmp_botskill tmp_cl
tmp_cradius tmp_ff tmp_gamma_list
tmp_hex tmpmode tmp_mode
tmp_mrem tmp_numargs tmp_numbots
tmp_old_sets tmp_sum tmp_svol tmp_wc
cc3 cdirlist cmapp
cs_sets cs_newsets customphud
custompwld customprimarydirs dirtotry
gametimestart i len
li modifier nargs
needsswitch numcla numrvsf
preload_music r s
sbdesc sbdns sbport
tmp tmpCCO tmp_botmap
tmp_botskill tmp_cl tmp_cradius
tmp_ff tmp_gamma_list tmp_hex
tmpmode tmp_mode tmp_mrem
tmp_numargs tmp_numbots tmp_old_sets
tmp_sum tmp_svol tmp_wc
addListOnQuit on_quit_aliases
]