<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1108" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9532"/>
+ <deployment identifier="macosx"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11201"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="HMAncherageRepairTimerViewController">
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="Len-bF-3P9">
<rect key="frame" x="157" y="6" width="101" height="17"/>
- <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="泊地修理タイマー" id="9rH-KA-HLC">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="lPa-da-VKP">
<rect key="frame" x="260" y="6" width="73" height="17"/>
- <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" id="ORE-wG-yKF">
<customFormatter key="formatter" id="LHP-bc-xIy" customClass="HMTimerCountFormatter"/>
<font key="font" metaFont="system"/>
<binding destination="-2" name="value" keyPath="repairTime" id="sMc-R4-LMf"/>
</connections>
</textField>
- <box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="18H-dF-jqB">
+ <box verticalHuggingPriority="750" boxType="separator" id="18H-dF-jqB">
<rect key="frame" x="11" y="-6" width="329" height="5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
- <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
- <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
- <font key="titleFont" metaFont="system"/>
</box>
<button id="gW9-cX-69H">
<rect key="frame" x="20" y="6" width="64" height="64"/>
- <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" heightSizable="YES"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="CameraDisabled" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="Mmi-jE-o88">
<behavior key="behavior" pushIn="YES" changeContents="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1108" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9532"/>
+ <deployment identifier="macosx"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11201"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
<action selector="selectPreviousFleet:" target="-1" id="l4N-mw-wZP"/>
</connections>
</menuItem>
- <menuItem isSeparatorItem="YES" id="pna-WT-8tJ"/>
+ <menuItem isSeparatorItem="YES" id="m3g-BP-cHn"/>
<menuItem title="Screen Shot" keyEquivalent="S" id="7Fq-TJ-VZE">
<connections>
<action selector="screenShot:" target="-1" id="eoB-LA-pzp"/>
</connections>
</menuItem>
+ <menuItem title="Toggle Screen Shot Button Size" id="tuF-Zr-OZU">
+ <modifierMask key="keyEquivalentModifierMask"/>
+ <connections>
+ <action selector="toggleAnchorageSize:" target="-1" id="1bR-yN-W7o"/>
+ </connections>
+ </menuItem>
<menuItem isSeparatorItem="YES" id="r9R-zW-j9D"/>
<menuItem title="Clear Quset List" id="HhI-qq-nGv">
<modifierMask key="keyEquivalentModifierMask"/>
@interface HMAncherageRepairTimerViewController : NSViewController
+@property NSControlSize controlSize;
+
+@property (class, readonly) CGFloat regularHeight;
+@property (class, readonly) CGFloat smallHeight;
+
@end
#import "HMAnchorageRepairManager.h"
+static const CGFloat regularHeight = 76;
+static const CGFloat smallHeight = regularHeight - 32;
+
@interface HMAncherageRepairTimerViewController ()
@property (strong) HMAnchorageRepairManager *anchorageRepairManager;
@property (strong) NSNumber *repairTime;
@end
@implementation HMAncherageRepairTimerViewController
+@synthesize controlSize = _controlSize;
- (id)init
{
self = [super initWithNibName:NSStringFromClass([self class]) bundle:nil];
if(self) {
_anchorageRepairManager = [HMAnchorageRepairManager defaultManager];
+ _controlSize = NSControlSizeRegular;
HMAppDelegate *appDelegate = [[NSApplication sharedApplication] delegate];
[appDelegate addCounterUpdateBlock:^{
self.screenshotButton.image = [NSImage imageNamed:@"CameraDisabled"];
}
+- (void)setControlSize:(NSControlSize)controlSize
+{
+ if(_controlSize == controlSize) return;
+
+ NSRect frame = self.view.frame;
+ frame.size.height = controlSize == NSControlSizeRegular ? regularHeight : smallHeight;
+ self.view.frame = frame;
+
+ NSRect buttonFrame = self.screenshotButton.frame;
+ buttonFrame.size.width += controlSize == NSControlSizeRegular ? +32 : -32;
+ self.screenshotButton.frame = buttonFrame;
+ _controlSize = controlSize;
+}
+- (NSControlSize)controlSize
+{
+ return _controlSize;
+}
+
++ (CGFloat)regularHeight
+{
+ return regularHeight;
+}
++ (CGFloat)smallHeight
+{
+ return smallHeight;
+}
+
- (NSNumber *)calcRepairTime
{
NSDate *compTimeValue = self.anchorageRepairManager.repairTime;
self.ancherageRepariTimerViewController = [HMAncherageRepairTimerViewController new];
[self.ancherageRepariTimerViewController.view setFrameOrigin:NSZeroPoint];
[self.ancherageRepariTimerPlaceholder addSubview:self.ancherageRepariTimerViewController.view];
+ if(HMStandardDefaults.screenshotButtonSize == NSControlSizeSmall) {
+ [self toggleAnchorageSize:nil];
+ }
self.docksViewController = [HMDocksViewController new];
self.shipViewController = [HMShipViewController new];
}
}
+
+- (IBAction)toggleAnchorageSize:(id)sender
+{
+ NSControlSize current = self.ancherageRepariTimerViewController.controlSize;
+ CGFloat diff = [HMAncherageRepairTimerViewController regularHeight] - [HMAncherageRepairTimerViewController smallHeight];
+ NSControlSize newSize = NSControlSizeRegular;
+ if(current == NSControlSizeRegular) {
+ diff *= -1;
+ newSize = NSControlSizeSmall;
+ }
+ self.ancherageRepariTimerViewController.controlSize = newSize;
+
+ NSRect frame = self.informations.frame;
+ frame.size.height -= diff;
+ frame.origin.y += diff;
+ self.informations.frame = frame;
+
+ HMStandardDefaults.screenshotButtonSize = newSize;
+}
+
#pragma mark - Combined view
- (IBAction)showHideCombinedView:(id)sender
{
if(self.fleetViewPosition == kOldStyle) return NO;
return YES;
}
+ if(action == @selector(toggleAnchorageSize:)) {
+ return YES;
+ }
return NO;
}
@property NSNumber *screenshotPreviewZoomValue;
/**
+ * 連結するスクリーンショットの列数
+ */
+@property NSInteger screenshotEditorColumnCount;
+
+/**
+ * スクリーンショットの切り抜きタイプ
+ */
+@property NSInteger scrennshotEditorType;
+
+/**
+ * スクリーンショットボタンの大きさ
+ */
+@property NSControlSize screenshotButtonSize;
+
+/**
* 遠征帰還時の通知音を鳴らす
*/
@property BOOL playFinishMissionSound;
/**
- * 連結するスクリーンショットの列数
- */
-@property NSInteger screenshotEditorColumnCount;
-
-/**
- * スクリーンショットの切り抜きタイプ
- */
-@property NSInteger scrennshotEditorType;
-
-/**
* 古い履歴を削除する
*/
@property BOOL cleanOldHistoryItems;
return [self integerForKey:@"scrennshotEditorType"];
}
+- (void)setScreenshotButtonSize:(NSControlSize)screenshotButtonSize
+{
+ [self setInteger:screenshotButtonSize forKey:@"screenshotButtonSize"];
+}
+- (NSControlSize)screenshotButtonSize
+{
+ return [self integerForKey:@"screenshotButtonSize"];
+}
+
#pragma mark - Notify Sound
- (void)setPlayFinishMissionSound:(BOOL)playFinishMissionSound
{
"y18-nA-SS3.title" = "改修工廠";
"U2N-Wx-ugY.title" = "修復";
+
+"tuF-Zr-OZU.title" = "スクリーンショットボタンの大きさを切り替え";
+
/* Class = "NSMenuItem"; title = "Select Next Fleet"; ObjectID = "zEh-tr-mhX"; */
"zEh-tr-mhX.title" = "選擇下一步艦隊";
+
+
+"tuF-Zr-OZU.title" = "切換截圖按鈕大小";
+