@ -39,43 +39,25 @@ export class MainMenuState extends GameState {
}
getInnerHTML ( ) {
const showLanguageIcon = ! G _CHINA _VERSION && ! G _WEGAME _VERSION ;
const showExitAppButton = G _IS _STANDALONE ;
const showPuzzleDLC =
! G _WEGAME _VERSION &&
( G _IS _STANDALONE || WEB _STEAM _SSO _AUTHENTICATED ) &&
! G _IS _STEAM _DEMO &&
! G _GOG _VERSION ;
const showWegameFooter = G _WEGAME _VERSION ;
const showPuzzleDLC = G _IS _STANDALONE || WEB _STEAM _SSO _AUTHENTICATED ;
const hasMods = MODS . anyModsActive ( ) ;
const hasSteamBridge = ! G _GOG _VERSION && ! G _IS _STEAM _DEMO ;
let showExternalLinks = true ;
if ( G _IS _STANDALONE ) {
if ( G _WEGAME _VERSION || G _CHINA _VERSION ) {
showExternalLinks = false ;
}
} else {
if ( ! G _IS _STANDALONE ) {
const wrapper = /** @type {PlatformWrapperImplBrowser} */ ( this . app . platformWrapper ) ;
if ( ! wrapper . embedProvider . externalLinks ) {
showExternalLinks = false ;
}
}
let showDiscordLink = showExternalLinks ;
if ( G _CHINA _VERSION ) {
showDiscordLink = true ;
}
const showDemoAdvertisement =
( showExternalLinks || G _CHINA _VERSION ) &&
this . app . restrictionMgr . getIsStandaloneMarketingActive ( ) ;
showExternalLinks && this . app . restrictionMgr . getIsStandaloneMarketingActive ( ) ;
const ownsPuzzleDLC =
WEB _STEAM _SSO _AUTHENTICATED ||
( G _IS _STANDALONE &&
! G _IS _STEAM _DEMO &&
/** @type { PlatformWrapperImplElectron}*/ ( this . app . platformWrapper ) . dlcs . puzzle ) ;
const showShapez2 = showExternalLinks && MODS . mods . length === 0 ;
@ -110,17 +92,12 @@ export class MainMenuState extends GameState {
}
Play shapez on Steam
< / a >
$ { ! G _IS _STEAM _DEMO ? ` <div class="onlinePlayerCount"></div> ` : "" }
< div class = "onlinePlayerCount" > < / d i v >
` ;
return `
< div class = "topButtons" >
$ {
showLanguageIcon
? ` <button aria-label="Choose Language" class="languageChoose" data-languageicon=" ${ this . app . settings . getLanguage ( ) } "></button> `
: ""
}
< button aria - label = "Choose Language" class = "languageChoose" data - languageicon = "${this.app.settings.getLanguage()}" > < / b u t t o n >
< button class = "settingsButton" aria - label = "Settings" > < / b u t t o n >
$ { showExitAppButton ? ` <button class="exitAppButton" aria-label="Exit App"></button> ` : "" }
@ -144,7 +121,7 @@ export class MainMenuState extends GameState {
< div class = "buttons" > < / d i v >
< div class = "savegamesMount" > < / d i v >
$ {
hasSteamBridge && ( G_IS _STANDALONE || ! WEB _STEAM _SSO _AUTHENTICATED )
G_IS _STANDALONE || ! WEB _STEAM _SSO _AUTHENTICATED
? ` <div class="steamSso">
< span class = "description" > $ {
G _IS _STANDALONE
@ -158,7 +135,7 @@ export class MainMenuState extends GameState {
: ""
}
$ {
hasSteamBridge && WEB_STEAM _SSO _AUTHENTICATED
WEB_STEAM _SSO _AUTHENTICATED
? `
< div class = "steamSso" >
< span class = "description" > $ { T . mainMenu . playingFullVersion } < / s p a n >
@ -252,27 +229,11 @@ export class MainMenuState extends GameState {
< / d i v >
$ {
showWegameFooter
? `
< div class = 'footer wegameDisclaimer' >
< div class = "disclaimer" >
健康游戏忠告
< br >
抵制不良游戏 , 拒绝盗版游戏 。 注意自我保护 , 谨防受骗上当 。 < br >
适度游戏益脑 , 沉迷游戏伤身 。 合理安排时间 , 享受健康生活 。
< / d i v >
< div class = "rating" > < / d i v >
< / d i v >
`
: `
< div class = "footer ${showExternalLinks ? " " : " noLinks "} " >
< div class = "socialLinks" >
$ {
showExternalLinks && ! G _IS _STEAM _DEMO
showExternalLinks
? ` <a class="patreonLink boxLink" target="_blank">
< span class = "thirdpartyLogo patreonLogo" > < / s p a n >
< span class = "label" > Patreon < / s p a n >
@ -280,7 +241,7 @@ export class MainMenuState extends GameState {
: ""
}
$ {
showExternalLinks && ( ! G _IS _STANDALONE || G _IS _STEAM _DEMO )
showExternalLinks && ! G _IS _STANDALONE
? ` <a class="steamLinkSocial boxLink" target="_blank">
< span class = "thirdpartyLogo steamLogo" > < / s p a n >
< span class = "label" > steam < / s p a n >
@ -288,7 +249,7 @@ export class MainMenuState extends GameState {
: ""
}
$ {
showExternalLinks && ! G _IS _STEAM _DEMO
showExternalLinks
? `
< a class = "githubLink boxLink" target = "_blank" >
< span class = "thirdpartyLogo githubLogo" > < / s p a n >
@ -299,7 +260,7 @@ export class MainMenuState extends GameState {
$ {
show DiscordLink
show ExternalLinks
? ` <a class="discordLink boxLink" target="_blank">
< span class = "thirdpartyLogo discordLogo" > < / s p a n >
< span class = "label" > Discord < / s p a n >
@ -346,9 +307,6 @@ export class MainMenuState extends GameState {
< / a > < / d i v >
< / d i v >
`
}
` ;
}
@ -549,6 +507,7 @@ export class MainMenuState extends GameState {
}
fetchPlayerCount ( ) {
/** @type {HTMLDivElement} */
const element = this . htmlElement . querySelector ( ".onlinePlayerCount" ) ;
if ( ! element ) {
return ;
@ -715,13 +674,11 @@ export class MainMenuState extends GameState {
downloadButton . setAttribute ( "aria-label" , "Download" ) ;
elem . appendChild ( downloadButton ) ;
if ( ! G _WEGAME _VERSION ) {
const renameButton = document . createElement ( "button" ) ;
renameButton . classList . add ( "styledButton" , "renameGame" ) ;
renameButton . setAttribute ( "aria-label" , "Rename Savegame" ) ;
name . appendChild ( renameButton ) ;
this . trackClicks ( renameButton , ( ) => this . requestRenameSavegame ( games [ i ] ) ) ;
}
const renameButton = document . createElement ( "button" ) ;
renameButton . classList . add ( "styledButton" , "renameGame" ) ;
renameButton . setAttribute ( "aria-label" , "Rename Savegame" ) ;
name . appendChild ( renameButton ) ;
this . trackClicks ( renameButton , ( ) => this . requestRenameSavegame ( games [ i ] ) ) ;
const resumeButton = document . createElement ( "button" ) ;
resumeButton . classList . add ( "styledButton" , "resumeGame" ) ;