Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Korok Type List in Filter Pane #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

savage13
Copy link
Contributor

@savage13 savage13 commented Feb 5, 2022

Add Korok Type List in Filter Pane

Allows the Display of Specific types of Koroks (Diving, Goal Ring / Race, Rock Lift, ...)

Korok Type names based on https://lepelog.github.io/korokmap/

"Korok Types" Toggle
Screenshot 2022-02-05 at 14-39-22 BotW Object Map

"Korok Types CheckList"
Screenshot 2022-02-05 at 14-39-43 BotW Object Map


This change is Reviewable

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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
className: (extra.styleLabel) ? classToColor(id) : "default",
className: extra.styleLabel ? classToColor(id) : "default",

@@ -139,6 +139,14 @@
<AppMapFilterMainButton v-for="(v, type) in markerComponents" :key="type" :type="type" :label="v.filterLabel" :icon="v.filterIcon" @toggle="updateMarkers" />
</div>
<b-checkbox switch v-model="showKorokIDs" @change="updateKorokIDs">Show Korok IDs</b-checkbox>
<b-checkbox v-model="korokTypeOpen" switch >Korok Types</b-checkbox>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<b-checkbox v-model="korokTypeOpen" switch >Korok Types</b-checkbox>
<b-checkbox v-model="korokTypeOpen" switch>Filter Korok Types</b-checkbox>

@@ -240,6 +240,9 @@ export default class AppMap extends mixins(MixinUtil) {
private searchResultMarkers: ui.Unobservable<MapMarkers.MapMarkerSearchResult>[] = [];
private searchGroups: SearchResultGroup[] = [];
private searchPresets = SEARCH_PRESETS;
private korokTypes = KOROK_TYPES;
private korokTypeOn = KOROK_TYPES.map(t => false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enabledKorokTypes?

@@ -240,6 +240,9 @@ export default class AppMap extends mixins(MixinUtil) {
private searchResultMarkers: ui.Unobservable<MapMarkers.MapMarkerSearchResult>[] = [];
private searchGroups: SearchResultGroup[] = [];
private searchPresets = SEARCH_PRESETS;
private korokTypes = KOROK_TYPES;
private korokTypeOn = KOROK_TYPES.map(t => false);
private korokTypeOpen: boolean = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe "filterOnKorokTypes" -- this name isn't super clear atm

<b-checkbox v-model="korokTypeOpen" switch >Korok Types</b-checkbox>

<b-collapse id="korokTypesList" class="mt-2" v-model="korokTypeOpen">
<b-card style="background: rgba(0,0,0,0); overflow-y: scroll; max-height: 300px; border:1px solid #333;">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the styles into CSS.

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] };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do? Is there no other way of doing this? Not a big fan of overwriting a property with completely unrelated data...

@@ -139,6 +139,14 @@
<AppMapFilterMainButton v-for="(v, type) in markerComponents" :key="type" :type="type" :label="v.filterLabel" :icon="v.filterIcon" @toggle="updateMarkers" />
</div>
<b-checkbox switch v-model="showKorokIDs" @change="updateKorokIDs">Show Korok IDs</b-checkbox>
<b-checkbox v-model="korokTypeOpen" switch >Korok Types</b-checkbox>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the UX is somewhat confusing. It's in the filter pane so I would have expected this feature to filter visible Korok markers, not add/remove extra search groups.

Copy link
Contributor Author

@savage13 savage13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 6 files reviewed, 7 unresolved discussions (waiting on @leoetlino and @savage13)


src/components/AppMap.ts, line 814 at r1 (raw file):

Previously, leoetlino (Léo Lam) wrote…

Why is this necessary?

The search results coming from radar.zeldamods.org for Koroks is different than from the static Korok List. The MapMarkerKorok (static list) expects the position in obj.Translate but the MapMarkerSearchResult (MapMarkerObj) expects the position as obj.pos.

The id is similar, in the search result (radar) it is korok_type and for the static list it is id.

These classes all result in a MapMarkerClassImpl eventually, I guess I have exposed some mismatch in what the classes expect. :|


src/components/AppMap.vue, line 142 at r1 (raw file):

Previously, leoetlino (Léo Lam) wrote…

I think the UX is somewhat confusing. It's in the filter pane so I would have expected this feature to filter visible Korok markers, not add/remove extra search groups.

Agree on this.

I attempted to add it to the Search Pane, but because the list of Korok Types is too long the Search pane got confused with scrolling. I was hoping to just add them as another "Search preset".

I thought placing it near the other Korok items was better than in Tools, Settings or Draw, as Search seemed not to work.

Another option would be to add it under the Search pane but like the Help pane with the list of Korok Types.

@leoetlino
Copy link
Member

Another option would be to add it under the Search pane but like the Help pane with the list of Korok Types.

Sounds good. Alternatively, we can keep it in the filter tab but change the implementation to actually filter Koroks (instead of adding search groups).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants