X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Ftracker%2FMap.js;h=b2685f873d6776814e00db66ff2cc6c225d51b03;hb=4e24f36eb5d6907697c106ca15c2c405728d78a8;hp=520ad938ab2faaafb61fd3774626af442104aa5b;hpb=3603709307e0777958cd18134ad4178cef410d14;p=alttp.git
diff --git a/resources/js/components/tracker/Map.js b/resources/js/components/tracker/Map.js
index 520ad93..b2685f8 100644
--- a/resources/js/components/tracker/Map.js
+++ b/resources/js/components/tracker/Map.js
@@ -7,6 +7,7 @@ import {
decrement,
hasDungeonBoss,
increment,
+ isDungeonCleared,
toggleBoolean,
unclearAll,
} from '../../helpers/tracker';
@@ -657,6 +658,25 @@ Location.propTypes = {
size: PropTypes.string,
};
+const makeBackground = (src, level) => {
+ const amount = Math.pow(2, Math.max(0, level - 8));
+ const size = 1 / amount;
+ const tiles = [];
+ for (let y = 0; y < amount; ++y) {
+ for (let x = 0; x < amount; ++x) {
+ tiles.push();
+ }
+ }
+ return tiles;
+};
+
const Map = () => {
const { dungeons, setState, state } = useTracker();
@@ -665,14 +685,8 @@ const Map = () => {
const cleared = state[`${dungeon.id}-checks`] || 0;
const total = definition.items;
let status = 'available';
- if (cleared === total) {
- if (['ct', 'gt'].includes(dungeon.id)) {
- if (hasDungeonBoss(state, dungeon)) {
- status = 'cleared';
- }
- } else {
- status = 'cleared';
- }
+ if (isDungeonCleared(state, definition)) {
+ status = 'cleared';
}
return {
...dungeon,
@@ -764,34 +778,7 @@ const Map = () => {
>
-
-
-
-
+ {makeBackground('lw_files', 10)}
{lwLocations.map(l =>
@@ -804,34 +791,7 @@ const Map = () => {
-
-
-
-
+ {makeBackground('dw_files', 10)}
{dwLocations.map(l =>