Skip to content

Commit

Permalink
initial sort by source work
Browse files Browse the repository at this point in the history
not functional yet, first plan is to perfectly rewrite the existing icon sort in script
  • Loading branch information
LlysiX committed Nov 11, 2024
1 parent 580c8d8 commit c044324
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 21 deletions.
52 changes: 31 additions & 21 deletions _ark/config/song_select.dta
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand All @@ -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
Expand Down
59 changes: 59 additions & 0 deletions _ark/dx/ui/dx_funcs.dta
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
)
}
}

0 comments on commit c044324

Please sign in to comment.