Skip to content

Commit

Permalink
Merge branch 'master' into degrade-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick authored Mar 18, 2024
2 parents bf397f9 + 68332eb commit f69a930
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 172 deletions.
37 changes: 9 additions & 28 deletions ui/core/components/filters_menu.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,15 @@
import {
ArmorType,
ItemSlot,
} from '../proto/common.js';
import {
SourceFilterOption,
UIItem_FactionRestriction,
} from '../proto/ui.js';
import {
armorTypeNames,
rangedWeaponTypeNames,
sourceNames,
weaponTypeNames,
} from '../proto_utils/names.js';
import {
classToEligibleRangedWeaponTypes,
classToEligibleWeaponTypes,
classToMaxArmorType,
canDualWield,
} from '../proto_utils/utils.js';
import { Player } from '../player.js';
import { ArmorType, ItemSlot } from '../proto/common.js';
import { SourceFilterOption, UIItem_FactionRestriction } from '../proto/ui.js';
import { armorTypeNames, rangedWeaponTypeNames, sourceNames, weaponTypeNames } from '../proto_utils/names.js';
import { canDualWield, classToEligibleRangedWeaponTypes, classToEligibleWeaponTypes, classToMaxArmorType } from '../proto_utils/utils.js';
import { Sim } from '../sim.js';
import { EventID } from '../typed_event.js';
import { getEnumValues } from '../utils.js';

import { BooleanPicker } from './boolean_picker.js';
import { NumberPicker } from './number_picker.js';
import { BaseModal } from './base_modal.js';
import { BooleanPicker } from './boolean_picker.js';
import { EnumPicker } from './enum_picker.js';
import { NumberPicker } from './number_picker.js';

const factionRestrictionsToLabels: Record<UIItem_FactionRestriction, string> = {
[UIItem_FactionRestriction.UNSPECIFIED]: 'None',
Expand All @@ -42,11 +25,7 @@ export class FiltersMenu extends BaseModal {

new EnumPicker(section, player.sim, {
extraCssClasses: ['w-50'],
values: [
UIItem_FactionRestriction.UNSPECIFIED,
UIItem_FactionRestriction.ALLIANCE_ONLY,
UIItem_FactionRestriction.HORDE_ONLY
].map((restriction) => {
values: [UIItem_FactionRestriction.UNSPECIFIED, UIItem_FactionRestriction.ALLIANCE_ONLY, UIItem_FactionRestriction.HORDE_ONLY].map(restriction => {
return {
name: factionRestrictionsToLabels[restriction],
value: restriction,
Expand All @@ -68,6 +47,7 @@ export class FiltersMenu extends BaseModal {
new BooleanPicker<Sim>(section, player.sim, {
label: sourceNames.get(source),
inline: true,
reverse: true,
changedEvent: (sim: Sim) => sim.filtersChangeEmitter,
getValue: (sim: Sim) => sim.getFilters().sources.includes(source),
setValue: (eventID: EventID, sim: Sim, newValue: boolean) => {
Expand Down Expand Up @@ -116,6 +96,7 @@ export class FiltersMenu extends BaseModal {
new BooleanPicker<Sim>(section, player.sim, {
label: armorTypeNames.get(armorType),
inline: true,
reverse: true,
changedEvent: (sim: Sim) => sim.filtersChangeEmitter,
getValue: (sim: Sim) => sim.getFilters().armorTypes.includes(armorType),
setValue: (eventID: EventID, sim: Sim, newValue: boolean) => {
Expand Down
12 changes: 6 additions & 6 deletions ui/scss/core/components/_boolean_picker.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@import "./input";
@import './input';

.boolean-picker-root {
}

@include media-breakpoint-down(xl) {
.input-root.boolean-picker-root {
flex-direction: row;
justify-content: space-between;
}
}
.input-root.boolean-picker-root {
flex-direction: row;
justify-content: space-between;
}
}
Loading

0 comments on commit f69a930

Please sign in to comment.