Merge remote-tracking branch 'template/main'
This commit is contained in:
commit
b03fd26b3c
86 changed files with 623 additions and 477 deletions
33
CHANGELOG.md
Normal file
33
CHANGELOG.md
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Changelog
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [0.1.1] - 2022-03-02
|
||||
### Added
|
||||
- Configuration for Glitch projects
|
||||
- Configuration for Replit projects
|
||||
- Hide versionTitle if blank
|
||||
### Changed
|
||||
- **BREAKING** Renamed modInfo.json -> projInfo.json
|
||||
- **BREAKING** Renamed mod.tsx -> projEntry.tsx
|
||||
- Improved performance of branch drawing code
|
||||
- Improved performance of formatting numbers
|
||||
- Changed some projInfo default values to empty strings
|
||||
- Renamed projInfo.allowSmall -> projInfo.defaultShowSmall
|
||||
### Fixed
|
||||
- Spacing on discord logo in NaN screen
|
||||
- Some files accessing old location for persistence code
|
||||
- Fixed lint-staged not being listed in devDependencies
|
||||
- Branch locations were not accurate after scrolling
|
||||
- Saves Manager displayed "default body" while closing
|
||||
- Reset buttons activating when held down when canClick is false
|
||||
- Lifting up on auto clickable elements not stopping the auto clicker
|
||||
### Removed
|
||||
- Removed Theme.stackedInfoboxes
|
||||
- Removed Theme.showSingleTab
|
||||
|
||||
## [0.1.0] - Initial Release
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "profectus",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "vue-cli-service serve",
|
||||
|
@ -41,7 +41,7 @@
|
|||
"sass": "^1.48.0",
|
||||
"sass-loader": "^10.2.0",
|
||||
"tsconfig-paths-webpack-plugin": "^3.5.1",
|
||||
"typescript": "^4.5.4"
|
||||
"typescript": "~4.5.5"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
|
|
|
@ -16,7 +16,7 @@ import GameOverScreen from "./components/GameOverScreen.vue";
|
|||
import NaNScreen from "./components/NaNScreen.vue";
|
||||
import Nav from "./components/Nav.vue";
|
||||
import TPS from "./components/TPS.vue";
|
||||
import modInfo from "./data/modInfo.json";
|
||||
import projInfo from "./data/projInfo.json";
|
||||
import themes from "./data/themes";
|
||||
import settings from "./game/settings";
|
||||
import "./main.css";
|
||||
|
@ -25,7 +25,7 @@ function updateMouse(/* event */) {
|
|||
// TODO use event to update mouse position for particles
|
||||
}
|
||||
|
||||
const useHeader = modInfo.useHeader;
|
||||
const useHeader = projInfo.useHeader;
|
||||
const theme = computed(() => themes[settings.theme].variables);
|
||||
const showTPS = toRef(settings, "showTPS");
|
||||
</script>
|
||||
|
|
|
@ -17,16 +17,16 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import modInfo from "@/data/modInfo.json";
|
||||
import { GenericLayer, layers } from "@/game/layers";
|
||||
import player from "@/game/player";
|
||||
import projInfo from "data/projInfo.json";
|
||||
import { GenericLayer, layers } from "game/layers";
|
||||
import player from "game/player";
|
||||
import { computed, toRef } from "vue";
|
||||
import Layer from "./Layer.vue";
|
||||
import Nav from "./Nav.vue";
|
||||
|
||||
const tabs = toRef(player, "tabs");
|
||||
const layerKeys = computed(() => Object.keys(layers));
|
||||
const useHeader = modInfo.useHeader;
|
||||
const useHeader = projInfo.useHeader;
|
||||
|
||||
function gatherLayerProps(layer: GenericLayer) {
|
||||
const { display, minimized, minWidth, name, color, style, classes, links, minimizable } = layer;
|
||||
|
|
|
@ -37,16 +37,16 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Modal from "@/components/Modal.vue";
|
||||
import { hasWon } from "@/data/mod";
|
||||
import modInfo from "@/data/modInfo.json";
|
||||
import player from "@/game/player";
|
||||
import { formatTime } from "@/util/bignum";
|
||||
import { loadSave, newSave } from "@/util/save";
|
||||
import Modal from "components/Modal.vue";
|
||||
import { hasWon } from "data/projEntry";
|
||||
import projInfo from "data/projInfo.json";
|
||||
import player from "game/player";
|
||||
import { formatTime } from "util/bignum";
|
||||
import { loadSave, newSave } from "util/save";
|
||||
import { computed, toRef } from "vue";
|
||||
import Toggle from "./fields/Toggle.vue";
|
||||
|
||||
const { title, logo, discordName, discordLink, versionNumber, versionTitle } = modInfo;
|
||||
const { title, logo, discordName, discordLink, versionNumber, versionTitle } = projInfo;
|
||||
|
||||
const timePlayed = computed(() => formatTime(player.timePlayed));
|
||||
const isOpen = computed(() => hasWon.value && !player.keepGoing);
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
<img class="info-modal-logo" v-if="logo" :src="logo" :alt="title" />
|
||||
<div class="info-modal-title">
|
||||
<h2>{{ title }}</h2>
|
||||
<h4>v{{ versionNumber }}: {{ versionTitle }}</h4>
|
||||
<h4>
|
||||
v{{ versionNumber }}<span v-if="versionTitle">: {{ versionTitle }}</span>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -48,14 +50,14 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Modal from "@/components/Modal.vue";
|
||||
import type Changelog from "@/data/Changelog.vue";
|
||||
import modInfo from "@/data/modInfo.json";
|
||||
import player from "@/game/player";
|
||||
import { formatTime } from "@/util/bignum";
|
||||
import Modal from "components/Modal.vue";
|
||||
import type Changelog from "data/Changelog.vue";
|
||||
import projInfo from "data/projInfo.json";
|
||||
import player from "game/player";
|
||||
import { formatTime } from "util/bignum";
|
||||
import { computed, ref, toRefs, unref } from "vue";
|
||||
|
||||
const { title, logo, author, discordName, discordLink, versionNumber, versionTitle } = modInfo;
|
||||
const { title, logo, author, discordName, discordLink, versionNumber, versionTitle } = projInfo;
|
||||
|
||||
const _props = defineProps<{ changelog: typeof Changelog | null }>();
|
||||
const props = toRefs(_props);
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Links from "@/components/links/Links.vue";
|
||||
import modInfo from "@/data/modInfo.json";
|
||||
import { CoercableComponent, StyleValue } from "@/features/feature";
|
||||
import { Link } from "@/features/links";
|
||||
import { PersistentRef } from "@/game/persistence";
|
||||
import player from "@/game/player";
|
||||
import { computeComponent, processedPropType, wrapRef } from "@/util/vue";
|
||||
import Links from "components/links/Links.vue";
|
||||
import projInfo from "data/projInfo.json";
|
||||
import { CoercableComponent, StyleValue } from "features/feature";
|
||||
import { Link } from "features/links";
|
||||
import { PersistentRef } from "game/persistence";
|
||||
import player from "game/player";
|
||||
import { computeComponent, processedPropType, wrapRef } from "util/vue";
|
||||
import { computed, defineComponent, nextTick, PropType, toRefs, unref, watch } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
|
@ -68,7 +68,7 @@ export default defineComponent({
|
|||
|
||||
const component = computeComponent(display);
|
||||
const showGoBack = computed(
|
||||
() => modInfo.allowGoBack && index.value > 0 && !minimized.value
|
||||
() => projInfo.allowGoBack && index.value > 0 && !minimized.value
|
||||
);
|
||||
|
||||
function goBack() {
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Link } from "@/features/links";
|
||||
import { Link } from "features/links";
|
||||
import { computed, ref, toRefs } from "vue";
|
||||
import Links from "./links/Links.vue";
|
||||
|
||||
|
|
|
@ -43,16 +43,16 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Modal from "@/components/Modal.vue";
|
||||
import modInfo from "@/data/modInfo.json";
|
||||
import player from "@/game/player";
|
||||
import state from "@/game/state";
|
||||
import Decimal, { DecimalSource, format } from "@/util/bignum";
|
||||
import Modal from "components/Modal.vue";
|
||||
import projInfo from "data/projInfo.json";
|
||||
import player from "game/player";
|
||||
import state from "game/state";
|
||||
import Decimal, { DecimalSource, format } from "util/bignum";
|
||||
import { ComponentPublicInstance, computed, ref, toRef } from "vue";
|
||||
import Toggle from "./fields/Toggle.vue";
|
||||
import SavesManager from "./SavesManager.vue";
|
||||
|
||||
const { discordName, discordLink } = modInfo;
|
||||
const { discordName, discordLink } = projInfo;
|
||||
const autosave = toRef(player, "autosave");
|
||||
const hasNaN = toRef(state, "hasNaN");
|
||||
const savesManager = ref<ComponentPublicInstance<typeof SavesManager> | null>(null);
|
||||
|
|
|
@ -99,8 +99,8 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Changelog from "@/data/Changelog.vue";
|
||||
import modInfo from "@/data/modInfo.json";
|
||||
import Changelog from "data/Changelog.vue";
|
||||
import projInfo from "data/projInfo.json";
|
||||
import { ComponentPublicInstance, ref } from "vue";
|
||||
import Info from "./Info.vue";
|
||||
import Options from "./Options.vue";
|
||||
|
@ -114,7 +114,7 @@ const options = ref<ComponentPublicInstance<typeof Options> | null>(null);
|
|||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const changelog = ref<ComponentPublicInstance<any> | null>(null);
|
||||
|
||||
const { useHeader, banner, title, discordName, discordLink, versionNumber } = modInfo;
|
||||
const { useHeader, banner, title, discordName, discordLink, versionNumber } = projInfo;
|
||||
|
||||
function openDiscord() {
|
||||
window.open(discordLink, "mywindow");
|
||||
|
|
|
@ -19,17 +19,17 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="tsx">
|
||||
import Modal from "@/components/Modal.vue";
|
||||
import rawThemes from "@/data/themes";
|
||||
import player from "@/game/player";
|
||||
import settings, { settingFields } from "@/game/settings";
|
||||
import { camelToTitle } from "@/util/common";
|
||||
import Modal from "components/Modal.vue";
|
||||
import rawThemes from "data/themes";
|
||||
import player from "game/player";
|
||||
import settings, { settingFields } from "game/settings";
|
||||
import { camelToTitle } from "util/common";
|
||||
import { computed, ref, toRefs } from "vue";
|
||||
import Toggle from "./fields/Toggle.vue";
|
||||
import Select from "./fields/Select.vue";
|
||||
import Tooltip from "./Tooltip.vue";
|
||||
import { jsx } from "@/features/feature";
|
||||
import { coerceComponent, render } from "@/util/vue";
|
||||
import { jsx } from "features/feature";
|
||||
import { coerceComponent, render } from "util/vue";
|
||||
|
||||
const isOpen = ref(false);
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import player from "@/game/player";
|
||||
import player from "game/player";
|
||||
import { computed, ref, toRefs, watch } from "vue";
|
||||
import DangerButton from "./fields/DangerButton.vue";
|
||||
import FeedbackButton from "./fields/FeedbackButton.vue";
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
<template v-slot:header>
|
||||
<h2>Saves Manager</h2>
|
||||
</template>
|
||||
<template v-slot:body>
|
||||
<template #body="{ shown }">
|
||||
<Draggable
|
||||
:list="settings.saves"
|
||||
handle=".handle"
|
||||
v-if="unref(modal?.isOpen)"
|
||||
v-if="shown"
|
||||
:itemKey="(save: string) => save"
|
||||
>
|
||||
<template #item="{ element }">
|
||||
|
@ -57,10 +57,10 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Modal from "@/components/Modal.vue";
|
||||
import player, { PlayerData } from "@/game/player";
|
||||
import settings from "@/game/settings";
|
||||
import { getUniqueID, loadSave, save, newSave } from "@/util/save";
|
||||
import Modal from "components/Modal.vue";
|
||||
import player, { PlayerData } from "game/player";
|
||||
import settings from "game/settings";
|
||||
import { getUniqueID, loadSave, save, newSave } from "util/save";
|
||||
import {
|
||||
ComponentPublicInstance,
|
||||
computed,
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import state from "@/game/state";
|
||||
import Decimal, { DecimalSource, formatWhole } from "@/util/bignum";
|
||||
import state from "game/state";
|
||||
import Decimal, { DecimalSource, formatWhole } from "util/bignum";
|
||||
import { computed, ref, watchEffect } from "vue";
|
||||
|
||||
const tps = computed(() =>
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { CoercableComponent } from "@/features/feature";
|
||||
import { computeOptionalComponent, processedPropType, unwrapRef } from "@/util/vue";
|
||||
import { CoercableComponent } from "features/feature";
|
||||
import { computeOptionalComponent, processedPropType, unwrapRef } from "util/vue";
|
||||
import { computed, defineComponent, ref, toRefs, unref } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
|
|
|
@ -14,9 +14,9 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import "@/components/common/fields.css";
|
||||
import { CoercableComponent } from "@/features/feature";
|
||||
import { computeOptionalComponent } from "@/util/vue";
|
||||
import "components/common/fields.css";
|
||||
import { CoercableComponent } from "features/feature";
|
||||
import { computeOptionalComponent } from "util/vue";
|
||||
import { ref, toRef, watch } from "vue";
|
||||
import VueNextSelect from "vue-next-select";
|
||||
import "vue-next-select/dist/index.css";
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, toRefs, unref } from "vue";
|
||||
import Tooltip from "../Tooltip.vue";
|
||||
import "@/components/common/fields.css";
|
||||
import "components/common/fields.css";
|
||||
|
||||
const _props = defineProps<{
|
||||
title?: string;
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { CoercableComponent } from "@/features/feature";
|
||||
import { coerceComponent } from "@/util/vue";
|
||||
import { CoercableComponent } from "features/feature";
|
||||
import { coerceComponent } from "util/vue";
|
||||
import { computed, onMounted, ref, toRefs, unref } from "vue";
|
||||
import VueTextareaAutosize from "vue-textarea-autosize";
|
||||
import "@/components/common/fields.css";
|
||||
import "components/common/fields.css";
|
||||
|
||||
const _props = defineProps<{
|
||||
title?: CoercableComponent;
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { CoercableComponent } from "@/features/feature";
|
||||
import { coerceComponent } from "@/util/vue";
|
||||
import { CoercableComponent } from "features/feature";
|
||||
import { coerceComponent } from "util/vue";
|
||||
import { computed, unref } from "vue";
|
||||
import "@/components/common/fields.css";
|
||||
import "components/common/fields.css";
|
||||
|
||||
const props = defineProps<{
|
||||
title?: CoercableComponent;
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import "@/components/common/table.css";
|
||||
import themes from "@/data/themes";
|
||||
import settings from "@/game/settings";
|
||||
import "components/common/table.css";
|
||||
import themes from "data/themes";
|
||||
import settings from "game/settings";
|
||||
import { computed } from "vue";
|
||||
|
||||
const mergeAdjacent = computed(() => themes[settings.theme].mergeAdjacent);
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import "@/components/common/table.css";
|
||||
import themes from "@/data/themes";
|
||||
import settings from "@/game/settings";
|
||||
import "components/common/table.css";
|
||||
import themes from "data/themes";
|
||||
import settings from "game/settings";
|
||||
import { computed } from "vue";
|
||||
|
||||
const mergeAdjacent = computed(() => themes[settings.theme].mergeAdjacent);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Link, LinkNode } from "@/features/links";
|
||||
import { Link, LinkNode } from "features/links";
|
||||
import { computed, toRefs, unref } from "vue";
|
||||
|
||||
const _props = defineProps<{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { RegisterLinkNodeInjectionKey, UnregisterLinkNodeInjectionKey } from "@/features/links";
|
||||
import { RegisterLinkNodeInjectionKey, UnregisterLinkNodeInjectionKey } from "features/links";
|
||||
import { computed, inject, onUnmounted, ref, toRefs, unref, watch } from "vue";
|
||||
|
||||
const _props = defineProps<{ id: string }>();
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
LinkNode,
|
||||
RegisterLinkNodeInjectionKey,
|
||||
UnregisterLinkNodeInjectionKey
|
||||
} from "@/features/links";
|
||||
} from "features/links";
|
||||
import { computed, nextTick, onMounted, provide, ref, toRef } from "vue";
|
||||
import LinkVue from "./Link.vue";
|
||||
|
||||
|
@ -80,7 +80,7 @@ function updateNodes() {
|
|||
nextTick(() => {
|
||||
boundingRect = resizeListener.value?.getBoundingClientRect();
|
||||
Object.keys(nodes.value).forEach(id => updateNode(id));
|
||||
isDirty = true
|
||||
isDirty = true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Modal from "@/components/Modal.vue";
|
||||
import Modal from "components/Modal.vue";
|
||||
import { ref } from "vue";
|
||||
|
||||
const isOpen = ref(false);
|
||||
|
|
|
@ -3,25 +3,26 @@ import {
|
|||
ClickableOptions,
|
||||
createClickable,
|
||||
GenericClickable
|
||||
} from "@/features/clickables/clickable";
|
||||
import { GenericConversion } from "@/features/conversion";
|
||||
import { CoercableComponent, jsx, Replace, setDefault } from "@/features/feature";
|
||||
import { displayResource } from "@/features/resources/resource";
|
||||
} from "features/clickables/clickable";
|
||||
import { GenericConversion } from "features/conversion";
|
||||
import { CoercableComponent, jsx, Replace, setDefault } from "features/feature";
|
||||
import { displayResource } from "features/resources/resource";
|
||||
import {
|
||||
createTreeNode,
|
||||
GenericTree,
|
||||
GenericTreeNode,
|
||||
TreeNode,
|
||||
TreeNodeOptions
|
||||
} from "@/features/trees/tree";
|
||||
import player from "@/game/player";
|
||||
import Decimal from "@/util/bignum";
|
||||
} from "features/trees/tree";
|
||||
import player from "game/player";
|
||||
import Decimal from "util/bignum";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
} from "util/computed";
|
||||
import { computed, Ref, unref } from "vue";
|
||||
|
||||
export interface ResetButtonOptions extends ClickableOptions {
|
||||
|
@ -104,6 +105,9 @@ export function createResetButton<T extends ClickableOptions & ResetButtonOption
|
|||
|
||||
const onClick = resetButton.onClick;
|
||||
resetButton.onClick = function () {
|
||||
if (!unref(resetButton.canClick)) {
|
||||
return;
|
||||
}
|
||||
resetButton.conversion.convert();
|
||||
resetButton.tree.reset(resetButton.treeNode);
|
||||
onClick?.();
|
||||
|
@ -115,39 +119,48 @@ export function createResetButton<T extends ClickableOptions & ResetButtonOption
|
|||
|
||||
export interface LayerTreeNodeOptions extends TreeNodeOptions {
|
||||
layerID: string;
|
||||
color: string;
|
||||
append?: boolean;
|
||||
color: Computable<string>; // marking as required
|
||||
display?: Computable<string>;
|
||||
append?: Computable<boolean>;
|
||||
}
|
||||
export type LayerTreeNode<T extends LayerTreeNodeOptions> = Replace<
|
||||
TreeNode<T>,
|
||||
{
|
||||
append: ProcessedComputable<boolean>;
|
||||
display: GetComputableTypeWithDefault<T["display"], T["layerID"]>;
|
||||
append: GetComputableType<T["append"]>;
|
||||
}
|
||||
>;
|
||||
export type GenericLayerTreeNode = Replace<
|
||||
LayerTreeNode<LayerTreeNodeOptions>,
|
||||
{
|
||||
display: ProcessedComputable<string>;
|
||||
append?: ProcessedComputable<boolean>;
|
||||
}
|
||||
>;
|
||||
export type GenericLayerTreeNode = LayerTreeNode<LayerTreeNodeOptions>;
|
||||
|
||||
export function createLayerTreeNode<T extends LayerTreeNodeOptions>(
|
||||
optionsFunc: () => T
|
||||
): LayerTreeNode<T> {
|
||||
return createTreeNode(() => {
|
||||
const options = optionsFunc();
|
||||
processComputable(options as T, "display");
|
||||
setDefault(options, "display", options.layerID);
|
||||
processComputable(options as T, "append");
|
||||
return {
|
||||
...options,
|
||||
display: options.layerID,
|
||||
onClick:
|
||||
options.append != null && options.append
|
||||
? function () {
|
||||
if (player.tabs.includes(options.layerID)) {
|
||||
const index = player.tabs.lastIndexOf(options.layerID);
|
||||
player.tabs.splice(index, 1);
|
||||
} else {
|
||||
player.tabs.push(options.layerID);
|
||||
}
|
||||
}
|
||||
: function () {
|
||||
player.tabs.splice(1, 1, options.layerID);
|
||||
onClick: unref((options as unknown as GenericLayerTreeNode).append)
|
||||
? function () {
|
||||
if (player.tabs.includes(options.layerID)) {
|
||||
const index = player.tabs.lastIndexOf(options.layerID);
|
||||
player.tabs.splice(index, 1);
|
||||
} else {
|
||||
player.tabs.push(options.layerID);
|
||||
}
|
||||
}
|
||||
: function () {
|
||||
player.tabs.splice(1, 1, options.layerID);
|
||||
}
|
||||
};
|
||||
}) as unknown as LayerTreeNode<T>;
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import Row from "@/components/layout/Row.vue";
|
||||
import Tooltip from "@/components/Tooltip.vue";
|
||||
import { main } from "@/data/mod";
|
||||
import { createAchievement } from "@/features/achievements/achievement";
|
||||
import { jsx } from "@/features/feature";
|
||||
import { createGrid } from "@/features/grids/grid";
|
||||
import { createResource } from "@/features/resources/resource";
|
||||
import { createTreeNode } from "@/features/trees/tree";
|
||||
import { createLayer } from "@/game/layers";
|
||||
import { DecimalSource } from "@/lib/break_eternity";
|
||||
import Decimal from "@/util/bignum";
|
||||
import { render, renderRow } from "@/util/vue";
|
||||
import Row from "components/layout/Row.vue";
|
||||
import Tooltip from "components/Tooltip.vue";
|
||||
import { main } from "data/projEntry";
|
||||
import { createAchievement } from "features/achievements/achievement";
|
||||
import { jsx } from "features/feature";
|
||||
import { createGrid } from "features/grids/grid";
|
||||
import { createResource } from "features/resources/resource";
|
||||
import { createTreeNode } from "features/trees/tree";
|
||||
import { createLayer } from "game/layers";
|
||||
import { DecimalSource } from "lib/break_eternity";
|
||||
import Decimal from "util/bignum";
|
||||
import { render, renderRow } from "util/vue";
|
||||
import { computed } from "vue";
|
||||
import f from "./f";
|
||||
|
||||
|
|
|
@ -1,42 +1,42 @@
|
|||
import Slider from "@/components/fields/Slider.vue";
|
||||
import Text from "@/components/fields/Text.vue";
|
||||
import Toggle from "@/components/fields/Toggle.vue";
|
||||
import Column from "@/components/layout/Column.vue";
|
||||
import Row from "@/components/layout/Row.vue";
|
||||
import Spacer from "@/components/layout/Spacer.vue";
|
||||
import Sticky from "@/components/layout/Sticky.vue";
|
||||
import VerticalRule from "@/components/layout/VerticalRule.vue";
|
||||
import Modal from "@/components/Modal.vue";
|
||||
import { createLayerTreeNode, createResetButton } from "@/data/common";
|
||||
import { main } from "@/data/mod";
|
||||
import themes from "@/data/themes";
|
||||
import { createBar, Direction } from "@/features/bars/bar";
|
||||
import { createBuyable } from "@/features/buyable";
|
||||
import { createChallenge } from "@/features/challenges/challenge";
|
||||
import { createClickable } from "@/features/clickables/clickable";
|
||||
import Slider from "components/fields/Slider.vue";
|
||||
import Text from "components/fields/Text.vue";
|
||||
import Toggle from "components/fields/Toggle.vue";
|
||||
import Column from "components/layout/Column.vue";
|
||||
import Row from "components/layout/Row.vue";
|
||||
import Spacer from "components/layout/Spacer.vue";
|
||||
import Sticky from "components/layout/Sticky.vue";
|
||||
import VerticalRule from "components/layout/VerticalRule.vue";
|
||||
import Modal from "components/Modal.vue";
|
||||
import { createLayerTreeNode, createResetButton } from "data/common";
|
||||
import { main } from "data/projEntry";
|
||||
import themes from "data/themes";
|
||||
import { createBar, Direction } from "features/bars/bar";
|
||||
import { createBuyable } from "features/buyable";
|
||||
import { createChallenge } from "features/challenges/challenge";
|
||||
import { createClickable } from "features/clickables/clickable";
|
||||
import {
|
||||
addSoftcap,
|
||||
createCumulativeConversion,
|
||||
createExponentialScaling
|
||||
} from "@/features/conversion";
|
||||
import { jsx, showIf, Visibility } from "@/features/feature";
|
||||
import { createHotkey } from "@/features/hotkey";
|
||||
import { createInfobox } from "@/features/infoboxes/infobox";
|
||||
import { createMilestone } from "@/features/milestones/milestone";
|
||||
import { createReset } from "@/features/reset";
|
||||
import MainDisplay from "@/features/resources/MainDisplay.vue";
|
||||
import { createResource, displayResource, trackBest } from "@/features/resources/resource";
|
||||
import Resource from "@/features/resources/Resource.vue";
|
||||
import { createTab } from "@/features/tabs/tab";
|
||||
import { createTabFamily } from "@/features/tabs/tabFamily";
|
||||
import { createTree, createTreeNode, GenericTreeNode, TreeBranch } from "@/features/trees/tree";
|
||||
import { createUpgrade } from "@/features/upgrades/upgrade";
|
||||
import { createLayer } from "@/game/layers";
|
||||
import { persistent } from "@/game/persistence";
|
||||
import settings from "@/game/settings";
|
||||
import { DecimalSource } from "@/lib/break_eternity";
|
||||
import Decimal, { format, formatWhole } from "@/util/bignum";
|
||||
import { render, renderCol, renderRow } from "@/util/vue";
|
||||
createPolynomialScaling
|
||||
} from "features/conversion";
|
||||
import { jsx, showIf, Visibility } from "features/feature";
|
||||
import { createHotkey } from "features/hotkey";
|
||||
import { createInfobox } from "features/infoboxes/infobox";
|
||||
import { createMilestone } from "features/milestones/milestone";
|
||||
import { createReset } from "features/reset";
|
||||
import MainDisplay from "features/resources/MainDisplay.vue";
|
||||
import { createResource, displayResource, trackBest } from "features/resources/resource";
|
||||
import Resource from "features/resources/Resource.vue";
|
||||
import { createTab } from "features/tabs/tab";
|
||||
import { createTabFamily } from "features/tabs/tabFamily";
|
||||
import { createTree, createTreeNode, GenericTreeNode, TreeBranch } from "features/trees/tree";
|
||||
import { createUpgrade } from "features/upgrades/upgrade";
|
||||
import { createLayer } from "game/layers";
|
||||
import { persistent } from "game/persistence";
|
||||
import settings from "game/settings";
|
||||
import { DecimalSource } from "lib/break_eternity";
|
||||
import Decimal, { format, formatWhole } from "util/bignum";
|
||||
import { render, renderCol, renderRow } from "util/vue";
|
||||
import { computed, ComputedRef, ref } from "vue";
|
||||
import f from "./f";
|
||||
|
||||
|
@ -346,7 +346,7 @@ const layer = createLayer(() => {
|
|||
}));
|
||||
|
||||
const conversion = createCumulativeConversion(() => ({
|
||||
scaling: addSoftcap(createExponentialScaling(10, 5, 0.5), 1e100, 0.5),
|
||||
scaling: addSoftcap(createPolynomialScaling(10, 0.5), 1e100, 0.5),
|
||||
baseResource: main.points,
|
||||
gainResource: points,
|
||||
roundUpCost: true
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { createLayerTreeNode, createResetButton } from "@/data/common";
|
||||
import { main } from "@/data/mod";
|
||||
import { createClickable } from "@/features/clickables/clickable";
|
||||
import { createExponentialScaling, createIndependentConversion } from "@/features/conversion";
|
||||
import { jsx } from "@/features/feature";
|
||||
import { createInfobox } from "@/features/infoboxes/infobox";
|
||||
import { createReset } from "@/features/reset";
|
||||
import MainDisplay from "@/features/resources/MainDisplay.vue";
|
||||
import { createResource, displayResource } from "@/features/resources/resource";
|
||||
import { createLayer } from "@/game/layers";
|
||||
import { persistent } from "@/game/persistence";
|
||||
import Decimal, { DecimalSource, formatWhole } from "@/util/bignum";
|
||||
import { render } from "@/util/vue";
|
||||
import { createLayerTreeNode, createResetButton } from "data/common";
|
||||
import { main } from "data/projEntry";
|
||||
import { createClickable } from "features/clickables/clickable";
|
||||
import { createPolynomialScaling, createIndependentConversion } from "features/conversion";
|
||||
import { jsx } from "features/feature";
|
||||
import { createInfobox } from "features/infoboxes/infobox";
|
||||
import { createReset } from "features/reset";
|
||||
import MainDisplay from "features/resources/MainDisplay.vue";
|
||||
import { createResource, displayResource } from "features/resources/resource";
|
||||
import { createLayer } from "game/layers";
|
||||
import { persistent } from "game/persistence";
|
||||
import Decimal, { DecimalSource, formatWhole } from "util/bignum";
|
||||
import { render } from "util/vue";
|
||||
import c from "./c";
|
||||
|
||||
const layer = createLayer(() => {
|
||||
|
@ -94,7 +94,7 @@ const layer = createLayer(() => {
|
|||
}));
|
||||
|
||||
const conversion = createIndependentConversion(() => ({
|
||||
scaling: createExponentialScaling(10, 3, 0.5),
|
||||
scaling: createPolynomialScaling(10, 0.5),
|
||||
baseResource: main.points,
|
||||
gainResource: points,
|
||||
modifyGainAmount: gain => Decimal.times(gain, c.otherThingy.value)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* eslint-disable */
|
||||
import { layers } from "@/game/layers";
|
||||
import player from "@/game/player";
|
||||
import { Layer, RawLayer } from "@/typings/layer";
|
||||
import Decimal, { format } from "@/util/bignum";
|
||||
import { layers } from "game/layers";
|
||||
import player from "game/player";
|
||||
import { Layer, RawLayer } from "typings/layer";
|
||||
import Decimal, { format } from "util/bignum";
|
||||
import {
|
||||
getBuyableAmount, hasChallenge, hasMilestone, hasUpgrade, setBuyableAmount
|
||||
} from "@/util/features";
|
||||
import { resetLayer } from "@/util/layers";
|
||||
} from "util/features";
|
||||
import { resetLayer } from "util/layers";
|
||||
|
||||
export default {
|
||||
id: "i",
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
/* eslint-disable */
|
||||
import { layers } from "@/game/layers";
|
||||
import player from "@/game/player";
|
||||
import { RawLayer } from "@/typings/layer";
|
||||
import Decimal, { format } from "@/util/bignum";
|
||||
import { layers } from "game/layers";
|
||||
import player from "game/player";
|
||||
import { RawLayer } from "typings/layer";
|
||||
import Decimal, { format } from "util/bignum";
|
||||
import {
|
||||
getBuyableAmount, hasChallenge, hasMilestone, hasUpgrade, setBuyableAmount
|
||||
} from "@/util/features";
|
||||
import { resetLayer } from "@/util/layers";
|
||||
} from "util/features";
|
||||
import { resetLayer } from "util/layers";
|
||||
|
||||
export default {
|
||||
id: "p",
|
||||
|
|
56
src/data/layers/prestige.tsx
Normal file
56
src/data/layers/prestige.tsx
Normal file
|
@ -0,0 +1,56 @@
|
|||
import { main } from "data/projEntry";
|
||||
import { createCumulativeConversion, createPolynomialScaling } from "features/conversion";
|
||||
import { jsx } from "features/feature";
|
||||
import { createReset } from "features/reset";
|
||||
import MainDisplay from "features/resources/MainDisplay.vue";
|
||||
import { createResource } from "features/resources/resource";
|
||||
import { createLayer } from "game/layers";
|
||||
import { DecimalSource } from "lib/break_eternity";
|
||||
import { render } from "util/vue";
|
||||
import { createLayerTreeNode, createResetButton } from "../common";
|
||||
|
||||
const layer = createLayer(() => {
|
||||
const id = "p";
|
||||
const name = "Prestige";
|
||||
const color = "#4BDC13";
|
||||
const points = createResource<DecimalSource>(0, "prestige points");
|
||||
|
||||
const conversion = createCumulativeConversion(() => ({
|
||||
scaling: createPolynomialScaling(10, 0.5),
|
||||
baseResource: main.points,
|
||||
gainResource: points,
|
||||
roundUpCost: true
|
||||
}));
|
||||
|
||||
const reset = createReset(() => ({
|
||||
thingsToReset: (): Record<string, unknown>[] => [layer]
|
||||
}));
|
||||
|
||||
const treeNode = createLayerTreeNode(() => ({
|
||||
layerID: id,
|
||||
color,
|
||||
reset
|
||||
}));
|
||||
|
||||
const resetButton = createResetButton(() => ({
|
||||
conversion,
|
||||
tree: main.tree,
|
||||
treeNode
|
||||
}));
|
||||
|
||||
return {
|
||||
id,
|
||||
name,
|
||||
color,
|
||||
points,
|
||||
display: jsx(() => (
|
||||
<>
|
||||
<MainDisplay resource={points} color={color} />
|
||||
{render(resetButton)}
|
||||
</>
|
||||
)),
|
||||
treeNode
|
||||
};
|
||||
});
|
||||
|
||||
export default layer;
|
|
@ -1,14 +1,14 @@
|
|||
import Profectus from "@/components/Profectus.vue";
|
||||
import Spacer from "@/components/layout/Spacer.vue";
|
||||
import { jsx } from "@/features/feature";
|
||||
import { createResource, trackBest, trackOOMPS, trackTotal } from "@/features/resources/resource";
|
||||
import { branchedResetPropagation, createTree, GenericTree } from "@/features/trees/tree";
|
||||
import { globalBus } from "@/game/events";
|
||||
import { createLayer, GenericLayer, setupLayerModal } from "@/game/layers";
|
||||
import player, { PlayerData } from "@/game/player";
|
||||
import { DecimalSource } from "@/lib/break_eternity";
|
||||
import Decimal, { format, formatTime } from "@/util/bignum";
|
||||
import { render } from "@/util/vue";
|
||||
import Profectus from "components/Profectus.vue";
|
||||
import Spacer from "components/layout/Spacer.vue";
|
||||
import { jsx } from "features/feature";
|
||||
import { createResource, trackBest, trackOOMPS, trackTotal } from "features/resources/resource";
|
||||
import { branchedResetPropagation, createTree, GenericTree } from "features/trees/tree";
|
||||
import { globalBus } from "game/events";
|
||||
import { createLayer, GenericLayer, setupLayerModal } from "game/layers";
|
||||
import player, { PlayerData } from "game/player";
|
||||
import { DecimalSource } from "lib/break_eternity";
|
||||
import Decimal, { format, formatTime } from "util/bignum";
|
||||
import { render } from "util/vue";
|
||||
import { computed, toRaw } from "vue";
|
||||
import a from "./layers/aca/a";
|
||||
import c from "./layers/aca/c";
|
|
@ -9,7 +9,7 @@
|
|||
"versionTitle": "Initial Commit",
|
||||
|
||||
"allowGoBack": true,
|
||||
"allowSmall": false,
|
||||
"defaultShowSmall": false,
|
||||
"defaultDecimalsShown": 2,
|
||||
"useHeader": true,
|
||||
"banner": null,
|
|
@ -21,9 +21,7 @@ interface ThemeVars {
|
|||
|
||||
export interface Theme {
|
||||
variables: ThemeVars;
|
||||
stackedInfoboxes: boolean;
|
||||
floatingTabs: boolean;
|
||||
showSingleTab: boolean;
|
||||
mergeAdjacent: boolean;
|
||||
}
|
||||
|
||||
|
@ -54,9 +52,7 @@ const defaultTheme: Theme = {
|
|||
"--modal-border": "solid 2px var(--color)",
|
||||
"--feature-margin": "0px"
|
||||
},
|
||||
stackedInfoboxes: false,
|
||||
floatingTabs: true,
|
||||
showSingleTab: false,
|
||||
mergeAdjacent: true
|
||||
};
|
||||
|
||||
|
@ -83,7 +79,6 @@ export default {
|
|||
"--modal-border": "",
|
||||
"--feature-margin": "5px"
|
||||
},
|
||||
stackedInfoboxes: true,
|
||||
floatingTabs: false
|
||||
} as Theme,
|
||||
// Based on https://www.nordtheme.com
|
||||
|
@ -109,7 +104,6 @@ export default {
|
|||
"--modal-border": "solid 2px #3B4252",
|
||||
"--feature-margin": "5px"
|
||||
},
|
||||
stackedInfoboxes: true,
|
||||
floatingTabs: false
|
||||
} as Theme,
|
||||
aqua: {
|
||||
|
|
|
@ -23,13 +23,13 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { CoercableComponent, Visibility } from "@/features/feature";
|
||||
import { computeOptionalComponent, processedPropType } from "@/util/vue";
|
||||
import { CoercableComponent, Visibility } from "features/feature";
|
||||
import { computeOptionalComponent, processedPropType } from "util/vue";
|
||||
import { defineComponent, StyleValue, toRefs, unref } from "vue";
|
||||
import Tooltip from "@/components/Tooltip.vue";
|
||||
import LinkNode from "@/components/links/LinkNode.vue";
|
||||
import MarkNode from "@/components/MarkNode.vue";
|
||||
import "@/components/common/features.css";
|
||||
import Tooltip from "components/Tooltip.vue";
|
||||
import LinkNode from "components/links/LinkNode.vue";
|
||||
import MarkNode from "components/MarkNode.vue";
|
||||
import "components/common/features.css";
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import AchievementComponent from "@/features/achievements/Achievement.vue";
|
||||
import AchievementComponent from "features/achievements/Achievement.vue";
|
||||
import {
|
||||
CoercableComponent,
|
||||
Component,
|
||||
|
@ -9,19 +9,19 @@ import {
|
|||
setDefault,
|
||||
StyleValue,
|
||||
Visibility
|
||||
} from "@/features/feature";
|
||||
import { globalBus } from "@/game/events";
|
||||
import "@/game/notifications";
|
||||
import { Persistent, makePersistent, PersistentState } from "@/game/persistence";
|
||||
} from "features/feature";
|
||||
import { globalBus } from "game/events";
|
||||
import "game/notifications";
|
||||
import { Persistent, makePersistent, PersistentState } from "game/persistence";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
import { coerceComponent } from "@/util/vue";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { coerceComponent } from "util/vue";
|
||||
import { Unsubscribe } from "nanoevents";
|
||||
import { Ref, unref } from "vue";
|
||||
import { useToast } from "vue-toastification";
|
||||
|
|
|
@ -46,12 +46,12 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { Direction } from "./bar";
|
||||
import { CoercableComponent, Visibility } from "@/features/feature";
|
||||
import Decimal, { DecimalSource } from "@/util/bignum";
|
||||
import { computeOptionalComponent, processedPropType, unwrapRef } from "@/util/vue";
|
||||
import { CoercableComponent, Visibility } from "features/feature";
|
||||
import Decimal, { DecimalSource } from "util/bignum";
|
||||
import { computeOptionalComponent, processedPropType, unwrapRef } from "util/vue";
|
||||
import { computed, CSSProperties, defineComponent, StyleValue, toRefs, unref } from "vue";
|
||||
import LinkNode from "@/components/links/LinkNode.vue";
|
||||
import MarkNode from "@/components/MarkNode.vue";
|
||||
import LinkNode from "components/links/LinkNode.vue";
|
||||
import MarkNode from "components/MarkNode.vue";
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import BarComponent from "@/features/bars/Bar.vue";
|
||||
import BarComponent from "features/bars/Bar.vue";
|
||||
import {
|
||||
CoercableComponent,
|
||||
Component,
|
||||
|
@ -8,16 +8,16 @@ import {
|
|||
setDefault,
|
||||
StyleValue,
|
||||
Visibility
|
||||
} from "@/features/feature";
|
||||
import { DecimalSource } from "@/lib/break_eternity";
|
||||
} from "features/feature";
|
||||
import { DecimalSource } from "lib/break_eternity";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
|
||||
export const BarType = Symbol("Bar");
|
||||
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { BoardNode, GenericBoard, getNodeProperty } from "@/features/boards/board";
|
||||
import { FeatureComponent, Visibility } from "@/features/feature";
|
||||
import { PersistentState } from "@/game/persistence";
|
||||
import { BoardNode, GenericBoard, getNodeProperty } from "features/boards/board";
|
||||
import { FeatureComponent, Visibility } from "features/feature";
|
||||
import { PersistentState } from "game/persistence";
|
||||
import { computed, ref, toRefs } from "vue";
|
||||
import panZoom from "vue-panzoom";
|
||||
import BoardLinkVue from "./BoardLink.vue";
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { BoardNodeLink } from "@/features/boards/board";
|
||||
import { BoardNodeLink } from "features/boards/board";
|
||||
import { computed, toRefs, unref } from "vue";
|
||||
|
||||
const _props = defineProps<{
|
||||
|
|
|
@ -167,7 +167,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import themes from "@/data/themes";
|
||||
import themes from "data/themes";
|
||||
import {
|
||||
BoardNode,
|
||||
GenericBoardNodeAction,
|
||||
|
@ -175,9 +175,9 @@ import {
|
|||
getNodeProperty,
|
||||
ProgressDisplay,
|
||||
Shape
|
||||
} from "@/features/boards/board";
|
||||
import { Visibility } from "@/features/feature";
|
||||
import settings from "@/game/settings";
|
||||
} from "features/boards/board";
|
||||
import { Visibility } from "features/feature";
|
||||
import settings from "game/settings";
|
||||
import { computed, ref, toRefs, unref, watch } from "vue";
|
||||
|
||||
const sqrtTwo = Math.sqrt(2);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import BoardComponent from "@/features/boards/Board.vue";
|
||||
import BoardComponent from "features/boards/Board.vue";
|
||||
import {
|
||||
Component,
|
||||
findFeatures,
|
||||
|
@ -8,19 +8,19 @@ import {
|
|||
setDefault,
|
||||
StyleValue,
|
||||
Visibility
|
||||
} from "@/features/feature";
|
||||
import { globalBus } from "@/game/events";
|
||||
import { State, Persistent, makePersistent, PersistentState } from "@/game/persistence";
|
||||
import Decimal, { DecimalSource } from "@/lib/break_eternity";
|
||||
import { isFunction } from "@/util/common";
|
||||
} from "features/feature";
|
||||
import { globalBus } from "game/events";
|
||||
import { State, Persistent, makePersistent, PersistentState } from "game/persistence";
|
||||
import Decimal, { DecimalSource } from "lib/break_eternity";
|
||||
import { isFunction } from "util/common";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { Unsubscribe } from "nanoevents";
|
||||
import { computed, Ref, unref } from "vue";
|
||||
import { Link } from "../links";
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import ClickableComponent from "@/features/clickables/Clickable.vue";
|
||||
import { Resource } from "@/features/resources/resource";
|
||||
import { Persistent, makePersistent, PersistentState } from "@/game/persistence";
|
||||
import Decimal, { DecimalSource, format, formatWhole } from "@/util/bignum";
|
||||
import ClickableComponent from "features/clickables/Clickable.vue";
|
||||
import { Resource } from "features/resources/resource";
|
||||
import { Persistent, makePersistent, PersistentState } from "game/persistence";
|
||||
import Decimal, { DecimalSource, format, formatWhole } from "util/bignum";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
import { coerceComponent, isCoercableComponent } from "@/util/vue";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { coerceComponent, isCoercableComponent } from "util/vue";
|
||||
import { computed, Ref, unref } from "vue";
|
||||
import {
|
||||
CoercableComponent,
|
||||
|
|
|
@ -27,11 +27,11 @@
|
|||
</template>
|
||||
|
||||
<script lang="tsx">
|
||||
import "@/components/common/features.css";
|
||||
import { GenericChallenge } from "@/features/challenges/challenge";
|
||||
import { jsx, StyleValue, Visibility } from "@/features/feature";
|
||||
import { getHighNotifyStyle, getNotifyStyle } from "@/game/notifications";
|
||||
import { coerceComponent, isCoercableComponent, processedPropType, unwrapRef } from "@/util/vue";
|
||||
import "components/common/features.css";
|
||||
import { GenericChallenge } from "features/challenges/challenge";
|
||||
import { jsx, StyleValue, Visibility } from "features/feature";
|
||||
import { getHighNotifyStyle, getNotifyStyle } from "game/notifications";
|
||||
import { coerceComponent, isCoercableComponent, processedPropType, unwrapRef } from "util/vue";
|
||||
import {
|
||||
Component,
|
||||
computed,
|
||||
|
@ -43,8 +43,8 @@ import {
|
|||
UnwrapRef,
|
||||
watchEffect
|
||||
} from "vue";
|
||||
import LinkNode from "@/components/links/LinkNode.vue";
|
||||
import MarkNode from "@/components/MarkNode.vue";
|
||||
import LinkNode from "components/links/LinkNode.vue";
|
||||
import MarkNode from "components/MarkNode.vue";
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Toggle from "@/components/fields/Toggle.vue";
|
||||
import ChallengeComponent from "@/features/challenges/Challenge.vue";
|
||||
import Toggle from "components/fields/Toggle.vue";
|
||||
import ChallengeComponent from "features/challenges/Challenge.vue";
|
||||
import {
|
||||
CoercableComponent,
|
||||
Component,
|
||||
|
@ -10,21 +10,21 @@ import {
|
|||
setDefault,
|
||||
StyleValue,
|
||||
Visibility
|
||||
} from "@/features/feature";
|
||||
import { GenericReset } from "@/features/reset";
|
||||
import { Resource } from "@/features/resources/resource";
|
||||
import { globalBus } from "@/game/events";
|
||||
import { persistent, PersistentRef } from "@/game/persistence";
|
||||
import settings, { registerSettingField } from "@/game/settings";
|
||||
import Decimal, { DecimalSource } from "@/util/bignum";
|
||||
} from "features/feature";
|
||||
import { GenericReset } from "features/reset";
|
||||
import { Resource } from "features/resources/resource";
|
||||
import { globalBus } from "game/events";
|
||||
import { persistent, PersistentRef } from "game/persistence";
|
||||
import settings, { registerSettingField } from "game/settings";
|
||||
import Decimal, { DecimalSource } from "util/bignum";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { computed, Ref, unref } from "vue";
|
||||
|
||||
export const ChallengeType = Symbol("ChallengeType");
|
||||
|
@ -251,7 +251,7 @@ export function createChallenge<T extends ChallengeOptions>(
|
|||
});
|
||||
}
|
||||
|
||||
declare module "@/game/settings" {
|
||||
declare module "game/settings" {
|
||||
interface Settings {
|
||||
hideChallenges: boolean;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
@touchstart="start"
|
||||
@touchend="stop"
|
||||
@touchcancel="stop"
|
||||
:disabled="!unref(canClick)"
|
||||
:class="{
|
||||
feature: true,
|
||||
clickable: true,
|
||||
|
@ -30,18 +29,18 @@
|
|||
</template>
|
||||
|
||||
<script lang="tsx">
|
||||
import "@/components/common/features.css";
|
||||
import LinkNode from "@/components/links/LinkNode.vue";
|
||||
import MarkNode from "@/components/MarkNode.vue";
|
||||
import { GenericClickable } from "@/features/clickables/clickable";
|
||||
import { jsx, StyleValue, Visibility } from "@/features/feature";
|
||||
import "components/common/features.css";
|
||||
import LinkNode from "components/links/LinkNode.vue";
|
||||
import MarkNode from "components/MarkNode.vue";
|
||||
import { GenericClickable } from "features/clickables/clickable";
|
||||
import { jsx, StyleValue, Visibility } from "features/feature";
|
||||
import {
|
||||
coerceComponent,
|
||||
isCoercableComponent,
|
||||
processedPropType,
|
||||
setupHoldToClick,
|
||||
unwrapRef
|
||||
} from "@/util/vue";
|
||||
} from "util/vue";
|
||||
import {
|
||||
Component,
|
||||
defineComponent,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import ClickableComponent from "@/features/clickables/Clickable.vue";
|
||||
import ClickableComponent from "features/clickables/Clickable.vue";
|
||||
import {
|
||||
CoercableComponent,
|
||||
Component,
|
||||
|
@ -8,15 +8,16 @@ import {
|
|||
setDefault,
|
||||
StyleValue,
|
||||
Visibility
|
||||
} from "@/features/feature";
|
||||
} from "features/feature";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { unref } from "vue";
|
||||
|
||||
export const ClickableType = Symbol("Clickable");
|
||||
|
||||
|
@ -83,6 +84,23 @@ export function createClickable<T extends ClickableOptions>(
|
|||
processComputable(clickable as T, "mark");
|
||||
processComputable(clickable as T, "display");
|
||||
|
||||
if (clickable.onClick) {
|
||||
const onClick = clickable.onClick;
|
||||
clickable.onClick = function () {
|
||||
if (unref(clickable.canClick)) {
|
||||
onClick();
|
||||
}
|
||||
};
|
||||
}
|
||||
if (clickable.onHold) {
|
||||
const onHold = clickable.onHold;
|
||||
clickable.onHold = function () {
|
||||
if (unref(clickable.canClick)) {
|
||||
onHold();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
clickable[GatherProps] = function (this: GenericClickable) {
|
||||
const {
|
||||
display,
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { GenericLayer } from "@/game/layers";
|
||||
import Decimal, { DecimalSource } from "@/util/bignum";
|
||||
import { GenericLayer } from "game/layers";
|
||||
import Decimal, { DecimalSource } from "util/bignum";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { computed, isRef, Ref, unref } from "vue";
|
||||
import { Replace, setDefault } from "./feature";
|
||||
import { Resource } from "./resources/resource";
|
||||
|
@ -132,9 +132,8 @@ export function createLinearScaling(
|
|||
|
||||
// Gain formula is (baseResource / base) ^ exponent
|
||||
// e.g. if exponent is 0.5 and base is 10, then having 10 points makes gain 1, and 40 points is 2
|
||||
export function createExponentialScaling(
|
||||
export function createPolynomialScaling(
|
||||
base: DecimalSource | Ref<DecimalSource>,
|
||||
coefficient: DecimalSource | Ref<DecimalSource>,
|
||||
exponent: DecimalSource | Ref<DecimalSource>
|
||||
): ScalingFunction {
|
||||
return {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { DefaultValue } from "@/game/persistence";
|
||||
import Decimal from "@/util/bignum";
|
||||
import { DoNotCache, ProcessedComputable } from "@/util/computed";
|
||||
import { DefaultValue } from "game/persistence";
|
||||
import Decimal from "util/bignum";
|
||||
import { DoNotCache, ProcessedComputable } from "util/computed";
|
||||
import { CSSProperties, DefineComponent, isRef } from "vue";
|
||||
|
||||
export const Component = Symbol("Component");
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import "@/components/common/table.css";
|
||||
import themes from "@/data/themes";
|
||||
import { Visibility } from "@/features/feature";
|
||||
import { GridCell } from "@/features/grids/grid";
|
||||
import settings from "@/game/settings";
|
||||
import { processedPropType } from "@/util/vue";
|
||||
import "components/common/table.css";
|
||||
import themes from "data/themes";
|
||||
import { Visibility } from "features/feature";
|
||||
import { GridCell } from "features/grids/grid";
|
||||
import settings from "game/settings";
|
||||
import { processedPropType } from "util/vue";
|
||||
import { computed, defineComponent, unref } from "vue";
|
||||
import GridCellVue from "./GridCell.vue";
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
@touchstart="start"
|
||||
@touchend="stop"
|
||||
@touchcancel="stop"
|
||||
:disabled="!unref(canClick)"
|
||||
>
|
||||
<div v-if="title"><component :is="titleComponent" /></div>
|
||||
<component :is="component" style="white-space: pre-line" />
|
||||
|
@ -24,15 +23,15 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import "@/components/common/features.css";
|
||||
import LinkNode from "@/components/links/LinkNode.vue";
|
||||
import { CoercableComponent, StyleValue, Visibility } from "@/features/feature";
|
||||
import "components/common/features.css";
|
||||
import LinkNode from "components/links/LinkNode.vue";
|
||||
import { CoercableComponent, StyleValue, Visibility } from "features/feature";
|
||||
import {
|
||||
computeComponent,
|
||||
computeOptionalComponent,
|
||||
processedPropType,
|
||||
setupHoldToClick
|
||||
} from "@/util/vue";
|
||||
} from "util/vue";
|
||||
import { defineComponent, PropType, toRefs, unref } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import GridComponent from "@/features/grids/Grid.vue";
|
||||
import GridComponent from "features/grids/Grid.vue";
|
||||
import {
|
||||
CoercableComponent,
|
||||
Component,
|
||||
|
@ -8,18 +8,18 @@ import {
|
|||
setDefault,
|
||||
StyleValue,
|
||||
Visibility
|
||||
} from "@/features/feature";
|
||||
import { isFunction } from "@/util/common";
|
||||
} from "features/feature";
|
||||
import { isFunction } from "util/common";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { computed, Ref, unref } from "vue";
|
||||
import { State, Persistent, makePersistent, PersistentState } from "@/game/persistence";
|
||||
import { State, Persistent, makePersistent, PersistentState } from "game/persistence";
|
||||
|
||||
export const GridType = Symbol("Grid");
|
||||
|
||||
|
@ -278,6 +278,23 @@ export function createGrid<T extends GridOptions>(
|
|||
processComputable(grid as T, "getTitle");
|
||||
processComputable(grid as T, "getDisplay");
|
||||
|
||||
if (grid.onClick) {
|
||||
const onClick = grid.onClick;
|
||||
grid.onClick = function (id, state) {
|
||||
if (unref((grid as GenericGrid).cells[id].canClick)) {
|
||||
onClick(id, state);
|
||||
}
|
||||
};
|
||||
}
|
||||
if (grid.onHold) {
|
||||
const onHold = grid.onHold;
|
||||
grid.onHold = function (id, state) {
|
||||
if (unref((grid as GenericGrid).cells[id].canClick)) {
|
||||
onHold(id, state);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
grid[GatherProps] = function (this: GenericGrid) {
|
||||
const { visibility, rows, cols, cells, id } = this;
|
||||
return { visibility, rows, cols, cells, id };
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { hasWon } from "@/data/mod";
|
||||
import { globalBus } from "@/game/events";
|
||||
import player from "@/game/player";
|
||||
import { hasWon } from "data/projEntry";
|
||||
import { globalBus } from "game/events";
|
||||
import player from "game/player";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableTypeWithDefault,
|
||||
GetComputableType,
|
||||
ProcessedComputable,
|
||||
processComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { unref } from "vue";
|
||||
import { findFeatures, Replace, setDefault } from "./feature";
|
||||
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import LinkNode from "@/components/links/LinkNode.vue";
|
||||
import themes from "@/data/themes";
|
||||
import { CoercableComponent, Visibility } from "@/features/feature";
|
||||
import settings from "@/game/settings";
|
||||
import { computeComponent, processedPropType } from "@/util/vue";
|
||||
import LinkNode from "components/links/LinkNode.vue";
|
||||
import themes from "data/themes";
|
||||
import { CoercableComponent, Visibility } from "features/feature";
|
||||
import settings from "game/settings";
|
||||
import { computeComponent, processedPropType } from "util/vue";
|
||||
import CollapseTransition from "@ivanv/vue-collapse-transition/src/CollapseTransition.vue";
|
||||
import { computed, defineComponent, PropType, Ref, StyleValue, toRefs, unref } from "vue";
|
||||
|
||||
|
@ -74,7 +74,7 @@ export default defineComponent({
|
|||
|
||||
const titleComponent = computeComponent(title);
|
||||
const bodyComponent = computeComponent(display);
|
||||
const stacked = computed(() => themes[settings.theme].stackedInfoboxes);
|
||||
const stacked = computed(() => themes[settings.theme].mergeAdjacent);
|
||||
|
||||
return {
|
||||
titleComponent,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import InfoboxComponent from "@/features/infoboxes/Infobox.vue";
|
||||
import InfoboxComponent from "features/infoboxes/Infobox.vue";
|
||||
import {
|
||||
CoercableComponent,
|
||||
Component,
|
||||
|
@ -8,17 +8,17 @@ import {
|
|||
setDefault,
|
||||
StyleValue,
|
||||
Visibility
|
||||
} from "@/features/feature";
|
||||
} from "features/feature";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { Ref } from "vue";
|
||||
import { Persistent, makePersistent, PersistentState } from "@/game/persistence";
|
||||
import { Persistent, makePersistent, PersistentState } from "game/persistence";
|
||||
|
||||
export const InfoboxType = Symbol("Infobox");
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Position } from "@/game/layers";
|
||||
import { Position } from "game/layers";
|
||||
import { InjectionKey, SVGAttributes } from "vue";
|
||||
|
||||
export interface LinkNode {
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
</template>
|
||||
|
||||
<script lang="tsx">
|
||||
import "@/components/common/features.css";
|
||||
import { jsx, StyleValue, Visibility } from "@/features/feature";
|
||||
import { GenericMilestone } from "@/features/milestones/milestone";
|
||||
import { coerceComponent, isCoercableComponent, processedPropType, unwrapRef } from "@/util/vue";
|
||||
import "components/common/features.css";
|
||||
import { jsx, StyleValue, Visibility } from "features/feature";
|
||||
import { GenericMilestone } from "features/milestones/milestone";
|
||||
import { coerceComponent, isCoercableComponent, processedPropType, unwrapRef } from "util/vue";
|
||||
import { Component, defineComponent, shallowRef, toRefs, unref, UnwrapRef, watchEffect } from "vue";
|
||||
import LinkNode from "../../components/links/LinkNode.vue";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import Select from "@/components/fields/Select.vue";
|
||||
import Select from "components/fields/Select.vue";
|
||||
import {
|
||||
CoercableComponent,
|
||||
Component,
|
||||
|
@ -10,22 +10,22 @@ import {
|
|||
setDefault,
|
||||
StyleValue,
|
||||
Visibility
|
||||
} from "@/features/feature";
|
||||
import MilestoneComponent from "@/features/milestones/Milestone.vue";
|
||||
import { globalBus } from "@/game/events";
|
||||
import "@/game/notifications";
|
||||
import { makePersistent, Persistent, PersistentState } from "@/game/persistence";
|
||||
import settings, { registerSettingField } from "@/game/settings";
|
||||
import { camelToTitle } from "@/util/common";
|
||||
} from "features/feature";
|
||||
import MilestoneComponent from "features/milestones/Milestone.vue";
|
||||
import { globalBus } from "game/events";
|
||||
import "game/notifications";
|
||||
import { makePersistent, Persistent, PersistentState } from "game/persistence";
|
||||
import settings, { registerSettingField } from "game/settings";
|
||||
import { camelToTitle } from "util/common";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
import { coerceComponent, isCoercableComponent } from "@/util/vue";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { coerceComponent, isCoercableComponent } from "util/vue";
|
||||
import { Unsubscribe } from "nanoevents";
|
||||
import { computed, Ref, unref } from "vue";
|
||||
import { useToast } from "vue-toastification";
|
||||
|
@ -180,7 +180,7 @@ globalBus.on("removeLayer", layer => {
|
|||
listeners[layer.id] = undefined;
|
||||
});
|
||||
|
||||
declare module "@/game/settings" {
|
||||
declare module "game/settings" {
|
||||
interface Settings {
|
||||
msDisplay: MilestoneDisplay;
|
||||
}
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import { getUniqueID, Replace } from "@/features/feature";
|
||||
import { globalBus } from "@/game/events";
|
||||
import { GenericLayer } from "@/game/layers";
|
||||
import { getUniqueID, Replace } from "features/feature";
|
||||
import { globalBus } from "game/events";
|
||||
import { GenericLayer } from "game/layers";
|
||||
import {
|
||||
DefaultValue,
|
||||
Persistent,
|
||||
persistent,
|
||||
PersistentRef,
|
||||
PersistentState
|
||||
} from "@/game/persistence";
|
||||
import Decimal from "@/lib/break_eternity";
|
||||
import { Computable, GetComputableType, processComputable } from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "game/persistence";
|
||||
import Decimal from "lib/break_eternity";
|
||||
import { Computable, GetComputableType, processComputable } from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { Unsubscribe } from "nanoevents";
|
||||
import { computed, isRef, unref } from "vue";
|
||||
|
||||
|
@ -101,7 +101,7 @@ globalBus.on("removeLayer", layer => {
|
|||
listeners[layer.id] = undefined;
|
||||
});
|
||||
|
||||
declare module "@/game/events" {
|
||||
declare module "game/events" {
|
||||
interface GlobalEvents {
|
||||
reset: (reset: GenericReset) => void;
|
||||
}
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { CoercableComponent } from "@/features/feature";
|
||||
import { Resource } from "@/features/resources/resource";
|
||||
import Decimal from "@/util/bignum";
|
||||
import { computeOptionalComponent } from "@/util/vue";
|
||||
import { CoercableComponent } from "features/feature";
|
||||
import { Resource } from "features/resources/resource";
|
||||
import Decimal from "util/bignum";
|
||||
import { computeOptionalComponent } from "util/vue";
|
||||
import { computed, Ref, StyleValue, toRefs } from "vue";
|
||||
import ResourceVue from "@/features/resources/Resource.vue";
|
||||
import ResourceVue from "features/resources/Resource.vue";
|
||||
|
||||
const _props = defineProps<{
|
||||
resource: Resource;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { displayResource, Resource } from "@/features/resources/resource";
|
||||
import { displayResource, Resource } from "features/resources/resource";
|
||||
import { computed } from "vue";
|
||||
|
||||
const props = defineProps<{
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
import Decimal, { DecimalSource, format, formatWhole } from "@/util/bignum";
|
||||
import Decimal, { DecimalSource, format, formatWhole } from "util/bignum";
|
||||
import { computed, ComputedRef, ref, Ref, watch } from "vue";
|
||||
import { globalBus } from "@/game/events";
|
||||
import { State, persistent } from "@/game/persistence";
|
||||
import { globalBus } from "game/events";
|
||||
import { State, persistent } from "game/persistence";
|
||||
|
||||
export interface Resource<T = DecimalSource> extends Ref<T> {
|
||||
displayName: string;
|
||||
precision: number;
|
||||
small: boolean;
|
||||
small?: boolean;
|
||||
}
|
||||
|
||||
export function createResource<T extends State>(
|
||||
defaultValue: T | Ref<T>,
|
||||
displayName = "points",
|
||||
precision = 0,
|
||||
small = false
|
||||
small = undefined
|
||||
): Resource<T> {
|
||||
const resource: Partial<Resource<T>> = persistent(defaultValue);
|
||||
resource.displayName = displayName;
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { CoercableComponent } from "@/features/feature";
|
||||
import { computeComponent } from "@/util/vue";
|
||||
import { CoercableComponent } from "features/feature";
|
||||
import { computeComponent } from "util/vue";
|
||||
import { toRefs } from "vue";
|
||||
|
||||
const _props = defineProps<{ display: CoercableComponent }>();
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { CoercableComponent, StyleValue, Visibility } from "@/features/feature";
|
||||
import { getNotifyStyle } from "@/game/notifications";
|
||||
import { computeComponent, processedPropType, unwrapRef } from "@/util/vue";
|
||||
import { CoercableComponent, StyleValue, Visibility } from "features/feature";
|
||||
import { getNotifyStyle } from "game/notifications";
|
||||
import { computeComponent, processedPropType, unwrapRef } from "util/vue";
|
||||
import { computed, defineComponent, toRefs, unref } from "vue";
|
||||
|
||||
export default defineComponent({
|
||||
|
|
|
@ -30,14 +30,14 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Sticky from "@/components/layout/Sticky.vue";
|
||||
import themes from "@/data/themes";
|
||||
import { CoercableComponent, StyleValue, Visibility } from "@/features/feature";
|
||||
import { GenericTab } from "@/features/tabs/tab";
|
||||
import TabButton from "@/features/tabs/TabButton.vue";
|
||||
import { GenericTabButton } from "@/features/tabs/tabFamily";
|
||||
import settings from "@/game/settings";
|
||||
import { coerceComponent, isCoercableComponent, processedPropType, unwrapRef } from "@/util/vue";
|
||||
import Sticky from "components/layout/Sticky.vue";
|
||||
import themes from "data/themes";
|
||||
import { CoercableComponent, StyleValue, Visibility } from "features/feature";
|
||||
import { GenericTab } from "features/tabs/tab";
|
||||
import TabButton from "features/tabs/TabButton.vue";
|
||||
import { GenericTabButton } from "features/tabs/tabFamily";
|
||||
import settings from "game/settings";
|
||||
import { coerceComponent, isCoercableComponent, processedPropType, unwrapRef } from "util/vue";
|
||||
import {
|
||||
Component,
|
||||
computed,
|
||||
|
|
|
@ -5,10 +5,10 @@ import {
|
|||
getUniqueID,
|
||||
Replace,
|
||||
StyleValue
|
||||
} from "@/features/feature";
|
||||
import TabComponent from "@/features/tabs/Tab.vue";
|
||||
import { Computable, GetComputableType } from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "features/feature";
|
||||
import TabComponent from "features/tabs/Tab.vue";
|
||||
import { Computable, GetComputableType } from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
|
||||
export const TabType = Symbol("Tab");
|
||||
|
||||
|
|
|
@ -7,18 +7,18 @@ import {
|
|||
setDefault,
|
||||
StyleValue,
|
||||
Visibility
|
||||
} from "@/features/feature";
|
||||
import TabButtonComponent from "@/features/tabs/TabButton.vue";
|
||||
import TabFamilyComponent from "@/features/tabs/TabFamily.vue";
|
||||
import { Persistent, makePersistent, PersistentState } from "@/game/persistence";
|
||||
} from "features/feature";
|
||||
import TabButtonComponent from "features/tabs/TabButton.vue";
|
||||
import TabFamilyComponent from "features/tabs/TabFamily.vue";
|
||||
import { Persistent, makePersistent, PersistentState } from "game/persistence";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { computed, Ref, unref } from "vue";
|
||||
import { GenericTab } from "./tab";
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { CoercableComponent } from "@/features/feature";
|
||||
import { ProcessedComputable } from "@/util/computed";
|
||||
import { CoercableComponent } from "features/feature";
|
||||
import { ProcessedComputable } from "util/computed";
|
||||
|
||||
declare module "@vue/runtime-dom" {
|
||||
interface CSSProperties {
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import "@/components/common/table.css";
|
||||
import { GenericTreeNode } from "@/features/trees/tree";
|
||||
import { processedPropType } from "@/util/vue";
|
||||
import "components/common/table.css";
|
||||
import { GenericTreeNode } from "features/trees/tree";
|
||||
import { processedPropType } from "util/vue";
|
||||
import { defineComponent, unref } from "vue";
|
||||
import TreeNode from "./TreeNode.vue";
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
},
|
||||
unref(style) ?? []
|
||||
]"
|
||||
:disabled="!unref(canClick)"
|
||||
>
|
||||
<component :is="unref(comp)" />
|
||||
</button>
|
||||
|
@ -39,19 +38,19 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import LinkNode from "@/components/links/LinkNode.vue";
|
||||
import MarkNode from "@/components/MarkNode.vue";
|
||||
import TooltipVue from "@/components/Tooltip.vue";
|
||||
import { CoercableComponent, StyleValue, Visibility } from "@/features/feature";
|
||||
import { gatherTooltipProps, Tooltip } from "@/features/tooltip";
|
||||
import { ProcessedComputable } from "@/util/computed";
|
||||
import LinkNode from "components/links/LinkNode.vue";
|
||||
import MarkNode from "components/MarkNode.vue";
|
||||
import TooltipVue from "components/Tooltip.vue";
|
||||
import { CoercableComponent, StyleValue, Visibility } from "features/feature";
|
||||
import { gatherTooltipProps, Tooltip } from "features/tooltip";
|
||||
import { ProcessedComputable } from "util/computed";
|
||||
import {
|
||||
computeOptionalComponent,
|
||||
isCoercableComponent,
|
||||
processedPropType,
|
||||
setupHoldToClick,
|
||||
unwrapRef
|
||||
} from "@/util/vue";
|
||||
} from "util/vue";
|
||||
import {
|
||||
computed,
|
||||
defineComponent,
|
||||
|
|
|
@ -7,15 +7,15 @@ import {
|
|||
setDefault,
|
||||
StyleValue,
|
||||
Visibility
|
||||
} from "@/features/feature";
|
||||
import { Link } from "@/features/links";
|
||||
import { GenericReset } from "@/features/reset";
|
||||
import { displayResource, Resource } from "@/features/resources/resource";
|
||||
import { Tooltip } from "@/features/tooltip";
|
||||
import TreeComponent from "@/features/trees/Tree.vue";
|
||||
import { persistent } from "@/game/persistence";
|
||||
import { DecimalSource, format } from "@/util/bignum";
|
||||
import Decimal, { formatWhole } from "@/util/break_eternity";
|
||||
} from "features/feature";
|
||||
import { Link } from "features/links";
|
||||
import { GenericReset } from "features/reset";
|
||||
import { displayResource, Resource } from "features/resources/resource";
|
||||
import { Tooltip } from "features/tooltip";
|
||||
import TreeComponent from "features/trees/Tree.vue";
|
||||
import { persistent } from "game/persistence";
|
||||
import { DecimalSource, format } from "util/bignum";
|
||||
import Decimal, { formatWhole } from "util/break_eternity";
|
||||
import {
|
||||
Computable,
|
||||
convertComputable,
|
||||
|
@ -23,8 +23,8 @@ import {
|
|||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { computed, ref, Ref, unref } from "vue";
|
||||
|
||||
export const TreeNodeType = Symbol("TreeNode");
|
||||
|
@ -101,6 +101,23 @@ export function createTreeNode<T extends TreeNodeOptions>(
|
|||
processComputable(treeNode as T, "style");
|
||||
processComputable(treeNode as T, "mark");
|
||||
|
||||
if (treeNode.onClick) {
|
||||
const onClick = treeNode.onClick;
|
||||
treeNode.onClick = function () {
|
||||
if (unref(treeNode.canClick)) {
|
||||
onClick();
|
||||
}
|
||||
};
|
||||
}
|
||||
if (treeNode.onHold) {
|
||||
const onHold = treeNode.onHold;
|
||||
treeNode.onHold = function () {
|
||||
if (unref(treeNode.canClick)) {
|
||||
onHold();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return treeNode as unknown as TreeNode<T>;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -25,14 +25,14 @@
|
|||
</template>
|
||||
|
||||
<script lang="tsx">
|
||||
import "@/components/common/features.css";
|
||||
import LinkNode from "@/components/links/LinkNode.vue";
|
||||
import MarkNode from "@/components/MarkNode.vue";
|
||||
import { jsx, StyleValue, Visibility } from "@/features/feature";
|
||||
import { displayResource, Resource } from "@/features/resources/resource";
|
||||
import { GenericUpgrade } from "@/features/upgrades/upgrade";
|
||||
import { DecimalSource } from "@/lib/break_eternity";
|
||||
import { coerceComponent, isCoercableComponent, processedPropType, unwrapRef } from "@/util/vue";
|
||||
import "components/common/features.css";
|
||||
import LinkNode from "components/links/LinkNode.vue";
|
||||
import MarkNode from "components/MarkNode.vue";
|
||||
import { jsx, StyleValue, Visibility } from "features/feature";
|
||||
import { displayResource, Resource } from "features/resources/resource";
|
||||
import { GenericUpgrade } from "features/upgrades/upgrade";
|
||||
import { DecimalSource } from "lib/break_eternity";
|
||||
import { coerceComponent, isCoercableComponent, processedPropType, unwrapRef } from "util/vue";
|
||||
import {
|
||||
Component,
|
||||
defineComponent,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import UpgradeComponent from "@/features/upgrades/Upgrade.vue";
|
||||
import UpgradeComponent from "features/upgrades/Upgrade.vue";
|
||||
import {
|
||||
CoercableComponent,
|
||||
Component,
|
||||
|
@ -9,21 +9,21 @@ import {
|
|||
setDefault,
|
||||
StyleValue,
|
||||
Visibility
|
||||
} from "@/features/feature";
|
||||
import { Resource } from "@/features/resources/resource";
|
||||
import { GenericLayer } from "@/game/layers";
|
||||
import Decimal, { DecimalSource } from "@/util/bignum";
|
||||
import { isFunction } from "@/util/common";
|
||||
} from "features/feature";
|
||||
import { Resource } from "features/resources/resource";
|
||||
import { GenericLayer } from "game/layers";
|
||||
import Decimal, { DecimalSource } from "util/bignum";
|
||||
import { isFunction } from "util/common";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { computed, Ref, unref } from "vue";
|
||||
import { Persistent, makePersistent, PersistentState } from "@/game/persistence";
|
||||
import { Persistent, makePersistent, PersistentState } from "game/persistence";
|
||||
|
||||
export const UpgradeType = Symbol("Upgrade");
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import modInfo from "@/data/modInfo.json";
|
||||
import Decimal, { DecimalSource } from "@/util/bignum";
|
||||
import projInfo from "data/projInfo.json";
|
||||
import Decimal, { DecimalSource } from "util/bignum";
|
||||
import { createNanoEvents } from "nanoevents";
|
||||
import { App, Ref } from "vue";
|
||||
import { GenericLayer } from "./layers";
|
||||
|
@ -51,8 +51,8 @@ function update() {
|
|||
|
||||
// Add offline time if any
|
||||
if (player.offlineTime != undefined) {
|
||||
if (Decimal.gt(player.offlineTime, modInfo.offlineLimit * 3600)) {
|
||||
player.offlineTime = new Decimal(modInfo.offlineLimit * 3600);
|
||||
if (Decimal.gt(player.offlineTime, projInfo.offlineLimit * 3600)) {
|
||||
player.offlineTime = new Decimal(projInfo.offlineLimit * 3600);
|
||||
}
|
||||
if (Decimal.gt(player.offlineTime, 0) && player.devSpeed !== 0) {
|
||||
const offlineDiff = Decimal.div(player.offlineTime, 10).max(diff);
|
||||
|
@ -67,7 +67,7 @@ function update() {
|
|||
}
|
||||
|
||||
// Cap at max tick length
|
||||
diff = Decimal.min(diff, modInfo.maxTickLength);
|
||||
diff = Decimal.min(diff, projInfo.maxTickLength);
|
||||
|
||||
// Apply dev speed
|
||||
if (player.devSpeed != undefined) {
|
||||
|
@ -93,7 +93,7 @@ function update() {
|
|||
}
|
||||
|
||||
export async function startGameLoop() {
|
||||
hasWon = (await import("@/data/mod")).hasWon;
|
||||
hasWon = (await import("data/projEntry")).hasWon;
|
||||
if (settings.unthrottled) {
|
||||
requestAnimationFrame(update);
|
||||
} else {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import Modal from "@/components/Modal.vue";
|
||||
import Modal from "components/Modal.vue";
|
||||
import {
|
||||
CoercableComponent,
|
||||
jsx,
|
||||
|
@ -6,17 +6,17 @@ import {
|
|||
Replace,
|
||||
setDefault,
|
||||
StyleValue
|
||||
} from "@/features/feature";
|
||||
import { Link } from "@/features/links";
|
||||
import Decimal from "@/util/bignum";
|
||||
} from "features/feature";
|
||||
import { Link } from "features/links";
|
||||
import Decimal from "util/bignum";
|
||||
import {
|
||||
Computable,
|
||||
GetComputableType,
|
||||
GetComputableTypeWithDefault,
|
||||
processComputable,
|
||||
ProcessedComputable
|
||||
} from "@/util/computed";
|
||||
import { createLazyProxy } from "@/util/proxies";
|
||||
} from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { createNanoEvents, Emitter } from "nanoevents";
|
||||
import { ref, unref } from "vue";
|
||||
import { globalBus } from "./events";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { globalBus } from "@/game/events";
|
||||
import { globalBus } from "game/events";
|
||||
import Toast from "vue-toastification";
|
||||
import "vue-toastification/dist/index.css";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { globalBus } from "@/game/events";
|
||||
import Decimal, { DecimalSource } from "@/util/bignum";
|
||||
import { ProxyState } from "@/util/proxies";
|
||||
import { globalBus } from "game/events";
|
||||
import Decimal, { DecimalSource } from "util/bignum";
|
||||
import { ProxyState } from "util/proxies";
|
||||
import { isArray } from "@vue/shared";
|
||||
import { isRef, Ref, ref } from "vue";
|
||||
import { GenericLayer } from "./layers";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import Decimal, { DecimalSource } from "@/util/bignum";
|
||||
import { isPlainObject } from "@/util/common";
|
||||
import { ProxiedWithState, ProxyPath, ProxyState } from "@/util/proxies";
|
||||
import Decimal, { DecimalSource } from "util/bignum";
|
||||
import { isPlainObject } from "util/common";
|
||||
import { ProxiedWithState, ProxyPath, ProxyState } from "util/proxies";
|
||||
import { reactive, unref } from "vue";
|
||||
import transientState from "./state";
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import modInfo from "@/data/modInfo.json";
|
||||
import { Themes } from "@/data/themes";
|
||||
import { CoercableComponent } from "@/features/feature";
|
||||
import { globalBus } from "@/game/events";
|
||||
import { hardReset } from "@/util/save";
|
||||
import projInfo from "data/projInfo.json";
|
||||
import { Themes } from "data/themes";
|
||||
import { CoercableComponent } from "features/feature";
|
||||
import { globalBus } from "game/events";
|
||||
import { hardReset } from "util/save";
|
||||
import { reactive, watch } from "vue";
|
||||
|
||||
export interface Settings {
|
||||
|
@ -24,14 +24,17 @@ const state = reactive<Partial<Settings>>({
|
|||
watch(
|
||||
state,
|
||||
state =>
|
||||
localStorage.setItem(modInfo.id, btoa(unescape(encodeURIComponent(JSON.stringify(state))))),
|
||||
localStorage.setItem(
|
||||
projInfo.id,
|
||||
btoa(unescape(encodeURIComponent(JSON.stringify(state))))
|
||||
),
|
||||
{ deep: true }
|
||||
);
|
||||
export default window.settings = state as Settings;
|
||||
|
||||
export function loadSettings(): void {
|
||||
try {
|
||||
const item: string | null = localStorage.getItem(modInfo.id);
|
||||
const item: string | null = localStorage.getItem(projInfo.id);
|
||||
if (item != null && item !== "") {
|
||||
const settings = JSON.parse(decodeURIComponent(escape(atob(item))));
|
||||
if (typeof settings === "object") {
|
||||
|
|
16
src/main.ts
16
src/main.ts
|
@ -1,6 +1,6 @@
|
|||
import { App as VueApp, createApp } from "vue";
|
||||
import App from "./App.vue";
|
||||
import modInfo from "./data/modInfo.json";
|
||||
import projInfo from "./data/projInfo.json";
|
||||
import { GenericLayer } from "./game/layers";
|
||||
import { PlayerData } from "./game/player";
|
||||
import { Settings } from "./game/settings";
|
||||
|
@ -8,6 +8,11 @@ import { Transient } from "./game/state";
|
|||
import Decimal, { DecimalSource } from "./lib/break_eternity";
|
||||
import { load } from "./util/save";
|
||||
|
||||
document.title = projInfo.title;
|
||||
if (projInfo.id === "") {
|
||||
throw "Project ID is empty! Please select a unique ID for this project in /src/data/projInfo.json";
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
vue: VueApp;
|
||||
|
@ -28,7 +33,7 @@ declare global {
|
|||
toPlaces: (x: DecimalSource, precision: number, maxAccepted: DecimalSource) => string;
|
||||
formatSmall: (x: DecimalSource, precision?: number) => string;
|
||||
invertOOM: (x: DecimalSource) => Decimal;
|
||||
modInfo: typeof modInfo;
|
||||
projInfo: typeof projInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,14 +47,11 @@ requestAnimationFrame(async () => {
|
|||
const { globalBus, startGameLoop } = await require("./game/events");
|
||||
|
||||
// Create Vue
|
||||
const vue = (window.vue = createApp({
|
||||
...App
|
||||
}));
|
||||
const vue = (window.vue = createApp(App));
|
||||
globalBus.emit("setupVue", vue);
|
||||
vue.mount("#app");
|
||||
document.title = modInfo.title;
|
||||
|
||||
startGameLoop();
|
||||
});
|
||||
|
||||
window.modInfo = modInfo;
|
||||
window.projInfo = projInfo;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Import Decimal and numberUtils from a different file to globally change which big num library gets used
|
||||
// This way switching out big number libraries just needs to happen here, not every file that needs big numbers
|
||||
import { DecimalSource as RawDecimalSource } from "@/lib/break_eternity";
|
||||
import Decimal, * as numberUtils from "@/util/break_eternity";
|
||||
import { DecimalSource as RawDecimalSource } from "lib/break_eternity";
|
||||
import Decimal, * as numberUtils from "util/break_eternity";
|
||||
|
||||
export const {
|
||||
exponentialFormat,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import Decimal, { DecimalSource } from "@/lib/break_eternity";
|
||||
import modInfo from "@/data/modInfo.json";
|
||||
import Decimal, { DecimalSource } from "lib/break_eternity";
|
||||
import projInfo from "data/projInfo.json";
|
||||
|
||||
export default Decimal;
|
||||
|
||||
|
@ -13,7 +13,7 @@ export function exponentialFormat(num: DecimalSource, precision: number, mantiss
|
|||
e = e.add(1);
|
||||
}
|
||||
const eString = e.gte(1e9)
|
||||
? format(e, Math.max(Math.max(precision, 3), modInfo.defaultDecimalsShown))
|
||||
? format(e, Math.max(Math.max(precision, 3), projInfo.defaultDecimalsShown))
|
||||
: e.gte(10000)
|
||||
? commaFormat(e, 0)
|
||||
: e.toStringWithDecimalPlaces(0);
|
||||
|
@ -48,7 +48,7 @@ export function regularFormat(num: DecimalSource, precision: number): string {
|
|||
return (0).toFixed(precision);
|
||||
}
|
||||
if (num.mag < 0.1 && precision !== 0) {
|
||||
precision = Math.max(Math.max(precision, 4), modInfo.defaultDecimalsShown);
|
||||
precision = Math.max(Math.max(precision, 4), projInfo.defaultDecimalsShown);
|
||||
}
|
||||
return num.toStringWithDecimalPlaces(precision);
|
||||
}
|
||||
|
@ -63,8 +63,8 @@ const nearOne = new Decimal(0.98);
|
|||
const thousandth = new Decimal(0.001);
|
||||
const zero = new Decimal(0);
|
||||
export function format(num: DecimalSource, precision?: number, small?: boolean): string {
|
||||
if (precision == null) precision = modInfo.defaultDecimalsShown;
|
||||
small = small || modInfo.allowSmall;
|
||||
if (precision == null) precision = projInfo.defaultDecimalsShown;
|
||||
small = small ?? projInfo.defaultShowSmall;
|
||||
num = new Decimal(num);
|
||||
if (isNaN(num.sign) || isNaN(num.layer) || isNaN(num.mag)) {
|
||||
return "NaN";
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
import modInfo from "@/data/modInfo.json";
|
||||
import player, { Player, PlayerData, stringifySave } from "@/game/player";
|
||||
import settings, { loadSettings } from "@/game/settings";
|
||||
import projInfo from "data/projInfo.json";
|
||||
import player, { Player, PlayerData, stringifySave } from "game/player";
|
||||
import settings, { loadSettings } from "game/settings";
|
||||
import Decimal from "./bignum";
|
||||
import { ProxyState } from "./proxies";
|
||||
|
||||
export function setupInitialStore(player: Partial<PlayerData> = {}): Player {
|
||||
return Object.assign(
|
||||
{
|
||||
id: `${modInfo.id}-0`,
|
||||
id: `${projInfo.id}-0`,
|
||||
name: "Default Save",
|
||||
tabs: modInfo.initialTabs.slice(),
|
||||
tabs: projInfo.initialTabs.slice(),
|
||||
time: Date.now(),
|
||||
autosave: true,
|
||||
offlineProd: true,
|
||||
offlineTime: new Decimal(0),
|
||||
timePlayed: new Decimal(0),
|
||||
keepGoing: false,
|
||||
modID: modInfo.id,
|
||||
modVersion: modInfo.versionNumber,
|
||||
modID: projInfo.id,
|
||||
modVersion: projInfo.versionNumber,
|
||||
layers: {}
|
||||
},
|
||||
player
|
||||
|
@ -41,7 +41,7 @@ export async function load(): Promise<void> {
|
|||
return;
|
||||
}
|
||||
const player = JSON.parse(decodeURIComponent(escape(atob(save))));
|
||||
if (player.modID !== modInfo.id) {
|
||||
if (player.modID !== projInfo.id) {
|
||||
await loadSave(newSave());
|
||||
return;
|
||||
}
|
||||
|
@ -67,15 +67,15 @@ export function getUniqueID(): string {
|
|||
let id,
|
||||
i = 0;
|
||||
do {
|
||||
id = `${modInfo.id}-${i++}`;
|
||||
id = `${projInfo.id}-${i++}`;
|
||||
} while (localStorage.getItem(id));
|
||||
return id;
|
||||
}
|
||||
|
||||
export async function loadSave(playerObj: Partial<PlayerData>): Promise<void> {
|
||||
console.info("Loading save", playerObj);
|
||||
const { layers, removeLayer, addLayer } = await import("@/game/layers");
|
||||
const { fixOldSave, getInitialLayers } = await import("@/data/mod");
|
||||
const { layers, removeLayer, addLayer } = await import("game/layers");
|
||||
const { fixOldSave, getInitialLayers } = await import("data/projEntry");
|
||||
|
||||
for (const layer in layers) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
|
@ -92,7 +92,7 @@ export async function loadSave(playerObj: Partial<PlayerData>): Promise<void> {
|
|||
);
|
||||
}
|
||||
playerObj.time = Date.now();
|
||||
if (playerObj.modVersion !== modInfo.versionNumber) {
|
||||
if (playerObj.modVersion !== projInfo.versionNumber) {
|
||||
fixOldSave(playerObj.modVersion, playerObj);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import Col from "@/components/layout/Column.vue";
|
||||
import Row from "@/components/layout/Row.vue";
|
||||
import Col from "components/layout/Column.vue";
|
||||
import Row from "components/layout/Row.vue";
|
||||
import {
|
||||
CoercableComponent,
|
||||
Component as ComponentKey,
|
||||
GatherProps,
|
||||
GenericComponent,
|
||||
JSXFunction
|
||||
} from "@/features/feature";
|
||||
} from "features/feature";
|
||||
import {
|
||||
Component,
|
||||
computed,
|
||||
|
|
|
@ -15,15 +15,10 @@
|
|||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"sourceMap": true,
|
||||
"baseUrl": ".",
|
||||
"baseUrl": "src",
|
||||
"types": [
|
||||
"webpack-env"
|
||||
],
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"src/*"
|
||||
]
|
||||
},
|
||||
"lib": [
|
||||
"esnext",
|
||||
"dom",
|
||||
|
|
Loading…
Reference in a new issue