cleanup examples for multi sprites

bd6da695c80ff6f9a065d67f4a376fa6b5a0ec55

Wolfsblvt <wolfsblvt@gmail.com>

3 files changed, +16 -5Ignore whitespace
public/scripts/extensions/expressions/settings.html+14 -3
@@ -75,9 +75,20 @@
75 <span data-i18n="Remove all image overrides">Remove all image overrides</span>75 <span data-i18n="Remove all image overrides">Remove all image overrides</span>
76 </div>76 </div>
77 </div>77 </div>
78 <p class="hint"><b data-i18n="Hint:">Hint:</b> <i><span data-i18n="Create new folder in the _space">Create new folder in the </span><b>/characters/</b> <span data-i18n="folder of your user data directory and name it as the name of the character.">folder of your user data directory and name it as the name of the character.</span>78 <p class="hint">
79 <span data-i18n="Put images with expressions there. File names should follow the pattern:">Put images with expressions there. File names should follow the pattern: </span><tt data-i18n="expression_label_pattern">[expression_label].[image_format]</tt></i></p>79 <b data-i18n="Hint:">Hint:</b>
80 <span>In case of multiple files per expression, file names can contain a suffix, either separated by a dot or a dash. Examples: </span><tt>joy.png</tt>, <tt>joy-1.png</tt>, <tt>joy.expressive.png</tt>, <tt>美しい-17.png</tt>80 <i>
81 <span data-i18n="Create new folder in the _space">Create new folder in the </span><b>/characters/</b> <span data-i18n="folder of your user data directory and name it as the name of the character.">folder of your user data directory and name it as the name of the character.</span>
82 <span data-i18n="Put images with expressions there. File names should follow the pattern:">Put images with expressions there. File names should follow the pattern: </span><tt data-i18n="expression_label_pattern">[expression_label].[image_format]</tt>
83 </i>
84 </p>
85 <p>
86 <i>
87 <span>In case of multiple files per expression, file names can contain a suffix, either separated by a dot or a
88 dash.
89 Examples: </span><tt>joy.png</tt>, <tt>joy-1.png</tt>, <tt>joy.expressive.png</tt>
90 </i>
91 </p>
81 <h3 id="image_list_header">92 <h3 id="image_list_header">
82 <strong data-i18n="Sprite set:">Sprite set:</strong>&nbsp;<span id="image_list_header_name"></span>93 <strong data-i18n="Sprite set:">Sprite set:</strong>&nbsp;<span id="image_list_header_name"></span>
83 </h3>94 </h3>
public/scripts/extensions/expressions/templates/upload-expression.html+1 -1
@@ -5,7 +5,7 @@
5<div data-i18n="upload_expression_naming_2">5<div data-i18n="upload_expression_naming_2">
6 For multiple expressions, the name must follow the expression name and a valid suffix. Allowed separators are '-' or dot '.'.6 For multiple expressions, the name must follow the expression name and a valid suffix. Allowed separators are '-' or dot '.'.
7</div>7</div>
8<span class="m-b-1" data-i18n="Examples:">Examples:</span> <tt>{{expression}}.png</tt>, <tt>{{expression}}-1.png</tt>, <tt>{{expression}}.expressive.png</tt>, <tt>美しい-17.png</tt>8<span class="m-b-1" data-i18n="Examples:">Examples:</span> <tt>{{expression}}.png</tt>, <tt>{{expression}}-1.png</tt>, <tt>{{expression}}.expressive.png</tt>
9{{#if clickedFileName}}9{{#if clickedFileName}}
10<div class="m-t-1" data-i18n="upload_expression_replace">Click 'Replace' to replace the existing expression:</div>10<div class="m-t-1" data-i18n="upload_expression_replace">Click 'Replace' to replace the existing expression:</div>
11<tt>{{clickedFileName}}</tt>11<tt>{{clickedFileName}}</tt>
src/endpoints/sprites.js+1 -1
@@ -128,7 +128,7 @@ router.get('/get', jsonParser, function (request, response) {
128128
129 const fileName = path.parse(pathToSprite).name.toLowerCase();129 const fileName = path.parse(pathToSprite).name.toLowerCase();
130 // Extract the label from the filename via regex, which can be suffixed with a sub-name, either connected with a dash or a dot.130 // Extract the label from the filename via regex, which can be suffixed with a sub-name, either connected with a dash or a dot.
131 // Examples: joy.png, joy-1.png, joy.expressive.png, 美しい-17.png131 // Examples: joy.png, joy-1.png, joy.expressive.png
132 const label = fileName.match(/^(.+?)(?:[-\\.].*?)?$/)?.[1] ?? fileName;132 const label = fileName.match(/^(.+?)(?:[-\\.].*?)?$/)?.[1] ?? fileName;
133133
134 return {134 return {