Skip to content

Commit

Permalink
⚡ Add specific labels "Select a texture" and "Select a style" for tem…
Browse files Browse the repository at this point in the history
…plate editors' main asset picker
  • Loading branch information
CosmoMyzrailGorynych committed Feb 4, 2025
1 parent c1524fa commit 597632b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/i18n/English.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"required": "Required",
"save": "Save",
"selectDialogue": "Select…",
"selectDialogueTexture": "Select a texture…",
"selectDialogueStyle": "Select a style…",
"select": "Select",
"search": "Search:",
"settings": "Settings",
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/Russian.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"zoomOut": "Уменьшить",
"filter": "Отфильтровать:",
"selectDialogue": "Выбрать…",
"selectDialogueTexture": "Выбрать текстуру…",
"selectDialogueStyle": "Выбрать стиль…",
"search": "Поиск:",
"close": "Закрыть",
"edit": "Изменить",
Expand Down
12 changes: 11 additions & 1 deletion src/riotTags/shared/asset-input.tag
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ asset-input
use(xlink:href="#{getThumbnail(currentAsset)}")
img(if="{opts.assetid == -1 || !opts.assetid}" src="data/img/notexture.png")
.dim(if="{opts.assetid != -1 && opts.assetid !== void 0}") {currentAsset.name}
.aNotice(if="{opts.assetid == -1 || opts.assetid === void 0}") {vocGlob.selectDialogue}
.aNotice(if="{opts.assetid == -1 || opts.assetid === void 0}") {getSelectDialogueText()}
asset-selector(
if="{showingSelector}"
assettypes="{opts.assettypes}"
Expand All @@ -88,6 +88,16 @@ asset-input
this.currentAsset = this.resourceAPIs.getById(null, this.opts.assetid);
}

this.getSelectDialogueText = () => {
if (this.opts.assettypes === 'texture') {
return this.vocGlob.selectDialogueTexture;
}
if (this.opts.assettypes === 'style') {
return this.vocGlob.selectDialogueStyle;
}
return this.vocGlob.selectDialogue;
};

this.openAsset = e => {
window.orders.trigger('openAsset', this.currentAsset.uid);
e.stopPropagation();
Expand Down

0 comments on commit 597632b

Please sign in to comment.