Change inventory filters to show all campaigns when all of them are selected

This commit is contained in:
DevilXD committed 2023-10-29 22:36:12 +01:00
1 parent bdf53fb33d
commit deee8abf61
15 files changed
+20 -20

No files matched your search

+5 -5
View File
@@ -1147,7 +1147,7 @@ class InventoryOverview:
self._cache: ImageCache = manager._cache self._cache: ImageCache = manager._cache
self._settings: Settings = manager._twitch.settings self._settings: Settings = manager._twitch.settings
self._filters = { self._filters = {
"linked": IntVar(master, 1), "not_linked": IntVar(master, 1),
"upcoming": IntVar(master, 1), "upcoming": IntVar(master, 1),
"expired": IntVar(master, 0), "expired": IntVar(master, 0),
"excluded": IntVar(master, 0), "excluded": IntVar(master, 0),
@@ -1165,11 +1165,11 @@ class InventoryOverview:
).grid(column=0, row=0) ).grid(column=0, row=0)
icolumn = 0 icolumn = 0
ttk.Checkbutton( ttk.Checkbutton(
filter_frame, variable=self._filters["linked"] filter_frame, variable=self._filters["not_linked"]
).grid(column=(icolumn := icolumn + 1), row=0) ).grid(column=(icolumn := icolumn + 1), row=0)
ttk.Label( ttk.Label(
filter_frame, filter_frame,
text=_("gui", "inventory", "filter", "linked"), text=_("gui", "inventory", "filter", "not_linked"),
padding=(0, 0, LABEL_SPACING, 0), padding=(0, 0, LABEL_SPACING, 0),
).grid(column=(icolumn := icolumn + 1), row=0) ).grid(column=(icolumn := icolumn + 1), row=0)
ttk.Checkbutton( ttk.Checkbutton(
@@ -1230,14 +1230,14 @@ class InventoryOverview:
def _update_visibility(self, campaign: DropsCampaign): def _update_visibility(self, campaign: DropsCampaign):
# True if the campaign is supposed to show, False makes it hidden. # True if the campaign is supposed to show, False makes it hidden.
frame = self._campaigns[campaign]["frame"] frame = self._campaigns[campaign]["frame"]
linked = bool(self._filters["linked"].get()) not_linked = bool(self._filters["not_linked"].get())
expired = bool(self._filters["expired"].get()) expired = bool(self._filters["expired"].get())
excluded = bool(self._filters["excluded"].get()) excluded = bool(self._filters["excluded"].get())
upcoming = bool(self._filters["upcoming"].get()) upcoming = bool(self._filters["upcoming"].get())
finished = bool(self._filters["finished"].get()) finished = bool(self._filters["finished"].get())
priority_only = self._settings.priority_only priority_only = self._settings.priority_only
if ( if (
(not linked or campaign.linked) (not_linked or campaign.linked)
and (campaign.active or upcoming and campaign.upcoming or expired and campaign.expired) and (campaign.active or upcoming and campaign.upcoming or expired and campaign.expired)
and ( and (
excluded or ( excluded or (
+1 -1
View File
@@ -107,7 +107,7 @@
"filter": { "filter": {
"name": "Filter", "name": "Filter",
"show": "Anzeigen:", "show": "Anzeigen:",
"linked": "Nur verknüpfte", "not_linked": "Nicht verbunden",
"upcoming": "Zukünftig", "upcoming": "Zukünftig",
"expired": "Abgelaufen", "expired": "Abgelaufen",
"excluded": "Ausgeschlossen", "excluded": "Ausgeschlossen",
+1 -1
View File
@@ -107,7 +107,7 @@
"filter": { "filter": {
"name": "Filtro de campañas", "name": "Filtro de campañas",
"show": "Mostrar:", "show": "Mostrar:",
"linked": "Vinculadas", "not_linked": "No enlazado",
"upcoming": "Próximas", "upcoming": "Próximas",
"expired": "Expiradas", "expired": "Expiradas",
"excluded": "Excluidas", "excluded": "Excluidas",
+1 -1
View File
@@ -107,7 +107,7 @@
"filter": { "filter": {
"name": "Filtre", "name": "Filtre",
"show": "Afficher :", "show": "Afficher :",
"linked": "Liés uniquement", "not_linked": "Non lié",
"upcoming": "À venir", "upcoming": "À venir",
"expired": "Expiré", "expired": "Expiré",
"excluded": "Exclu", "excluded": "Exclu",
+1 -1
View File
@@ -107,7 +107,7 @@
"filter": { "filter": {
"name": "Filtro", "name": "Filtro",
"show": "Mostra:", "show": "Mostra:",
"linked": "Solo collegati", "not_linked": "Non collegato",
"upcoming": "In arrivo", "upcoming": "In arrivo",
"expired": "Scaduti", "expired": "Scaduti",
"excluded": "Esclusi", "excluded": "Esclusi",
+1 -1
View File
@@ -107,7 +107,7 @@
"filter": { "filter": {
"name": "Filtr", "name": "Filtr",
"show": "Pokaż:", "show": "Pokaż:",
"linked": "Tylko połączone", "not_linked": "Nie połączone",
"upcoming": "Nadchodzące", "upcoming": "Nadchodzące",
"expired": "Wygasłe", "expired": "Wygasłe",
"excluded": "Wykluczone", "excluded": "Wykluczone",
+1 -1
View File
@@ -107,7 +107,7 @@
"filter": { "filter": {
"name": "Filtro", "name": "Filtro",
"show": "Mostrar:", "show": "Mostrar:",
"linked": "Conectado apenas", "not_linked": "Não ligado",
"upcoming": "Se Aproximando", "upcoming": "Se Aproximando",
"expired": "Expirado", "expired": "Expirado",
"excluded": "Excluido", "excluded": "Excluido",
+1 -1
View File
@@ -107,7 +107,7 @@
"filter": { "filter": {
"name": "Filtre", "name": "Filtre",
"show": "Dava etmek:", "show": "Dava etmek:",
"linked": "Yalnızca bağlantılı", "not_linked": "Bağlantılı değil",
"upcoming": "Gelecek", "upcoming": "Gelecek",
"expired": "Süresi doldu", "expired": "Süresi doldu",
"excluded": "Hariç tutuldu", "excluded": "Hariç tutuldu",
+1 -1
View File
@@ -100,7 +100,7 @@
"filter": { "filter": {
"name": "Filtr", "name": "Filtr",
"show": "Drop:", "show": "Drop:",
"linked": "Pouze živě", "not_linked": "Nepropojeno",
"expired": "Ukončeno", "expired": "Ukončeno",
"excluded": "Vynecháno", "excluded": "Vynecháno",
"upcoming": "Nadcházející", "upcoming": "Nadcházející",
+1 -1
View File
@@ -107,7 +107,7 @@
"filter": { "filter": {
"name": "Фильтр", "name": "Фильтр",
"show": "Показать:", "show": "Показать:",
"linked": "Только связанные", "not_linked": "Не связано",
"upcoming": "Будущие", "upcoming": "Будущие",
"expired": "Прошедшие", "expired": "Прошедшие",
"excluded": "Исключенные", "excluded": "Исключенные",
+1 -1
View File
@@ -107,7 +107,7 @@
"filter": { "filter": {
"name": "Фільтри", "name": "Фільтри",
"show": "Показати тільки:", "show": "Показати тільки:",
"linked": "Зв'язані", "not_linked": "Не пов'язано",
"upcoming": "Наближаються", "upcoming": "Наближаються",
"expired": "Прострочені", "expired": "Прострочені",
"excluded": "Виключені", "excluded": "Виключені",
+1 -1
View File
@@ -107,7 +107,7 @@
"filter": { "filter": {
"name": "تصفية", "name": "تصفية",
"show": "عرض \u279C", "show": "عرض \u279C",
"linked": "المرتبطة فقط", "not_linked": "غير مرتبط",
"upcoming": "القادمة", "upcoming": "القادمة",
"expired": "المنتهية", "expired": "المنتهية",
"excluded": "المستبعدة", "excluded": "المستبعدة",
+1 -1
View File
@@ -107,7 +107,7 @@
"filter": { "filter": {
"name": "筛选", "name": "筛选",
"show": "掉宝活动:", "show": "掉宝活动:",
"linked": "仅已关联账户的游戏掉宝", "not_linked": "未链接",
"expired": "已结束", "expired": "已结束",
"excluded": "未添加的掉宝活动", "excluded": "未添加的掉宝活动",
"upcoming": "即将上线", "upcoming": "即将上线",
+1 -1
View File
@@ -107,7 +107,7 @@
"filter": { "filter": {
"name": "篩選", "name": "篩選",
"show": "掉寶活動:", "show": "掉寶活動:",
"linked": "僅顯示關聯帳號的遊戲掉寶", "not_linked": "未連結",
"expired": "已結束", "expired": "已結束",
"excluded": "未添加的掉寶活動", "excluded": "未添加的掉寶活動",
"upcoming": "即將開啟", "upcoming": "即將開啟",
+2 -2
View File
@@ -130,7 +130,7 @@ class GUIChannels(TypedDict):
class GUIInvFilter(TypedDict): class GUIInvFilter(TypedDict):
name: str name: str
show: str show: str
linked: str not_linked: str
upcoming: str upcoming: str
expired: str expired: str
excluded: str excluded: str
@@ -330,7 +330,7 @@ default_translation: Translation = {
"filter": { "filter": {
"name": "Filter", "name": "Filter",
"show": "Show:", "show": "Show:",
"linked": "Linked only", "not_linked": "Not linked",
"upcoming": "Upcoming", "upcoming": "Upcoming",
"expired": "Expired", "expired": "Expired",
"excluded": "Excluded", "excluded": "Excluded",