From: Holger Schemel Date: Tue, 16 Feb 2021 00:48:54 +0000 (+0100) Subject: fixed sorting in tutorial and classic level groups X-Git-Tag: 4.2.3.0~10 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1936db4e59f82c3814e89194eb8a882c69714dc7;p=rocksndiamonds.git fixed sorting in tutorial and classic level groups --- diff --git a/src/libgame/setup.h b/src/libgame/setup.h index 8ec6b4d8..367bbbc3 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -228,17 +228,19 @@ typedef struct hashtable SetupFileHash; ARTWORKCLASS_UNDEFINED) #define TREE_SORTING_DIR(ti) \ - (((ti)->parent_link ? 0 : \ - (ti)->in_user_dir ? 4 : \ - (ti)->sort_priority >= LEVELCLASS_CLASSICS_START ? 3 : \ - (ti)->sort_priority >= LEVELCLASS_TUTORIAL_START ? 2 : \ - 1) * 2 + \ - ((ti)->level_group ? 0 : 1)) + (((ti)->parent_link ? 0 : \ + (ti)->in_user_dir ? 4 * 200 : \ + (ti)->sort_priority >= LEVELCLASS_CLASSICS_START ? 3 * 200 + \ + (ti)->sort_priority % 100 : \ + (ti)->sort_priority >= LEVELCLASS_TUTORIAL_START ? 2 * 200 + \ + (ti)->sort_priority % 100 : \ + 1 * 200) + \ + ((ti)->level_group ? 0 : 100)) #define TREE_COLOR_DIR(ti, active) \ ((active) ? FC_YELLOW : \ - TREE_SORTING(ti) / 2 == 4 ? FC_GREEN : \ - TREE_SORTING(ti) / 2 == 2 ? FC_BLUE : \ + TREE_SORTING(ti) / 200 == 4 ? FC_GREEN : \ + TREE_SORTING(ti) / 200 == 2 ? FC_BLUE : \ FC_RED) #define TREE_SORTING(ti) \