mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-21 16:13:55 +00:00
Many minor fixes, updated b_e
This commit is contained in:
parent
5180497c90
commit
dccdae2f2a
6 changed files with 23 additions and 18 deletions
|
@ -1,8 +1,12 @@
|
|||
# The Modding Tree changelog:
|
||||
|
||||
|
||||
- Added option for shift-clicking nodes toggling their tooltips.
|
||||
- Fixed NaN check for setting Decimal values with text boxes.
|
||||
- Added display-image, h-line, and v-line to documentation.
|
||||
|
||||
- Fixed an issue with subtab glow colors.
|
||||
- Fixed being able to buy upgrades on deactivated layers.
|
||||
- Updated break_eternity library.
|
||||
- Cleaned up buyable/clickable code.
|
||||
|
||||
# v2.6.5.1 - 7/13/21
|
||||
- Fixed offline production more.
|
||||
|
|
|
@ -254,7 +254,6 @@ function loadVue() {
|
|||
`
|
||||
})
|
||||
|
||||
// data = button size, in px
|
||||
Vue.component('buyables', {
|
||||
props: ['layer', 'data'],
|
||||
template: `
|
||||
|
@ -271,11 +270,11 @@ function loadVue() {
|
|||
})
|
||||
|
||||
Vue.component('buyable', {
|
||||
props: ['layer', 'data', 'size'],
|
||||
props: ['layer', 'data'],
|
||||
template: `
|
||||
<div v-if="tmp[layer].buyables && tmp[layer].buyables[data]!== undefined && tmp[layer].buyables[data].unlocked" style="display: grid">
|
||||
<button v-bind:class="{ buyable: true, tooltipBox: true, can: tmp[layer].buyables[data].canBuy, locked: !tmp[layer].buyables[data].canBuy, bought: player[layer].buyables[data].gte(tmp[layer].buyables[data].purchaseLimit)}"
|
||||
v-bind:style="[tmp[layer].buyables[data].canBuy ? {'background-color': tmp[layer].color} : {}, size ? {'height': size, 'width': size} : {}, tmp[layer].componentStyles.buyable, tmp[layer].buyables[data].style]"
|
||||
v-bind:style="[tmp[layer].buyables[data].canBuy ? {'background-color': tmp[layer].color} : {}, tmp[layer].componentStyles.buyable, tmp[layer].buyables[data].style]"
|
||||
v-on:click="if(!interval) buyBuyable(layer, data)" :id='"buyable-" + layer + "-" + data' @mousedown="start" @mouseleave="stop" @mouseup="stop" @touchstart="start" @touchend="stop" @touchcancel="stop">
|
||||
<span v-if= "tmp[layer].buyables[data].title"><h2 v-html="tmp[layer].buyables[data].title"></h2><br></span>
|
||||
<span v-bind:style="{'white-space': 'pre-line'}" v-html="run(layers[layer].buyables[data].display, layers[layer].buyables[data])"></span>
|
||||
|
@ -333,12 +332,12 @@ function loadVue() {
|
|||
|
||||
// data = id of clickable
|
||||
Vue.component('clickable', {
|
||||
props: ['layer', 'data', 'size'],
|
||||
props: ['layer', 'data'],
|
||||
template: `
|
||||
<button
|
||||
v-if="tmp[layer].clickables && tmp[layer].clickables[data]!== undefined && tmp[layer].clickables[data].unlocked"
|
||||
v-bind:class="{ upg: true, tooltipBox: true, can: tmp[layer].clickables[data].canClick, locked: !tmp[layer].clickables[data].canClick}"
|
||||
v-bind:style="[tmp[layer].clickables[data].canClick ? {'background-color': tmp[layer].color} : {}, size ? {'height': size, 'width': size} : {}, tmp[layer].clickables[data].style]"
|
||||
v-bind:style="[tmp[layer].clickables[data].canClick ? {'background-color': tmp[layer].color} : {}, tmp[layer].clickables[data].style]"
|
||||
v-on:click="if(!interval) clickClickable(layer, data)" :id='"clickable-" + layer + "-" + data' @mousedown="start" @mouseleave="stop" @mouseup="stop" @touchstart="start" @touchend="stop" @touchcancel="stop">
|
||||
<span v-if= "tmp[layer].clickables[data].title"><h2 v-html="tmp[layer].clickables[data].title"></h2><br></span>
|
||||
<span v-bind:style="{'white-space': 'pre-line'}" v-html="run(layers[layer].clickables[data].display, layers[layer].clickables[data])"></span>
|
||||
|
@ -376,7 +375,7 @@ function loadVue() {
|
|||
})
|
||||
|
||||
|
||||
// data = button size, in px
|
||||
// data = optionally, array of rows for the grid to show
|
||||
Vue.component('grid', {
|
||||
props: ['layer', 'data'],
|
||||
template: `
|
||||
|
@ -428,7 +427,7 @@ function loadVue() {
|
|||
},
|
||||
})
|
||||
|
||||
// data = button size, in px
|
||||
// data = id of microtab family
|
||||
Vue.component('microtabs', {
|
||||
props: ['layer', 'data'],
|
||||
computed: {
|
||||
|
|
|
@ -1820,8 +1820,8 @@
|
|||
var a = this;
|
||||
var b = decimal;
|
||||
|
||||
//special case: if a is 0, then return 0
|
||||
if (a.sign === 0) { return a; }
|
||||
//special case: if a is 0, then return 0 (UNLESS b is 0, then return 1)
|
||||
if (a.sign === 0) { return b.eq(0) ? FC_NN(1, 0, 1) : a; }
|
||||
//special case: if a is 1, then return 1
|
||||
if (a.sign === 1 && a.layer === 0 && a.mag === 1) { return a; }
|
||||
//special case: if b is 0, then return 1
|
||||
|
@ -1831,7 +1831,7 @@
|
|||
|
||||
var result = (a.absLog10().mul(b)).pow10();
|
||||
|
||||
if (this.sign === -1 && b.toNumber() % 2 === 1) {
|
||||
if (this.sign === -1 && Math.abs(b.toNumber() % 2) === 1) {
|
||||
return result.neg();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ var systemComponents = {
|
|||
<div class="upgRow">
|
||||
<div v-for="tab in Object.keys(data)">
|
||||
<button v-if="data[tab].unlocked == undefined || data[tab].unlocked" v-bind:class="{tabButton: true, notify: subtabShouldNotify(layer, name, tab), resetNotify: subtabResetNotify(layer, name, tab)}"
|
||||
v-bind:style="[{'border-color': tmp[layer].color}, (subtabShouldNotify(layer, name, tab) ? {'box-shadow': 'var(--hqProperty2a), 0 0 20px ' + data[tab].glowColor || defaultGlow} : {}), tmp[layer].componentStyles['tab-button'], data[tab].buttonStyle]"
|
||||
v-bind:style="[{'border-color': tmp[layer].color}, (subtabShouldNotify(layer, name, tab) ? {'box-shadow': 'var(--hqProperty2a), 0 0 20px ' + (data[tab].glowColor || defaultGlow)} : {}), tmp[layer].componentStyles['tab-button'], data[tab].buttonStyle]"
|
||||
v-on:click="function(){player.subtabs[layer][name] = tab; updateTabFormats(); needCanvasUpdate = true;}">{{tab}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -18,7 +18,7 @@ var systemComponents = {
|
|||
<button v-if="nodeShown(layer)"
|
||||
v-bind:id="layer"
|
||||
v-on:click="function() {
|
||||
if (shiftDown) player[layer].forceTooltip = !player[layer].forceTooltip
|
||||
if (shiftDown && options.forceTooltips) player[layer].forceTooltip = !player[layer].forceTooltip
|
||||
else if(tmp[layer].isLayer) {
|
||||
if (tmp[layer].leftTab) {
|
||||
showNavTab(layer, prev)
|
||||
|
@ -169,7 +169,8 @@ var systemComponents = {
|
|||
<tr>
|
||||
<td><button class="opt" onclick="toggleOpt('hideChallenges')">Completed Challenges: {{ options.hideChallenges?"HIDDEN":"SHOWN" }}</button></td>
|
||||
<td><button class="opt" onclick="toggleOpt('forceOneTab'); needsCanvasUpdate = true">Single-Tab Mode: {{ options.forceOneTab?"ALWAYS":"AUTO" }}</button></td>
|
||||
</tr>
|
||||
<td><button class="opt" onclick="toggleOpt('forceTooltips'); needsCanvasUpdate = true">Shift-Click to Toggle Tooltips: {{ options.forceTooltips?"ON":"OFF" }}</button></td>
|
||||
</tr>
|
||||
</table>`
|
||||
},
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ function buyUpgrade(layer, id) {
|
|||
function buyUpg(layer, id) {
|
||||
if (!tmp[layer].upgrades || !tmp[layer].upgrades[id]) return
|
||||
let upg = tmp[layer].upgrades[id]
|
||||
if (!player[layer].unlocked) return
|
||||
if (!player[layer].unlocked || player[layer].deactivated) return
|
||||
if (!tmp[layer].upgrades[id].unlocked) return
|
||||
if (player[layer].upgrades.includes(id)) return
|
||||
if (upg.canAfford === false) return
|
||||
|
@ -346,7 +346,7 @@ document.title = modInfo.name
|
|||
function toValue(value, oldValue) {
|
||||
if (oldValue instanceof Decimal) {
|
||||
value = new Decimal (value)
|
||||
if (value.eq(decimalNaN)) return decimalZero
|
||||
if (checkDecimalNaN(value)) return decimalZero
|
||||
return value
|
||||
}
|
||||
if (!isNaN(oldValue))
|
||||
|
|
|
@ -13,6 +13,7 @@ function getStartOptions() {
|
|||
showStory: true,
|
||||
forceOneTab: false,
|
||||
oldStyle: false,
|
||||
tooltipForcing: true,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue