mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2025-03-22 22:21:41 +00:00
Minor polishing
This commit is contained in:
parent
56bd46d7b7
commit
ad0064d65d
4 changed files with 29 additions and 15 deletions
src
|
@ -1,7 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="layer-container" :style="{ '--layer-color': unref(color) }">
|
<div class="layer-container" :style="{ '--layer-color': unref(color) }">
|
||||||
<button v-if="showGoBack" class="goBack" @click="goBack">❌</button>
|
<button v-if="showGoBack" class="goBack" @click="goBack">❌</button>
|
||||||
<button class="layer-tab minimized" v-if="minimized.value" @click="minimized.value = false">
|
|
||||||
|
<button class="layer-tab minimized" v-if="minimized" @click="setMinimized(false)">
|
||||||
<component v-if="minimizedComponent" :is="minimizedComponent" />
|
<component v-if="minimizedComponent" :is="minimizedComponent" />
|
||||||
<div v-else>{{ unref(name) }}</div>
|
<div v-else>{{ unref(name) }}</div>
|
||||||
</button>
|
</button>
|
||||||
|
@ -10,7 +11,8 @@
|
||||||
<component :is="component" />
|
<component :is="component" />
|
||||||
</Context>
|
</Context>
|
||||||
</div>
|
</div>
|
||||||
<button v-if="unref(minimizable)" class="minimize" @click="minimized.value = true">
|
|
||||||
|
<button v-if="unref(minimizable)" class="minimize" @click="setMinimized(true)">
|
||||||
▼
|
▼
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -63,7 +65,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const { display, index, minimized, minWidth, tab, minimizedDisplay } = toRefs(props);
|
const { display, index, minimized, minWidth, tab, minimizedDisplay, name } = toRefs(props);
|
||||||
|
|
||||||
const component = computeComponent(display);
|
const component = computeComponent(display);
|
||||||
const minimizedComponent = computeOptionalComponent(minimizedDisplay);
|
const minimizedComponent = computeOptionalComponent(minimizedDisplay);
|
||||||
|
@ -75,23 +77,28 @@ export default defineComponent({
|
||||||
player.tabs.splice(unref(props.index), 1);
|
player.tabs.splice(unref(props.index), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setMinimized(min: boolean) {
|
||||||
|
minimized.value = min;
|
||||||
|
}
|
||||||
|
|
||||||
nextTick(() => updateTab(minimized.value, unref(minWidth.value)));
|
nextTick(() => updateTab(minimized.value, unref(minWidth.value)));
|
||||||
watch([minimized, wrapRef(minWidth)], ([minimized, minWidth]) =>
|
watch([name, minimized, wrapRef(minWidth)], ([name, minimized, minWidth]) => {
|
||||||
updateTab(minimized, minWidth)
|
updateTab(minimized, minWidth);
|
||||||
);
|
});
|
||||||
|
|
||||||
function updateNodes(nodes: Record<string, FeatureNode | undefined>) {
|
function updateNodes(nodes: Record<string, FeatureNode | undefined>) {
|
||||||
props.nodes.value = nodes;
|
props.nodes.value = nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTab(minimized: boolean, minWidth: number | string) {
|
function updateTab(min: boolean, minWidth: number | string) {
|
||||||
|
minimized.value = min;
|
||||||
const width =
|
const width =
|
||||||
typeof minWidth === "number" || Number.isNaN(parseInt(minWidth))
|
typeof minWidth === "number" || Number.isNaN(parseInt(minWidth))
|
||||||
? minWidth + "px"
|
? minWidth + "px"
|
||||||
: minWidth;
|
: minWidth;
|
||||||
const tabValue = tab.value();
|
const tabValue = tab.value();
|
||||||
if (tabValue != undefined) {
|
if (tabValue != undefined) {
|
||||||
if (minimized) {
|
if (min) {
|
||||||
tabValue.style.flexGrow = "0";
|
tabValue.style.flexGrow = "0";
|
||||||
tabValue.style.flexShrink = "0";
|
tabValue.style.flexShrink = "0";
|
||||||
tabValue.style.width = "60px";
|
tabValue.style.width = "60px";
|
||||||
|
@ -107,13 +114,17 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
component,
|
component,
|
||||||
minimizedComponent,
|
minimizedComponent,
|
||||||
showGoBack,
|
showGoBack,
|
||||||
updateNodes,
|
updateNodes,
|
||||||
unref,
|
unref,
|
||||||
goBack
|
goBack,
|
||||||
|
setMinimized,
|
||||||
|
minimized,
|
||||||
|
minWidth,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -162,6 +173,7 @@ export default defineComponent({
|
||||||
.layer-tab.minimized > * {
|
.layer-tab.minimized > * {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
writing-mode: vertical-rl;
|
writing-mode: vertical-rl;
|
||||||
|
text-align: left;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,11 +15,13 @@
|
||||||
<div v-if="isTab('behaviour')">
|
<div v-if="isTab('behaviour')">
|
||||||
<div v-if="canAutoSave">
|
<div v-if="canAutoSave">
|
||||||
<Toggle :title="autosaveTitle" v-model="autosave" />
|
<Toggle :title="autosaveTitle" v-model="autosave" />
|
||||||
<FeedbackButton v-if="!autosave" class="button save-button" @click="save()"
|
<FeedbackButton v-if="!autosave" class="button save-button" @click="save()">
|
||||||
>Manually save</FeedbackButton
|
Manually save
|
||||||
>
|
</FeedbackButton>
|
||||||
|
</div>
|
||||||
|
<div style="text-align: center" v-else>
|
||||||
|
Auto-saving is disabled while between days
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align: center" v-else>Auto-saving disabled while between days</div>
|
|
||||||
<Toggle v-if="projInfo.enablePausing" :title="isPausedTitle" v-model="isPaused" />
|
<Toggle v-if="projInfo.enablePausing" :title="isPausedTitle" v-model="isPaused" />
|
||||||
</div>
|
</div>
|
||||||
<div v-if="isTab('appearance')">
|
<div v-if="isTab('appearance')">
|
||||||
|
|
|
@ -579,7 +579,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
inverseCost(x: DecimalSource) {
|
inverseCost(x: DecimalSource) {
|
||||||
let v = Decimal.div(x, 50000).root(1.5).sub(1);
|
let v = Decimal.div(x, 50000).root(1.5).sub(1);
|
||||||
v = v.mul(wrappingPaper.boosts.rainbow1.value);
|
v = v.mul(wrappingPaper.boosts.rainbow1.value);
|
||||||
if (management.elfTraining.fertilizerElfTraining.milestones[0].earned.value) {
|
if (management.elfTraining.fertilizerElfTraining.milestones[1].earned.value) {
|
||||||
v = v.div(Decimal.pow(0.95, paper.books.fertilizerBook.totalAmount.value));
|
v = v.div(Decimal.pow(0.95, paper.books.fertilizerBook.totalAmount.value));
|
||||||
}
|
}
|
||||||
v = v.div(Decimal.pow(0.95, paper.books.fertilizerBook.totalAmount.value));
|
v = v.div(Decimal.pow(0.95, paper.books.fertilizerBook.totalAmount.value));
|
||||||
|
|
|
@ -326,7 +326,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
||||||
)),
|
)),
|
||||||
minimizedDisplay: jsx(() => (
|
minimizedDisplay: jsx(() => (
|
||||||
<div>
|
<div>
|
||||||
{name} - {format(foundationProgress.value)} {foundationProgress.displayName}
|
{name} - {format(foundationProgress.value)}% {foundationProgress.displayName}
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue