1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-01-18 03:31:30 +00:00

Fixed tooltip overlay issue and settings not updating

This commit is contained in:
Harley White 2021-05-21 23:22:39 -04:00
parent 431e1a1b71
commit fabf31ccf6
11 changed files with 25 additions and 12 deletions

View file

@ -1,5 +1,8 @@
# The Modding Tree changelog:
- Tooltips can now show over the top overlay again.
- Fixed text on two settings buttons not changing.
### v2.5.9.2 - 5/19/21
- Fixed many issues with things not updating.

View file

@ -64,7 +64,7 @@
col: (player.tab !== 'none' && player.navTab !== 'none'),
left: (player.tab !== 'none' && player.navTab !== 'none')}"
:style="{'margin-top': !readData(layoutInfo.showTree) && player.tab == 'info-tab' ? '50px' : ''}">
<div id="version" onclick="showTab('changelog-tab')" class="overlayThing" style="margin-right: 13px">
<div id="version" onclick="showTab('changelog-tab')" class="overlayThing" style="margin-right: 13px" >
{{VERSION.withoutName}}</div>
<button
v-if="player.navTab == 'none' && (tmp[player.tab].row == 'side' || tmp[player.tab].row == 'otherside')"
@ -93,12 +93,11 @@
</div>
</div>
<div v-if="!(gameEnded && !player.keepGoing) && (player.tab === 'none' || tmp.other.splitScreen)" id="treeTab" style="z-index: 0" onscroll="resizeCanvas()"
v-bind:class="{ fullWidth: (player.tab == 'none' || player.navTab == 'none'), col: (player.tab !== 'none' && player.navTab !== 'none'), left: (player.tab !== 'none' && player.navTab !== 'none')}">
<div v-if="!(gameEnded && !player.keepGoing) && (player.tab === 'none' || tmp.other.splitScreen)" id="treeTab" onscroll="resizeCanvas()"
v-bind:class="{ fullWidth: (player.tab == 'none' || player.navTab == 'none'), col: (player.tab !== 'none' && player.navTab !== 'none'), left: (player.tab !== 'none' && player.navTab !== 'none'), 'front': !tmp.scrolled}">
<br><br><br><br>
<overlay-head id="fakeHead" style="visibility: hidden;">
</overlay-head>
<layer-tab :layer="player.navTab == 'none' ? player.tab : player.navTab" :key="'left'"></layer-tab>
</div>

View file

@ -8,7 +8,7 @@ You can test your mod by opening the [index.html][/index.html] file in your brow
Most of the time, you won't need to dive deep into the code to create things, but you still can if you really want to, for example to add new Vue components in [components.js](/js/components.js).
The Modding Tree uses [break\_eternity.js](https://github.com/Patashu/break_eternity.js) to store large values. This means that many numbers are `Decimal` objects, and must be treated differently. For example, you have to use `new Decimal(x)` to create a `Decimal` value instead of a plain number, and perform operations on them by calling functions. e.g, instead of `x = x + y`, use `x = x.add(y)`. Keep in mind this also applies to comparison operators, which should be replaced with calling the `.gt`, `.gte`, `.lt`, `.lte`, `.eq`, and `.neq` functions. See the [break\_eternity.js](https://github.com/Patashu/break_eternity.js) docs for more details on working with `Decimal` values.
The Modding Tree uses [break\_eternity.js](https://github.com/Patashu/break_eternity.js) to store large values. This means that many numbers are `Decimal` objects, and must be treated differently. For example, you have to use `new Decimal(x)` to create a `Decimal` value instead of a plain number (x can be a number or a string for larger values). You perform operations on them by calling functions. e.g, instead of `x = x + y`, use `x = x.add(y)`. Keep in mind this also applies to comparison operators, which should be replaced with calling the `.gt`, `.gte`, `.lt`, `.lte`, `.eq`, and `.neq` functions. See the [break\_eternity.js](https://github.com/Patashu/break_eternity.js) docs for more details on working with `Decimal` values.
Almost all values can be either a constant value, or a dynamic value. Dynamic values are defined by putting a function that returns what the value should be at any given time.

3
docs/making-a-mod.md Normal file
View file

@ -0,0 +1,3 @@
# Making a Mod
This guide assumes you have already gone through the [getting started guide](getting-started.md). It will walk you through the basics of using TMT to create a mod.

View file

@ -93,8 +93,8 @@
</div>
<div v-if="!(gameEnded && !player.keepGoing) && (player.tab === 'none' || tmp.other.splitScreen)" id="treeTab" style="z-index: 0" onscroll="resizeCanvas()"
v-bind:class="{ fullWidth: (player.tab == 'none' || player.navTab == 'none'), col: (player.tab !== 'none' && player.navTab !== 'none'), left: (player.tab !== 'none' && player.navTab !== 'none')}">
<br><br><br><br>
v-bind:class="{ fullWidth: (player.tab == 'none' || player.navTab == 'none'), col: (player.tab !== 'none' && player.navTab !== 'none'), left: (player.tab !== 'none' && player.navTab !== 'none'), 'front': !tmp.scrolled}">
<br><br><br><br>
<overlay-head id="fakeHead" style="visibility: hidden;">
</overlay-head>

View file

@ -369,7 +369,7 @@ addLayer("c", {
},
tooltip() { // Optional, tooltip displays when the layer is unlocked
let tooltip = formatWhole(player[this.layer].points) + " " + this.resource
if (player[this.layer].buyables[11].gt(0)) tooltip += "<br><i>" + formatWhole(player[this.layer].buyables[11]) + " Exhancers</i>"
if (player[this.layer].buyables[11].gt(0)) tooltip += "<br><i><br><br><br>" + formatWhole(player[this.layer].buyables[11]) + " Exhancers</i>"
return tooltip
},
shouldNotify() { // Optional, layer will be highlighted on the tree if true.

View file

@ -567,6 +567,7 @@ function loadVue() {
layerunlocked,
doReset,
buyUpg,
buyUpgrade,
startChallenge,
milestoneShown,
keepGoing,
@ -575,6 +576,8 @@ function loadVue() {
hasAchievement,
hasChallenge,
maxedChallenge,
getBuyableAmount,
getClickableState,
inChallenge,
canAffordUpgrade,
canBuyBuyable,

View file

@ -1,7 +1,6 @@
var player;
var needCanvasUpdate = true;
var gameEnded = false;
var scrolled = false;
// Don't change this
const TMT_VERSION = {

View file

@ -10,6 +10,8 @@ function startPlayerBase() {
autosave: true,
notify: {},
msDisplay: "always",
theme: null,
hqTree: false,
offlineProd: true,
versionType: modInfo.id,
version: VERSION.num,

View file

@ -18,12 +18,12 @@ function getThemeName() {
return player.theme ? theme_names[player.theme] : "Default";
}
function switchTheme() {
if (player.theme === undefined)
if (player.theme === null)
player.theme = themes[1];
else {
player.theme = themes[Object.keys(themes)[player.theme] + 1];
if (!player.theme)
delete player.theme;
player.theme = null;
}
changeTheme();
resizeCanvas();

View file

@ -595,7 +595,7 @@ ul {
transition: opacity 0.5s;
position: absolute;
z-index: 99999999 !important;
z-index: 20000 ;
background-color: var(--background_tooltip);
color: var(--points);
@ -629,6 +629,10 @@ ul {
overflow:hidden;
}
.front {
z-index: 30000
}
.overlayThing {
z-index: 10000;
pointer-events:auto;