Added menu item to set time easily to the next Midnight and the next Noon

This commit is contained in:
Nick Loose 2010-11-19 15:10:16 +01:00
parent 34500b6141
commit 1a4a04ecc8
3 changed files with 92 additions and 7 deletions

View File

@ -64,5 +64,7 @@
- (IBAction)setNextDay:(id)sender;
- (IBAction)setNextNight:(id)sender;
- (IBAction)setNextNoon:(id)sender;
- (IBAction)setNextMidnight:(id)sender;
@end

View File

@ -341,6 +341,25 @@
[self setWorldTime:newTime];
}
- (IBAction)setNextMidnight:(id)sender
{
int result;
int wTime = [[self worldTime] intValue];
result =wTime +(18000 - (wTime % 18000));
NSNumber *newTime = [NSNumber numberWithInt:result];
[self setWorldTime:newTime];
}
- (IBAction)setNextNoon:(id)sender
{
int result;
int wTime = [[self worldTime] intValue];
result =wTime +(6000 - (wTime % 6000));
NSNumber *newTime = [NSNumber numberWithInt:result];
[self setWorldTime:newTime];
}
#pragma mark -
#pragma mark IJInventoryViewDelegate

View File

@ -12,8 +12,8 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="701"/>
<integer value="372"/>
<integer value="701"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@ -396,7 +396,16 @@
<object class="NSMenuItem" id="195507455">
<reference key="NSMenu" ref="500439511"/>
<string key="NSTitle">Next Sunrise</string>
<string key="NSKeyEquiv">D</string>
<string key="NSKeyEquiv">R</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="35465992"/>
<reference key="NSMixedImage" ref="502551668"/>
</object>
<object class="NSMenuItem" id="234384199">
<reference key="NSMenu" ref="500439511"/>
<string key="NSTitle">Next Noon</string>
<string key="NSKeyEquiv">N</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="35465992"/>
@ -405,7 +414,16 @@
<object class="NSMenuItem" id="431631770">
<reference key="NSMenu" ref="500439511"/>
<string key="NSTitle">Next Sunset</string>
<string key="NSKeyEquiv">N</string>
<string key="NSKeyEquiv">S</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="35465992"/>
<reference key="NSMixedImage" ref="502551668"/>
</object>
<object class="NSMenuItem" id="19459331">
<reference key="NSMenu" ref="500439511"/>
<string key="NSTitle">Next Midnight</string>
<string key="NSKeyEquiv">M</string>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="35465992"/>
@ -1417,6 +1435,22 @@
</object>
<int key="connectionID">708</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">setNextMidnight:</string>
<reference key="source" ref="760161335"/>
<reference key="destination" ref="19459331"/>
</object>
<int key="connectionID">710</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">setNextNoon:</string>
<reference key="source" ref="760161335"/>
<reference key="destination" ref="234384199"/>
</object>
<int key="connectionID">712</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@ -2012,6 +2046,8 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="195507455"/>
<reference ref="431631770"/>
<reference ref="19459331"/>
<reference ref="234384199"/>
</object>
<reference key="parent" ref="1003822312"/>
</object>
@ -2025,6 +2061,16 @@
<reference key="object" ref="431631770"/>
<reference key="parent" ref="500439511"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">709</int>
<reference key="object" ref="19459331"/>
<reference key="parent" ref="500439511"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">711</int>
<reference key="object" ref="234384199"/>
<reference key="parent" ref="500439511"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@ -2170,6 +2216,8 @@
<string>701.IBPluginDependency</string>
<string>702.IBPluginDependency</string>
<string>706.IBPluginDependency</string>
<string>709.IBPluginDependency</string>
<string>711.IBPluginDependency</string>
<string>75.IBPluginDependency</string>
<string>75.ImportedFromIB2</string>
<string>81.IBEditorWindowLastContentRect</string>
@ -2246,9 +2294,9 @@
<integer value="1"/>
<string>{74, 862}</string>
<string>{{6, 978}, {478, 20}}</string>
<string>{{602, 140}, {585, 396}}</string>
<string>{{1099, 52}, {585, 396}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{602, 140}, {585, 396}}</string>
<string>{{1099, 52}, {585, 396}}</string>
<integer value="1"/>
<string>{{33, 99}, {480, 360}}</string>
<string>{3.40282e+38, 3.40282e+38}</string>
@ -2341,7 +2389,9 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>{{585, 793}, {176, 43}}</string>
<string>{{585, 753}, {189, 83}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@ -2373,7 +2423,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">708</int>
<int key="maxID">712</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@ -2407,7 +2457,9 @@
<string>makeSearchFieldFirstResponder:</string>
<string>menuSelectWorld:</string>
<string>setNextDay:</string>
<string>setNextMidnight:</string>
<string>setNextNight:</string>
<string>setNextNoon:</string>
<string>updateItemSearchFilter:</string>
<string>worldSelectionChanged:</string>
</object>
@ -2419,6 +2471,8 @@
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
@ -2428,7 +2482,9 @@
<string>makeSearchFieldFirstResponder:</string>
<string>menuSelectWorld:</string>
<string>setNextDay:</string>
<string>setNextMidnight:</string>
<string>setNextNight:</string>
<string>setNextNoon:</string>
<string>updateItemSearchFilter:</string>
<string>worldSelectionChanged:</string>
</object>
@ -2446,10 +2502,18 @@
<string key="name">setNextDay:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">setNextMidnight:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">setNextNight:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">setNextNoon:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">updateItemSearchFilter:</string>
<string key="candidateClassName">id</string>