Skip to content

Commit

Permalink
Dont double sim and sort properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ToxicKevinFerm committed Jan 30, 2024
1 parent 29335dc commit fb4dfd7
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 15 deletions.
7 changes: 6 additions & 1 deletion sim/core/bulksim.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"math"
"reflect"
"runtime"
"runtime/debug"
"sort"
Expand Down Expand Up @@ -197,6 +198,10 @@ func (b *bulkSimRunner) Run(pctx context.Context, progress chan *proto.ProgressM
for _, talent := range talentsToSim {
sr := goproto.Clone(substitutedRequest).(*proto.RaidSimRequest)
cl := *changeLog
if sr.Raid.Parties[0].Players[0].TalentsString == talent.TalentsString && reflect.DeepEqual(talent.Glyphs, sr.Raid.Parties[0].Players[0].Glyphs) {
continue
}

sr.Raid.Parties[0].Players[0].TalentsString = talent.TalentsString
sr.Raid.Parties[0].Players[0].Glyphs = talent.Glyphs
cl.TalentLoadout = talent
Expand Down Expand Up @@ -395,7 +400,7 @@ func (b *bulkSimRunner) getRankedResults(pctx context.Context, validCombos []sin
cancel() // cancel reporter
return nil, nil, errors.New("simulation failed: " + result.Result.ErrorResult)
}
if !result.Substitution.HasItemReplacements() {
if !result.Substitution.HasItemReplacements() && result.ChangeLog.TalentLoadout == nil {
baseResult = result
}
rankedResults[i] = result
Expand Down
9 changes: 4 additions & 5 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, TalentLoadout } from "../../proto/api";
import { EquipmentSpec, Faction, GemColor, ItemSlot, ItemSpec, SimDatabase, SimEnchant, SimGem, SimItem, Spec } from "../../proto/common";
import { EquipmentSpec, Faction, GemColor, Glyphs, 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 Down Expand Up @@ -712,10 +712,9 @@ export class BulkTab extends SimTab {
let index = this.savedTalents.findIndex(talent => JSON.stringify(talent) === JSON.stringify(loadout));
const talentFragment = document.createElement('fragment');
talentFragment.innerHTML = `
<div class="saved-data-set-chip badge rounded-pill ${index !== -1 ? 'active' : ''}">
<a href="javascript:void(0)" class="saved-data-set-name" role="button">${name}</a>
</div>
`;
<div class="saved-data-set-chip badge rounded-pill ${index !== -1 ? 'active' : ''}">
<a href="javascript:void(0)" class="saved-data-set-name" role="button">${name}</a>
</div>`;

console.log("Adding event for loadout", loadout);
// Wrap the event listener addition in an IIFE
Expand Down
36 changes: 27 additions & 9 deletions ui/scss/core/components/_bulk.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@

.bulk-result {
margin-bottom: 0.5rem;

.bulk-equipit {
height: 40px;
flex: 1;
}

.bulk-results-body {
flex-direction: row;
}
}

.bulk-result-item-slot {
color:aliceblue;
color: aliceblue;
margin-left: 0.5rem;
font-size: 0.5 * map.get($font-sizes, 6);
}
Expand All @@ -25,7 +27,8 @@
border-bottom: none;
}

.bulk-result-header-positive, .bulk-result-header-negative {
.bulk-result-header-positive,
.bulk-result-header-negative {
font-weight: bold;
margin-left: 0.5rem;
}
Expand Down Expand Up @@ -60,6 +63,7 @@
grid-template-columns: repeat(3, 32%);
grid-template-rows: auto;
flex: 5;

.item-picker-root {
padding: 2px;
}
Expand Down Expand Up @@ -90,9 +94,9 @@
align-items: center;
justify-content: center;
z-index: 1;
background: rgba(0,0,0,0.5);
background: rgba(0, 0, 0, 0.5);
max-height: 100vh;

.results-content {
.results-sim {
div {
Expand Down Expand Up @@ -120,6 +124,7 @@
margin-top: 5px;
border-bottom: 1px solid white;
padding: 3px;

label {
flex: 1;
}
Expand All @@ -133,25 +138,38 @@
display: flex;
}
}

.batch-search-results {
list-style: none;
background: rgba(0,0,0,0.3);
background: rgba(0, 0, 0, 0.3);

li {
cursor: pointer;
background: transparent;

&:hover {
background: rgba(255,255,255, 0.3);
background: rgba(255, 255, 255, 0.3);
}
}
}

.talents-picker-container {
display: flex;
flex-direction: column;
border-bottom: 1px solid white;
padding-bottom: 5px;

.talents-container {
display: flex;
}
}

.default-gem-container {
display: flex;
flex-direction: column;
border-bottom: 1px solid white;
padding-bottom: 5px;

.gem-socket-container {
height: 40px;
width: 40px;
Expand All @@ -172,4 +190,4 @@
.results-sim {
margin-right: map-get($spacers, 3);
}
}
}

0 comments on commit fb4dfd7

Please sign in to comment.