Compare commits
3 Commits
e3fbe22ac0
...
ec3db0e1f2
Author | SHA1 | Date | |
---|---|---|---|
ec3db0e1f2 | |||
de3989dfbc | |||
a930cbd705 |
@ -9,7 +9,6 @@
|
||||
- Кнопки сброса настроек и очистки кэша
|
||||
- Начальная интеграция с EGS с помощью [Legendary](https://github.com/derrod/legendary)
|
||||
- Зависимость на `xdg-utils`
|
||||
- Установка ширины бейджа в две трети ширины карточки
|
||||
- Интеграция статуса WeAntiCheatYet в карточку
|
||||
- Стили в AddGameDialog
|
||||
- Переключение полноэкранного режима через F11
|
||||
@ -22,7 +21,6 @@
|
||||
- Пункт в контекстное меню "Удалить из Steam”
|
||||
- Метод сортировки сначала избранное
|
||||
- Авто сборки для тестирования
|
||||
- Благодарности контрибьюторам в README
|
||||
|
||||
### Changed
|
||||
- Обновлены все иконки
|
||||
@ -31,6 +29,8 @@
|
||||
- Бейдж Steam теперь открывает Steam Community
|
||||
- Изменена лицензия с MIT на GPL-3.0 для совместимости с кодом от legendary
|
||||
- Оптимизирована генерация карточек для предотвращения лагов при поиске и изменения размера окна
|
||||
- Бейджи с карточек так же теперь дублируются и на странице с деталями, а не только в библиотеке
|
||||
- Установка ширины бейджа в две трети ширины карточки
|
||||
|
||||
### Fixed
|
||||
- Обработка несуществующей темы с возвратом к “standart”
|
||||
|
@ -35,7 +35,7 @@
|
||||
- [X] Добавить в карточку игры сведения о поддержке геймадов
|
||||
- [X] Добавить в карточки данные с ProtonDB
|
||||
- [X] Добавить в карточки данные с Are We Anti-Cheat Yet?
|
||||
- [ ] Продублировать бейджы с карточки на страницу с деталями игрыы
|
||||
- [X] Продублировать бейджы с карточки на страницу с деталями игрыы
|
||||
- [X] Добавить парсинг ярлыков со Steam
|
||||
- [X] Добавить парсинг ярлыков с EGS
|
||||
- [ ] Избавится от бинарника legendary
|
||||
|
@ -217,7 +217,8 @@ class GameCard(QFrame):
|
||||
if self.context_menu_manager:
|
||||
self.context_menu_manager.show_context_menu(self, pos)
|
||||
|
||||
def getAntiCheatText(self, status):
|
||||
@staticmethod
|
||||
def getAntiCheatText(status: str) -> str:
|
||||
if not status:
|
||||
return ""
|
||||
translations = {
|
||||
@ -229,7 +230,8 @@ class GameCard(QFrame):
|
||||
}
|
||||
return translations.get(status.lower(), "")
|
||||
|
||||
def getAntiCheatIconFilename(self, status):
|
||||
@staticmethod
|
||||
def getAntiCheatIconFilename(status: str) -> str:
|
||||
status = status.lower()
|
||||
if status in ("supported", "running"):
|
||||
return "platinum-gold"
|
||||
@ -237,7 +239,8 @@ class GameCard(QFrame):
|
||||
return "broken"
|
||||
return ""
|
||||
|
||||
def getProtonDBText(self, tier):
|
||||
@staticmethod
|
||||
def getProtonDBText(tier: str) -> str:
|
||||
if not tier:
|
||||
return ""
|
||||
translations = {
|
||||
@ -250,7 +253,8 @@ class GameCard(QFrame):
|
||||
}
|
||||
return translations.get(tier.lower(), "")
|
||||
|
||||
def getProtonDBIconFilename(self, tier):
|
||||
@staticmethod
|
||||
def getProtonDBIconFilename(tier: str) -> str:
|
||||
tier = tier.lower()
|
||||
if tier in ("platinum", "gold"):
|
||||
return "platinum-gold"
|
||||
@ -451,7 +455,8 @@ class GameCard(QFrame):
|
||||
self.last_launch,
|
||||
self.formatted_playtime,
|
||||
self.protondb_tier,
|
||||
self.steam_game
|
||||
self.steam_game,
|
||||
self.anticheat_status
|
||||
)
|
||||
super().mousePressEvent(event)
|
||||
|
||||
@ -467,7 +472,8 @@ class GameCard(QFrame):
|
||||
self.last_launch,
|
||||
self.formatted_playtime,
|
||||
self.protondb_tier,
|
||||
self.steam_game
|
||||
self.steam_game,
|
||||
self.anticheat_status
|
||||
)
|
||||
else:
|
||||
super().keyPressEvent(event)
|
||||
|
@ -1320,7 +1320,7 @@ class MainWindow(QMainWindow):
|
||||
def darkenColor(self, color, factor=200):
|
||||
return color.darker(factor)
|
||||
|
||||
def openGameDetailPage(self, name, description, cover_path=None, appid="", exec_line="", controller_support="", last_launch="", formatted_playtime="", protondb_tier="", steam_game=""):
|
||||
def openGameDetailPage(self, name, description, cover_path=None, appid="", exec_line="", controller_support="", last_launch="", formatted_playtime="", protondb_tier="", steam_game="", anticheat_status=""):
|
||||
detailPage = QWidget()
|
||||
self._animations = {}
|
||||
imageLabel = QLabel()
|
||||
@ -1375,7 +1375,7 @@ class MainWindow(QMainWindow):
|
||||
|
||||
coverLayout.addWidget(imageLabel)
|
||||
|
||||
# Добавляем значок избранного поверх обложки в левом верхнем углу
|
||||
# Значок избранного
|
||||
favoriteLabelCover = ClickableLabel(coverFrame)
|
||||
favoriteLabelCover.setFixedSize(*self.theme.favoriteLabelSize)
|
||||
favoriteLabelCover.setStyleSheet(self.theme.FAVORITE_LABEL_STYLE)
|
||||
@ -1388,6 +1388,91 @@ class MainWindow(QMainWindow):
|
||||
favoriteLabelCover.move(8, 8)
|
||||
favoriteLabelCover.raise_()
|
||||
|
||||
# Добавляем бейджи (ProtonDB, Steam, WeAntiCheatYet)
|
||||
right_margin = 8
|
||||
badge_spacing = 5
|
||||
top_y = 10
|
||||
badge_y_positions = []
|
||||
badge_width = int(300 * 2/3) # 2/3 ширины обложки (300 px)
|
||||
|
||||
# ProtonDB бейдж
|
||||
protondb_text = GameCard.getProtonDBText(protondb_tier)
|
||||
if protondb_text:
|
||||
icon_filename = GameCard.getProtonDBIconFilename(protondb_tier)
|
||||
icon = self.theme_manager.get_icon(icon_filename, self.current_theme_name)
|
||||
protondbLabel = ClickableLabel(
|
||||
protondb_text,
|
||||
icon=icon,
|
||||
parent=coverFrame,
|
||||
icon_size=16,
|
||||
icon_space=3,
|
||||
)
|
||||
protondbLabel.setStyleSheet(self.theme.get_protondb_badge_style(protondb_tier))
|
||||
protondbLabel.setFixedWidth(badge_width)
|
||||
protondbLabel.clicked.connect(lambda: QDesktopServices.openUrl(QUrl(f"https://www.protondb.com/app/{appid}")))
|
||||
protondb_visible = True
|
||||
else:
|
||||
protondbLabel = ClickableLabel("", parent=coverFrame, icon_size=16, icon_space=3)
|
||||
protondbLabel.setFixedWidth(badge_width)
|
||||
protondbLabel.setVisible(False)
|
||||
protondb_visible = False
|
||||
|
||||
# Steam бейдж
|
||||
steam_icon = self.theme_manager.get_icon("steam")
|
||||
steamLabel = ClickableLabel(
|
||||
"Steam",
|
||||
icon=steam_icon,
|
||||
parent=coverFrame,
|
||||
icon_size=16,
|
||||
icon_space=5,
|
||||
)
|
||||
steamLabel.setStyleSheet(self.theme.STEAM_BADGE_STYLE)
|
||||
steamLabel.setFixedWidth(badge_width)
|
||||
steam_visible = (str(steam_game).lower() == "true")
|
||||
steamLabel.setVisible(steam_visible)
|
||||
steamLabel.clicked.connect(lambda: QDesktopServices.openUrl(QUrl(f"https://steamcommunity.com/app/{appid}")))
|
||||
|
||||
# WeAntiCheatYet бейдж
|
||||
anticheat_text = GameCard.getAntiCheatText(anticheat_status)
|
||||
if anticheat_text:
|
||||
icon_filename = GameCard.getAntiCheatIconFilename(anticheat_status)
|
||||
icon = self.theme_manager.get_icon(icon_filename, self.current_theme_name)
|
||||
anticheatLabel = ClickableLabel(
|
||||
anticheat_text,
|
||||
icon=icon,
|
||||
parent=coverFrame,
|
||||
icon_size=16,
|
||||
icon_space=3,
|
||||
)
|
||||
anticheatLabel.setStyleSheet(self.theme.STEAM_BADGE_STYLE)
|
||||
anticheatLabel.setFixedWidth(badge_width)
|
||||
anticheatLabel.clicked.connect(lambda: QDesktopServices.openUrl(QUrl(f"https://areweanticheatyet.com/game/{name.lower().replace(' ', '-')}")))
|
||||
anticheat_visible = True
|
||||
else:
|
||||
anticheatLabel = ClickableLabel("", parent=coverFrame, icon_size=16, icon_space=3)
|
||||
anticheatLabel.setFixedWidth(badge_width)
|
||||
anticheatLabel.setVisible(False)
|
||||
anticheat_visible = False
|
||||
|
||||
# Расположение бейджей
|
||||
if steam_visible:
|
||||
steam_x = 300 - badge_width - right_margin
|
||||
steamLabel.move(steam_x, top_y)
|
||||
badge_y_positions.append(top_y + steamLabel.height())
|
||||
if protondb_visible:
|
||||
protondb_x = 300 - badge_width - right_margin
|
||||
protondb_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y
|
||||
protondbLabel.move(protondb_x, protondb_y)
|
||||
badge_y_positions.append(protondb_y + protondbLabel.height())
|
||||
if anticheat_visible:
|
||||
anticheat_x = 300 - badge_width - right_margin
|
||||
anticheat_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y
|
||||
anticheatLabel.move(anticheat_x, anticheat_y)
|
||||
|
||||
anticheatLabel.raise_()
|
||||
protondbLabel.raise_()
|
||||
steamLabel.raise_()
|
||||
|
||||
contentFrameLayout.addWidget(coverFrame)
|
||||
|
||||
# Детали игры (справа)
|
||||
|
Loading…
x
Reference in New Issue
Block a user