Skip to content

Commit

Permalink
optimized passive skills ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisCris committed Oct 10, 2024
1 parent 17aa7ec commit e160b00
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/palworld-pal-editor-webui/src/stores/paleditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 "⚪";
}
Expand Down
1 change: 0 additions & 1 deletion src/palworld_pal_editor/api/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/palworld_pal_editor/utils/data_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e160b00

Please sign in to comment.