mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Load map icons directly from DCS.
If the user's DCS directory is not configured correctly this will degrade by not showing an icon. Otherwise (and typically) we get nicer looking icons for each theater, and we don't have to make these for each new map.
This commit is contained in:
@@ -63,16 +63,6 @@ def load_icons():
|
||||
|
||||
ICONS["Hangar"] = QPixmap("./resources/ui/misc/hangar.png")
|
||||
|
||||
ICONS["Terrain_Caucasus"] = QPixmap("./resources/ui/terrain_caucasus.gif")
|
||||
ICONS["Terrain_PersianGulf"] = QPixmap("./resources/ui/terrain_pg.gif")
|
||||
ICONS["Terrain_Nevada"] = QPixmap("./resources/ui/terrain_nevada.gif")
|
||||
ICONS["Terrain_Normandy"] = QPixmap("./resources/ui/terrain_normandy.gif")
|
||||
ICONS["Terrain_TheChannel"] = QPixmap("./resources/ui/terrain_channel.gif")
|
||||
ICONS["Terrain_Syria"] = QPixmap("./resources/ui/terrain_syria.gif")
|
||||
ICONS["Terrain_MarianaIslands"] = QPixmap("./resources/ui/terrain_marianas.gif")
|
||||
# TODO
|
||||
ICONS["Terrain_Falklands"] = QPixmap("./resources/ui/terrain_marianas.gif")
|
||||
|
||||
ICONS["Dawn"] = QPixmap("./resources/ui/conditions/timeofday/dawn.png")
|
||||
ICONS["Day"] = QPixmap("./resources/ui/conditions/timeofday/day.png")
|
||||
ICONS["Dusk"] = QPixmap("./resources/ui/conditions/timeofday/dusk.png")
|
||||
|
||||
@@ -4,18 +4,20 @@ from typing import Optional
|
||||
|
||||
from PySide2 import QtGui
|
||||
from PySide2.QtCore import QItemSelectionModel, QModelIndex, Qt
|
||||
from PySide2.QtGui import QStandardItem, QStandardItemModel
|
||||
from PySide2.QtGui import QPixmap, QStandardItem, QStandardItemModel
|
||||
from PySide2.QtWidgets import QAbstractItemView, QListView
|
||||
|
||||
import qt_ui.uiconstants as CONST
|
||||
from game.campaignloader.campaign import Campaign
|
||||
from qt_ui.liberation_install import get_dcs_install_directory
|
||||
|
||||
|
||||
class QCampaignItem(QStandardItem):
|
||||
def __init__(self, campaign: Campaign) -> None:
|
||||
super(QCampaignItem, self).__init__()
|
||||
self.setData(campaign, QCampaignList.CampaignRole)
|
||||
self.setIcon(QtGui.QIcon(CONST.ICONS[campaign.icon_name]))
|
||||
dcs_path = get_dcs_install_directory()
|
||||
icon_path = dcs_path / campaign.menu_thumbnail_dcs_relative_path
|
||||
self.setIcon(QtGui.QIcon(QPixmap(str(icon_path))))
|
||||
self.setEditable(False)
|
||||
if campaign.is_compatible:
|
||||
name = campaign.name
|
||||
|
||||
Reference in New Issue
Block a user