diff --git a/_ark/config/song_select.dta b/_ark/config/song_select.dta index bc504b33..393367e2 100644 --- a/_ark/config/song_select.dta +++ b/_ark/config/song_select.dta @@ -124,8 +124,76 @@ ; $rhs ; (kSTOrigin) ; (kSTName)} - {dx_icon_compare $lhs $rhs rb2_icon ()} - {dx_icon_compare $lhs $rhs rb1_icon (rb2_icon)} + {cond + ({&& {== {$lhs get_icon} rb2_icon} {! {== {$rhs get_icon} rb2_icon}}} + -1 ; bring what we already sorted to the top (left side) + ) + ({&& {! {== {$lhs get_icon} rb2_icon}} {== {$rhs get_icon} rb2_icon}} + 1 ; bring what we already sorted to the top (right side) + ) + ({&& {== {$lhs get_icon} rb1_icon} {! {== {$rhs get_icon} rb1_icon}}} + {if_else {== {$rhs get_icon} rb2_icon} + 1 + -1 ; bring what we already sorted to the top (left side) + } + ) + ({&& {! {== {$lhs get_icon} rb1_icon}} {== {$rhs get_icon} rb1_icon}} + {if_else {== {$lhs get_icon} rb2_icon} + -1 + 1 ; bring what we already sorted to the top (right side) + } + ) + ({&& {== {$lhs get_icon} ugc_icon} {! {== {$rhs get_icon} ugc_icon}}} + {if_else {== {$rhs get_icon} rb2_icon} + 1 + {if_else {== {$rhs get_icon} rb1_icon} + 1 + -1 ; bring what we already sorted to the top (left side) + } + } + ) + ({&& {! {== {$lhs get_icon} ugc_icon}} {== {$rhs get_icon} ugc_icon}} + {if_else {== {$lhs get_icon} rb2_icon} + -1 + {if_else {== {$lhs get_icon} rb1_icon} + -1 + 1 ; bring what we already sorted to the top (right side) + } + } + ) + ({&& {== {$lhs get_icon} rb2_icon} {== {$rhs get_icon} rb2_icon}} ; ignore + {$this + cmp + $lhs + $rhs + (kSTName) + } + ) + ({&& {== {$lhs get_icon} rb1_icon} {== {$rhs get_icon} rb1_icon}} ; ignore + {$this + cmp + $lhs + $rhs + (kSTName) + } + ) + ({&& {== {$lhs get_icon} ugc_icon} {== {$rhs get_icon} ugc_icon}} ; ignore + {$this + cmp + $lhs + $rhs + (kSTName) + } + ) + ({&& {! {== {$lhs get_icon} rb2_icon}} {! {== {$rhs get_icon} rb2_icon}} {! {== {$lhs get_icon} rb1_icon}} {! {== {$rhs get_icon} rb1_icon}} {! {== {$lhs get_icon} ugc_icon}} {! {== {$rhs get_icon} ugc_icon}}} + {$this + cmp + $lhs + $rhs + (kSTName) + } + ) + } ;{dx_icon_compare $lhs $rhs downloaded} ;{dx_icon_compare $lhs $rhs ugc_icon} ) @@ -135,7 +203,10 @@ {sprint {$offer get_icon}} {if_else {== {$offer get_icon} rb1_icon} {sprint {$offer get_icon}} - downloaded + {if_else {== {$offer get_icon} ugc_icon} + {sprint {$offer get_icon}} + downloaded + } } } ) diff --git a/_ark/dx/ui/dx_funcs.dta b/_ark/dx/ui/dx_funcs.dta index 74114fed..f6b25322 100644 --- a/_ark/dx/ui/dx_funcs.dta +++ b/_ark/dx/ui/dx_funcs.dta @@ -49,29 +49,19 @@ } ; rewritten compare function for sorting by source -{func dx_icon_already_compared ($lhs $rhs $icon_compared) +{func dx_icon_already_compared ($lhs $rhs $icon $icon_compared) {cond - ({&& {! {== {$lhs get_icon} $icon_compared}} {! {== {$rhs get_icon} $icon_compared}}} ; ignore - ; {$this - ; cmp - ; $lhs - ; $rhs - ; (kSTName) - ; } - ) - ({&& {== {$lhs get_icon} $icon_compared} {! {== {$rhs get_icon} $icon_compared}}} - -1 ; bring what we already sorted to the top (left side) - ) - ({&& {! {== {$lhs get_icon} $icon_compared}} {== {$rhs get_icon} $icon_compared}} - 1 ; bring what we already sorted to the top (right side) + ({&& {== {$lhs get_icon} $icon} {! {== {$rhs get_icon} $icon}}} + {if_else {== {$rhs get_icon} $icon_compared} + 1 + -1 ; bring what we already sorted to the top (left side) + } ) - ({&& {== {$lhs get_icon} $icon_compared} {== {$rhs get_icon} $icon_compared}} ; ignore - ; {$this - ; cmp - ; $lhs - ; $rhs - ; (kSTName) - ; } + ({&& {! {== {$lhs get_icon} $icon}} {== {$rhs get_icon} $icon}} + {if_else {== {$lhs get_icon} $icon_compared} + -1 + 1 ; bring what we already sorted to the top (right side) + } ) } } @@ -79,7 +69,7 @@ {func dx_icon_compare ($lhs $rhs $icon $already_compared) {foreach $icon_compared $already_compared - {dx_icon_already_compared $lhs $rhs $icon_compared} ;ordering fix + {dx_icon_already_compared $lhs $rhs $icon $icon_compared} ;ordering fix } {cond ({&& {! {== {$lhs get_icon} $icon}} {! {== {$rhs get_icon} $icon}}} ; ignore