From eb9feb97282b54c4b2cad20044efbb0b52c9b354 Mon Sep 17 00:00:00 2001 From: dazedanon Date: Sat, 20 Dec 2025 11:37:42 -0600 Subject: [PATCH] Simplify a bit --- js/plugins.js | 4 +-- js/plugins/MinimapZoom.js | 76 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 76 insertions(+), 4 deletions(-) diff --git a/js/plugins.js b/js/plugins.js index 609ac79..3ec86b8 100644 --- a/js/plugins.js +++ b/js/plugins.js @@ -2546,9 +2546,9 @@ var $plugins = [ { name: "MinimapZoom", status: true, - description: "Press O to toggle a zoomed-out minimap view of the current map", + description: "Press M to toggle a zoomed-out minimap view of the current map", parameters: { - "Toggle Key": "79", + "Toggle Key": "77", }, }, ]; diff --git a/js/plugins/MinimapZoom.js b/js/plugins/MinimapZoom.js index 160de82..86f8609 100644 --- a/js/plugins/MinimapZoom.js +++ b/js/plugins/MinimapZoom.js @@ -222,9 +222,9 @@ } } - // Draw events as markers + // Draw important events as markers (NPCs only, not decorations) for (const event of $gameMap.events()) { - if (event && event.characterName()) { + if (event && this.isImportantEvent(event)) { const ex = event.x * tileWidth + tileWidth / 2; const ey = event.y * tileHeight + tileHeight / 2; @@ -241,6 +241,78 @@ } }; + // Determine if an event is "important" (NPC, not decoration/ambient) + Scene_Map.prototype.isImportantEvent = function(event) { + if (!event) return false; + + // Must have a character graphic + if (!event.characterName()) return false; + + // Get the event data + const eventData = event.event(); + if (!eventData) return false; + + // Check the current page + const page = event.page(); + if (!page) return false; + + // Skip if no trigger (parallel process/autorun without interaction) + // Trigger types: 0=Action Button, 1=Player Touch, 2=Event Touch, 3=Autorun, 4=Parallel + const trigger = page.trigger; + + // Only show Action Button (0) and Player Touch (1) - these are interactive NPCs + if (trigger !== 0 && trigger !== 1) return false; + + // Skip common decoration/ambient event names + const name = eventData.name.toLowerCase(); + const skipPatterns = [ + '窓', 'window', // Windows + '鳩', 'bird', 'pigeon', // Birds + '猫', 'cat', // Cats + '犬', 'dog', // Dogs + 'light', '灯', 'lamp', // Lights + 'flame', '炎', 'fire', // Fire effects + 'smoke', '煙', // Smoke + 'effect', '効果', // Effects + 'particle', // Particles + 'ambient', // Ambient + 'decor', '装飾', // Decorations + 'bg', 'background', // Background elements + 'fog', '霧', // Fog + 'water', '水', // Water effects + 'shadow', '影', // Shadows + 'grass', '草', // Grass + 'tree', '木', // Trees + 'flower', '花', // Flowers + 'rock', '岩', // Rocks + 'sparkle', 'shine', // Sparkle effects + 'animation', 'anim', // Animations + ]; + + for (const pattern of skipPatterns) { + if (name.includes(pattern)) return false; + } + + // Skip events with very short command lists (likely just empty or simple triggers) + const list = page.list; + if (!list || list.length <= 2) return false; + + // Check if event has meaningful commands (text, choices, transfers, etc.) + // Command codes: 101=Show Text, 102=Show Choices, 201=Transfer Player, + // 121=Control Switches, 122=Control Variables, 301=Battle Processing + const meaningfulCodes = [101, 102, 103, 104, 105, 201, 301, 302, 303, 311, 312, 326]; + let hasMeaningfulCommand = false; + + for (const cmd of list) { + if (meaningfulCodes.includes(cmd.code)) { + hasMeaningfulCommand = true; + break; + } + } + + return hasMeaningfulCommand; + }; + Scene_Map.prototype.adjustColor = function(hex, amount) { // Simple color adjustment let r = parseInt(hex.slice(1, 3), 16);