X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=DocInterfaceActions.m;h=b2e120868eb1c99ba5693694456ab48aeaf1976d;hb=refs%2Fheads%2Fyishen;hp=c136f2cd6ff1d285c87b41db5aa3e9ac92316dc2;hpb=179538478d0db2e5f8f2b50ccb3ff889b474aa01;p=chaz%2Fthecheat diff --git a/DocInterfaceActions.m b/DocInterfaceActions.m index c136f2c..b2e1208 100644 --- a/DocInterfaceActions.m +++ b/DocInterfaceActions.m @@ -1,22 +1,13 @@ -// ********************************************************************** -// The Cheat - A universal game cheater for Mac OS X -// (C) 2003-2005 Chaz McGarvey (BrokenZipper) -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 1, or (at your option) -// any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// +/* + * The Cheat - The legendary universal game trainer for Mac OS X. + * http://www.brokenzipper.com/trac/wiki/TheCheat + * + * Copyright (c) 2003-2011, Charles McGarvey et al. + * + * Distributable under the terms and conditions of the 2-clause BSD + * license; see the file COPYING for the legal text of the license. + */ #import "CheatDocument.h" @@ -61,7 +52,8 @@ - (IBAction)ibSetRemoteCheater:(id)sender { - ChazLog( @"Selected %@", sender ); + int timeout=5; + ChazLog( @"Selected %@", sender ); if ( ![self shouldConnectWithServer:sender] ) { return; @@ -71,7 +63,7 @@ _resolvingService = [[sender representedObject] retain]; [_resolvingService setDelegate:self]; - [_resolvingService resolve]; + [_resolvingService resolveWithTimeout:timeout]; } - (void)netServiceDidResolveAddress:(NSNetService *)sender @@ -301,25 +293,11 @@ [self switchToCheatMode]; int rowIndex = [_cheatData variableCount]-1; - if ( MacOSXVersion() >= 0x1030 ) { - [ibCheatVariableTable selectRowIndexes:[NSIndexSet indexSetWithIndex:rowIndex] byExtendingSelection:NO]; - } - else { - [ibCheatVariableTable selectRow:rowIndex byExtendingSelection:NO]; - } + [ibCheatVariableTable selectRowIndexes:[NSIndexSet indexSetWithIndex:rowIndex] byExtendingSelection:NO]; // start editing the last added variable if ( [[NSUserDefaults standardUserDefaults] boolForKey:TCAutoStartEditingVarsPref] ) { if ( top > 1 ) { - // edit multiple - if ( MacOSXVersion() >= 0x1030 ) { - [ibCheatVariableTable selectRowIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(rowIndex-top+1,top-1)] - byExtendingSelection:YES]; - } - else { - for ( i = 1; i < top; i++ ) { - [ibCheatVariableTable selectRow:rowIndex-i byExtendingSelection:YES]; - } - } + [ibCheatVariableTable selectRowIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(rowIndex-top+1,top-1)] byExtendingSelection:YES]; [ibCheatVariableTable scrollRowToVisible:rowIndex]; [self ibRunEditVariablesSheet:nil]; } @@ -556,12 +534,7 @@ [self switchToCheatMode]; int row = [_cheatData variableCount]-1; - if ( MacOSXVersion() >= 0x1030 ) { - [ibCheatVariableTable selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; - } - else { - [ibCheatVariableTable selectRow:row byExtendingSelection:NO]; - } + [ibCheatVariableTable selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO]; // start editing new variable if ( [[NSUserDefaults standardUserDefaults] boolForKey:TCAutoStartEditingVarsPref] ) { [ibCheatVariableTable editColumn:[ibCheatVariableTable columnWithIdentifier:@"address"] row:row withEvent:nil select:YES];