From 8ad02dd967ee82271996c0ca975f1ce5204a9f77 Mon Sep 17 00:00:00 2001 From: Ben Echols Date: Thu, 8 Jun 2023 14:22:38 -0600 Subject: [PATCH] updated batch search ui to show heroic / faction info --- makefile | 2 +- .../components/individual_sim_ui/bulk_tab.ts | 24 ++++++++++++++++--- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index 546a45fe80..7db086bf0a 100644 --- a/makefile +++ b/makefile @@ -170,7 +170,7 @@ ifeq ($(WATCH), 1) npx vite build -m development --watch & ulimit -n 10240 && air -tmp_dir "/tmp" -build.include_ext "go,proto" -build.args_bin "--usefs=true --launch=false" -build.bin "./wowsimwotlk" -build.cmd "make devserver" -build.exclude_dir "assets,dist,node_modules,ui,tools" else - ./wowsimwotlk --usefs=true --launch=false + ./wowsimwotlk --usefs=true --launch=false --host=":3333" endif wowsimwotlk-windows.exe: wowsimwotlk diff --git a/ui/core/components/individual_sim_ui/bulk_tab.ts b/ui/core/components/individual_sim_ui/bulk_tab.ts index 90c0692b2b..51a9d953e9 100644 --- a/ui/core/components/individual_sim_ui/bulk_tab.ts +++ b/ui/core/components/individual_sim_ui/bulk_tab.ts @@ -8,7 +8,7 @@ import { TypedEvent } from "../../typed_event"; import { EventID } from '../../typed_event.js'; import { BulkComboResult, BulkSettings, ItemSpecWithSlot, ProgressMetrics } from "../../proto/api"; -import { EquipmentSpec, GemColor, ItemSlot, ItemSpec, SimDatabase, SimEnchant, SimGem, SimItem, Spec } from "../../proto/common"; +import { EquipmentSpec, Faction, GemColor, ItemSlot, ItemSpec, SimDatabase, SimEnchant, SimGem, SimItem, Spec } from "../../proto/common"; import { ItemData, ItemList, ItemRenderer, SelectorModal, SelectorModalTabs } from "../gear_picker"; import { SimTab } from "../sim_tab"; @@ -23,6 +23,7 @@ import { getEmptyGemSocketIconUrl } from "../../proto_utils/gems"; import { canEquipItem, getEligibleItemSlots } from "../../proto_utils/utils"; import { BaseModal } from "../base_modal"; import { BooleanPicker } from "../boolean_picker"; +import { UIItem_FactionRestriction } from '../../proto/ui'; export class BulkGearJsonImporter extends Importer { private readonly simUI: IndividualSimUI; @@ -591,7 +592,6 @@ export class BulkTab extends SimTab { pieces.forEach((piece) => { var lcPiece = piece.toLowerCase(); - if (!lcName.includes(lcPiece) && !lcSetName.includes(lcPiece)) { matched = false; return false; @@ -601,11 +601,29 @@ export class BulkTab extends SimTab { if (matched) { let itemElement = document.createElement('li'); - itemElement.innerText = item.name; + itemElement.innerHTML = `${item.name}`; itemElement.setAttribute("data-item-id", item.id.toString()); itemElement.addEventListener("click", (ev) => { this.addItems(Array(ItemSpec.create({ id: item.id }))); }) + if (item.heroic) { + let htxt = document.createElement("span"); + htxt.style.color = "green"; + htxt.innerText = "[H]"; + itemElement.appendChild(htxt); + } + if (item.factionRestriction == UIItem_FactionRestriction.HORDE_ONLY) { + let ftxt = document.createElement("span"); + ftxt.style.color = "red"; + ftxt.innerText = "(H)"; + itemElement.appendChild(ftxt); + } + if (item.factionRestriction == UIItem_FactionRestriction.ALLIANCE_ONLY) { + let ftxt = document.createElement("span"); + ftxt.style.color = "blue"; + ftxt.innerText = "(A)"; + itemElement.appendChild(ftxt); + } searchResults.append(itemElement); displayCount++; }