2023-11-07 00:46:27 +00:00
// noinspection SpellCheckingInspection
const systemComponents = {
"tab-buttons" : {
props : [ "layer" , "data" , "name" ] ,
template : `
< 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}, (data[tab].glowColor && subtabShouldNotify(layer, name, tab) ? {'box-shadow': 'var(--hqProperty2a), 0 0 20px ' + data[tab].glowColor} : {}), tmp[layer].componentStyles['tab-button'], data[tab].buttonStyle]"
v - on : click = "function(){player.subtabs[layer][name] = tab; updateTabFormats(); needCanvasUpdate = true;}" > { { tab } }
< / b u t t o n >
< / d i v >
< / d i v >
`
} ,
"tree-node" : {
props : [ "layer" , "abb" , "size" ] ,
template : `
< button v - if = "nodeShown(layer)"
v - bind : id = "layer"
v - on : click = " function ( ) {
if ( shiftDown ) player [ layer ] . forceTooltip = ! player [ layer ] . forceTooltip
else if ( tmp [ layer ] . isLayer ) { showTab ( layer ) }
else { run ( layers [ layer ] . onClick , layers [ layer ] ) }
} "
v - bind : class = " {
treeNode : tmp [ layer ] . isLayer ,
treeButton : ! tmp [ layer ] . isLayer ,
smallNode : size === 'small' ,
[ layer ] : true ,
tooltipBox : true ,
forceTooltip : player [ layer ] . forceTooltip ,
ghost : tmp [ layer ] . layerShown == 'ghost' ,
hidden : ! tmp [ layer ] . layerShown ,
locked : tmp [ layer ] . isLayer ? ! ( player [ layer ] . unlocked || tmp [ layer ] . canReset ) : ! ( tmp [ layer ] . canClick ) ,
notify : tmp [ layer ] . notify && player [ layer ] . unlocked ,
resetNotify : tmp [ layer ] . prestigeNotify ,
can : ( ( player [ layer ] . unlocked || tmp [ layer ] . isLayer ) && tmp [ layer ] . isLayer ) || ( ! tmp [ layer ] . isLayer && tmp [ layer ] . canClick ) ,
} "
v - bind : style = "constructNodeStyle(layer)" >
< span v - html = "(abb !== '' && tmp[layer].image === undefined) ? abb : ' '" > < / s p a n >
< tooltip
v - if = "tmp[layer].tooltip != ''"
: text = " ( tmp [ layer ] . isLayer ) ? (
player [ layer ] . unlocked ? ( tmp [ layer ] . tooltip ? tmp [ layer ] . tooltip : formatWhole ( player [ layer ] . points ) + ' ' + tmp [ layer ] . resource )
: ( tmp [ layer ] . tooltipLocked ? tmp [ layer ] . tooltipLocked : 'Reach ' + formatWhole ( tmp [ layer ] . requires ) + ' ' + tmp [ layer ] . baseResource + ' to unlock (You have ' + formatWhole ( tmp [ layer ] . baseAmount ) + ' ' + tmp [ layer ] . baseResource + ')' )
)
: (
tmp [ layer ] . canClick ? ( tmp [ layer ] . tooltip ? tmp [ layer ] . tooltip : 'I am a button!' )
: ( tmp [ layer ] . tooltipLocked ? tmp [ layer ] . tooltipLocked : 'I am a button!' )
) " > < / t o o l t i p >
< node - mark : layer = 'layer' : data = 'layers[layer].marked' > < / n o d e - m a r k > < / s p a n >
< / b u t t o n >
`
} ,
"layer-tab" : {
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" style = "position: fixed; z-index: 100;" >
< button v - bind : class = "back === 'big' ? 'other-back' : 'back'" v - on : click = "goBack()" > ← < / b u t t o n >
< / d i v >
< div v - if = "!tmp[layer].tabFormat" >
< div v - if = "spacing" v - bind : style = "{'height': spacing}" : key = "this.$vnode.key + '-spacing'" > < / d i v >
< infobox v - if = "tmp[layer].infoboxes" : layer = "layer" : data = "Object.keys(tmp[layer].infoboxes)[0]"
: key = "this.$vnode.key + '-info'" > < / i n f o b o x >
< main - display v - bind : style = "tmp[layer].componentStyles['main-display']" : layer = "layer" > < / m a i n - d i s p l a y >
< div v - if = "tmp[layer].type !== 'none'" >
< prestige - button v - bind : style = "tmp[layer].componentStyles['prestige-button']"
: layer = "layer" > < / p r e s t i g e - b u t t o n >
< / d i v >
< resource - display v - bind : style = "tmp[layer].componentStyles['resource-display']"
: layer = "layer" > < / r e s o u r c e - d i s p l a y >
< milestones v - bind : style = "tmp[layer].componentStyles.milestones" : layer = "layer" > < / m i l e s t o n e s >
< div v - if = "Array.isArray(tmp[layer].midsection)" >
< column : layer = "layer" : data = "tmp[layer].midsection" : key = "this.$vnode.key + '-mid'" > < / c o l u m n >
< / d i v >
< clickables v - bind : style = "tmp[layer].componentStyles['clickables']" : layer = "layer" > < / c l i c k a b l e s >
< buyables v - bind : style = "tmp[layer].componentStyles.buyables" : layer = "layer" > < / b u y a b l e s >
< upgrades v - bind : style = "tmp[layer].componentStyles['upgrades']" : layer = "layer" > < / u p g r a d e s >
< challenges v - bind : style = "tmp[layer].componentStyles['challenges']" : layer = "layer" > < / c h a l l e n g e s >
< achievements v - bind : style = "tmp[layer].componentStyles.achievements" : layer = "layer" > < / a c h i e v e m e n t s >
< br > < br >
< / d i v >
< div v - if = "tmp[layer].tabFormat" >
< div v - if = "Array.isArray(tmp[layer].tabFormat)" >
< div v - if = "spacing" v - bind : style = "{'height': spacing}" > < / d i v >
< column : layer = "layer" : data = "tmp[layer].tabFormat" : key = "this.$vnode.key + '-col'" > < / c o l u m n >
< / d i v >
< div v - else >
< 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'" > < / t a b - b u t t o n s >
< / d i v >
< layer - tab v - if = "tmp[layer].tabFormat[player.subtabs[layer].mainTabs].embedLayer"
: layer = "tmp[layer].tabFormat[player.subtabs[layer].mainTabs].embedLayer" : embedded = "true"
: key = "this.$vnode.key + '-' + layer" > < / l a y e r - t a b >
< column v - else : layer = "layer" : data = "tmp[layer].tabFormat[player.subtabs[layer].mainTabs].content"
: key = "this.$vnode.key + '-col'" > < / c o l u m n >
< / d i v >
< / d i v >
< / d i v >
`
} ,
"overlay-head" : {
template : `
< div class = "overlayThing" style = "padding-bottom:7px; width: 90%; z-index: 1000; position: relative" >
< span v - if = "player.devSpeed && player.devSpeed != 1" class = "overlayThing" >
< br > Dev Speed : { { format ( player . devSpeed ) } } x < br >
< / s p a n >
< span v - if = "player.offTime !== undefined" class = "overlayThing" >
< br > Offline Time : { { formatTime ( player . offTime . remain ) } } < br >
< / s p a n >
< br >
< span v - if = "canGenPoints()" class = "overlayThing" > ( { { tmp . other . oompsMag != 0 ? format ( tmp . other . oomps ) + " OOM" + ( tmp . other . oompsMag < 0 ? "^OOM" : tmp . other . oompsMag > 1 ? "^" + tmp . other . oompsMag : "" ) + "s" : formatSmall ( getPointGen ( ) ) } } / sec ) < / s p a n >
< div v - for = "thing in tmp.displayThings" class = "overlayThing" > < span v - if = "thing" v - html = "thing" > < / s p a n > < / d i v >
< / d i v >
`
} ,
"info-tab" : {
template : `
< div >
< h2 > { { modInfo . name } } < / h 2 >
< br >
< h3 > { { VERSION . withName } } < / h 3 >
< span v - if = "modInfo.author" >
< br >
Made by { { modInfo . author } }
< / s p a n >
< br >
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 > b y A c a m a e d a
< br >
The Prestige Tree made by Jacorb and Aarex
< br >
Original idea by papyrus ( on discord )
< br >
Hourglass used with modifications from < a v - bind : href = "'https://codepen.io/jkantner/pen/wvWXyKG'" target = "_blank" class = "link" v - bind : style = "{'font-size': '14px', 'display': 'inline'}" > jkantner < / a > u n d e r M I T l i c e n s e
< br > < br >
2023-11-28 02:32:46 +00:00
< img : src = "'https://www.thepaperpilot.tech/nocount/tag.svg?url=' + encodeURIComponent(window.location.href)" alt = "Hits" / >
2023-11-07 00:46:27 +00:00
< br > < br >
< div class = "link" onclick = "showTab('changelog-tab')" > Changelog < / d i v > < b r >
< span v - if = "modInfo.discordLink" > < a class = "link" v - bind : href = "modInfo.discordLink" target = "_blank" > { { modInfo . discordName } } < / a > < b r > < / s p a n >
< a class = "link" href = "https://discord.gg/F3xveHV" target = "_blank" v - bind : style = "modInfo.discordLink ? {'font-size': '16px'} : {}" > The Modding Tree Discord < / a > < b r >
< a class = "link" href = "http://discord.gg/wwQfgPa" target = "_blank" v - bind : style = "{'font-size': '16px'}" > Main Prestige Tree server < / a > < b r >
< br > < br >
Time Played : { { formatTime ( player . timePlayed ) } } < br >
< span v - if = "player.chapterTime[1] > 0" > Chapter 1 Time : { { formatTime ( player . chapterTime [ 1 ] ) } } < / s p a n > < b r >
< span v - if = "player.chapterTime[2] > 0" > Chapter 2 Time : { { formatTime ( player . chapterTime [ 2 ] ) } } < / s p a n > < b r >
< span v - if = "player.chapterTime[3] > 0" > Chapter 3 Time : { { formatTime ( player . chapterTime [ 3 ] ) } } < / s p a n > < b r >
< span v - if = "player.chapterTime[4] > 0" > Chapter 4 Time : { { formatTime ( player . chapterTime [ 4 ] ) } } < / s p a n > < b r >
< span v - if = "player.chapterTime[5] > 0" > Chapter 5 Time : { { formatTime ( player . chapterTime [ 5 ] ) } } < / s p a n > < b r > < b r >
< h3 v - if = "Object.keys(hotkeys) > 0" > Hotkeys < / h 3 > < b r >
< span v - for = "key in hotkeys" v - if = "player[key.layer].unlocked && tmp[key.layer].hotkeys[key.id].unlocked" > < br > { { key . description } } < / s p a n >
< / d i v >
`
} ,
"options-tab" : {
template : `
< table >
< tr >
< td > < button class = "opt" onclick = "save()" > Save < / b u t t o n > < / t d >
< td > < button class = "opt" onclick = "toggleOpt('autosave')" > Autosave : { { player . autosave ? "ON" : "OFF" } } < / b u t t o n > < / t d >
< td > < button class = "opt" onclick = "hardReset()" > HARD RESET < / b u t t o n > < / t d >
< / t r >
< tr >
< td > < button class = "opt" onclick = "exportSave()" > Export to clipboard < / b u t t o n > < / t d >
< td > < button class = "opt" onclick = "importSave()" > Import < / b u t t o n > < / t d >
< td > < button class = "opt" onclick = "toggleOpt('offlineProd')" > Offline Prod : { { player . offlineProd ? "ON" : "OFF" } } < / b u t t o n > < / t d >
< / t r >
< tr >
< td > < button class = "opt" onclick = "adjustMSDisp()" > Show Milestones : { { MS _DISPLAYS [ MS _SETTINGS . indexOf ( player . msDisplay ) ] } } < / b u t t o n > < / t d >
< td > < button class = "opt" onclick = "toggleOpt('forceOneTab'); needsCanvasUpdate = true" > Single - Tab Mode : { { player . forceOneTab ? "ALWAYS" : "AUTO" } } < / b u t t o n > < / t d >
< td > < button class = "opt" onclick = "toggleOpt('advancedExp')" > XP bars : { { player . advancedExp ? "ADVANCED" : "SIMPLE" } } < / b u t t o n > < / t d >
< / t r >
< / t a b l e > `
} ,
"back-button" : {
template : `
< button v - bind : class = "back" onclick = "goBack()" > ← < / b u t t o n >
`
} ,
'tooltip' : {
props : [ 'text' ] ,
template : ` <div class="tooltip" v-html="text"></div>
`
} ,
'node-mark' : {
props : [ 'layer' , 'data' ] ,
template : ` <div v-if='data'>
< div v - if = 'data === true' class = 'star' style = 'position: absolute; left: -10px; top: -10px;' > < / d i v >
< img v - else class = 'mark' style = 'position: absolute; left: -25px; top: -10px;' v - bind : src = "data" > < / d i v >
< / d i v >
`
} ,
'particle' : {
props : [ 'data' , 'index' ] ,
template : ` <div><div class='particle instant' v-bind:style="[constructParticleStyle(data), data.style]"
v - on : click = "run(data.onClick, data)" v - on : mouseenter = "run(data.onMouseOver, data)" v - on : mouseleave = "run(data.onMouseLeave, data)" > < span v - html = "data.text" > < / s p a n >
< / d i v >
< svg version = "2" v - if = "data.color" >
< mask v - bind : id = "'pmask' + data.id" >
< image id = "img" v - bind : href = "data.image" x = "0" y = "0" : height = "data.width" : width = "data.height" / >
< / m a s k >
< / s v g >
< / d i v >
`
} ,
}