|
132 | 132 | {$uuid} |
133 | 133 | </div> |
134 | 134 |
|
135 | | - <div class="toolbar" style="margin: 8px 0;"> |
136 | | - <div> |
137 | | - {translate('dialog.variant_config.texture_map.title')} |
138 | | - </div> |
139 | | - <div class="spacer" /> |
140 | | - <!-- svelte-ignore a11y-click-events-have-key-events --> |
141 | | - <div |
142 | | - class="tool" |
143 | | - title={translate('dialog.variant_config.texture_map.create_new_mapping')} |
144 | | - on:click={() => {}} |
145 | | - > |
146 | | - <i class="material-icons icon" on:click={() => createTextureMapping()}>add</i> |
| 135 | + {#if !variant.isDefault} |
| 136 | + <div class="toolbar" style="margin: 8px 0;"> |
| 137 | + <div> |
| 138 | + {translate('dialog.variant_config.texture_map.title')} |
| 139 | + </div> |
| 140 | + <div class="spacer" /> |
| 141 | + <!-- svelte-ignore a11y-click-events-have-key-events --> |
| 142 | + <div |
| 143 | + class="tool" |
| 144 | + title={translate('dialog.variant_config.texture_map.create_new_mapping')} |
| 145 | + on:click={() => {}} |
| 146 | + > |
| 147 | + <i class="material-icons icon" on:click={() => createTextureMapping()}>add</i> |
| 148 | + </div> |
| 149 | + <!-- svelte-ignore a11y-click-events-have-key-events --> |
| 150 | + <!-- svelte-ignore missing-declaration --> |
| 151 | + <i |
| 152 | + class="fa fa-question dialog_form_description" |
| 153 | + title={translate('dialog.variant_config.texture_map.description')} |
| 154 | + on:click={() => { |
| 155 | + const tooltip = translate('dialog.variant_config.texture_map.description') |
| 156 | + Blockbench.showQuickMessage(tooltip, 50 * tooltip.length) |
| 157 | + }} |
| 158 | + /> |
147 | 159 | </div> |
148 | | - <!-- svelte-ignore a11y-click-events-have-key-events --> |
149 | | - <!-- svelte-ignore missing-declaration --> |
150 | | - <i |
151 | | - class="fa fa-question dialog_form_description" |
152 | | - title={translate('dialog.variant_config.texture_map.description')} |
153 | | - on:click={() => { |
154 | | - const tooltip = translate('dialog.variant_config.texture_map.description') |
155 | | - Blockbench.showQuickMessage(tooltip, 50 * tooltip.length) |
156 | | - }} |
157 | | - /> |
158 | | - </div> |
159 | | - <lu class="texture_map_container"> |
160 | | - {#key textureMapUpdated} |
161 | | - {#each [...textureMap.map.entries()] as entry, index} |
162 | | - <div class="texture_mapping_item"></div> |
163 | | - <li class="texture_mapping_item"> |
164 | | - <div class="texture_mapping_item_dropdown_container"> |
165 | | - <img src={getTextureSrc(entry[0])} alt="" /> |
166 | | - <select |
167 | | - class="texture_mapping_item_dropdown" |
168 | | - on:change={e => selectNewPrimaryTexture(e, entry[0])} |
169 | | - > |
170 | | - <!-- svelte-ignore missing-declaration --> |
171 | | - {#each primaryTextures as texture} |
172 | | - <option selected={texture.uuid === entry[0]}> |
173 | | - {texture.name} |
174 | | - </option> |
175 | | - {/each} |
176 | | - </select> |
177 | | - </div> |
| 160 | + <lu class="texture_map_container"> |
| 161 | + {#key textureMapUpdated} |
| 162 | + {#each [...textureMap.map.entries()] as entry, index} |
| 163 | + <div class="texture_mapping_item"></div> |
| 164 | + <li class="texture_mapping_item"> |
| 165 | + <div class="texture_mapping_item_dropdown_container"> |
| 166 | + <img src={getTextureSrc(entry[0])} alt="" /> |
| 167 | + <select |
| 168 | + class="texture_mapping_item_dropdown" |
| 169 | + on:change={e => selectNewPrimaryTexture(e, entry[0])} |
| 170 | + > |
| 171 | + <!-- svelte-ignore missing-declaration --> |
| 172 | + {#each primaryTextures as texture} |
| 173 | + <option selected={texture.uuid === entry[0]}> |
| 174 | + {texture.name} |
| 175 | + </option> |
| 176 | + {/each} |
| 177 | + </select> |
| 178 | + </div> |
| 179 | + |
| 180 | + <i class="material-icons icon">east</i> |
178 | 181 |
|
179 | | - <i class="material-icons icon">east</i> |
| 182 | + <div class="texture_mapping_item_dropdown_container"> |
| 183 | + <img src={getTextureSrc(entry[1])} alt="" /> |
| 184 | + <select |
| 185 | + class="texture_mapping_item_dropdown" |
| 186 | + on:change={e => selectNewSecondaryTexture(e, entry[0])} |
| 187 | + > |
| 188 | + <!-- svelte-ignore missing-declaration --> |
| 189 | + {#each secondaryTextures as texture} |
| 190 | + <option selected={texture.uuid === entry[1]}> |
| 191 | + {texture.name} |
| 192 | + </option> |
| 193 | + {/each} |
| 194 | + </select> |
| 195 | + </div> |
180 | 196 |
|
181 | | - <div class="texture_mapping_item_dropdown_container"> |
182 | | - <img src={getTextureSrc(entry[1])} alt="" /> |
183 | | - <select |
184 | | - class="texture_mapping_item_dropdown" |
185 | | - on:change={e => selectNewSecondaryTexture(e, entry[0])} |
| 197 | + <!-- svelte-ignore a11y-click-events-have-key-events --> |
| 198 | + <i |
| 199 | + class="material-icons icon tool" |
| 200 | + on:click={() => deleteTextureMapping(entry[0])}>delete</i |
186 | 201 | > |
187 | | - <!-- svelte-ignore missing-declaration --> |
188 | | - {#each secondaryTextures as texture} |
189 | | - <option selected={texture.uuid === entry[1]}> |
190 | | - {texture.name} |
191 | | - </option> |
192 | | - {/each} |
193 | | - </select> |
| 202 | + </li> |
| 203 | + {:else} |
| 204 | + <div class="no_mappings"> |
| 205 | + {translate('dialog.variant_config.texture_map.no_mappings')} |
194 | 206 | </div> |
195 | | - |
196 | | - <!-- svelte-ignore a11y-click-events-have-key-events --> |
197 | | - <i |
198 | | - class="material-icons icon tool" |
199 | | - on:click={() => deleteTextureMapping(entry[0])}>delete</i |
200 | | - > |
201 | | - </li> |
202 | | - {:else} |
203 | | - <div class="no_mappings"> |
204 | | - {translate('dialog.variant_config.texture_map.no_mappings')} |
205 | | - </div> |
206 | | - {/each} |
207 | | - {/key} |
208 | | - </lu> |
209 | | - <Collection |
210 | | - label={translate('dialog.variant_config.excluded_bones.title')} |
211 | | - tooltip={translate('dialog.variant_config.bone_lists.description')} |
212 | | - availableItemsColumnLable={translate('dialog.variant_config.included_bones.title')} |
213 | | - availableItemsColumnTooltip={translate('dialog.variant_config.included_bones.description')} |
214 | | - includedItemsColumnLable={translate('dialog.variant_config.excluded_bones.title')} |
215 | | - includedItemsColumnTooltip={translate('dialog.variant_config.excluded_bones.description')} |
216 | | - swapColumnsButtonTooltip={translate('dialog.variant_config.swap_columns_button.tooltip')} |
217 | | - availableItems={availableBones} |
218 | | - bind:includedItems={excludedBones} |
219 | | - /> |
| 207 | + {/each} |
| 208 | + {/key} |
| 209 | + </lu> |
| 210 | + <Collection |
| 211 | + label={translate('dialog.variant_config.excluded_bones.title')} |
| 212 | + tooltip={translate('dialog.variant_config.bone_lists.description')} |
| 213 | + availableItemsColumnLable={translate('dialog.variant_config.included_bones.title')} |
| 214 | + availableItemsColumnTooltip={translate( |
| 215 | + 'dialog.variant_config.included_bones.description', |
| 216 | + )} |
| 217 | + includedItemsColumnLable={translate('dialog.variant_config.excluded_bones.title')} |
| 218 | + includedItemsColumnTooltip={translate( |
| 219 | + 'dialog.variant_config.excluded_bones.description', |
| 220 | + )} |
| 221 | + swapColumnsButtonTooltip={translate( |
| 222 | + 'dialog.variant_config.swap_columns_button.tooltip', |
| 223 | + )} |
| 224 | + availableItems={availableBones} |
| 225 | + bind:includedItems={excludedBones} |
| 226 | + /> |
| 227 | + {/if} |
220 | 228 | </div> |
221 | 229 |
|
222 | 230 | <style> |
|
0 commit comments