less ugly screenshot type slider code

also: persistent
This commit is contained in:
ac-stef
2016-08-05 01:42:02 +02:00
parent 25d09990c8
commit f36c1661d8
+10 -2
View File
@@ -443,12 +443,20 @@ menuitem [Weapon settings...] [ showmenu [Weapo
menuitem [Edit kill messages...] [ showmenu [Kill Messages] ]
menuitem [Bot settings...] [ showmenu [Bot settings] ]
tempalias __screenshottype 0
alias askquit 1
alias showmenuonstartup 1
alias menufilesort_cgz 0
alias menufilesort_dmo 0
tempalias __screenshottypes ["JPEG (Terrible Quality)" "JPEG (Bad Quality)" "JPEG (Good Quality)" "JPEG (Best Quality)" "PNG (Lossless)" "BMP (Lossless)"]
tempalias __getscreenshottype [
tempalias __screenshottype (at "5 0 4" $screenshottype) // 0:BMP 1:JPG 2:PNG
if (= $screenshottype 1) [
looplist [50 70 85] q [ if (< $q $jpegquality) [ += __screenshottype 1 ] ]
]
result $__screenshottype
]
newmenu Misc
menuitemcheckbox [Auto map download: ] "$autogetmap" [ autogetmap $arg1 ]
menuitem [Configure auto media download --> ] [ showmenu "Autodownload config"]
@@ -459,7 +467,7 @@ menuitemcheckbox [Auto-screenshot: ] "$autoscreenshot" [ autoscree
menuitemcheckbox [Allow HUD echos: ] "$allowhudechos" [ allowhudechos $arg1 ]
menuitemslider [Servers to ping at once: ] 0 50 "$maxservpings" 5 [] [ maxservpings $arg1 ]
menuitemslider [Milliseconds between pinging servers: ] 1000 60000 "$servpingrate" 1000 [] [ servpingrate $arg1 ]
menuitemslider [Screenshot type: ] -1 4 "$__screenshottype" 1 ["JPEG (Terrible Quality)" "JPEG (Bad Quality)" "JPEG (Good Quality)" "JPEG (Best Quality)" "PNG (Lossless)" "BMP (Lossless)"] [ if (= $arg1 -1) [ screenshottype 1; jpegquality 50; __screenshottype = -1 ] [ if (= $arg1 0) [ screenshottype 1; jpegquality 70; __screenshottype = 0 ] [ if (= $arg1 1) [ screenshottype 1; jpegquality 85; __screenshottype = 1 ] [ if (= $arg1 2) [ screenshottype 1; jpegquality 100; __screenshottype = 2 ] [ if (= $arg1 3) [ screenshottype 2; __screenshottype = 3 ] [ if (= $arg1 4) [ screenshottype 0; __screenshottype = 4 ] ] ] ] ] ] ]
menuitemslider [Screenshot type: ] 0 5 __getscreenshottype 1 $__screenshottypes [ screenshottype (at "1 1 1 1 2 0" $arg1) ; if (< $arg1 4) [ jpegquality (at [50 70 85 100] $arg1) ] ]
menuitemslider [Console size: ] 0 20 "$consize" 1 [] [ consize $arg1 ]
menuitemslider [Font type: ] 0 2 "$__fontsetting" 1 [Default Serif Monospace] [ if (= $arg1 1) [ setfont serif ] [ if (= $arg1 2) [ setfont mono ] [ setfont default ] ] ]
menuitemslider [Mini-map background style: ] 0 2 "$showmapbackdrop" 1 ["Fully Transparent" Black White/Transparent] [ showmapbackdrop $arg1 ]