diff --git a/src/MapMarker.ts b/src/MapMarker.ts index 2fc3922..dacf5c0 100644 --- a/src/MapMarker.ts +++ b/src/MapMarker.ts @@ -218,12 +218,13 @@ export class MapMarkerKorok extends MapMarkerCanvasImpl { constructor(mb: MapBase, info: any, extra: any) { let id = info.id || 'Korok'; + extra.styleLabel = (extra.styleLabel !== undefined) ? extra.styleLabel : true; super(mb, `${id}`, [info.Translate.X, info.Translate.Y, info.Translate.Z], { icon: KOROK_ICON, iconWidth: 20, iconHeight: 20, showLabel: extra.showLabel, - className: classToColor(id), + className: (extra.styleLabel) ? classToColor(id) : "default", }); this.info = info; // @ts-ignore diff --git a/src/MapSearch.ts b/src/MapSearch.ts index 039aba0..45b61d5 100644 --- a/src/MapSearch.ts +++ b/src/MapSearch.ts @@ -37,6 +37,43 @@ function makeNameQuery(names: string[]): string { return names.map(x => `name:"^${x}"`).join(' OR '); } +export const KOROK_TYPES = + [ + "Acorn in a Hole", + "Ball and Chain", + "Burn the Leaves", + "Circle of Rocks", + "Cube Puzzle", + "Dive", + "Flower Order", + "Flower Trail", + "Goal Ring", + "Hanging Acorn", + "Jump the Fences", + "Light Torch", + "Matching Trees", + "Melt Ice Block", + "Moving Lights", + "Offering Plate", + "Pinwheel Acorns", + "Pinwheel Balloons", + "Remove Luminous Stone", + "Rock Lift", + "Rock Lift (Boulder)", + "Rock Lift (Door)", + "Rock Lift (Leaves)", + "Rock Lift (Rock Pile)", + "Rock Lift (Slab)", + "Rock Pattern", + "Roll a Boulder", + "Shoot the Crest", + "Shoot the Targets", + "Stationary Balloon", + "Stationary Lights", + "Take Apple from Palm Tree", + "Take the Stick", + ]; + export const SEARCH_PRESETS: ReadonlyArray = Object.freeze([ { label: '', diff --git a/src/components/AppMap.ts b/src/components/AppMap.ts index 1f7746f..fb383ff 100644 --- a/src/components/AppMap.ts +++ b/src/components/AppMap.ts @@ -20,7 +20,7 @@ import * as MapIcons from '@/MapIcon'; import * as MapMarkers from '@/MapMarker'; import { MapMarker, SearchResultUpdateMode } from '@/MapMarker'; import { MapMarkerGroup } from '@/MapMarkerGroup'; -import { SearchResultGroup, SearchExcludeSet, SEARCH_PRESETS } from '@/MapSearch'; +import { SearchResultGroup, SearchExcludeSet, SEARCH_PRESETS, KOROK_TYPES } from '@/MapSearch'; import * as save from '@/save'; import MixinUtil from '@/components/MixinUtil'; @@ -240,6 +240,9 @@ export default class AppMap extends mixins(MixinUtil) { private searchResultMarkers: ui.Unobservable[] = []; private searchGroups: SearchResultGroup[] = []; private searchPresets = SEARCH_PRESETS; + private korokTypes = KOROK_TYPES; + private korokTypeOn = KOROK_TYPES.map(t => false); + private korokTypeOpen: boolean = false; private searchExcludedSets: SearchExcludeSet[] = []; private readonly MAX_SEARCH_RESULT_COUNT = 2000; @@ -804,6 +807,42 @@ export default class AppMap extends mixins(MixinUtil) { this.search(); } + async addKorokType(name: string, query: string) { + let objs = await MapMgr.getInstance().getObjs(this.settings!.mapType, + this.settings!.mapName, query); + objs.forEach((obj: any) => { + obj.Translate = { X: obj.pos[0], Y: obj.pos[1], Z: obj.pos[2] }; + obj.id = obj.korok_type; + }); + let group = new MapMarkerGroup( + objs.map((m: any) => + new MapMarkers.MapMarkerKorok(this.map, m, { + showLabel: this.showKorokIDs, + styleLabel: false + })), + 1.0, false); + this.markerGroups.set(name, group); + group.addToMap(this.map.m); + + for (const group of this.markerGroups.values()) + group.update(); + + } + + searchToggleGroup(name: string) { + const ROCK_LIFT_QUERY = 'korok_type: "Rock Lift" NOT Leaves NOT Pile NOT Slab NOT Door NOT Boulder'; + let query = `korok_type: "${name}"`; + if (name == "Rock Lift") { + query = ROCK_LIFT_QUERY; + } + if (this.markerGroups.has(name)) { + this.markerGroups.get(name)!.destroy(); + this.markerGroups.delete(name); + } else { + this.addKorokType(name, query); + } + } + searchRemoveGroup(idx: number) { const group = this.searchGroups[idx]; group.remove(); diff --git a/src/components/AppMap.vue b/src/components/AppMap.vue index a278075..bc984cd 100644 --- a/src/components/AppMap.vue +++ b/src/components/AppMap.vue @@ -139,6 +139,14 @@ Show Korok IDs + Korok Types + + + + {{ktype}} + + +

Visible map areas

diff --git a/src/components/ObjectInfo.vue b/src/components/ObjectInfo.vue index e1ed19a..988ca0d 100644 --- a/src/components/ObjectInfo.vue +++ b/src/components/ObjectInfo.vue @@ -40,6 +40,7 @@ No modifier +
Korok Type: {{data.korok_type}}