From e160b006445165e92bbdb95b1f832f1196c1dc9f Mon Sep 17 00:00:00 2001 From: connlost <4348524953.h@gmail.com> Date: Fri, 11 Oct 2024 01:32:21 +0800 Subject: [PATCH] optimized passive skills ordering --- frontend/palworld-pal-editor-webui/src/stores/paleditor.js | 1 + src/palworld_pal_editor/api/save.py | 1 - src/palworld_pal_editor/utils/data_provider.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/palworld-pal-editor-webui/src/stores/paleditor.js b/frontend/palworld-pal-editor-webui/src/stores/paleditor.js index a0576c4..2353a0c 100644 --- a/frontend/palworld-pal-editor-webui/src/stores/paleditor.js +++ b/frontend/palworld-pal-editor-webui/src/stores/paleditor.js @@ -1251,6 +1251,7 @@ export const usePalEditorStore = defineStore("paleditor", () => { function displayRating(rating) { if (rating === undefined) return ""; if (rating < 0) return "🔴"; + if (rating > 2) return "🟠"; if (rating > 1) return "🟡"; return "⚪"; } diff --git a/src/palworld_pal_editor/api/save.py b/src/palworld_pal_editor/api/save.py index 2362faf..41c0d95 100644 --- a/src/palworld_pal_editor/api/save.py +++ b/src/palworld_pal_editor/api/save.py @@ -59,7 +59,6 @@ def save(): @jwt_required() def get_passive_skills(): passives_raw = DataProvider.get_sorted_passives() - passives_raw.reverse() passive_dict = {} passive_arr = [] for passive in passives_raw: diff --git a/src/palworld_pal_editor/utils/data_provider.py b/src/palworld_pal_editor/utils/data_provider.py index 00bbf80..cf02200 100644 --- a/src/palworld_pal_editor/utils/data_provider.py +++ b/src/palworld_pal_editor/utils/data_provider.py @@ -212,7 +212,7 @@ def has_passive_skill(key: str) -> bool: def get_sorted_passives() -> list[dict]: sorted_list = sorted( PAL_PASSIVES.values(), - key=lambda item: (item["Rating"], item["InternalName"]), + key=lambda item: (-item["Rating"], DataProvider.get_passive_i18n(item["InternalName"])), ) return sorted_list