diff --git a/resources/lang/en.json b/resources/lang/en.json index 4c990d3c8..9d601ad66 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -875,6 +875,7 @@ "trial_remaining": "remaining", "trial_granted": "Skin trial granted!", "trial_cooldown": "Only one trial per 24 hours. Please try again later.", + "trial_login_required": "Must be logged in to trial a skin", "reward_countdown": "Reward in {seconds} seconds...", "steam_wishlist_prompt": "Support OpenFront by adding it to your Steam wishlist", "select_skin": "Select Skin", diff --git a/src/client/TerritoryPatternsModal.ts b/src/client/TerritoryPatternsModal.ts index 00a92e433..105e3fb63 100644 --- a/src/client/TerritoryPatternsModal.ts +++ b/src/client/TerritoryPatternsModal.ts @@ -161,6 +161,7 @@ export class TerritoryPatternsModal extends BaseModal { .requiresPurchase=${rel === "purchasable" || rel === "purchasable_no_trial"} .allowTrial=${rel === "purchasable"} + .hasLinkedAccount=${hasLinkedAccount(this.userMeResponse)} .trialCooldown=${this.userMeResponse !== false && this.userMeResponse.player.tempFlaresCooldown} .trialTimeRemaining=${isTrial diff --git a/src/client/components/PatternButton.ts b/src/client/components/PatternButton.ts index e381f95ea..59156b854 100644 --- a/src/client/components/PatternButton.ts +++ b/src/client/components/PatternButton.ts @@ -38,6 +38,9 @@ export class PatternButton extends LitElement { @property({ type: Boolean }) trialCooldown: boolean = false; + @property({ type: Boolean }) + hasLinkedAccount: boolean = false; + @property({ type: Function }) onSelect?: (pattern: PlayerPattern | null) => void; @@ -171,6 +174,11 @@ export class PatternButton extends LitElement { e.stopPropagation(); if (this.pattern === null || this._adLoading) return; + if (!this.hasLinkedAccount) { + alert(translateText("territory_patterns.trial_login_required")); + return; + } + if (this.trialCooldown) { alert(translateText("territory_patterns.trial_cooldown")); return;