masakih

艦これレベル経験値管理(プロジェクト終了、KCDに移行)

  • R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

艦これの経験値を管理するツール


Commit MetaInfo

Revisiona362cf184b42fff1067eb212a5902b0ddff099c9 (tree)
Zeit2014-02-03 00:11:14
Autormasakih <masakih@user...>
Commitermasakih

Log Message

ステータスが最大値の艦娘を隠せるようにした

Ändern Zusammenfassung

Diff

--- a/KanColleLevelManager/KCStatusCheckWindowController.h
+++ b/KanColleLevelManager/KCStatusCheckWindowController.h
@@ -12,6 +12,7 @@
1212
1313 @property (nonatomic, readonly) NSManagedObjectContext *managedObjectContext;
1414 @property (nonatomic, retain) IBOutlet NSArrayController *collectionShip;
15+@property (nonatomic, retain) IBOutlet NSSegmentedControl *typeSegment;
1516
1617
1718 - (IBAction)selectCategory:(id)sender;
--- a/KanColleLevelManager/KCStatusCheckWindowController.m
+++ b/KanColleLevelManager/KCStatusCheckWindowController.m
@@ -16,10 +16,18 @@
1616
1717 @property (retain) NSDictionary *categoryList;
1818
19+@property (readonly) BOOL hideMaxFire;
20+@property (readonly) BOOL hideMaxTorpedo;
21+@property (readonly) BOOL hideMaxAA;
22+@property (readonly) BOOL hideMaxArmor;
23+@property (readonly) BOOL hideMaxLuck;
24+
1925 @end
2026
2127 @implementation KCStatusCheckWindowController
2228
29+@dynamic hideMaxFire, hideMaxTorpedo, hideMaxAA, hideMaxArmor, hideMaxLuck;
30+
2331 - (id)init
2432 {
2533 self = [super initWithWindowNibName:NSStringFromClass([self class])];
@@ -43,16 +51,79 @@
4351 return ((HMAppDelegate *)[NSApp delegate]).managedObjectContext;
4452 }
4553
54+- (id)valueForUndefinedKey:(NSString *)key
55+{
56+ NSArray *defindeKyes = @[@"hideMaxFire", @"hideMaxTorpedo", @"hideMaxAA", @"hideMaxArmor", @"hideMaxLuck"];
57+ if([defindeKyes containsObject:key]) {
58+ return [[NSUserDefaults standardUserDefaults] objectForKey:key];
59+ }
60+
61+ return [super valueForUndefinedKey:key];
62+}
63+- (BOOL)hideMaxFire
64+{
65+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideMaxFire"];
66+}
67+- (BOOL)hideMaxTorpedo
68+{
69+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideMaxTorpedo"];
70+}
71+- (BOOL)hideMaxAA
72+{
73+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideMaxAA"];
74+}
75+- (BOOL)hideMaxArmor
76+{
77+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideMaxArmor"];
78+}
79+- (BOOL)hideMaxLuck
80+{
81+ return [[NSUserDefaults standardUserDefaults] boolForKey:@"hideMaxLuck"];
82+}
83+
84+- (NSPredicate *)omitPredicate
85+{
86+ NSMutableArray *hideKeys = [NSMutableArray array];
87+ if(self.hideMaxFire) {
88+ [hideKeys addObject:@"isMaxFire != TRUE"];
89+ }
90+ if(self.hideMaxTorpedo) {
91+ [hideKeys addObject:@"isMaxTorpedo != TRUE"];
92+ }
93+ if(self.hideMaxAA) {
94+ [hideKeys addObject:@"isMaxAA != TRUE"];
95+ }
96+ if(self.hideMaxArmor) {
97+ [hideKeys addObject:@"isMaxArmor != TRUE"];
98+ }
99+ if(self.hideMaxLuck) {
100+ [hideKeys addObject:@"isMaxLuck != TRUE"];
101+ }
102+
103+ if([hideKeys count] == 0) return nil;
104+
105+ NSString *predicateString = [hideKeys componentsJoinedByString:@" AND "];
106+
107+ return [NSPredicate predicateWithFormat:predicateString];
108+}
109+
46110 - (IBAction)selectCategory:(id)sender
47111 {
48- NSPredicate *predicate = nil;
49- NSInteger segment = [sender selectedSegment];
50- NSString *label = [sender labelForSegment:segment];
112+ NSPredicate *predicate = [self omitPredicate];
113+ NSInteger segment = [self.typeSegment selectedSegment];
114+ NSString *label = [self.typeSegment labelForSegment:segment];
51115
52116 NSDictionary *types = [self.categoryList objectForKey:label];
53117 if(types) {
54- predicate = [NSPredicate predicateWithFormat:@"ship.type.name IN %@", types];
118+ NSPredicate *catPredicate = [NSPredicate predicateWithFormat:@"ship.type.name IN %@", types];
119+ if(predicate) {
120+ NSArray *sub = @[predicate, catPredicate];
121+ predicate = [NSCompoundPredicate andPredicateWithSubpredicates:sub];
122+ } else {
123+ predicate = catPredicate;
124+ }
55125 }
126+
56127
57128 [self.collectionShip setFetchPredicate:predicate];
58129 }
--- a/KanColleLevelManager/KCStatusCheckWindowController.xib
+++ b/KanColleLevelManager/KCStatusCheckWindowController.xib
@@ -8,6 +8,7 @@
88 <customObject id="-2" userLabel="File's Owner" customClass="KCStatusCheckWindowController">
99 <connections>
1010 <outlet property="collectionShip" destination="b5h-Jc-6Om" id="sS5-7K-uIT"/>
11+ <outlet property="typeSegment" destination="YYD-QZ-qFG" id="OSS-Rc-COE"/>
1112 <outlet property="window" destination="1" id="3"/>
1213 </connections>
1314 </customObject>
@@ -214,13 +215,74 @@
214215 </tableHeaderView>
215216 </scrollView>
216217 <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="175-sD-FkB">
217- <rect key="frame" x="18" y="360" width="126" height="18"/>
218+ <rect key="frame" x="143" y="361" width="48" height="18"/>
218219 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
219- <buttonCell key="cell" type="check" title="最大の艦娘は隠す" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="NRl-Ed-dfv">
220+ <buttonCell key="cell" type="check" title="火力" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="NRl-Ed-dfv">
220221 <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
221222 <font key="font" size="13" name="AquaKana"/>
222223 </buttonCell>
224+ <connections>
225+ <action selector="selectCategory:" target="-2" id="H5w-Tb-SwM"/>
226+ <binding destination="bQa-hr-EKb" name="value" keyPath="values.hideMaxFire" id="0CD-Is-HCc"/>
227+ </connections>
228+ </button>
229+ <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="mHC-Ii-S5A">
230+ <rect key="frame" x="195" y="361" width="48" height="18"/>
231+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
232+ <buttonCell key="cell" type="check" title="雷装" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="h0E-Xu-bHD">
233+ <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
234+ <font key="font" size="13" name="AquaKana"/>
235+ </buttonCell>
236+ <connections>
237+ <action selector="selectCategory:" target="-2" id="MIt-Mj-8Uy"/>
238+ <binding destination="bQa-hr-EKb" name="value" keyPath="values.hideMaxTorpedo" id="bHU-PK-w4F"/>
239+ </connections>
240+ </button>
241+ <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="GiW-Zb-LZA">
242+ <rect key="frame" x="247" y="361" width="48" height="18"/>
243+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
244+ <buttonCell key="cell" type="check" title="対空" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="zXJ-A2-60m">
245+ <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
246+ <font key="font" size="13" name="AquaKana"/>
247+ </buttonCell>
248+ <connections>
249+ <action selector="selectCategory:" target="-2" id="oP1-JV-WCL"/>
250+ <binding destination="bQa-hr-EKb" name="value" keyPath="values.hideMaxAA" id="QeJ-Ny-XAU"/>
251+ </connections>
223252 </button>
253+ <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="O9T-wc-PgY">
254+ <rect key="frame" x="299" y="361" width="48" height="18"/>
255+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
256+ <buttonCell key="cell" type="check" title="装甲" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="0M2-OV-IHQ">
257+ <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
258+ <font key="font" size="13" name="AquaKana"/>
259+ </buttonCell>
260+ <connections>
261+ <action selector="selectCategory:" target="-2" id="Ocn-2S-6T8"/>
262+ <binding destination="bQa-hr-EKb" name="value" keyPath="values.hideMaxArmor" id="ipI-3n-Xe2"/>
263+ </connections>
264+ </button>
265+ <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Zwc-46-uuS">
266+ <rect key="frame" x="351" y="361" width="35" height="18"/>
267+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
268+ <buttonCell key="cell" type="check" title="運" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="8oz-Ok-3e5">
269+ <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
270+ <font key="font" size="13" name="AquaKana"/>
271+ </buttonCell>
272+ <connections>
273+ <action selector="selectCategory:" target="-2" id="ibY-LD-g2j"/>
274+ <binding destination="bQa-hr-EKb" name="value" keyPath="values.hideMaxLuck" id="wLb-Sg-rcK"/>
275+ </connections>
276+ </button>
277+ <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="FIC-ZJ-kr2">
278+ <rect key="frame" x="18" y="362" width="121" height="17"/>
279+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
280+ <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="最大の艦娘は隠す:" id="G9m-XF-G6U">
281+ <font key="font" size="13" name="AquaKana"/>
282+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
283+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
284+ </textFieldCell>
285+ </textField>
224286 </subviews>
225287 </view>
226288 <connections>
@@ -232,5 +294,6 @@
232294 <binding destination="-2" name="managedObjectContext" keyPath="managedObjectContext" id="2A8-bK-70W"/>
233295 </connections>
234296 </arrayController>
297+ <userDefaultsController id="bQa-hr-EKb"/>
235298 </objects>
236299 </document>
\ No newline at end of file