Skip to content

Commit

Permalink
Add Description for Pal Waza
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisCris committed Apr 4, 2024
1 parent f1b668a commit 1278251
Show file tree
Hide file tree
Showing 9 changed files with 3,878 additions and 723 deletions.
49 changes: 28 additions & 21 deletions frontend/palworld-pal-editor-webui/src/components/PalEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ function formatString(input) {
if (!match) return input; // Return the input as is if it doesn't match the expected pattern
const [, numbers, suffix] = match;
// Pad the numeric part with leading zeros to make it at least 3 digits
const paddedNumbers = numbers.padStart(3, '0');
// Append the suffix if it exists; otherwise, append an empty space
const formatted = suffix ? paddedNumbers + suffix : paddedNumbers;
if (suffix) {
Expand Down Expand Up @@ -43,8 +43,12 @@ function formatString(input) {
<p class="const"> Specie: </p>
<select class="selector" name="CharacterID" v-model="palStore.SELECTED_PAL_DATA.DataAccessKey">
<option class="" v-for="pal in palStore.PAL_STATIC_DATA_LIST" :value="pal.InternalName"
:key="pal.InternalName" :title="pal.I18n"> {{`${formatString(pal.SortingKey) || ""} ${pal.Invalid ? '': ""} ${palStore.displayPalElement(pal.InternalName)} ${pal.I18n}`}}
</option>
:key="pal.InternalName" :title="pal.I18n"> {{ `
${formatString(pal.SortingKey) || ""}
${pal.Invalid ? '' : ""}
${palStore.displayPalElement(pal.InternalName)}
${pal.I18n}`
}}</option>
</select>
<button class="edit" @click="palStore.SELECTED_PAL_DATA.changeSpecie" name="CharacterID"
:disabled="palStore.LOADING_FLAG">✅</button>
Expand Down Expand Up @@ -179,7 +183,7 @@ function formatString(input) {
{{ palStore.displayRating(palStore.PASSIVE_SKILLS[skill]?.Rating) }} {{
palStore.PASSIVE_SKILLS[skill]?.I18n[0] || skill }}
</p>
<span class="tooltip-text">{{ palStore.PASSIVE_SKILLS[skill]?.I18n[1] || skill}}</span>
<span class="tooltip-text">{{ palStore.PASSIVE_SKILLS[skill]?.I18n[1] || skill }}</span>
</div>
<button class="edit del" @click="palStore.SELECTED_PAL_DATA.pop_PassiveSkillList" :name="skill"
Expand All @@ -204,12 +208,15 @@ function formatString(input) {
<div class="editField skillList">
<div v-for="skill in palStore.SELECTED_PAL_DATA.EquipWaza">
<div class="tooltip-container">
<p class="const" :title="palStore.ACTIVE_SKILLS[skill]?.I18n || skill">{{
palStore.displayElement(palStore.ACTIVE_SKILLS[skill]?.Element) }} {{ palStore.ACTIVE_SKILLS[skill]?.I18n || skill
}}
<p class="const" :title="palStore.ACTIVE_SKILLS[skill]?.I18n[1] || skill">{{
palStore.displayElement(palStore.ACTIVE_SKILLS[skill]?.Element) }} {{
palStore.ACTIVE_SKILLS[skill]?.I18n[0] || skill
}}
</p>
<span class="tooltip-text">
<p>{{ palStore.ACTIVE_SKILLS[skill]?.I18n || skill }}</p>
<h3>{{ palStore.ACTIVE_SKILLS[skill]?.I18n[0] || skill }}</h3>
<p>{{ palStore.ACTIVE_SKILLS[skill]?.I18n[1] || "" }}</p>
<p> --- </p>
<p>Attack: {{ palStore.ACTIVE_SKILLS[skill]?.Power }} | CT: {{ palStore.ACTIVE_SKILLS[skill]?.CT }}</p>
<p>Element: {{ palStore.displayElement(palStore.ACTIVE_SKILLS[skill]?.Element) }} {{
palStore.ACTIVE_SKILLS[skill]?.Element }}</p>
Expand All @@ -224,17 +231,20 @@ function formatString(input) {
</div>
</div>
<hr>
<p class="cat">MASTERED ACTIVE SKILLS</p>
<p class="cat">MASTERED ACTIVE SKILLS (SKILLS ARE AUTOMATICALLY ADDED WHEN LEVELING UP PALS)</p>
<div class="flex-h">
<div class="editField skillList">
<div v-for="skill in palStore.SELECTED_PAL_DATA.MasteredWaza">
<div class="tooltip-container">
<p class="const" :title="palStore.ACTIVE_SKILLS[skill]?.I18n || skill">{{
palStore.displayElement(palStore.ACTIVE_SKILLS[skill]?.Element) }} {{ palStore.ACTIVE_SKILLS[skill]?.I18n || skill
}}
<p class="const" :title="palStore.ACTIVE_SKILLS[skill]?.I18n[1] || skill">{{
palStore.displayElement(palStore.ACTIVE_SKILLS[skill]?.Element) }} {{
palStore.ACTIVE_SKILLS[skill]?.I18n[0] || skill
}}
</p>
<span class="tooltip-text">
<p>{{ palStore.ACTIVE_SKILLS[skill]?.I18n || skill }}</p>
<h3>{{ palStore.ACTIVE_SKILLS[skill]?.I18n[0] || skill }}</h3>
<p>{{ palStore.ACTIVE_SKILLS[skill]?.I18n[1] || "" }}</p>
<p> --- </p>
<p>Attack: {{ palStore.ACTIVE_SKILLS[skill]?.Power }} | CT: {{ palStore.ACTIVE_SKILLS[skill]?.CT }}</p>
<p>Element: {{ palStore.displayElement(palStore.ACTIVE_SKILLS[skill]?.Element) }} {{
palStore.ACTIVE_SKILLS[skill]?.Element }}</p>
Expand All @@ -253,8 +263,9 @@ function formatString(input) {
<select class="selector" name="add_MasteredWaza" v-model="palStore.PAL_ACTIVE_SELECTED_ITEM">
<option value="" key="">Add Skills</option>
<option v-for="skill in palStore.ACTIVE_SKILLS_LIST" :value="skill.InternalName" :key="skill.InternalName"
:title="skill.I18n">
{{ `${palStore.displayElement(skill.Element)} ${skill.I18n} ${palStore.skillIcon(skill.InternalName)} - ⚔️ ${skill.Power} - ⏱️ ${skill.CT}` }}
:title="skill.I18n[1]">
{{ `${palStore.displayElement(skill.Element)} ${skill.I18n[0]} ${palStore.skillIcon(skill.InternalName)} -
⚔️ ${skill.Power} - ⏱️ ${skill.CT}` }}
</option>
</select>
<button class="edit" @click="palStore.SELECTED_PAL_DATA.add_MasteredWaza" name="add_MasteredWaza"
Expand All @@ -263,10 +274,6 @@ function formatString(input) {
</div>
</div>
</div>
<!-- <div class="EditorItem item flex-v left">
</div> -->
</div>
</template>
Expand Down Expand Up @@ -591,7 +598,7 @@ div.spaceBetween {
color: white;
text-align: center;
border-radius: 6px;
padding: 5px 5px;
padding: 1rem;
/* Position the tooltip */
position: absolute;
Expand Down
11 changes: 7 additions & 4 deletions src/palworld_pal_editor/api/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,24 @@ def get_active_skills():
atk_dict = {}
atk_arr = []
for attack in attacks_raw:
if attack.get("Invalid", None):
continue
# if attack.get("Invalid", None):
# continue
data = {
"InternalName": attack["InternalName"],
# "I18n": f'[{displayElement(attack["Element"])}] ' \
# f'{"🍐" if DataProvider.has_skill_fruit(attack["InternalName"]) else ""}' \
# f'{"✨"if DataProvider.is_unique_attacks(attack["InternalName"]) else ""}' \
# f'{DataProvider.get_attack_i18n(attack["InternalName"]) or attack["InternalName"]}',
"I18n": DataProvider.get_attack_i18n(attack["InternalName"]) or attack["InternalName"],
"I18n": list(DataProvider.get_attack_i18n(attack["InternalName"]) or [attack["InternalName"], ""]),
"HasSkillFruit": DataProvider.has_skill_fruit(attack["InternalName"]),
"IsUniqueSkill": DataProvider.is_unique_attacks(attack["InternalName"]),
"Power": attack["Power"],
"Element": attack["Element"],
"CT": attack["CT"]
"CT": attack["CT"],
"Invalid": attack.get("Invalid", False)
}
if data["Invalid"]:
data["I18n"][0] = "❌ " + data["I18n"][0]
atk_dict[attack["InternalName"]] = data
atk_arr.append(data)
return reply(0, {"dict": atk_dict, "arr": atk_arr})
Expand Down
Loading

0 comments on commit 1278251

Please sign in to comment.