From 595fd096be7891f99a83b7eddadb136b60a941ab Mon Sep 17 00:00:00 2001
From: Rj Manhas <117674421+RjManhas@users.noreply.github.com>
Date: Wed, 12 Nov 2025 20:55:58 -0700
Subject: [PATCH] feat: added a button to hide non owned patterns (#2432)
Resolves #2431
## Description:
Adds a button in the pattern menu to hide non owned skins
## Please complete the following:
- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Please put your Discord username so you can be contacted if a bug or
regression is found:
notifxy (1379678982676676639)
---
resources/lang/en.json | 1 +
src/client/TerritoryPatternsModal.ts | 45 ++++++++++++++++++++--------
2 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/resources/lang/en.json b/resources/lang/en.json
index 9e3d78251..189d54202 100644
--- a/resources/lang/en.json
+++ b/resources/lang/en.json
@@ -679,6 +679,7 @@
"title": "Skins",
"colors": "Colors",
"purchase": "Purchase",
+ "show_only_owned": "My Skins",
"blocked": {
"login": "You must be logged in to access this skin.",
"purchase": "Purchase this skin to unlock it."
diff --git a/src/client/TerritoryPatternsModal.ts b/src/client/TerritoryPatternsModal.ts
index f13faf670..79f4666f6 100644
--- a/src/client/TerritoryPatternsModal.ts
+++ b/src/client/TerritoryPatternsModal.ts
@@ -28,6 +28,7 @@ export class TerritoryPatternsModal extends LitElement {
@state() private selectedColor: string | null = null;
@state() private activeTab: "patterns" | "colors" = "patterns";
+ @state() private showOnlyOwned: boolean = false;
private cosmetics: Cosmetics | null = null;
@@ -112,6 +113,9 @@ export class TerritoryPatternsModal extends LitElement {
if (rel === "blocked") {
continue;
}
+ if (this.showOnlyOwned && rel !== "owned") {
+ continue;
+ }
buttons.push(html`
- ${this.affiliateCode === null
- ? html`
- this.selectPattern(null)}
- >
- `
- : html``}
- ${buttons}
+