watchyoursixx / huntersim Goto Github PK
View Code? Open in Web Editor NEWHunter Classic Sim
Home Page: https://watchyoursixx.github.io/HunterSim/
License: GNU General Public License v3.0
Hunter Classic Sim
Home Page: https://watchyoursixx.github.io/HunterSim/
License: GNU General Public License v3.0
The extra crit from dwarf gun racial is not being applied in the sim.
"Carapace of Sun and Shadow" is currently configured as Location:"Sunwell", whereas it actually is a LW craftable. Because of that it is not filtered out when unchecking "Crafted" in the item selector.
Line 1761 in b274546
The input field on the page has the ID 'huntersraid' and 'onchange' calls 'fightSettings()'
The 'fightSettings()' function correctly reads/parses the value, and then stores it in 'huntersraid' variable before calling 'storeData();'.
let huntinraid = document.getElementById("huntersraid").value;
huntersraid = parseInt(huntinraid);
The 'storeData()' function then attempts to save it in localStorage:
localStorage.setItem('huntraid',huntersinraid);
Issue: It reads it from the variable 'huntersinraid', but the actual value was stored in 'huntersraid' - thus it does not get updated in localStorage.
will need to look at. Talents after first refresh require you to re-select the talent dropdown.
custom armor values don't save correctly due to how I'm loading/saving buffs. Will need to look at later, basically changing targets doesn't trigger the save data so it doesn't keep that data unless you change another setting
Even though in the settings I selected "Draenei" race and "BM 41/20/0" spec, whenever I reload the page it shows "Orc" and "SV 0/20/41" spec above the active gear.
Edit: Just to clarify, the settings are correctly saved/loaded, it is just not reflected on the "main page" upon reloading the page. Also, shouldn't there be a different icon for MM/SV specs?
Hi, I did some investigation on the exporting issue under Firefox and why simply nothing happens when clicking on the Export button.
The root-cause is that "showSaveFilePicker" does not exist in Firefox. It is still considered an experimental feature in general and Mozilla sees potential harmful use-cases due to which they don't want to add it (yet).
See here for browser-support: https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker
And here for Mozilla's reasoning: https://mozilla.github.io/standards-positions/#native-file-system
Now because the function-call is inside a try-catch that has no "error-handling" (it simply sets the 'succes' variable to 'false'), it seems like nothing happens to the user:
try {
handle = await showSaveFilePicker(opts);
success = true;
} catch (e) {
success = false;
}
May I therefore propose an alternative solution for browsers that don't support "showSaveFilePicker" (mainly Firefox & Safari, and all mobile browsers), to instead open a new browser tab that simply shows the JSON content as plain-text so one can copy-paste it and save it manually in a file or wherever instead? This even could be done directly inside the "catch" part as a generic fallback solution.
"Old" item from the saved set is shown
The "new" changed item is still there
When loading a (custom) set, in 'loadSet()' the set is read from "SavedSets" and a reference to its object is put in the 'gear' variable.
let activeset = SavedSets[val];
gear = activeset.data;
When an item is changed and 'selectItem(itemid)' is called, it overwrites the value(s) in 'gear'.
case 'shoulder':
console.log("you selected "+ itemid);
gear[activeslot] = { id: parseInt(itemid), gems: [], enchant: ench };
break;
Now since 'gear' is basically just a reference to the 'SavedSets[val].data' object, it is also changed there.
Simple example to reproduce/understand this issue:
const myArray = [
{
'name': 'First Entry'
},
{
'name': 'Second Entry'
}
];
let firstObject = myArray[0]; // firstObject is just a reference to the first entry in the Array
console.log(myArray[0].name); // "First Entry"
firstObject.name = 'Changed Entry';
console.log(myArray[0].name); // "Changed Entry"
In order to fix it, you need to make a shallow/deep copy of the set when loading it. In case of above example, the following would result in a deep-copy:
const myArray = [
{
'name': 'First Entry'
},
{
'name': 'Second Entry'
}
];
let firstObject = JSON.parse(JSON.stringify(myArray[0])); // now an actual (deep) copy of the object is created
console.log(myArray[0].name); // "First Entry"
firstObject.name = 'Changed Entry';
console.log(myArray[0].name); // "First Entry"
Unequipping a gem or enchant, does not trigger an update of the gear object in localStorage. It is only getting updated if a an actual gem/enchant is selected.
Thus in order to actually remove a gem/enchant from localStorage (and thus make it relevant for the DPS sim), you need to re-select a gem/enchant in another slot as this triggers a refresh of the whole localStorage['gear'].
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.