X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=DocInterfaceActions.m;h=c136f2cd6ff1d285c87b41db5aa3e9ac92316dc2;hb=179538478d0db2e5f8f2b50ccb3ff889b474aa01;hp=f53ddf3e512aa6a0d612aeb899166c99a49aeae3;hpb=d27548f80fe411fda2ee69c74a24eab4292267e9;p=chaz%2Fthecheat diff --git a/DocInterfaceActions.m b/DocInterfaceActions.m index f53ddf3..c136f2c 100644 --- a/DocInterfaceActions.m +++ b/DocInterfaceActions.m @@ -1,10 +1,23 @@ -// -// DocumentActions.m -// The Cheat -// -// Created by Chaz McGarvey on 12/26/04. -// Copyright 2004 Chaz McGarvey. All rights reserved. -// + +// ********************************************************************** +// 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. +// + #import "CheatDocument.h" @@ -169,6 +182,7 @@ return; } + [_cheatData process]; if ( [_searchData hasSearchedOnce] ) { NSBeginInformationalAlertSheet( @"Confirm target change.", @"OK", @"Cancel", nil, ibWindow, self, NULL, @selector(_confirmTargetChange:returnCode:context:), [[sender representedObject] retain], @@ -234,6 +248,7 @@ // do the search if ( [_searchData valueUsed] == TCGivenValue ) { variable = [[Variable alloc] initWithType:[_searchData variableType] integerSign:[_searchData integerSign]]; + [variable setProcess:_process]; [variable setStringValue:[ibSearchValueField stringValue]]; if ( [variable isValueValid] && [variable valueSize] > 0 ) { _status = TCSearchingStatus; @@ -241,8 +256,9 @@ [ibStatusBar setIndeterminate:NO]; [_searchData setSearchValue:variable]; + [_cheater searchForVariable:variable comparison:[_searchData searchOperator]]; + //[_cheater searchForVariable:[_searchData searchValue] comparison:[_searchData searchOperator]]; [variable release]; - [_cheater searchForVariable:[_searchData searchValue] comparison:[_searchData searchOperator]]; } else { NSBeginAlertSheet( @"Invalid Input", @"OK", nil, nil, ibWindow, nil, NULL, NULL, NULL, @@ -435,9 +451,8 @@ var = [_cheatData variableAtIndex:row]; - // update fields + // update field [ibNewValueField setStringValue:[var stringValue]]; - [ibVariableEnableButton setState:[var isEnabled]]; // display sheet [NSApp beginSheet:ibEditVariablesSheet modalForWindow:ibWindow modalDelegate:nil didEndSelector:NULL contextInfo:nil]; @@ -446,7 +461,6 @@ - (IBAction)ibEndEditVariablesSheet:(id)sender { NSString *newValue = [ibNewValueField stringValue]; - BOOL enabled = [ibVariableEnableButton state]; NSArray *rows; int i, top; @@ -463,12 +477,12 @@ rows = [ibCheatVariableTable selectedRows]; top = [rows count]; - for ( i = 0; i < top; i++ ) { - Variable *var = [_cheatData variableAtIndex:[[rows objectAtIndex:i] unsignedIntValue]]; - if ( newValue ) { + // change all selected variables with the new value + if ( newValue ) { + for ( i = 0; i < top; i++ ) { + Variable *var = [_cheatData variableAtIndex:[[rows objectAtIndex:i] unsignedIntValue]]; [var setStringValue:newValue]; } - [var setEnabled:enabled]; } [ibCheatVariableTable reloadData]; @@ -531,7 +545,6 @@ - (IBAction)ibAddCheatVariable:(id)sender { ChazLog( @"ibAddCheatVariable:" ); - Variable *var = [[Variable alloc] initWithType:[sender tag]]; // add the new variable to the doc data [_cheatData addVariable:var];