Skip to content

Commit

Permalink
updated batch search ui to show heroic / faction info
Browse files Browse the repository at this point in the history
  • Loading branch information
lologarithm committed Jun 8, 2023
1 parent 1e174c3 commit 8ad02dd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 21 additions & 3 deletions ui/core/components/individual_sim_ui/bulk_tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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<SpecType extends Spec> extends Importer {
private readonly simUI: IndividualSimUI<SpecType>;
Expand Down Expand Up @@ -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;
Expand All @@ -601,11 +601,29 @@ export class BulkTab extends SimTab {

if (matched) {
let itemElement = document.createElement('li');
itemElement.innerText = item.name;
itemElement.innerHTML = `<span>${item.name}</span>`;
itemElement.setAttribute("data-item-id", item.id.toString());
itemElement.addEventListener("click", (ev) => {
this.addItems(Array<ItemSpec>(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++;
}
Expand Down

0 comments on commit 8ad02dd

Please sign in to comment.