Browse Source

Reorganize art directory with subdirectories

Restructured mapgameimgs/ into organized subdirectories:
- monsters/ - Monster sprites (default, moop variants)
- player/ - Player sprites (playerattack)
- bases/ - Home base icons (homebase00, homebase01)
- effects/ - Status effect icons (defense, poison, buffs)

Updated all image references in:
- index.html: Monster icons, home base markers, status effects
- server.js: Homebase icons API, monster creation image copy

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
master
HikeMap User 1 month ago
parent
commit
5ff0395cb8
  1. 34
      index.html
  2. BIN
      mapgameimgs/bases/homebase00-100.png
  3. BIN
      mapgameimgs/bases/homebase01-100.png
  4. 0
      mapgameimgs/effects/default_buff100.png
  5. 0
      mapgameimgs/effects/default_status100.png
  6. 0
      mapgameimgs/effects/defense100.png
  7. 0
      mapgameimgs/effects/defense_up100.png
  8. 0
      mapgameimgs/effects/poison100.png
  9. 0
      mapgameimgs/monsters/default100.png
  10. 0
      mapgameimgs/monsters/default50.png
  11. 0
      mapgameimgs/monsters/moop_fanciest100.png
  12. 0
      mapgameimgs/monsters/moop_fanciest50.png
  13. 0
      mapgameimgs/monsters/moop_fancy100.png
  14. 0
      mapgameimgs/monsters/moop_fancy50.png
  15. 0
      mapgameimgs/monsters/moop_sub_par100.png
  16. 0
      mapgameimgs/monsters/moop_sub_par50.png
  17. 0
      mapgameimgs/player/playerattack50.png
  18. 16
      server.js

34
index.html

@ -9769,7 +9769,7 @@
const type = MONSTER_TYPES[m.type] || { name: 'Unknown', icon: '👹' }; const type = MONSTER_TYPES[m.type] || { name: 'Unknown', icon: '👹' };
monstersHtml += ` monstersHtml += `
<div class="char-sheet-monster"> <div class="char-sheet-monster">
<img src="/mapgameimgs/${m.type}50.png" onerror="this.src='/mapgameimgs/default50.png'" alt="${type.name}" class="monster-thumb">
<img src="/mapgameimgs/monsters/${m.type}50.png" onerror="this.src='/mapgameimgs/monsters/default50.png'" alt="${type.name}" class="monster-thumb">
<span class="monster-info">Lv${m.level} ${type.name}</span> <span class="monster-info">Lv${m.level} ${type.name}</span>
<span class="monster-hp">${m.hp}/${m.maxHp} HP</span> <span class="monster-hp">${m.hp}/${m.maxHp} HP</span>
</div> </div>
@ -10165,12 +10165,12 @@
// Use selected icon or default to '00' (use 100px, CSS scales to 50) // Use selected icon or default to '00' (use 100px, CSS scales to 50)
const iconId = playerStats.homeBaseIcon || '00'; const iconId = playerStats.homeBaseIcon || '00';
const iconSrc = `/mapgameimgs/homebase${iconId}-100.png`;
const iconSrc = `/mapgameimgs/bases/homebase${iconId}-100.png`;
const iconHtml = ` const iconHtml = `
<div class="home-base-marker"> <div class="home-base-marker">
<img src="${iconSrc}" alt="Home Base" style="width:50px;height:50px;" <img src="${iconSrc}" alt="Home Base" style="width:50px;height:50px;"
onerror="this.src='/mapgameimgs/default50.png'">
onerror="this.src='/mapgameimgs/monsters/default50.png'">
</div> </div>
`; `;
@ -10288,7 +10288,7 @@
onclick="selectHomebaseIcon('${icon.id}')" onclick="selectHomebaseIcon('${icon.id}')"
data-icon-id="${icon.id}"> data-icon-id="${icon.id}">
<img src="${icon.preview}" alt="Homebase ${icon.id}" <img src="${icon.preview}" alt="Homebase ${icon.id}"
onerror="this.src='/mapgameimgs/default50.png'">
onerror="this.src='/mapgameimgs/monsters/default50.png'">
</div> </div>
`).join(''); `).join('');
} catch (err) { } catch (err) {
@ -10800,8 +10800,8 @@
const iconHtml = ` const iconHtml = `
<div class="monster-marker" data-monster-id="${monster.id}"> <div class="monster-marker" data-monster-id="${monster.id}">
<img class="monster-icon" src="/mapgameimgs/${monster.type}50.png"
onerror="this.src='/mapgameimgs/default50.png'" alt="${monsterType.name}">
<img class="monster-icon" src="/mapgameimgs/monsters/${monster.type}50.png"
onerror="this.src='/mapgameimgs/monsters/default50.png'" alt="${monsterType.name}">
<div class="monster-dialogue-bubble" style="display: none;"></div> <div class="monster-dialogue-bubble" style="display: none;"></div>
</div> </div>
`; `;
@ -11033,11 +11033,11 @@
// Check for buffs (defense, generic, etc.) // Check for buffs (defense, generic, etc.)
if (monster.buffs.defense && monster.buffs.defense.turnsLeft > 0) { if (monster.buffs.defense && monster.buffs.defense.turnsLeft > 0) {
html += `<img class="buff-icon" src="/mapgameimgs/defense100.png"
onerror="this.src='/mapgameimgs/default_buff100.png'"
html += `<img class="buff-icon" src="/mapgameimgs/effects/defense100.png"
onerror="this.src='/mapgameimgs/effects/default_buff100.png'"
alt="Defense Up" title="Defense +${monster.buffs.defense.percent}% (${monster.buffs.defense.turnsLeft} turns)">`; alt="Defense Up" title="Defense +${monster.buffs.defense.percent}% (${monster.buffs.defense.turnsLeft} turns)">`;
} else if (monster.buffs.generic && monster.buffs.generic.turnsLeft > 0) { } else if (monster.buffs.generic && monster.buffs.generic.turnsLeft > 0) {
html += `<img class="buff-icon" src="/mapgameimgs/default_buff100.png"
html += `<img class="buff-icon" src="/mapgameimgs/effects/default_buff100.png"
alt="Buff" title="Buffed (${monster.buffs.generic.turnsLeft} turns)">`; alt="Buff" title="Buffed (${monster.buffs.generic.turnsLeft} turns)">`;
} }
@ -11045,8 +11045,8 @@
if (monster.statusEffects) { if (monster.statusEffects) {
monster.statusEffects.forEach(effect => { monster.statusEffects.forEach(effect => {
const effectType = effect.type || 'status'; const effectType = effect.type || 'status';
html += `<img class="status-icon" src="/mapgameimgs/${effectType}100.png"
onerror="this.src='/mapgameimgs/default_status100.png'"
html += `<img class="status-icon" src="/mapgameimgs/effects/${effectType}100.png"
onerror="this.src='/mapgameimgs/effects/default_status100.png'"
alt="${effectType}" title="${effectType} (${effect.turnsLeft} turns)">`; alt="${effectType}" title="${effectType} (${effect.turnsLeft} turns)">`;
}); });
} }
@ -11061,8 +11061,8 @@
// Check for player defense buff // Check for player defense buff
if (combatState.defenseBuffTurns > 0) { if (combatState.defenseBuffTurns > 0) {
html += `<img class="buff-icon" src="/mapgameimgs/defense100.png"
onerror="this.src='/mapgameimgs/default_buff100.png'"
html += `<img class="buff-icon" src="/mapgameimgs/effects/defense100.png"
onerror="this.src='/mapgameimgs/effects/default_buff100.png'"
alt="Defense Up" title="Defense Up (${combatState.defenseBuffTurns} turns)">`; alt="Defense Up" title="Defense Up (${combatState.defenseBuffTurns} turns)">`;
} }
@ -11070,8 +11070,8 @@
if (combatState.playerStatusEffects && combatState.playerStatusEffects.length > 0) { if (combatState.playerStatusEffects && combatState.playerStatusEffects.length > 0) {
combatState.playerStatusEffects.forEach(effect => { combatState.playerStatusEffects.forEach(effect => {
const effectType = effect.type || 'status'; const effectType = effect.type || 'status';
html += `<img class="status-icon" src="/mapgameimgs/${effectType}100.png"
onerror="this.src='/mapgameimgs/default_status100.png'"
html += `<img class="status-icon" src="/mapgameimgs/effects/${effectType}100.png"
onerror="this.src='/mapgameimgs/effects/default_status100.png'"
alt="${effectType}" title="${effectType} (${effect.turnsLeft} turns)">`; alt="${effectType}" title="${effectType} (${effect.turnsLeft} turns)">`;
}); });
} }
@ -11113,8 +11113,8 @@
<div class="monster-entry-header"> <div class="monster-entry-header">
${index === combatState.selectedTargetIndex ? '<span class="target-arrow"></span>' : ''} ${index === combatState.selectedTargetIndex ? '<span class="target-arrow"></span>' : ''}
<div class="sprite-container"> <div class="sprite-container">
<img class="monster-entry-icon" src="/mapgameimgs/${monster.type}100.png"
onerror="this.src='/mapgameimgs/default100.png'" alt="${monster.data.name}">
<img class="monster-entry-icon" src="/mapgameimgs/monsters/${monster.type}100.png"
onerror="this.src='/mapgameimgs/monsters/default100.png'" alt="${monster.data.name}">
<div class="status-overlay">${monsterOverlayHtml}</div> <div class="status-overlay">${monsterOverlayHtml}</div>
</div> </div>
<span class="monster-entry-name">${monster.data.name} Lv.${monster.level}</span> <span class="monster-entry-name">${monster.data.name} Lv.${monster.level}</span>

BIN
mapgameimgs/bases/homebase00-100.png

After

Width: 102  |  Height: 100  |  Size: 7.3 KiB

BIN
mapgameimgs/bases/homebase01-100.png

After

Width: 102  |  Height: 100  |  Size: 7.4 KiB

0
mapgameimgs/default_buff100.png → mapgameimgs/effects/default_buff100.png

Before

Width: 102  |  Height: 100  |  Size: 2.3 KiB

After

Width: 102  |  Height: 100  |  Size: 2.3 KiB

0
mapgameimgs/default_status100.png → mapgameimgs/effects/default_status100.png

Before

Width: 102  |  Height: 100  |  Size: 2.4 KiB

After

Width: 102  |  Height: 100  |  Size: 2.4 KiB

0
mapgameimgs/defense100.png → mapgameimgs/effects/defense100.png

Before

Width: 102  |  Height: 100  |  Size: 2.3 KiB

After

Width: 102  |  Height: 100  |  Size: 2.3 KiB

0
mapgameimgs/defense_up100.png → mapgameimgs/effects/defense_up100.png

Before

Width: 102  |  Height: 100  |  Size: 2.3 KiB

After

Width: 102  |  Height: 100  |  Size: 2.3 KiB

0
mapgameimgs/poison100.png → mapgameimgs/effects/poison100.png

Before

Width: 102  |  Height: 100  |  Size: 2.4 KiB

After

Width: 102  |  Height: 100  |  Size: 2.4 KiB

0
mapgameimgs/default100.png → mapgameimgs/monsters/default100.png

Before

Width: 102  |  Height: 100  |  Size: 15 KiB

After

Width: 102  |  Height: 100  |  Size: 15 KiB

0
mapgameimgs/default50.png → mapgameimgs/monsters/default50.png

Before

Width: 50  |  Height: 50  |  Size: 5.7 KiB

After

Width: 50  |  Height: 50  |  Size: 5.7 KiB

0
mapgameimgs/moop_fanciest100.png → mapgameimgs/monsters/moop_fanciest100.png

Before

Width: 102  |  Height: 100  |  Size: 15 KiB

After

Width: 102  |  Height: 100  |  Size: 15 KiB

0
mapgameimgs/moop_fanciest50.png → mapgameimgs/monsters/moop_fanciest50.png

Before

Width: 50  |  Height: 50  |  Size: 5.7 KiB

After

Width: 50  |  Height: 50  |  Size: 5.7 KiB

0
mapgameimgs/moop_fancy100.png → mapgameimgs/monsters/moop_fancy100.png

Before

Width: 102  |  Height: 100  |  Size: 16 KiB

After

Width: 102  |  Height: 100  |  Size: 16 KiB

0
mapgameimgs/moop_fancy50.png → mapgameimgs/monsters/moop_fancy50.png

Before

Width: 50  |  Height: 50  |  Size: 6.0 KiB

After

Width: 50  |  Height: 50  |  Size: 6.0 KiB

0
mapgameimgs/moop_sub_par100.png → mapgameimgs/monsters/moop_sub_par100.png

Before

Width: 102  |  Height: 100  |  Size: 15 KiB

After

Width: 102  |  Height: 100  |  Size: 15 KiB

0
mapgameimgs/moop_sub_par50.png → mapgameimgs/monsters/moop_sub_par50.png

Before

Width: 50  |  Height: 50  |  Size: 5.7 KiB

After

Width: 50  |  Height: 50  |  Size: 5.7 KiB

0
mapgameimgs/playerattack50.png → mapgameimgs/player/playerattack50.png

Before

Width: 50  |  Height: 50  |  Size: 6.7 KiB

After

Width: 50  |  Height: 50  |  Size: 6.7 KiB

16
server.js

@ -887,14 +887,14 @@ app.post('/api/user/home-base', authenticateToken, (req, res) => {
} }
}); });
// Get available homebase icons (auto-detected from mapgameimgs directory)
// Get available homebase icons (auto-detected from mapgameimgs/bases directory)
app.get('/api/homebase-icons', (req, res) => { app.get('/api/homebase-icons', (req, res) => {
try { try {
const fs = require('fs'); const fs = require('fs');
const imagesDir = path.join(__dirname, 'mapgameimgs');
const basesDir = path.join(__dirname, 'mapgameimgs', 'bases');
// Read directory and find homebaseXX-100.png files // Read directory and find homebaseXX-100.png files
const files = fs.readdirSync(imagesDir);
const files = fs.readdirSync(basesDir);
const iconPattern = /^homebase(\d+)-100\.png$/; const iconPattern = /^homebase(\d+)-100\.png$/;
const icons = files const icons = files
@ -904,8 +904,8 @@ app.get('/api/homebase-icons', (req, res) => {
return { return {
id: match[1], id: match[1],
filename: file, filename: file,
preview: `/mapgameimgs/${file}`, // Use 100px, CSS scales down
full: `/mapgameimgs/${file}`
preview: `/mapgameimgs/bases/${file}`, // Use 100px, CSS scales down
full: `/mapgameimgs/bases/${file}`
}; };
} }
return null; return null;
@ -1216,11 +1216,11 @@ app.post('/api/admin/monster-types', adminOnly, async (req, res) => {
db.createMonsterType(data); db.createMonsterType(data);
// Copy default images for the new monster // Copy default images for the new monster
const imgDir = path.join(__dirname, 'mapgameimgs');
const monstersDir = path.join(__dirname, 'mapgameimgs', 'monsters');
const sizes = ['50', '100']; const sizes = ['50', '100'];
for (const size of sizes) { for (const size of sizes) {
const defaultImg = path.join(imgDir, `default${size}.png`);
const newImg = path.join(imgDir, `${monsterId}${size}.png`);
const defaultImg = path.join(monstersDir, `default${size}.png`);
const newImg = path.join(monstersDir, `${monsterId}${size}.png`);
try { try {
// Only copy if the new image doesn't already exist // Only copy if the new image doesn't already exist
await fs.access(newImg); await fs.access(newImg);

Loading…
Cancel
Save