Skip to content

Commit

Permalink
Added fields for max # of clones and jump delay along with tooltips t…
Browse files Browse the repository at this point in the history
…o show relevant skills.
  • Loading branch information
Bleyddyn committed May 11, 2015
1 parent 096b4af commit 288910f
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 16 deletions.
45 changes: 32 additions & 13 deletions src/Windows/METJumpClone.xib
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="METJumpCloneController">
<connections>
<outlet property="characterName" destination="GdR-Vl-a67" id="ffe-hk-8mO"/>
<outlet property="jumpCloneView" destination="3SF-xI-D2Q" id="7nC-na-agQ"/>
<outlet property="jumpDelay" destination="wsS-Xe-Alx" id="bed-uD-Cs3"/>
<outlet property="maxClones" destination="rJw-XC-Okk" id="5gm-Hx-59b"/>
<outlet property="nextJumpDate" destination="jYx-oY-Eya" id="02Q-jp-NAT"/>
<outlet property="portrait" destination="V0D-Q6-KIx" id="E11-Ex-7FS"/>
<outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
Expand Down Expand Up @@ -92,43 +93,61 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" imageFrameStyle="grayBezel" id="2dR-bu-Xhb"/>
</imageView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="9cS-hx-Ton">
<rect key="frame" x="154" y="591" width="111" height="17"/>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="FEA-QC-snS">
<rect key="frame" x="154" y="593" width="135" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Jump Clones For:" id="uYJ-dG-ayy">
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Next Available Jump:" id="hJX-v4-nfY">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="FEA-QC-snS">
<rect key="frame" x="154" y="561" width="135" height="17"/>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="Ovm-du-zAP">
<rect key="frame" x="154" y="568" width="152" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Next Available Jump:" id="hJX-v4-nfY">
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Max Number of Clones:" id="HPf-AG-Vzq">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="GdR-Vl-a67">
<rect key="frame" x="298" y="591" width="633" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" placeholderString="Current Character" id="wQU-xQ-CiX">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="Oxc-Sm-ef6">
<rect key="frame" x="154" y="543" width="120" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Clone Jump Delay:" id="6su-1W-hy9">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="jYx-oY-Eya">
<rect key="frame" x="298" y="561" width="633" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMinY="YES" heightSizable="YES"/>
<rect key="frame" x="310" y="593" width="621" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" placeholderString="Now" id="e9U-rx-8PD">
<dateFormatter key="formatter" dateStyle="long" timeStyle="long" doesRelativeDateFormatting="YES" id="tBq-NM-OHG"/>
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="rJw-XC-Okk">
<rect key="frame" x="310" y="568" width="621" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" placeholderString="5" id="Ms4-JL-L2y">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="wsS-Xe-Alx">
<rect key="frame" x="310" y="543" width="621" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" placeholderString="24 hours" id="ddx-eQ-P0t">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<connections>
Expand Down
3 changes: 2 additions & 1 deletion src/Windows/METJumpCloneController.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
NSArray *_jumpClones; //< We need this so we have a fixed order for the jump clones
IBOutlet NSOutlineView *jumpCloneView;
IBOutlet NSImageView *portrait;
IBOutlet NSTextField *characterName;
IBOutlet NSTextField *nextJumpDate;
IBOutlet NSTextField *maxClones;
IBOutlet NSTextField *jumpDelay;

NSTimer *_jumpDateTimer;
}
Expand Down
39 changes: 37 additions & 2 deletions src/Windows/METJumpCloneController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
//

#import "METJumpCloneController.h"
#import "GlobalData.h"
#import "Character.h"
#import "METJumpClone.h"
#import "CCPImplant.h"
#import "Skill.h"
#import "SkillTree.h"
#import "Helpers.h"

@interface METJumpCloneController ()
@property (retain,readwrite) NSArray *jumpClones;
Expand Down Expand Up @@ -60,7 +62,8 @@ - (void)windowDidLoad

[[self window] setTitle:[NSString stringWithFormat:@"%@: Jump Clones",[[self character] characterName]]];
[portrait setImage:[[self character] portrait]];
[characterName setStringValue:[[self character] characterName]];
[self updateMaxJumpClonesField];
[self updateJumpDelayField];
[self updateNextJumpCloneDateField:nil];
}

Expand All @@ -69,11 +72,43 @@ - (void)windowWillClose:(NSNotification *)notification
[self autorelease];
}

static const NSInteger infomorphPsychologyID = 24242;
static const NSInteger advancedInfomorphPsychologyID = 33407;
static const NSInteger infomorphSynchronizingID = 33399;

- (void)updateMaxJumpClonesField
{
SkillTree *globalSkills = [[GlobalData sharedInstance] skillTree];
SkillTree *skillTree = [[self character] skillTree];
Skill *infomorphPsychology = [skillTree skillForIdInteger:infomorphPsychologyID];
Skill *advanced = [skillTree skillForIdInteger:advancedInfomorphPsychologyID];
[maxClones setObjectValue:[NSNumber numberWithInteger:([infomorphPsychology skillLevel] + [advanced skillLevel])]];

NSString *name1 = infomorphPsychology?[infomorphPsychology skillName]:[[globalSkills skillForIdInteger:infomorphPsychologyID] skillName];
NSString *name2 = advanced?[advanced skillName]:[[globalSkills skillForIdInteger:advancedInfomorphPsychologyID] skillName];
NSString *desc = [NSString stringWithFormat:@"%@ %@\n%@ %@", name1, romanForInteger([infomorphPsychology skillLevel]),
name2, romanForInteger([advanced skillLevel])];
[maxClones setToolTip:desc];
}

- (void)updateJumpDelayField
{
SkillTree *globalSkills = [[GlobalData sharedInstance] skillTree];
SkillTree *skillTree = [[self character] skillTree];
Skill *infomorphSync = [skillTree skillForIdInteger:infomorphSynchronizingID];

[jumpDelay setStringValue:[NSString stringWithFormat:@"%d %@", (24 - (int)[infomorphSync skillLevel]), NSLocalizedString( @"hours", @"Jump clone delay units" )]];

NSString *name1 = infomorphSync?[infomorphSync skillName]:[[globalSkills skillForIdInteger:infomorphSynchronizingID] skillName];
NSString *desc = [NSString stringWithFormat:@"%@ %@", name1, romanForInteger([infomorphSync skillLevel])];
[jumpDelay setToolTip:desc];
}

- (void)updateNextJumpCloneDateField:(NSTimer *)timer
{
NSDate *jumpDate = [[self character] jumpCloneDate]; // date-time of last clone jump
SkillTree *skillTree = [[self character] skillTree];
Skill *informorphSynchronizing = [skillTree skillForIdInteger:33399]; // [skillTree skillForName:@"Infomorph Synchronizing"];
Skill *informorphSynchronizing = [skillTree skillForIdInteger:infomorphSynchronizingID]; // [skillTree skillForName:@"Infomorph Synchronizing"];

// add 24 hours to last clone jump date, then subtract 1 hour per level of Infomorph Synchronizing
jumpDate = [jumpDate dateByAddingTimeInterval:SEC_DAY-([informorphSynchronizing skillLevel]*SEC_HOUR)];
Expand Down

0 comments on commit 288910f

Please sign in to comment.