Skip to content

Commit

Permalink
adapt smaa options to prop system
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Jan 7, 2024
1 parent 4250834 commit 5f96996
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
2 changes: 0 additions & 2 deletions config/glsl/ui.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,3 @@ lazyshader 0 "modelpreview" [
fragcolor.a = 1.0;
}
]


28 changes: 28 additions & 0 deletions config/ui/lib.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,31 @@ UIlistslider = [
]
]

//UIlistslider 1:prop 2:COMPARISON 3:[values] 4:X 5:Y 6:[on-change] 7:(ARROW-%-SIZE) 8:[children]
UIproplistslider = [
if $arg7 [] [arg7 = 0.5]
uihlist 0 [
UIarrowbutton $arg5 $arg5 90 [
n = ([listfind@arg2] $arg3 (do (concatword get $arg1)) 1)
if (< $n 0) [n = 0] [
n = (- $n 2)
if (< $n 0) [n = (+ $n (listlen $arg3))]
]
do (concatword set $arg1 " " (at $arg3 $n))
arg6
] $arg7
uifill (-f $arg4 (*f $arg5 2)) $arg5 [
uicolor $c_slider
uiclamp* 1 1 1 1
if (=s $arg8 "") [
uitext (|| [[listassoc@arg2] $arg3 (do (concatword get $arg1))] [result $uistr_lib_0]) 0.6
] arg8
]
UIarrowbutton $arg5 $arg5 270 [
n = ([listfind@arg2] $arg3 (do (concatword get $arg1)) 1)
n = (if (>= $n 0) [mod (+ $n 2) (listlen $arg3)] [- (listlen $arg3) 2])
do (concatword set $arg1 " " (at $arg3 $n))
arg6
] $arg7
]
]
16 changes: 8 additions & 8 deletions config/ui/options.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -369,15 +369,15 @@ UImenu "options" [
UI_optbar//----------------------------------------------------------------------
uitablerow [
UIbutton "hold2" [
UIcheckbox (getsmaaproperty 3) 0.016
UIcheckbox (getsmaaproperty enabled) 0.016
uitext $uistr_options_52 0.6
] $UI_optc1wB $UI_optrowh [setsmaaproperty 3 (! (getsmaaproperty 3))] -1
UIlistslider smaaquality = [
0 @(concatword (? (! (getsmaaproperty 3)) "^f4" "^f1") $uistr_options_g_0)
1 @(concatword (? (! (getsmaaproperty 3)) "^f4" "^f0") $uistr_options_g_1)
2 @(concatword (? (! (getsmaaproperty 3)) "^f4" "^f2") $uistr_options_g_2)
3 @(concatword (? (! (getsmaaproperty 3)) "^f4" "^f3") $uistr_options_g_3)
] 0.3 $UI_optrowh [setsmaaproperty 6 (>= (getsmaaproperty 5) 3)]
] $UI_optc1wB $UI_optrowh [setsmaaproperty enabled (! (getsmaaproperty enabled))] -1
UIproplistslider "smaaproperty quality" = [
0 @(concatword (? (! (getsmaaproperty enabled)) "^f4" "^f1") $uistr_options_g_0)
1 @(concatword (? (! (getsmaaproperty enabled)) "^f4" "^f0") $uistr_options_g_1)
2 @(concatword (? (! (getsmaaproperty enabled)) "^f4" "^f2") $uistr_options_g_2)
3 @(concatword (? (! (getsmaaproperty enabled)) "^f4" "^f3") $uistr_options_g_3)
] 0.3 $UI_optrowh [setsmaaproperty coloredge (>= (getsmaaproperty quality) 3)]
uialign* -1 0
]
uitablerow [
Expand Down

0 comments on commit 5f96996

Please sign in to comment.