]> Dogcows Code - chaz/thecheat/blobdiff - DocInterfaceActions.m
update contact information and project URL
[chaz/thecheat] / DocInterfaceActions.m
index f53ddf3e512aa6a0d612aeb899166c99a49aeae3..26542d690600f545991eb00b6fd0c943c68dd146 100644 (file)
@@ -1,10 +1,14 @@
-//
-//  DocumentActions.m
-//  The Cheat
-//
-//  Created by Chaz McGarvey on 12/26/04.
-//  Copyright 2004 Chaz McGarvey. All rights reserved.
-//
+
+/*
+ * 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"
 
                return;
        }
        
+       [_cheatData process];
        if ( [_searchData hasSearchedOnce] ) {
                NSBeginInformationalAlertSheet( @"Confirm target change.", @"OK", @"Cancel", nil, ibWindow, self, NULL,
                                                                                @selector(_confirmTargetChange:returnCode:context:), [[sender representedObject] retain],
        // 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;
                        [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,
        
        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];
 - (IBAction)ibEndEditVariablesSheet:(id)sender
 {
        NSString *newValue = [ibNewValueField stringValue];
-       BOOL enabled = [ibVariableEnableButton state];
        NSArray *rows;
        int i, top;
        
        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];
 - (IBAction)ibAddCheatVariable:(id)sender
 {
        ChazLog( @"ibAddCheatVariable:" );
-
        Variable *var = [[Variable alloc] initWithType:[sender tag]];
        // add the new variable to the doc data
        [_cheatData addVariable:var];
This page took 0.026681 seconds and 4 git commands to generate.