Skip to content

Commit

Permalink
icon sort fully recreated in script
Browse files Browse the repository at this point in the history
  • Loading branch information
LlysiX committed Nov 11, 2024
1 parent c044324 commit d17b2ad
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 25 deletions.
77 changes: 74 additions & 3 deletions _ark/config/song_select.dta
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
Expand All @@ -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
}
}
}
)
Expand Down
34 changes: 12 additions & 22 deletions _ark/dx/ui/dx_funcs.dta
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,27 @@
}

; 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)
}
)
}
}


{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
Expand Down

0 comments on commit d17b2ad

Please sign in to comment.