diff --git a/_ark/config/song_select.dta b/_ark/config/song_select.dta index 4e63121f..bc504b33 100644 --- a/_ark/config/song_select.dta +++ b/_ark/config/song_select.dta @@ -89,19 +89,17 @@ (kSTArtist) (kSTName) } - {do - {if_else {&& {$lhs has_data decade} {! {$rhs has_data decade}}} - -1 - {if_else {&& {! {$lhs has_data decade}} {$rhs has_data decade}} - 1 - {if {&& {! {$lhs has_data decade}} {! {$rhs has_data decade}}} - {$this - cmp - $lhs - $rhs - (kSTArtist) - (kSTName) - } + {if_else {&& {$lhs has_data decade} {! {$rhs has_data decade}}} + -1 + {if_else {&& {! {$lhs has_data decade}} {$rhs has_data decade}} + 1 + {if {&& {! {$lhs has_data decade}} {! {$rhs has_data decade}}} + {$this + cmp + $lhs + $rhs + (kSTArtist) + (kSTName) } } } @@ -120,16 +118,28 @@ (by_origin (cmp_song_to_song ($lhs $rhs) - {$this - cmp - $lhs - $rhs - (kSTOrigin) - (kSTName)}) + ; {$this + ; cmp + ; $lhs + ; $rhs + ; (kSTOrigin) + ; (kSTName)} + {dx_icon_compare $lhs $rhs rb2_icon ()} + {dx_icon_compare $lhs $rhs rb1_icon (rb2_icon)} + ;{dx_icon_compare $lhs $rhs downloaded} + ;{dx_icon_compare $lhs $rhs ugc_icon} + ) (browser_group ($offer) - {sprint - {$offer get_icon}})) + {if_else {== {$offer get_icon} rb2_icon} + {sprint {$offer get_icon}} + {if_else {== {$offer get_icon} rb1_icon} + {sprint {$offer get_icon}} + downloaded + } + } + ) + ) #ifndef HX_WII (by_stars (cmp_song_to_song diff --git a/_ark/dx/ui/dx_funcs.dta b/_ark/dx/ui/dx_funcs.dta index 98aba712..74114fed 100644 --- a/_ark/dx/ui/dx_funcs.dta +++ b/_ark/dx/ui/dx_funcs.dta @@ -46,4 +46,63 @@ {ui pop_screen} ) } +} + +; rewritten compare function for sorting by source +{func dx_icon_already_compared ($lhs $rhs $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_compared} {== {$rhs get_icon} $icon_compared}} ; ignore + ; {$this + ; cmp + ; $lhs + ; $rhs + ; (kSTName) + ; } + ) + } +} + + +{func dx_icon_compare ($lhs $rhs $icon $already_compared) + {foreach $icon_compared $already_compared + {dx_icon_already_compared $lhs $rhs $icon_compared} ;ordering fix + } + {cond + ({&& {! {== {$lhs get_icon} $icon}} {! {== {$rhs get_icon} $icon}}} ; ignore + ; {$this + ; cmp + ; $lhs + ; $rhs + ; (kSTName) + ; } + ) + ({&& {== {$lhs get_icon} $icon} {! {== {$rhs get_icon} $icon}}} + -1 ; bring what we want to sort to the top (left side) + ) + ({&& {! {== {$lhs get_icon} $icon}} {== {$rhs get_icon} $icon}} + 1 ; bring what we want to sort to the top (right side) + ) + ({&& {== {$lhs get_icon} $icon} {== {$rhs get_icon} $icon}} ; sort matches by song game + {$this + cmp + $lhs + $rhs + (kSTName) + } + ) + } } \ No newline at end of file