require login before trialing a skin

This commit is contained in:
evanpelle
2026-02-13 19:46:46 -08:00
parent 712ce96794
commit a2a8035b1d
3 changed files with 10 additions and 0 deletions
+1
View File
@@ -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",
+1
View File
@@ -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
+8
View File
@@ -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;