OSDN Git Service

カラーセットを使用するように
authormasakih <masakih@users.sourceforge.jp>
Sun, 1 Jul 2018 00:14:32 +0000 (09:14 +0900)
committermasakih <masakih@users.sourceforge.jp>
Sun, 1 Jul 2018 00:14:32 +0000 (09:14 +0900)
KCD/AirPlanInfoView.swift
KCD/BattleCommand.swift
KCD/DamageView.swift
KCD/SlotItemLevelView.swift
KCD/SuppliesCell.swift

index 5fc63a8..f4d9edb 100644 (file)
@@ -61,11 +61,11 @@ final class AirPlanInfoView: NSTableCellView {
         
         switch cond {
             
-        case .normal: return .clear
+        case .normal: return ColorSet.current[.airPlanInforViewNormal]
             
-        case .tired: return #colorLiteral(red: 1, green: 0.7233425379, blue: 0.1258574128, alpha: 0.8239436619)
+        case .tired: return ColorSet.current[.airPlanInforViewTired]
             
-        case .bad: return #colorLiteral(red: 0.7320367694, green: 0.07731548697, blue: 0.06799335033, alpha: 1)
+        case .bad: return ColorSet.current[.airPlanInforViewBad]
             
         }
     }
@@ -74,11 +74,11 @@ final class AirPlanInfoView: NSTableCellView {
         
         switch cond {
             
-        case .normal: return .clear
+        case .normal: return ColorSet.current[.airPlanInforViewBoarderNormal]
             
-        case .tired: return #colorLiteral(red: 0.458858192, green: 0.3335277438, blue: 0.07979661971, alpha: 1)
+        case .tired: return ColorSet.current[.airPlanInforViewBoarderTired]
             
-        case .bad: return #colorLiteral(red: 0.5462518334, green: 0.04599834234, blue: 0.04913448542, alpha: 1)
+        case .bad: return ColorSet.current[.airPlanInforViewBoarderBad]
             
         }
     }
index 5b72fd6..f51ca70 100644 (file)
@@ -26,8 +26,8 @@ final class BattleCommand: JSONCommand {
             DummyShipCommand(apiResponse: apiResponse).execute()
             GuardShelterCommand(apiResponse: apiResponse).execute()
             
-        default: break
-            
+        default:
+            EnemyStatusCommand(apiResponse: apiResponse).execute()
         }
     }
 }
index 1486174..5ff47c9 100644 (file)
@@ -44,44 +44,28 @@ final class DamageView: NSView {
         
         switch innerDamageType {
             
-        case .none:
-            
-            return nil
-            
-        case .slightly:
+        case .none: return nil
             
-            return #colorLiteral(red: 1.000, green: 0.956, blue: 0.012, alpha: 0.5)
+        case .slightly: return ColorSet.current[.damageViewInnerSlightly]
             
-        case .modest:
-            
-            return NSColor.orange.withAlphaComponent(0.5)
+        case .modest: return ColorSet.current[.damageViewInnerModest]
             
-        case .badly:
-            
-            return NSColor.red.withAlphaComponent(0.5)
+        case .badly: return ColorSet.current[.damageViewInnerBadly]
             
         }
     }
     
     private var borderColor: NSColor? {
-        
+                
         switch innerDamageType {
             
-        case .none:
-            
-            return nil
-            
-        case .slightly:
-            
-            return NSColor.orange.withAlphaComponent(0.5)
+        case .none: return nil
             
-        case .modest:
+        case .slightly: return ColorSet.current[.damageViewBoarderSlightly]
             
-            return NSColor.orange.withAlphaComponent(0.9)
-            
-        case .badly:
+        case .modest: return ColorSet.current[.damageViewBoarderModest]
             
-            return NSColor.red.withAlphaComponent(0.9)
+        case .badly: return ColorSet.current[.damageViewBoarderBadly]
             
         }
     }
index 7511771..3ac3c98 100644 (file)
@@ -213,7 +213,9 @@ final class SlotItemLevelView: NSTextField {
     
     private var levelColor: NSColor {
         
-        return #colorLiteral(red: 0.135, green: 0.522, blue: 0.619, alpha: 1)
+        return ColorSet.current[.slotItemLevelViewLevel]
+        
+        
     }
     
     // MARK: - Function
@@ -262,9 +264,9 @@ final class SlotItemLevelView: NSTextField {
         
         switch level {
             
-        case 1, 2, 3: return #colorLiteral(red: 0.257, green: 0.523, blue: 0.643, alpha: 1)
+        case 1, 2, 3: return ColorSet.current[.slotItemLevelViewLowAirLevel]
             
-        case 4, 5, 6, 7: return #colorLiteral(red: 0.784, green: 0.549, blue: 0.000, alpha: 1)
+        case 4, 5, 6, 7: return ColorSet.current[.slotItemLevelViewHighAirLevel]
             
         default: return nil
             
@@ -277,14 +279,14 @@ final class SlotItemLevelView: NSTextField {
             
         case 1, 2, 3:
             let shadow = NSShadow()
-            shadow.shadowColor = #colorLiteral(red: 0.095, green: 0.364, blue: 0.917, alpha: 1)
+            shadow.shadowColor = ColorSet.current[.slotItemLevelViewLowAirLevelShadow]
             shadow.shadowBlurRadius = 4.0
             
             return shadow
             
         case 4, 5, 6, 7:
             let shadow = NSShadow()
-            shadow.shadowColor = .yellow
+            shadow.shadowColor = ColorSet.current[.slotItemLevelViewHighAirLevelShadow]
             shadow.shadowBlurRadius = 3.0
             
             return shadow
index d3e1adf..be3b53b 100644 (file)
@@ -18,12 +18,31 @@ final class SuppliesCell: NSCell {
     }
     
     private let numberOfCell = 10
-    private let greenColor = NSColor(calibratedWhite: 0.39, alpha: 1.0)
-    private let yellowColor = NSColor(calibratedWhite: 0.55, alpha: 1.0)
-    private let orangeColor = NSColor(calibratedWhite: 0.7, alpha: 1.0)
-    private let redColor = NSColor(calibratedWhite: 0.79, alpha: 1.0)
-    private let borderColor = NSColor(calibratedWhite: 0.632, alpha: 1.0)
-    private let backgroundColor = NSColor(calibratedWhite: 0.948, alpha: 1.0)
+    
+    private var greenColor: NSColor {
+        
+        return ColorSet.current[.suppliesCellGreen]
+    }
+    private var yellowColor: NSColor {
+        
+        return ColorSet.current[.suppliesCellYellow]
+    }
+    private var orangeColor: NSColor {
+        
+        return ColorSet.current[.suppliesCellOrange]
+    }
+    private var redColor: NSColor {
+        
+        return ColorSet.current[.suppliesCellRedColor]
+    }
+    private var borderColor: NSColor {
+        
+        return ColorSet.current[.suppliesCellBorder]
+    }
+    private var backgroundColor: NSColor {
+        
+        return ColorSet.current[.suppliesCellBackground]
+    }
     
     @objc dynamic var ship: Ship?