Files
assaultcube-/config/dyngamma.cfg
T
Bukz d2e12f9d6d minor fixes
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6213 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-04-05 19:17:16 +00:00

40 lines
1.5 KiB
INI

// Initialize the list (if it doesn't already exist) using the current gamma as initial values.
if (! (checkalias ofc_gamma_list)) [
ofc_gamma_list = ""
loop ogl (listlen $defaultmaps) [
add2list ofc_gamma_list $gamma
]
]
// setgamma - allows clients to set custom gamma values for each official map, disabling/enabling the entire system
// can be done with the dyngamma variable.
setgamma = [
if (&& (<= $arg1 300) (>= $arg1 30)) [
if (strstr $defaultmaps (curmap 1)) [
tmp_gamma_list = $ofc_gamma_list
ofc_gamma_list = ""
cmapp = (findlist $defaultmaps (curmap 1)) // Find the position in the list of the current map
loop sgl (listlen $defaultmaps) [
if (= $sgl $cmapp) [ // Add the new gamma at the correct position in the list
add2list ofc_gamma_list $arg1
] [
add2list ofc_gamma_list (at $tmp_gamma_list $sgl)
]
]
echo (c 1)Note: (c 5) $arg1 has been set as your default gamma for (c 2) (curmap 1)
] [
echo (c 3)Error: (c 5)You are not on a official map!
]
] [
echo (c 3)Error: (c 5)gamma has a minimum value of 30 and maximum value of 300!
]
]
// Plugin to mapstartalways on every run if it doesn't already exist.
if (! (checkalias dyngamma)) [ dyngamma = 0 ]
if (! (checkalias mapstartalways)) [ mapstartalways = "" ]
if (! (strstr $mapstartalways dyngamma)) [
add2alias mapstartalways [
if $dyngamma [ if (strstr $defaultmaps (curmap 1)) [ gamma (at $ofc_gamma_list (findlist $defaultmaps (curmap 1))) ] ]
]
]