Skip to content

Commit 84b775a

Browse files
Merge branch 'dev'
2 parents ac9a905 + 96bb9d2 commit 84b775a

File tree

12 files changed

+1563
-1353
lines changed

12 files changed

+1563
-1353
lines changed

components/editor-form.html

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ <h2>Item Properties</h2>
6969
<div class="form-group full-width">
7070
<label for="tags">Tags</label>
7171
<input type="text" class="tag-input" id="tagInput" placeholder="Type to add tags...">
72+
<div id="tagSuggestions" class="tag-suggestions hidden"></div>
7273
<div class="tags-container" id="tagsContainer">
7374
</div>
7475
<small class="help-text">Use tags for categorization, filtering, and gameplay logic</small>
@@ -209,9 +210,26 @@ <h2>Visual Assets</h2>
209210
<input type="file" id="meshPath" name="meshPath" accept=".fbx,.obj" />
210211
<small class="file-info">Accepted formats: FBX, OBJ</small>
211212
</div>
212-
<div class="form-group">
213-
<label for="materialPath">Material Path</label>
214-
<input type="text" id="materialPath" name="materialPath" placeholder="/Game/Materials/..." />
213+
</div>
214+
</section>
215+
216+
<!-- Materials -->
217+
<section class="form-section">
218+
<h2>Materials</h2>
219+
<div class="form-grid">
220+
<div class="form-group full-width">
221+
<label>Materials</label>
222+
<div class="materials-header">
223+
<button type="button" id="addMaterial" class="btn btn-secondary">
224+
Add Material
225+
</button>
226+
<small class="help-text">
227+
Define materials used by this item. Paths will auto-generate as "/Game/Materials/{MaterialName}"
228+
</small>
229+
</div>
230+
<div id="materialsContainer" class="materials-container">
231+
<!-- Material rows will be dynamically added here -->
232+
</div>
215233
</div>
216234
</div>
217235
</section>

script/core/InventoryEditor.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export class InventoryEditor {
1818
this.componentLoader = new ComponentLoader();
1919
this.currentTemplate = null;
2020
this.customPropCounter = 0;
21+
this.materialCounter = 0;
2122
this.selectedTemplates = new Set();
2223
this.componentsLoaded = false;
2324
this.selectedTags = [];
@@ -53,6 +54,10 @@ export class InventoryEditor {
5354
'Combat', 'Magic', 'Healing', 'Buff', 'Debuff', 'Craftable',
5455
'Fire', 'Ice', 'Lightning', 'Earth', 'Water', 'Air',
5556
'Melee', 'Ranged', 'Defense', 'Attack', 'Speed', 'Strength'
57+
],
58+
materialPresets: [
59+
'BaseMaterial', 'MetallicMaterial', 'EmissiveMaterial',
60+
'GlassMaterial', 'FabricMaterial', 'WoodMaterial'
5661
]
5762
};
5863

@@ -162,6 +167,7 @@ export class InventoryEditor {
162167
if (settings.rarities) this.settings.rarities = settings.rarities;
163168
if (settings.equipmentSlots) this.settings.equipmentSlots = settings.equipmentSlots;
164169
if (settings.tagSuggestions) this.settings.tagSuggestions = settings.tagSuggestions;
170+
if (settings.materialPresets) this.settings.materialPresets = settings.materialPresets;
165171
} catch (error) {
166172
console.error('Failed to load settings:', error);
167173
}
@@ -207,6 +213,7 @@ export class InventoryEditor {
207213
addListener('deleteSelected', 'click', () => this.deleteSelectedTemplates());
208214

209215
addListener('addCustomProp', 'click', () => this.ui.addCustomProperty());
216+
addListener('addMaterial', 'click', () => this.form.addMaterialRow());
210217

211218
addListener('isEquippable', 'change', (e) => {
212219
const equipmentSection = document.getElementById('equipmentSection');

0 commit comments

Comments
 (0)