1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2025-05-10 03:51:33 +00:00
This commit is contained in:
Acamaeda 2020-12-05 14:52:29 -05:00
parent 595d4916a6
commit 473f9d58d9
14 changed files with 74 additions and 34 deletions

View file

@ -395,7 +395,6 @@ addLayer("f", {
tooltipLocked() { // Optional, tooltip displays when the layer is locked
return ("This weird farmer dinosaur will only see you if you have at least " + this.requires() + " candies. You only have " + formatWhole(player.points))
},
midsection: [
"blank", ['display-image', 'https://images.beano.com/store/24ab3094eb95e5373bca1ccd6f330d4406db8d1f517fc4170b32e146f80d?auto=compress%2Cformat&dpr=1&w=390'],
["display-text", "Bork bork!"]

View file

@ -4,7 +4,6 @@ let modInfo = {
pointsName: "points",
discordName: "",
discordLink: "",
changelogLink: "https://github.com/Acamaeda/The-Modding-Tree/blob/master/changelog.md",
initialStartPoints: new Decimal (10), // Used for hard resets and new players
offlineLimit: 1, // In hours
@ -12,10 +11,16 @@ let modInfo = {
// Set your version in num and name
let VERSION = {
num: "2.2.8",
num: "2.2.9",
name: "Uprooted",
}
let changelog = `<h1>Changelog:</h1><br>
<h3>v0.0</h3><br>
- Added things.<br>
- Added stuff.`
let winText = `Congratulations! You have reached the end and beaten this game, but for now...`
// If you add new functions anywhere inside of a layer, and those functions have an effect when called, add them here.
// (The ones here are examples, all official functions are already taken care of)
var doNotCallTheseFunctionsEveryTick = ["doReset", "buy", "onPurchase", "blowUpEverything"]

View file

@ -134,10 +134,10 @@ function loadVue() {
})
Vue.component('upgrades', {
props: ['layer'],
props: ['layer', 'data'],
template: `
<div v-if="tmp[layer].upgrades" class="upgTable">
<div v-for="row in tmp[layer].upgrades.rows" class="upgRow">
<div v-for="row in (data === undefined ? tmp[layer].upgrades.rows : data)" class="upgRow">
<div v-for="col in tmp[layer].upgrades.cols"><div v-if="tmp[layer].upgrades[row*10+col]!== undefined && tmp[layer].upgrades[row*10+col].unlocked" class="upgAlign">
<upgrade :layer = "layer" :data = "row*10+col" v-bind:style="tmp[layer].componentStyles.upgrade"></upgrade>
</div></div>
@ -320,7 +320,7 @@ function loadVue() {
<div class="upgTable instant">
<tab-buttons :layer="layer" :data="tmp[layer].microtabs[data]" :name="data" v-bind:style="tmp[layer].componentStyles['tab-buttons']"></tab-buttons>
</div>
<layer-tab v-if="tmp[layer].microtabs[data][player.subtabs[layer][data]].embedLayer" :layer="tmp[layer].microtabs[data][player.subtabs[layer][data]].embedLayer" ></layer-tab>
<layer-tab v-if="tmp[layer].microtabs[data][player.subtabs[layer][data]].embedLayer" :layer="tmp[layer].microtabs[data][player.subtabs[layer][data]].embedLayer" :embedded="true"></layer-tab>
<column v-else v-bind:style="tmp[layer].microtabs[data][player.subtabs[layer][data]].style" :layer="layer" :data="tmp[layer].microtabs[data][player.subtabs[layer][data]].content"></column>
</div>

View file

@ -4,7 +4,7 @@ var gameEnded = false;
// Don't change this
const TMT_VERSION = {
tmtNum: "2.2.8",
tmtNum: "2.2.9",
tmtName: "Uprooted"
}

View file

@ -5,7 +5,6 @@ let modInfo = {
pointsName: "points",
discordName: "",
discordLink: "",
changelogLink: "https://github.com/Acamaeda/The-Modding-Tree/blob/master/changelog.md",
initialStartPoints: new Decimal (10), // Used for hard resets and new players
offlineLimit: 1, // In hours
@ -17,6 +16,13 @@ let VERSION = {
name: "Literally nothing",
}
let changelog = `<h1>Changelog:</h1><br>
<h3>v0.0</h3><br>
- Added things.<br>
- Added stuff.`
let winText = `Congratulations! You have reached the end and beaten this game, but for now...`
// If you add new functions anywhere inside of a layer, and those functions have an effect when called, add them here.
// (The ones here are examples, all official functions are already taken care of)
var doNotCallTheseFunctionsEveryTick = ["blowUpEverything"]

View file

@ -144,6 +144,7 @@ function updateLayers(){
if(layers[layer].softcap === undefined) layers[layer].softcap = new Decimal("e1e7")
if(layers[layer].softcapPower === undefined) layers[layer].softcapPower = new Decimal("0.5")
if(layers[layer].displayRow === undefined) layers[layer].displayRow = layers[layer].row
if(layers[layer].name === undefined) layers[layer].name = layer
let row = layers[layer].row
@ -180,9 +181,30 @@ function updateLayers(){
updateHotkeys()
}
function addLayer(layerName, layerData){ // Call this to add layers from a different file!
function addLayer(layerName, layerData, tabLayers = null){ // Call this to add layers from a different file!
layers[layerName] = layerData
layers[layerName].isLayer = true
if (tabLayers !== null)
{
let format = {}
for (id in tabLayers) {
layer = tabLayers[id]
format[(layers[layer].name ? layers[layer].name : layer)] = {
embedLayer: layer,
buttonStyle() {
if (!tmp[this.embedLayer].nodeStyle) return {'border-color': tmp[this.embedLayer].color}
else {
style = tmp[this.embedLayer].nodeStyle
if (style['border-color'] === undefined) style['border-color'] = tmp[this.embedLayer].color
return style
}
},
unlocked() {return tmp[this.embedLayer].layerShown},
}
}
layers[layerName].tabFormat = format
}
}
function addNode(layerName, layerData){ // Does the same thing, but for non-layer nodes
@ -190,7 +212,6 @@ function addNode(layerName, layerData){ // Does the same thing, but for non-laye
layers[layerName].isLayer = false
}
// If data is a function, return the result of calling it. Otherwise, return the data.
function readData(data, args=null){
if (!!(data && data.constructor && data.call && data.apply))
@ -222,4 +243,9 @@ addLayer("info-tab", {
addLayer("options-tab", {
tabFormat: ["options-tab"],
row: "otherside"
})
addLayer("changelog-tab", {
tabFormat() {return ([["raw-html", modInfo.changelog]])},
row: "otherside"
})

View file

@ -51,7 +51,7 @@ var systemComponents = {
'layer-tab': {
props: ['layer', 'back', 'spacing'],
props: ['layer', 'back', 'spacing', 'embedded'],
template: `<div v-bind:style="[tmp[layer].style ? tmp[layer].style : {}, (tmp[layer].tabFormat && !Array.isArray(tmp[layer].tabFormat)) ? tmp[layer].tabFormat[player.subtabs[layer].mainTabs].style : {}]">
<div v-if="back"><button v-bind:class="back == 'big' ? 'other-back' : 'back'" v-on:click="goBack()"></button></div>
<div v-if="!tmp[layer].tabFormat">
@ -78,10 +78,10 @@ var systemComponents = {
<column :layer="layer" :data="tmp[layer].tabFormat"></column>
</div>
<div v-else>
<div class="upgTable" v-bind:style="{'padding-top': '25px', 'margin-bottom': '24px'}">
<div class="upgTable" v-bind:style="{'padding-top': (embedded ? '0' : '25px'), 'margin-top': (embedded ? '-10px' : '0'), 'margin-bottom': '24px'}">
<tab-buttons v-bind:style="tmp[layer].componentStyles['tab-buttons']" :layer="layer" :data="tmp[layer].tabFormat" :name="'mainTabs'"></tab-buttons>
</div>
<layer-tab v-if="tmp[layer].tabFormat[player.subtabs[layer].mainTabs].embedLayer" :layer="tmp[layer].tabFormat[player.subtabs[layer].mainTabs].embedLayer"></layer-tab>
<layer-tab v-if="tmp[layer].tabFormat[player.subtabs[layer].mainTabs].embedLayer" :layer="tmp[layer].tabFormat[player.subtabs[layer].mainTabs].embedLayer" :embedded="true"></layer-tab>
<column v-else :layer="layer" :data="tmp[layer].tabFormat[player.subtabs[layer].mainTabs].content"></column>
</div>
</div></div>
@ -122,17 +122,17 @@ var systemComponents = {
Made by {{modInfo.author}}
</span>
<br>
The Modding Tree {{TMT_VERSION.tmtNum}} by Acamaeda
The Modding Tree <a v-bind:href="'https://github.com/Acamaeda/The-Modding-Tree/blob/master/changelog.md'" target="_blank" class="link" v-bind:style = "{'font-size': '14px', 'display': 'inline'}" >{{TMT_VERSION.tmtNum}}</a> by Acamaeda
<br>
The Prestige Tree made by Jacorb and Aarex
<br>
Original idea by papyrus (on discord)
<br><br>
<a v-bind:href="modInfo.changelogLink" target="_blank" class="link" >Changelog</a><br>
<br><br>
<div class="link" onclick="showTab('changelog-tab')">Changelog</div><br>
<span v-if="modInfo.discordLink"><a class="link" v-bind:href="modInfo.discordLink" target="_blank">{{modInfo.discordName}}</a><br></span>
<a class="link" href="https://discord.gg/F3xveHV" target="_blank" v-bind:style="modInfo.discordLink ? {'font-size': '16px'} : {}">The Modding Tree Discord</a><br>
<a class="link" href="http://discord.gg/wwQfgPa" target="_blank" v-bind:style="{'font-size': '16px'}">Main Prestige Tree server</a><br>
<br><br>
<br><br>
Time Played: {{ formatTime(player.timePlayed) }}<br><br>
<h3>Hotkeys</h3><br>
<span v-for="key in hotkeys" v-if="player[key.layer].unlocked && tmp[key.layer].hotkeys[key.id].unlocked"><br>{{key.description}}</span></div>

View file

@ -129,7 +129,6 @@ function updateChallengeTemp(layer)
function updateChallengeDisplay(layer) {
for (id in player[layer].challenges) {
let style = "locked"
console.log(layer + " " + id)
if (player[layer].activeChallenge == id && canCompleteChallenge(layer, id)) style = "canComplete"
else if (hasChallenge(layer, id)) style = "done"
tmp[layer].challenges[id].defaultStyle = style

View file

@ -256,6 +256,7 @@ function load() {
changeTheme();
changeTreeQuality();
updateLayers()
setupModInfo()
setupTemp();
updateTemp();
@ -263,6 +264,11 @@ function load() {
loadVue();
}
function setupModInfo() {
modInfo.changelog = changelog
modInfo.winText = winText ? winText : `Congratulations! You have reached the end and beaten this game, but for now...`
}
function fixNaNs() {
NaNcheck(player)