OSDN Git Service
(root)
/
kcd
/
KCD.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0a39841
)
ColorSetを変更
author
masakih
<masakih@users.sourceforge.jp>
Mon, 2 Jul 2018 12:20:42 +0000
(21:20 +0900)
committer
masakih
<masakih@users.sourceforge.jp>
Mon, 2 Jul 2018 12:20:42 +0000
(21:20 +0900)
KCD/AirPlanInfoView.swift
patch
|
blob
|
history
KCD/ColorSet.swift
patch
|
blob
|
history
KCD/DamageView.swift
patch
|
blob
|
history
KCD/SlotItemLevelView.swift
patch
|
blob
|
history
KCD/SuppliesCell.swift
patch
|
blob
|
history
diff --git
a/KCD/AirPlanInfoView.swift
b/KCD/AirPlanInfoView.swift
index
f4d9edb
..
e1a1b15
100644
(file)
--- a/
KCD/AirPlanInfoView.swift
+++ b/
KCD/AirPlanInfoView.swift
@@
-61,11
+61,11
@@
final class AirPlanInfoView: NSTableCellView {
switch cond {
switch cond {
- case .normal: return ColorSet.current[.airPlanInforViewNormal]
+ case .normal: return ColorSet
Manager
.current[.airPlanInforViewNormal]
- case .tired: return ColorSet.current[.airPlanInforViewTired]
+ case .tired: return ColorSet
Manager
.current[.airPlanInforViewTired]
- case .bad: return ColorSet.current[.airPlanInforViewBad]
+ case .bad: return ColorSet
Manager
.current[.airPlanInforViewBad]
}
}
}
}
@@
-74,11
+74,11
@@
final class AirPlanInfoView: NSTableCellView {
switch cond {
switch cond {
- case .normal: return ColorSet.current[.airPlanInforViewBoarderNormal]
+ case .normal: return ColorSet
Manager
.current[.airPlanInforViewBoarderNormal]
- case .tired: return ColorSet.current[.airPlanInforViewBoarderTired]
+ case .tired: return ColorSet
Manager
.current[.airPlanInforViewBoarderTired]
- case .bad: return ColorSet.current[.airPlanInforViewBoarderBad]
+ case .bad: return ColorSet
Manager
.current[.airPlanInforViewBoarderBad]
}
}
}
}
diff --git
a/KCD/ColorSet.swift
b/KCD/ColorSet.swift
index
3ddaccc
..
1050ac9
100644
(file)
--- a/
KCD/ColorSet.swift
+++ b/
KCD/ColorSet.swift
@@
-65,7
+65,13
@@
extension ColorName {
static let slotItemLevelViewHighAirLevelShadow = ColorName("SlotItemLevelView.airLevel.high.shadow")
}
static let slotItemLevelViewHighAirLevelShadow = ColorName("SlotItemLevelView.airLevel.high.shadow")
}
-class ColorSet {
+protocol ColorSet {
+
+ subscript(named: ColorName) -> NSColor { get }
+}
+
+
+struct ColorSetManager {
static var current: ColorSet {
static var current: ColorSet {
@@
-74,12
+80,13
@@
class ColorSet {
return HighContrastColorSet.shared
}
return HighContrastColorSet.shared
}
- return ColorSet.shared
+ return
Default
ColorSet.shared
}
}
+}
+
+private struct DefaultColorSet: ColorSet {
- class var shared: ColorSet { return _shared }
-
- private static let _shared = ColorSet()
+ static let shared = DefaultColorSet()
subscript(named: ColorName) -> NSColor {
subscript(named: ColorName) -> NSColor {
@@
-141,13
+148,12
@@
class ColorSet {
}
}
-
class
HighContrastColorSet: ColorSet {
+
private struct
HighContrastColorSet: ColorSet {
- override class var shared: ColorSet { return _shared }
-
private static let _
shared = HighContrastColorSet()
+
static let
shared = HighContrastColorSet()
-
override
subscript(named: ColorName) -> NSColor {
+ subscript(named: ColorName) -> NSColor {
switch named {
switch named {
@@
-157,22
+163,20
@@
class HighContrastColorSet: ColorSet {
case .damageViewBoarderBadly: return .red
case .damageViewBoarderBadly: return .red
- default: return
super
[named]
+ default: return
DefaultColorSet.shared
[named]
}
}
}
}
}
}
-
class
DarkModeColorSet: ColorSet {
+
private struct
DarkModeColorSet: ColorSet {
- override class var shared: ColorSet { return _shared }
+ private static let shared = DarkModeColorSet()
- private static let _shared = DarkModeColorSet()
-
- override subscript(named: ColorName) -> NSColor {
+ subscript(named: ColorName) -> NSColor {
switch named {
switch named {
- default: return
super
[named]
+ default: return
DefaultColorSet.shared
[named]
}
}
}
}
}
}
diff --git
a/KCD/DamageView.swift
b/KCD/DamageView.swift
index
5ff47c9
..
5f5e076
100644
(file)
--- a/
KCD/DamageView.swift
+++ b/
KCD/DamageView.swift
@@
-46,11
+46,11
@@
final class DamageView: NSView {
case .none: return nil
case .none: return nil
- case .slightly: return ColorSet.current[.damageViewInnerSlightly]
+ case .slightly: return ColorSet
Manager
.current[.damageViewInnerSlightly]
- case .modest: return ColorSet.current[.damageViewInnerModest]
+ case .modest: return ColorSet
Manager
.current[.damageViewInnerModest]
- case .badly: return ColorSet.current[.damageViewInnerBadly]
+ case .badly: return ColorSet
Manager
.current[.damageViewInnerBadly]
}
}
}
}
@@
-61,11
+61,11
@@
final class DamageView: NSView {
case .none: return nil
case .none: return nil
- case .slightly: return ColorSet.current[.damageViewBoarderSlightly]
+ case .slightly: return ColorSet
Manager
.current[.damageViewBoarderSlightly]
- case .modest: return ColorSet.current[.damageViewBoarderModest]
+ case .modest: return ColorSet
Manager
.current[.damageViewBoarderModest]
- case .badly: return ColorSet.current[.damageViewBoarderBadly]
+ case .badly: return ColorSet
Manager
.current[.damageViewBoarderBadly]
}
}
}
}
diff --git
a/KCD/SlotItemLevelView.swift
b/KCD/SlotItemLevelView.swift
index
3ac3c98
..
9560138
100644
(file)
--- a/
KCD/SlotItemLevelView.swift
+++ b/
KCD/SlotItemLevelView.swift
@@
-213,7
+213,7
@@
final class SlotItemLevelView: NSTextField {
private var levelColor: NSColor {
private var levelColor: NSColor {
- return ColorSet.current[.slotItemLevelViewLevel]
+ return ColorSet
Manager
.current[.slotItemLevelViewLevel]
}
}
@@
-264,9
+264,9
@@
final class SlotItemLevelView: NSTextField {
switch level {
switch level {
- case 1, 2, 3: return ColorSet.current[.slotItemLevelViewLowAirLevel]
+ case 1, 2, 3: return ColorSet
Manager
.current[.slotItemLevelViewLowAirLevel]
- case 4, 5, 6, 7: return ColorSet.current[.slotItemLevelViewHighAirLevel]
+ case 4, 5, 6, 7: return ColorSet
Manager
.current[.slotItemLevelViewHighAirLevel]
default: return nil
default: return nil
@@
-279,14
+279,14
@@
final class SlotItemLevelView: NSTextField {
case 1, 2, 3:
let shadow = NSShadow()
case 1, 2, 3:
let shadow = NSShadow()
- shadow.shadowColor = ColorSet.current[.slotItemLevelViewLowAirLevelShadow]
+ shadow.shadowColor = ColorSet
Manager
.current[.slotItemLevelViewLowAirLevelShadow]
shadow.shadowBlurRadius = 4.0
return shadow
case 4, 5, 6, 7:
let shadow = NSShadow()
shadow.shadowBlurRadius = 4.0
return shadow
case 4, 5, 6, 7:
let shadow = NSShadow()
- shadow.shadowColor = ColorSet.current[.slotItemLevelViewHighAirLevelShadow]
+ shadow.shadowColor = ColorSet
Manager
.current[.slotItemLevelViewHighAirLevelShadow]
shadow.shadowBlurRadius = 3.0
return shadow
shadow.shadowBlurRadius = 3.0
return shadow
diff --git
a/KCD/SuppliesCell.swift
b/KCD/SuppliesCell.swift
index
be3b53b
..
7632604
100644
(file)
--- a/
KCD/SuppliesCell.swift
+++ b/
KCD/SuppliesCell.swift
@@
-21,27
+21,27
@@
final class SuppliesCell: NSCell {
private var greenColor: NSColor {
private var greenColor: NSColor {
- return ColorSet.current[.suppliesCellGreen]
+ return ColorSet
Manager
.current[.suppliesCellGreen]
}
private var yellowColor: NSColor {
}
private var yellowColor: NSColor {
- return ColorSet.current[.suppliesCellYellow]
+ return ColorSet
Manager
.current[.suppliesCellYellow]
}
private var orangeColor: NSColor {
}
private var orangeColor: NSColor {
- return ColorSet.current[.suppliesCellOrange]
+ return ColorSet
Manager
.current[.suppliesCellOrange]
}
private var redColor: NSColor {
}
private var redColor: NSColor {
- return ColorSet.current[.suppliesCellRedColor]
+ return ColorSet
Manager
.current[.suppliesCellRedColor]
}
private var borderColor: NSColor {
}
private var borderColor: NSColor {
- return ColorSet.current[.suppliesCellBorder]
+ return ColorSet
Manager
.current[.suppliesCellBorder]
}
private var backgroundColor: NSColor {
}
private var backgroundColor: NSColor {
- return ColorSet.current[.suppliesCellBackground]
+ return ColorSet
Manager
.current[.suppliesCellBackground]
}
@objc dynamic var ship: Ship?
}
@objc dynamic var ship: Ship?