add2list, dyngamma, setgamma, and friends
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6199 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+10
-1
@@ -28,4 +28,13 @@ askquit = 1
|
||||
gfxqualityalias = 3 // Default GFX is medium.
|
||||
soundqualityalias = 3 // Default sound is best.
|
||||
poniesmodeon = 0 // Reduced violence mode.
|
||||
__gibsgore = 1 // Default value for gibs slider.
|
||||
__gibsgore = 1 // Default value for gibs slider.
|
||||
|
||||
// The code used below is for initializing the dynamic gamma system "ofc_gamma_list" alias to be stored in saved.cfg
|
||||
// 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
|
||||
]
|
||||
]
|
||||
@@ -166,6 +166,10 @@ docargument [W] [the width] [] [0];
|
||||
docargument [V] [the number] [] [0];
|
||||
docexample [echo (l0 5 1000)] [Output: 01000];
|
||||
docexample [echo (l0 3 1000)] [Output: 1000];
|
||||
docident [add2list] [Appends a new element to a list.];
|
||||
docargument [A] [the alias (list) to add to] [] [0];
|
||||
docargument [E] [the new element to add] [] [0];
|
||||
docexample [tmp_list = []; add2list tmp_list Hello; add2list tmp_list world!; echo $tmp_list] [Output: Hello world!];
|
||||
docsection [General]
|
||||
docident [addserver] [Adds a server to the list of server to query in the server list menu.];
|
||||
docargument [S] [the address of the server (hostname or IP)] [] [0];
|
||||
@@ -1078,6 +1082,12 @@ docremark [Not supported on Windows and Mac.];
|
||||
docident [gamma] [Sets the hardware gamma value.];
|
||||
docargument [N] [the gamma value] [min 30/max 300/default 100];
|
||||
docremark [May not work if your card/driver doesn't support it.];
|
||||
docident [dyngamma] [Enables or disables the per official map dynamic gamma system.];
|
||||
docexample [dyngamma = 0] [disables the system];
|
||||
docexample [dyngamma = 1] [enables the system];
|
||||
docident [setgamma] [Sets the current map's default dynamic gamma.];
|
||||
docargument [G] [the gamma value] [min 30/max 300/default 100] [0];
|
||||
docremark [The setting will take affect automatically if dyngamma is enabled, upon future loads of that map. This command only works on official maps!];
|
||||
docident [gib] [Enables or disables the gib animation entirely.];
|
||||
docargument [B] [off OR on] [0 (false), 1 (true)];
|
||||
docident [gibnum] [Sets the number of gibs to display when performing a "messy" kill (grenade, knife, sniper headshot).];
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// 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 [ gamma (at $ofc_gamma_list (findlist $defaultmaps (curmap 1))) ]
|
||||
]
|
||||
]
|
||||
@@ -394,6 +394,8 @@ menuitemslider "Screenshot type: " -1 4 "$__screenshottype" 1 [ "JPEG (Terrible
|
||||
menuitemslider "Console size: " 0 20 "$consize" 1 "" [ consize $arg1 ]
|
||||
menuitemslider "Font type: " 0 2 "$__fontsetting" 1 [ "Default" "v104" "Mono" ] [ if (= $arg1 1) [ setfont v104; __fontsetting = 1 ] [ if (= $arg1 2) [ setfont mono; __fontsetting = 2 ] [ setfont default; __fontsetting = 0 ] ] ]
|
||||
menuitemslider "Mini-map background style: " 0 2 "$showmapbackdrop" 1 [ "Fully Transparent" "Black" "White/Transparent" ] [ showmapbackdrop $arg1 ]
|
||||
menuitemcheckbox "Enable per-official map dynamic gamma: " "$dyngamma" [ dyngamma = $arg1 ]
|
||||
menuitemtextinput "Set default gamma for this map: " "(at $ofc_gamma_list (findlist $defaultmaps (curmap 1)))" [ setgamma $arg1 ]
|
||||
|
||||
// Reduced game violence mode...
|
||||
reducedviolencemode = [
|
||||
|
||||
+7
-2
@@ -259,7 +259,8 @@ addOnLoadOnce = [ add2alias mapstartonce $arg1 ]
|
||||
addOnLoadAlways = [ add2alias mapstartalways $arg1 ]
|
||||
addOnQuit = [ add2alias onQuit $arg1 ]
|
||||
|
||||
run tutorial
|
||||
// add2list - Quickly append an element to a list without add2alias'es ";"
|
||||
add2list = [ if (strcmp "" (getalias $arg1)) [ $arg1 = $arg2 ] [ $arg1 = (concat (getalias $arg1) $arg2) ] ]
|
||||
|
||||
// copyent & pasteent - Quickly copy/paste the current closest entity.
|
||||
ent_type = none
|
||||
@@ -324,4 +325,8 @@ customclaimadminscript = [
|
||||
] [
|
||||
echo (concat (c 3)Error: (c 5)you're not connected to $_CAS_servername servers)
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
run dyngamma
|
||||
|
||||
run tutorial
|
||||
@@ -617,6 +617,20 @@
|
||||
<argument token="V" description="VALUE"/>
|
||||
</arguments>
|
||||
</command>
|
||||
|
||||
<command name="add2list">
|
||||
<description>Appends a new element to a list.</description>
|
||||
<examples>
|
||||
<example>
|
||||
<code><![CDATA[tmp_list = []; add2list tmp_list Hello; add2list tmp_list world!; echo $tmp_list]]></code>
|
||||
<explanation>Output: Hello world!</explanation>
|
||||
</example>
|
||||
</examples>
|
||||
<arguments>
|
||||
<argument token="A" description="the alias (list) to add to"/>
|
||||
<argument token="E" description="the new element to add"/>
|
||||
</arguments>
|
||||
</command>
|
||||
|
||||
</identifiers>
|
||||
</section>
|
||||
@@ -4228,6 +4242,38 @@ Output:
|
||||
</remarks>
|
||||
<value token="N" description="the gamma value" minValue="30" maxValue="300" defaultValue="100"/>
|
||||
</variable>
|
||||
|
||||
<variable name="dyngamma">
|
||||
<description>Enables or disables the per official map dynamic gamma system.</description>
|
||||
<examples>
|
||||
<example>
|
||||
<code><![CDATA[dyngamma = 0]]></code>
|
||||
<explanation>Output: disables the system</explanation>
|
||||
</example>
|
||||
<example>
|
||||
<code><![CDATA[dyngamma = 1]]></code>
|
||||
<explanation>Output: enables the system</explanation>
|
||||
</example>
|
||||
</examples>
|
||||
<references>
|
||||
<identifierReference identifier="gamma"/>
|
||||
<identifierReference identifier="setgamma"/>
|
||||
</references>
|
||||
</variable>
|
||||
|
||||
<command name="setgamma">
|
||||
<description>Sets the current map's default dynamic gamma.</description>
|
||||
<arguments>
|
||||
<argument token="G" description="the gamma value" minValue="30" maxValue="300" defaultValue="100"/>
|
||||
</arguments>
|
||||
<remarks>
|
||||
<remark>The setting will take affect automatically if dyngamma is enabled, upon future loads of that map. This command only works on official maps!</remark>
|
||||
</remarks>
|
||||
<references>
|
||||
<identifierReference identifier="dyngamma"/>
|
||||
<identifierReference identifier="gamma"/>
|
||||
</references>
|
||||
</command>
|
||||
|
||||
<variable name="lighterror">
|
||||
<description>Allows to finetune the amount of "error" the mipmapper/stripifier allow themselves for changing lightlevels.</description>
|
||||
|
||||
Reference in New Issue
Block a user