feat: added egs badge
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
This commit is contained in:
parent
768d437dda
commit
a31c9dc186
@ -156,6 +156,20 @@ class GameCard(QFrame):
|
|||||||
steam_visible = (str(steam_game).lower() == "true")
|
steam_visible = (str(steam_game).lower() == "true")
|
||||||
self.steamLabel.setVisible(steam_visible)
|
self.steamLabel.setVisible(steam_visible)
|
||||||
|
|
||||||
|
# Epic Games Store бейдж
|
||||||
|
egs_icon = self.theme_manager.get_icon("steam")
|
||||||
|
self.egsLabel = ClickableLabel(
|
||||||
|
"Epic Games",
|
||||||
|
icon=egs_icon,
|
||||||
|
parent=coverWidget,
|
||||||
|
icon_size=16,
|
||||||
|
icon_space=5,
|
||||||
|
)
|
||||||
|
self.egsLabel.setStyleSheet(self.theme.STEAM_BADGE_STYLE)
|
||||||
|
self.egsLabel.setFixedWidth(int(card_width * 2/3)) # Устанавливаем ширину в 2/3 ширины карточки
|
||||||
|
egs_visible = (str(steam_game).lower() == "epic")
|
||||||
|
self.egsLabel.setVisible(egs_visible)
|
||||||
|
|
||||||
# WeAntiCheatYet бейдж
|
# WeAntiCheatYet бейдж
|
||||||
anticheat_text = self.getAntiCheatText(anticheat_status)
|
anticheat_text = self.getAntiCheatText(anticheat_status)
|
||||||
if anticheat_text:
|
if anticheat_text:
|
||||||
@ -187,6 +201,11 @@ class GameCard(QFrame):
|
|||||||
steam_x = card_width - badge_width - right_margin
|
steam_x = card_width - badge_width - right_margin
|
||||||
self.steamLabel.move(steam_x, top_y)
|
self.steamLabel.move(steam_x, top_y)
|
||||||
badge_y_positions.append(top_y + self.steamLabel.height())
|
badge_y_positions.append(top_y + self.steamLabel.height())
|
||||||
|
if egs_visible:
|
||||||
|
egs_x = card_width - badge_width - right_margin
|
||||||
|
egs_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y
|
||||||
|
self.egsLabel.move(egs_x, egs_y)
|
||||||
|
badge_y_positions.append(egs_y + self.egsLabel.height())
|
||||||
if protondb_visible:
|
if protondb_visible:
|
||||||
protondb_x = card_width - badge_width - right_margin
|
protondb_x = card_width - badge_width - right_margin
|
||||||
protondb_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y
|
protondb_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y
|
||||||
@ -199,6 +218,7 @@ class GameCard(QFrame):
|
|||||||
|
|
||||||
self.anticheatLabel.raise_()
|
self.anticheatLabel.raise_()
|
||||||
self.protondbLabel.raise_()
|
self.protondbLabel.raise_()
|
||||||
|
self.egsLabel.raise_()
|
||||||
self.steamLabel.raise_()
|
self.steamLabel.raise_()
|
||||||
self.protondbLabel.clicked.connect(self.open_protondb_report)
|
self.protondbLabel.clicked.connect(self.open_protondb_report)
|
||||||
self.steamLabel.clicked.connect(self.open_steam_page)
|
self.steamLabel.clicked.connect(self.open_steam_page)
|
||||||
@ -219,16 +239,16 @@ class GameCard(QFrame):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getAntiCheatText(status: str) -> str:
|
def getAntiCheatText(status: str) -> str:
|
||||||
if not status:
|
if not status:
|
||||||
return ""
|
return ""
|
||||||
translations = {
|
translations = {
|
||||||
"supported": _("Supported"),
|
"supported": _("Supported"),
|
||||||
"running": _("Running"),
|
"running": _("Running"),
|
||||||
"planned": _("Planned"),
|
"planned": _("Planned"),
|
||||||
"broken": _("Broken"),
|
"broken": _("Broken"),
|
||||||
"denied": _("Denied")
|
"denied": _("Denied")
|
||||||
}
|
}
|
||||||
return translations.get(status.lower(), "")
|
return translations.get(status.lower(), "")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def getAntiCheatIconFilename(status: str) -> str:
|
def getAntiCheatIconFilename(status: str) -> str:
|
||||||
@ -273,9 +293,9 @@ class GameCard(QFrame):
|
|||||||
QDesktopServices.openUrl(url)
|
QDesktopServices.openUrl(url)
|
||||||
|
|
||||||
def open_weanticheatyet_page(self):
|
def open_weanticheatyet_page(self):
|
||||||
formatted_name = self.name.lower().replace(" ", "-")
|
formatted_name = self.name.lower().replace(" ", "-")
|
||||||
url = QUrl(f"https://areweanticheatyet.com/game/{formatted_name}")
|
url = QUrl(f"https://areweanticheatyet.com/game/{formatted_name}")
|
||||||
QDesktopServices.openUrl(url)
|
QDesktopServices.openUrl(url)
|
||||||
|
|
||||||
def update_favorite_icon(self):
|
def update_favorite_icon(self):
|
||||||
if self.is_favorite:
|
if self.is_favorite:
|
||||||
|
@ -1432,6 +1432,20 @@ class MainWindow(QMainWindow):
|
|||||||
steamLabel.setVisible(steam_visible)
|
steamLabel.setVisible(steam_visible)
|
||||||
steamLabel.clicked.connect(lambda: QDesktopServices.openUrl(QUrl(f"https://steamcommunity.com/app/{appid}")))
|
steamLabel.clicked.connect(lambda: QDesktopServices.openUrl(QUrl(f"https://steamcommunity.com/app/{appid}")))
|
||||||
|
|
||||||
|
# Epic Games Store бейдж
|
||||||
|
egs_icon = self.theme_manager.get_icon("steam")
|
||||||
|
egsLabel = ClickableLabel(
|
||||||
|
"Epic Games",
|
||||||
|
icon=egs_icon,
|
||||||
|
parent=coverFrame,
|
||||||
|
icon_size=16,
|
||||||
|
icon_space=5,
|
||||||
|
)
|
||||||
|
egsLabel.setStyleSheet(self.theme.STEAM_BADGE_STYLE)
|
||||||
|
egsLabel.setFixedWidth(badge_width)
|
||||||
|
egs_visible = (str(steam_game).lower() == "epic")
|
||||||
|
egsLabel.setVisible(egs_visible)
|
||||||
|
|
||||||
# WeAntiCheatYet бейдж
|
# WeAntiCheatYet бейдж
|
||||||
anticheat_text = GameCard.getAntiCheatText(anticheat_status)
|
anticheat_text = GameCard.getAntiCheatText(anticheat_status)
|
||||||
if anticheat_text:
|
if anticheat_text:
|
||||||
@ -1459,6 +1473,11 @@ class MainWindow(QMainWindow):
|
|||||||
steam_x = 300 - badge_width - right_margin
|
steam_x = 300 - badge_width - right_margin
|
||||||
steamLabel.move(steam_x, top_y)
|
steamLabel.move(steam_x, top_y)
|
||||||
badge_y_positions.append(top_y + steamLabel.height())
|
badge_y_positions.append(top_y + steamLabel.height())
|
||||||
|
if egs_visible:
|
||||||
|
egs_x = 300 - badge_width - right_margin
|
||||||
|
egs_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y
|
||||||
|
egsLabel.move(egs_x, egs_y)
|
||||||
|
badge_y_positions.append(egs_y + egsLabel.height())
|
||||||
if protondb_visible:
|
if protondb_visible:
|
||||||
protondb_x = 300 - badge_width - right_margin
|
protondb_x = 300 - badge_width - right_margin
|
||||||
protondb_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y
|
protondb_y = badge_y_positions[-1] + badge_spacing if badge_y_positions else top_y
|
||||||
|
Loading…
x
Reference in New Issue
Block a user