Skip to content

Commit

Permalink
Merge pull request #165 from jrconway3/issue-161-filter-assets-by-ani…
Browse files Browse the repository at this point in the history
…mation

Issue 161 Added Ability to Filter Assets by Available Animation
  • Loading branch information
sanderfrenken authored May 22, 2024
2 parents 61b8901 + 70245da commit 0911b73
Show file tree
Hide file tree
Showing 132 changed files with 3,238 additions and 617 deletions.
1,114 changes: 596 additions & 518 deletions index.html

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion scripts/generate_html.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ function generateListHTML(json) {
const variants = definition.variants
const name = definition.name
const typeName = definition.type_name
const defaultAnimations = ['spellcast', 'thrust', 'walk', 'slash', 'shoot', 'hurt', 'watering'];

var requiredSexes = [];
var animations = [];
var previewRow = 10;
var previewColumn = 0;
var previewXOffset = 0;
Expand All @@ -26,6 +28,12 @@ function generateListHTML(json) {
previewYOffset = definition.preview_y_offset;
}

if (definition.animations !== undefined) {
animations = definition.animations
} else {
animations = defaultAnimations
}

if (definition.layer_1.male !== undefined) {
requiredSexes.push("male");
}
Expand All @@ -46,8 +54,9 @@ function generateListHTML(json) {
}

const requiredSex = requiredSexes.join(",");
const supportedAnimations = animations.join(",");

const startHTML = `<li data-required="[REQUIRED_SEX]"><span class="condensed">${name}</span><ul>`.replace("[REQUIRED_SEX]", requiredSex);
const startHTML = `<li data-required="[REQUIRED_SEX]" data-animations="[SUPPORTED_ANIMATIONS]"><span class="condensed">${name}</span><ul>`.replace("[REQUIRED_SEX]", requiredSex).replace("[SUPPORTED_ANIMATIONS]", supportedAnimations);
const templateHTML = fs.readFileSync("scripts/template-general.html", 'utf8');

const endHTML = '</ul></li>';
Expand Down
19 changes: 19 additions & 0 deletions sheet_definitions/beards_5oclock_shadow.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
19 changes: 19 additions & 0 deletions sheet_definitions/beards_beard.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
19 changes: 19 additions & 0 deletions sheet_definitions/beards_bigstache.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
19 changes: 19 additions & 0 deletions sheet_definitions/beards_chevron.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
19 changes: 19 additions & 0 deletions sheet_definitions/beards_french.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
19 changes: 19 additions & 0 deletions sheet_definitions/beards_handlebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
19 changes: 19 additions & 0 deletions sheet_definitions/beards_horseshoe.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
19 changes: 19 additions & 0 deletions sheet_definitions/beards_lampshade.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
19 changes: 19 additions & 0 deletions sheet_definitions/beards_medium.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
19 changes: 19 additions & 0 deletions sheet_definitions/beards_mustache.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
19 changes: 19 additions & 0 deletions sheet_definitions/beards_trimmed.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
19 changes: 19 additions & 0 deletions sheet_definitions/beards_walrus.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
19 changes: 19 additions & 0 deletions sheet_definitions/beards_winter.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,24 @@
"purple",
"pink",
"rose"
],
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
21 changes: 20 additions & 1 deletion sheet_definitions/body.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,24 @@
"fur_grey",
"fur_white"
],
"match_body_color": true
"match_body_color": true,
"animations": [
"spellcast",
"thrust",
"walk",
"slash",
"shoot",
"hurt",
"watering",
"idle",
"jump",
"run",
"sit",
"emote",
"climb",
"combat",
"1h_slash",
"1h_backslash",
"1h_halfslash"
]
}
Loading

0 comments on commit 0911b73

Please sign in to comment.