NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

colorThemes.py (5513B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\colorThemes.py
      2 import carbonui
      3 import localization
      4 from eve.common.lib import appConst
      5 
      6 class ColorTheme(object):
      7 
      8     def __init__(self, theme_id, name, tint, focus, focus_dark, accent, alert, omega_only = True):
      9         self._id = theme_id
     10         self._name = name
     11         self._tint = carbonui.Color.from_any(tint)
     12         self._focus = carbonui.Color.from_any(focus)
     13         self._focus_dark = carbonui.Color.from_any(focus_dark)
     14         self._accent = carbonui.Color.from_any(accent)
     15         self._alert = carbonui.Color.from_any(alert)
     16         self._omega_only = omega_only
     17 
     18     @property
     19     def id(self):
     20         return self._id
     21 
     22     @property
     23     def name(self):
     24         if callable(self._name):
     25             return self._name()
     26         return self._name
     27 
     28     @property
     29     def tint(self):
     30         return self._tint
     31 
     32     @property
     33     def focus(self):
     34         return self._focus
     35 
     36     @property
     37     def focus_dark(self):
     38         return self._focus_dark
     39 
     40     @property
     41     def accent(self):
     42         return self._accent
     43 
     44     @property
     45     def alert(self):
     46         return self._alert
     47 
     48     @property
     49     def is_preset(self):
     50         return self.id in COLOR_THEME_PRESET_BY_ID
     51 
     52     @property
     53     def omega_only(self):
     54         return self._omega_only
     55 
     56     def copy_with(self, theme_id = None, name = None, tint = None, focus = None, focus_dark = None, accent = None, alert = None):
     57         return ColorTheme(theme_id=theme_id if theme_id is not None else self.id, name=name if name is not None else self.name, tint=tint if tint is not None else self.tint, focus=focus if focus is not None else self.focus, focus_dark=focus_dark if focus_dark is not None else self.focus_dark, accent=accent if accent is not None else self.accent, alert=alert if alert is not None else self.alert)
     58 
     59     def __eq__(self, other):
     60         return isinstance(other, ColorTheme) and self.id == other.id and self.name == other.name and self.tint.hex_argb == other.tint.hex_argb and self.focus.hex_argb == other.focus.hex_argb and self.focus_dark.hex_argb == other.focus_dark.hex_argb and self.accent.hex_argb == other.accent.hex_argb and self.alert.hex_argb == other.alert.hex_argb
     61 
     62     def __ne__(self, other):
     63         return not self.__eq__(other)
     64 
     65     def __hash__(self):
     66         return hash(self._id)
     67 
     68     def __repr__(self):
     69         return u'ColorTheme(theme_id={!r}, name={!r}, tint={!r}, focus={!r}, focus_dark={!r}, accent={!r}, alert={!r})'.format(self.id, self.name, self.tint.hex_argb, self.focus.hex_argb, self.focus_dark.hex_argb, self.accent.hex_argb, self.alert.hex_argb)
     70 
     71 
     72 COLOR_THEME_PRESETS = (ColorTheme(theme_id='UI/ColorThemes/Photon', name=lambda : localization.GetByLabel('UI/ColorThemes/Photon'), tint='#060a0c', focus='#58A7BF', focus_dark='#305665', accent='#58A7BF', alert='#F39058', omega_only=False),
     73  ColorTheme(theme_id='UI/ColorThemes/Amarr', name=lambda : localization.GetByLabel('UI/ColorThemes/Amarr'), tint='#07030d', focus='#A38264', focus_dark='#7F6744', accent='#FFEE93', alert='#F39058', omega_only=False),
     74  ColorTheme(theme_id='UI/ColorThemes/Caldari', name=lambda : localization.GetByLabel('UI/ColorThemes/Caldari'), tint='#030e0e', focus='#9AD2E3', focus_dark='#5790A1', accent='#48C7BF', alert='#DC8C2E', omega_only=False),
     75  ColorTheme(theme_id='UI/ColorThemes/Gallente', name=lambda : localization.GetByLabel('UI/ColorThemes/Gallente'), tint='#0A090F', focus='#58BF9A', focus_dark='#479377', accent='#6DB09E', alert='#F39058', omega_only=False),
     76  ColorTheme(theme_id='UI/ColorThemes/Minmatar', name=lambda : localization.GetByLabel('UI/ColorThemes/Minmatar'), tint='#030909', focus='#D05C3B', focus_dark='#9D452D', accent='#9D452D', alert='#F39058', omega_only=False),
     77  ColorTheme(theme_id='UI/ColorThemes/ORE', name=lambda : localization.GetByLabel('UI/ColorThemes/ORE'), tint='#030805', focus='#DDB825', focus_dark='#8E7100', accent='#55999C', alert='#DE8B78'),
     78  ColorTheme(theme_id='UI/ColorThemes/SOE', name=lambda : localization.GetByLabel('UI/ColorThemes/SOE'), tint='#070d11', focus='#E55252', focus_dark='#853C3C', accent='#A1DDE0', alert='#C0B337'),
     79  ColorTheme(theme_id='UI/ColorThemes/Carbon', name=lambda : localization.GetByLabel('UI/ColorThemes/Carbon'), tint='#000000', focus='#e5e5e5', focus_dark='#4d4d4d', accent='#e0e0e0', alert='#F39058'))
     80 COLOR_THEME_PRESET_BY_ID = {theme.id:theme for theme in COLOR_THEME_PRESETS}
     81 DEFAULT_COLORTHEMEID = 'UI/ColorThemes/Photon'
     82 ALPHA_COLORTHEMEID = 'UI/ColorThemes/Photon'
     83 COLOR_THEME_ID_BY_RACE = {appConst.raceCaldari: 'UI/ColorThemes/Caldari',
     84  appConst.raceMinmatar: 'UI/ColorThemes/Minmatar',
     85  appConst.raceAmarr: 'UI/ColorThemes/Amarr',
     86  appConst.raceGallente: 'UI/ColorThemes/Gallente'}
     87 COLOR_THEME_ID_BY_FACTION = {appConst.factionAmarrEmpire: 'UI/ColorThemes/Amarr',
     88  appConst.factionCaldariState: 'UI/ColorThemes/Caldari',
     89  appConst.factionGallenteFederation: 'UI/ColorThemes/Gallente',
     90  appConst.factionMinmatarRepublic: 'UI/ColorThemes/Minmatar',
     91  appConst.factionORE: 'UI/ColorThemes/ORE',
     92  appConst.factionGuristasPirates: 'UI/ColorThemes/Guristas',
     93  appConst.factionSanshasNation: 'UI/ColorThemes/SanshasNation',
     94  appConst.factionTheBloodRaiderCovenant: 'UI/ColorThemes/BloodRaiders',
     95  appConst.factionAngelCartel: 'UI/ColorThemes/AngelCartel',
     96  appConst.factionSerpentis: 'UI/ColorThemes/Serpentis',
     97  appConst.factionSistersOfEVE: 'UI/ColorThemes/SOE',
     98  appConst.factionMordusLegion: 'UI/ColorThemes/MordusLegion'}