OSDN Git Service

ver0.632
[awarsiii/AwarsIV.git] / Awars III / UnitChipList.m
index 7d60656..3ef4b69 100644 (file)
     [animationListTV setTarget:self];
     [animationListTV setAction:@selector(ClickANL:)];
     
+    [commandListTV setTarget:self];
+    [commandListTV setAction:@selector(ClickCMD:)];
+    
+    [comboListTV setTarget:self];
+    [comboListTV setAction:@selector(ClickCMB:)];
+    
     [self addPUBEquipList];
     equipItemMA = [NSMutableArray new];
     attackListMA = [NSMutableArray new];
     
     if (self) {
         UCLtime  = [NSTimer
-                    scheduledTimerWithTimeInterval:0.01f
+                    scheduledTimerWithTimeInterval:1.0/30
                     target:self
                     selector:@selector(EventLoopUCL:)
                     userInfo:nil
                     repeats:YES
                     ];
-        [[NSRunLoop currentRunLoop] addTimer: UCLtime forMode:NSDefaultRunLoopMode];
-        
         
+        /*
         aniTimer  = [NSTimer
-                    scheduledTimerWithTimeInterval:0.015
+                    scheduledTimerWithTimeInterval:1.0/30
                     target:self
                     selector:@selector(EventLoopANI:)
                     userInfo:nil
                     repeats:YES
-                    ];
-        [[NSRunLoop currentRunLoop] addTimer: aniTimer forMode:NSDefaultRunLoopMode];
+                    ];*/
+        UnitChipListInst = self;
         
         [self initFileDirectoryItem];
         [self initItemList];
     return self;
 }
 
+-(void)ClickCMB:(id)sender{
+    CMBrow = (int)[comboListTV clickedRow];
+}
+
+-(void)ClickCMD:(id)sender{
+    CMDrow = (int)[commandListTV clickedRow];
+}
+
 -(void)ClickSL:(id)sender{
     SKLrow = (int)[skillListTV clickedRow];
 }
@@ -727,7 +740,7 @@ bool InitialFlag;
     
     [PUPtEquip addItemWithTitle:@"装備リスト"];
     for (int i = 0; i < eItemNum; i++) {
-        [PUPtEquip addItemWithTitle:EQ[i].name];
+        [PUPtEquip addItemWithTitle:EQ[i].nameRecognition];
     }
 }
 
@@ -2945,7 +2958,7 @@ bool eHandLFlag = false;
             fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%d", UC[i].A->dmgExtend]] stringByAppendingString:@","];
             fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%d", UC[i].A->imagine]] stringByAppendingString:@"\n"];
         
-            fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%@", UC[i].A->cmd]] stringByAppendingString:@"\n"];
+            fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%@,%d", UC[i].A->cmd, UC[i].A->hasei]] stringByAppendingString:@"\n"];
             fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%@,%d", UC[i].A->AN.movName, UC[i].A->AN.frame]] stringByAppendingString:@"\n"];
             if(UC[i].A->msg){
                 fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"####"]] stringByAppendingString:@"\n"];
@@ -3071,7 +3084,7 @@ bool eHandLFlag = false;
             fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%d", LC[i].A->dmgExtend]] stringByAppendingString:@","];
             fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%d", LC[i].A->imagine]] stringByAppendingString:@"\n"];
             
-            fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%@", LC[i].A->cmd]] stringByAppendingString:@"\n"];
+            fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%@,%d", LC[i].A->cmd, LC[i].A->hasei]] stringByAppendingString:@"\n"];
             
             if(LC[i].A->msg){
                 fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"####"]] stringByAppendingString:@"\n"];
@@ -3200,7 +3213,7 @@ bool eHandLFlag = false;
             fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%d", EQ[i].A->dmgExtend]] stringByAppendingString:@","];
             fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%d", EQ[i].A->imagine]] stringByAppendingString:@"\n"];
             
-            fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%@", EQ[i].A->cmd]] stringByAppendingString:@"\n"];
+            fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%@,%d", EQ[i].A->cmd, EQ[i].A->hasei]] stringByAppendingString:@"\n"];
             fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"%@,%d", EQ[i].A->AN.movName, EQ[i].A->AN.frame]] stringByAppendingString:@"\n"];
             if(EQ[i].A->msg){
                 fileData = [[fileData stringByAppendingString:[NSString stringWithFormat:@"####"]] stringByAppendingString:@"\n"];
@@ -3440,20 +3453,28 @@ bool eHandLFlag = false;
     NSString *fileData = nil;
     
     
-    comboItemNumb = 2;
+    fileData = [NSString stringWithContentsOfFile:pathCL encoding:NSUTF8StringEncoding error:nil];
+    fileDataArray = [fileData componentsSeparatedByString:@"\n"];
+    int instantNum = [[fileDataArray objectAtIndex:0] intValue];
+    
+    comboItemNumb = instantNum;
+    CLN = (int)comboItemNumb;
     if(!InitialData){
         [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
         [[NSFileManager defaultManager] createFileAtPath:pathCL contents:nil attributes:nil];
+        [[NSString stringWithFormat:@"%d", UCN] writeToFile:pathCL atomically:YES encoding:NSUTF8StringEncoding error:nil];
         
-        NSString *data1 = @"0,1,2,3\n####\n236A,0,0\n####\nA>A>A\nA>A>B";
+        comboItemNumb = UCN;
+        CLN = (int)comboItemNumb;
+        NSString *data1 = @"A>A>A\nA>A>B";
         
-        NSString *data2 = @"0,1,2,3\n####\n236A,0,0\n####\nA>A>A\nA>A>B";
+        NSString *data2 = @"A>A>B\nA>A>C";
         
-        for (int i=1; i<=comboItemNumb; i++) {
+        for (int i=1; i<=UCN; i++) {
             NSString *fdata = @"data/ComboList/CLdata";
             
             fdata = [fdata stringByAppendingFormat:@"%d.txt", i];
-            
+            /*
             switch (i) {
                 case 1:
                     [data1 writeToFile:fdata atomically:YES encoding:NSUTF8StringEncoding error:nil];
@@ -3464,15 +3485,13 @@ bool eHandLFlag = false;
                 default:
                     
                     break;
-            }
-            
+            }*/
+            [@"" writeToFile:fdata atomically:YES encoding:NSUTF8StringEncoding error:nil];
         }
-        
     }
     
     NSArray *fileDataArray2;
-    for (int i = 0; i< itemNumb; i++){
-        COMMANDS *CStop = UC[i].CM.cs;
+    for (int i = 0; i< CLN; i++){
         COMBO *COtop = UC[i].CM.co;
         
         NSString *fdata = @"data/ComboList/CLdata";
@@ -3480,47 +3499,16 @@ bool eHandLFlag = false;
         fdata = [fdata stringByAppendingFormat:@"%d.txt", i+1];
         
         fileData = [NSString stringWithContentsOfFile:fdata encoding:NSUTF8StringEncoding error:nil];
-        fileDataArray2 = [fileData componentsSeparatedByString:@"\n####\n"];
+        fileDataArray2 = [fileData componentsSeparatedByString:@"\n"];
         
-        NSArray *items = [[fileDataArray2 objectAtIndex:0] componentsSeparatedByString:@","];
         
-        /*
-        UC[i].CM.A = [[items objectAtIndex:0] intValue];
-        UC[i].CM.B = [[items objectAtIndex:1] intValue];
-        UC[i].CM.C = [[items objectAtIndex:2] intValue];
-        UC[i].CM.D = [[items objectAtIndex:3] intValue];
-        */
-        fileDataArray = [[fileDataArray2 objectAtIndex:1] componentsSeparatedByString:@"\n"];
-        
-        for(int k = 0;k < [fileDataArray count];k++){
-            if (k == 0) {
-                UC[i].CM.cs = calloc(1, sizeof(COMMANDS));
-                CStop = UC[i].CM.cs;
-            }
-            items = [[fileDataArray objectAtIndex:k] componentsSeparatedByString:@","];
-            
-            NSLog(@"%@", UC[i].CM.cs->cmd);
-            
-            UC[i].CM.cs->cmd = [[items objectAtIndex:0] retain];
-            UC[i].CM.cs->waza = [[items objectAtIndex:1] intValue];
-            UC[i].CM.cs->hasei = [[items objectAtIndex:2] retain];
-            
-            UC[i].CM.cs->next = calloc(1, sizeof(COMMANDS));
-            UC[i].CM.cs = UC[i].CM.cs->next;
-        }
-        UC[i].CM.cs = NULL;
-        
-        fileDataArray = [[fileDataArray2 objectAtIndex:2] componentsSeparatedByString:@"\n"];
-        
-        
-        for(int k = 0;k < [fileDataArray count];k++){
+        for(int k = 0;k < [fileDataArray2 count] && ![[fileDataArray2 objectAtIndex:k] isEqualToString:@""];k++){
             if (k == 0) {
                 UC[i].CM.co = calloc(1, sizeof(COMBO));
                 COtop = UC[i].CM.co;
             }
-            items = [[fileDataArray objectAtIndex:k] componentsSeparatedByString:@","];
             
-            UC[i].CM.co->mbo = [[items objectAtIndex:0] retain];
+            UC[i].CM.co->mbo = [[fileDataArray2 objectAtIndex:k] retain];
             
             UC[i].CM.co->next = calloc(1, sizeof(COMBO));
             UC[i].CM.co = UC[i].CM.co->next;
@@ -3529,12 +3517,46 @@ bool eHandLFlag = false;
         
         
         UC[i].CM.co = COtop;
-        UC[i].CM.cs = CStop;
     }
 
 
 }
 
+-(void)saveDataCL{
+
+    NSString *directoryPath;
+    
+    directoryPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent];
+    [[NSFileManager defaultManager] changeCurrentDirectoryPath:directoryPath];
+    
+    char *cwd;
+    cwd = getcwd(NULL, 0);
+    
+    
+    
+    for (int i=0; i<CLN; i++) {
+        NSString *fdata = @"data/ComboList/CLdata";
+        fdata = [fdata stringByAppendingFormat:@"%d.txt", i+1];
+        
+        NSString *fileData = @"";
+        
+        COMBO *cTop = UC[i].CM.co;
+        int p = 0;
+        while(UC[i].CM.co){
+            if(p > 0)
+                fileData = [fileData stringByAppendingString:@"\n"];
+
+        fileData = [fileData stringByAppendingString:[NSString stringWithFormat:@"%@", UC[i].CM.co->mbo]];
+            
+            p++;
+            UC[i].CM.co = UC[i].CM.co->next;
+        }UC[i].CM.co = cTop;
+
+        [fileData writeToFile:fdata atomically:YES encoding:NSUTF8StringEncoding error:nil];
+    }
+
+}
+
 -(void)initFileDirectoryAttack{
     NSString *directoryPath;
     
@@ -3662,7 +3684,11 @@ bool eHandLFlag = false;
         UC[i].A->dmgExtend = [[items objectAtIndex:4] intValue];
         UC[i].A->imagine = [[items objectAtIndex:5] intValue];
         
-        UC[i].A->cmd = [[fileDataArray objectAtIndex:5] retain];
+        items = [[fileDataArray objectAtIndex:5] componentsSeparatedByString:@","];
+            
+        UC[i].A->cmd = [[items objectAtIndex:0] retain];
+        if([items count] >= 2)
+            UC[i].A->hasei = [[items objectAtIndex:1] intValue];
             
         items = [[fileDataArray objectAtIndex:6] componentsSeparatedByString:@","];
         
@@ -3987,7 +4013,11 @@ bool eHandLFlag = false;
             LC[i].A->dmgExtend = [[items objectAtIndex:4] intValue];
             LC[i].A->imagine = [[items objectAtIndex:5] intValue];
             
-            LC[i].A->cmd = [[fileDataArray objectAtIndex:5] retain];
+            items = [[fileDataArray objectAtIndex:5] componentsSeparatedByString:@","];
+            
+            LC[i].A->cmd = [[items objectAtIndex:0] retain];
+            if([items count] >= 2)
+                LC[i].A->hasei = [[items objectAtIndex:1] intValue];
             LC[i].A->msg = @"";
             
             //[self AddDAMAGE:&UC[i].A->D :0];
@@ -4313,7 +4343,11 @@ bool eHandLFlag = false;
             EQ[i].A->AN.movName = [[items objectAtIndex:0] retain];
             else EQ[i].A->AN.movName = @"";
             EQ[i].A->AN.frame = [[items objectAtIndex:1] intValue];
-            EQ[i].A->cmd = [[fileDataArray objectAtIndex:5] retain];
+            items = [[fileDataArray objectAtIndex:5] componentsSeparatedByString:@","];
+            
+            EQ[i].A->cmd = [[items objectAtIndex:0] retain];
+            if([items count] >= 2)
+                EQ[i].A->hasei = [[items objectAtIndex:1] intValue];
             EQ[i].A->msg = @"";
             
             //[self AddDAMAGE:&UC[i].A->D :0];
@@ -5585,7 +5619,7 @@ bool eHandLFlag = false;
                 //INIT 処理
                 
                 LC[cil].A->name = [@"新技" retain];
-                LC[cil].A->cmd = [@"A" retain];
+
                 LC[cil].A->rangeA = 1;
                 LC[cil].A->rangeB = 1;
                 LC[cil].A->extent = 0;
@@ -5603,7 +5637,6 @@ bool eHandLFlag = false;
                 LC[cil].A = LC[cil].A->next;
                 //INIT 処理
                 LC[cil].A->name = [@"新技" retain];
-                LC[cil].A->cmd = [@"A" retain];
                 LC[cil].A->rangeA = 1;
                 LC[cil].A->rangeB = 1;
                 LC[cil].A->extent = 0;
@@ -5631,7 +5664,6 @@ bool eHandLFlag = false;
                 LC[cil].A = (ATTACK*)malloc(sizeof(ATTACK));
                 //INIT 処理
                 LC[cil].A->name = [@"新技" retain];
-                LC[cil].A->cmd = [@"A" retain];
                 LC[cil].A->rangeA = 1;
                 LC[cil].A->rangeB = 1;
                 LC[cil].A->extent = 0;
@@ -5653,7 +5685,6 @@ bool eHandLFlag = false;
                 LC[cil].A = LC[cil].A->next;
                 //INIT 処理
                 LC[cil].A->name = [@"新技" retain];
-                LC[cil].A->cmd = [@"A" retain];
                 LC[cil].A->rangeA = 1;
                 LC[cil].A->rangeB = 1;
                 LC[cil].A->extent = 0;
@@ -5669,7 +5700,7 @@ bool eHandLFlag = false;
                 tmp->next = LC[cil].A;
                 // INIT 処理[self InitAttack:tmp];
                 tmp->name = [@"新技" retain];
-                tmp->cmd = [@"A" retain];
+
                 tmp->rangeA = 1;
                 tmp->rangeB = 1;
                 tmp->extent = 0;
@@ -5701,7 +5732,6 @@ bool eHandLFlag = false;
 
 
     A->name = [@"新技" retain];
-    A->cmd = [@"A" retain];
     A->msg = [@"" retain];
     A->rangeA = 1;
     A->rangeB = 1;
@@ -5764,7 +5794,6 @@ bool eHandLFlag = false;
     A->sora = 0;
     A->dmgExtend = 0;
     
-    A->cmd = @"A";
     A->msg = @"";
 
     
@@ -5894,12 +5923,7 @@ bool eHandLFlag = false;
     }
     
 }
--(IBAction)insertComboList:(id)sender{
 
-}
--(IBAction)removeComboList:(id)sender{
-    
-}
 
 -(IBAction)submitAttackList:(id)sender{
     
@@ -7086,6 +7110,8 @@ int omfgErase() {
     UCN = (int)chipNumb;
     UnitChipMax = (int)chipNumb/25+1;
     [self initUnitChipList];
+    [self saveData];
+    [self saveDataAL];
     [UCLRegisterPanel close];
 }
 -(IBAction)registCancelUCL:(id)sender{
@@ -7106,6 +7132,12 @@ int omfgErase() {
     [comboListMA removeAllObjects];
     [self didChangeValueForKey:@"comboListMA"];
     
+    
+    [AMbtnA addItemWithTitle:@"なし"];
+    [AMbtnB addItemWithTitle:@"なし"];
+    [AMbtnC addItemWithTitle:@"なし"];
+    [AMbtnD addItemWithTitle:@"なし"];
+    
     ATTACK *Atop = UC[clickIndex].A;
     while (UC[clickIndex].A != NULL) {
         if(UC[clickIndex].A->name != NULL){
@@ -7117,39 +7149,41 @@ int omfgErase() {
         UC[clickIndex].A = UC[clickIndex].A->next;
     }
     UC[clickIndex].A = Atop;
+
     
-    COMMANDS *CMtop = UC[clickIndex].CM.cs;
-    if(UC[clickIndex].CM.cs != NULL)
-    while (UC[clickIndex].CM.cs->cmd != NULL) {
-        NSMutableDictionary* dict = [NSMutableDictionary new];
-        [dict setValue:[NSString stringWithFormat:@"%@", UC[clickIndex].CM.cs->cmd] forKey:@"name"];
-        if(![UC[clickIndex].CM.cs->hasei isEqualToString:@"0"])
-            [dict setValue:[NSString stringWithFormat:@"%@", UC[clickIndex].CM.cs->hasei] forKey:@"hasei"];
-        
-        NSMutableArray *Array = [NSMutableArray array];
-        ATTACK *AAtop = UC[clickIndex].A;
-        while (UC[clickIndex].A != NULL) {
-            [Array addObject:UC[clickIndex].A->name];
-            UC[clickIndex].A = UC[clickIndex].A->next;
+    for(int i = 0;UC[clickIndex].A;i++){
+    
+        if(UC[clickIndex].A->cmd && ![UC[clickIndex].A->cmd isEqualToString:@"(null)"] && ![UC[clickIndex].A->cmd isEqualToString:@""]){
+            NSMutableDictionary *dict = [NSMutableDictionary new];
+            
+            [dict setValue:UC[clickIndex].A->cmd forKey:@"name"];
+            [dict setValue:[NSString stringWithFormat:@"%d", UC[clickIndex].A->hasei] forKey:@"hasei"];
+            
+            NSMutableArray *Array = [NSMutableArray array];
+            ATTACK *AA = Atop;
+            while (AA != NULL) {
+                [Array addObject:AA->name];
+                AA = AA->next;
+            }
+            [dict setValue:Array forKey:@"waza"];
+            [dict setValue:[NSString stringWithFormat:@"%d", i] forKey:@"wazaSet"];
+            
+            
+            [self willChangeValueForKey:@"commandListMA"];
+            [commandListMA addObject:dict];
+            [self didChangeValueForKey:@"commandListMA"];
         }
-        UC[clickIndex].A = AAtop;
-        [dict setValue:Array forKey:@"waza"];
         
-        [self willChangeValueForKey:@"commandListMA"];
-        [commandListMA addObject:dict];
-        [self didChangeValueForKey:@"commandListMA"];
-        UC[clickIndex].CM.cs = UC[clickIndex].CM.cs->next;
-    }
-    
-    
-    UC[clickIndex].CM.cs = CMtop;
-    
+        
     
+        
+        UC[clickIndex].A = UC[clickIndex].A->next;
+    }
+    UC[clickIndex].A = Atop;
     
     
     COMBO *Ctop = UC[clickIndex].CM.co;
-    if(UC[clickIndex].CM.co != NULL)
-    while (UC[clickIndex].CM.co->mbo != NULL) {
+    while (UC[clickIndex].CM.co != NULL) {
         NSMutableDictionary* dict = [NSMutableDictionary new];
         [dict setValue:[NSString stringWithFormat:@"%@", UC[clickIndex].CM.co->mbo] forKey:@"name"];
         [self willChangeValueForKey:@"comboListMA"];
@@ -7160,10 +7194,10 @@ int omfgErase() {
     UC[clickIndex].CM.co = Ctop;
     
     
-    [AMbtnA selectItemAtIndex:UC[clickIndex].CM.A];
-    [AMbtnB selectItemAtIndex:UC[clickIndex].CM.B];
-    [AMbtnC selectItemAtIndex:UC[clickIndex].CM.C];
-    [AMbtnD selectItemAtIndex:UC[clickIndex].CM.D];
+    [AMbtnA selectItemAtIndex:UC[clickIndex].CM.A+1];
+    [AMbtnB selectItemAtIndex:UC[clickIndex].CM.B+1];
+    [AMbtnC selectItemAtIndex:UC[clickIndex].CM.C+1];
+    [AMbtnD selectItemAtIndex:UC[clickIndex].CM.D+1];
     
     
     
@@ -7191,12 +7225,50 @@ int omfgErase() {
 
 -(IBAction)attackListTotalSubmit:(id)sender{
     
-    UC[clickIndex].CM.A = (int)[AMbtnA indexOfSelectedItem];
-    UC[clickIndex].CM.B = (int)[AMbtnB indexOfSelectedItem];
-    UC[clickIndex].CM.C = (int)[AMbtnC indexOfSelectedItem];
-    UC[clickIndex].CM.D = (int)[AMbtnD indexOfSelectedItem];
+    UC[clickIndex].CM.A = (int)[AMbtnA indexOfSelectedItem]-1;
+    UC[clickIndex].CM.B = (int)[AMbtnB indexOfSelectedItem]-1;
+    UC[clickIndex].CM.C = (int)[AMbtnC indexOfSelectedItem]-1;
+    UC[clickIndex].CM.D = (int)[AMbtnD indexOfSelectedItem]-1;
+    
+    ATTACK *aTop2 = UC[clickIndex].A;
+    while (UC[clickIndex].A) {
+        UC[clickIndex].A->cmd = NULL;
+        UC[clickIndex].A->hasei = false;
+        UC[clickIndex].A = UC[clickIndex].A->next;
+    }
+    UC[clickIndex].A = aTop2;
     
+    for(int i = 0;i < [commandListMA count];i++){
+        
+        ATTACK *aTop = UC[clickIndex].A;
+        for(int k = 0;k < [[commandListMA[i] valueForKeyPath:@"wazaSet"] intValue];k++)
+            UC[clickIndex].A = UC[clickIndex].A->next;
+        UC[clickIndex].A->cmd = [[commandListMA[i] valueForKeyPath:@"name"] retain];
+        UC[clickIndex].A->hasei = [[commandListMA[i] valueForKeyPath:@"hasei"] intValue];
+        
+        UC[clickIndex].A = aTop;
+    }
+    
+    COMBO *cTop = UC[clickIndex].CM.co;
+    for(int i = 0;i < [comboListMA count];i++){
+        if (i == 0) {
+            UC[clickIndex].CM.co =calloc(1, sizeof(COMBO));
+            cTop = UC[clickIndex].CM.co;
+        }
+        UC[clickIndex].CM.co->mbo = [[comboListMA[i] valueForKeyPath:@"name"] retain];
+        
+        if(i+1 < [comboListMA count]){
+            UC[clickIndex].CM.co->next =calloc(1, sizeof(COMBO));
+        }
+        UC[clickIndex].CM.co = UC[clickIndex].CM.co->next;
+    }UC[clickIndex].CM.co = cTop;
+    
+    
+    
+    
+    [self saveDataCL];
     [UCLPanelAttackList close];
+    
 }
 -(IBAction)attackListOpenBtn:(id)sender{
     clickedRowAT = -1;
@@ -7212,10 +7284,178 @@ int omfgErase() {
      */
     [UCLPanelAttack makeKeyAndOrderFront:nil];
 }
--(IBAction)commandListAdd:(id)sender{}
--(IBAction)commandListRemove:(id)sender{}
--(IBAction)comboListAdd:(id)sender{}
--(IBAction)comboListRemove:(id)sender{}
+-(IBAction)commandListAdd:(id)sender{
+    
+    if(1){
+        NSMutableDictionary *dict = [NSMutableDictionary new];
+        
+        NSMutableArray *Array = [NSMutableArray array];
+        ATTACK *AA = UC[clickIndex].A;
+        while (AA != NULL) {
+            [Array addObject:AA->name];
+            AA = AA->next;
+        }
+        [dict setValue:Array forKey:@"waza"];
+        
+        if([commandListMA count] == 0){
+            
+            [self willChangeValueForKey:@"commandListMA"];
+            [commandListMA insertObject:dict atIndex:[commandListMA count]];
+            [self didChangeValueForKey:@"commandListMA"];
+            [commandListAC setSelectionIndex:999];
+        }else if(CMDrow == -1){
+            
+            [self willChangeValueForKey:@"commandListMA"];
+            [commandListMA insertObject:dict atIndex:[commandListMA count]];
+            [self didChangeValueForKey:@"commandListMA"];
+            [commandListAC setSelectionIndex:999];
+            
+        }else if(CMDrow > 0){
+
+            [self willChangeValueForKey:@"commandListMA"];
+            [commandListMA insertObject:dict atIndex:CMDrow];
+            [self didChangeValueForKey:@"commandListMA"];
+            [commandListAC setSelectionIndex:999];
+            
+        }else{
+
+            [self willChangeValueForKey:@"commandListMA"];
+            [commandListMA insertObject:dict atIndex:commandListMA];
+            [self didChangeValueForKey:@"commandListMA"];
+            [commandListAC setSelectionIndex:999];
+        }
+        
+
+    }
+
+
+
+
+
+
+
+    
+    
+    
+    
+    
+}
+-(IBAction)commandListRemove:(id)sender{
+
+    if(1){
+        if([commandListMA count] == 0){
+            return;
+        }else if(CMDrow == -1){
+            
+            [self willChangeValueForKey:@"commandListMA"];
+            [commandListMA removeObjectAtIndex:[commandListMA count]-1];
+            [self didChangeValueForKey:@"commandListMA"];
+            [commandListAC setSelectionIndex:999];
+            
+        }else if(CMDrow > 0){
+            
+            [self willChangeValueForKey:@"commandListMA"];
+            [commandListMA removeObjectAtIndex:CMDrow];
+            [self didChangeValueForKey:@"commandListMA"];
+            [commandListAC setSelectionIndex:999];
+            
+            
+        }else{
+
+            [self willChangeValueForKey:@"commandListMA"];
+            [commandListMA removeObjectAtIndex:CMDrow];
+            [self didChangeValueForKey:@"commandListMA"];
+            [commandListAC setSelectionIndex:999];
+            
+
+        }
+
+    }
+
+    CMDrow = -1;
+    
+    
+
+
+
+
+}
+-(IBAction)comboListAdd:(id)sender{
+    if(1){
+        NSMutableDictionary *dict = [NSMutableDictionary new];
+        
+        if([comboListMA count] == 0){
+            
+            [self willChangeValueForKey:@"comboListMA"];
+            [comboListMA insertObject:dict atIndex:[comboListMA count]];
+            [self didChangeValueForKey:@"comboListMA"];
+            [comboListAC setSelectionIndex:999];
+        }else if(CMBrow == -1){
+            
+            [self willChangeValueForKey:@"comboListMA"];
+            [comboListMA insertObject:dict atIndex:[comboListMA count]];
+            [self didChangeValueForKey:@"comboListMA"];
+            [comboListAC setSelectionIndex:999];
+            
+        }else if(CMBrow > 0){
+            
+            [self willChangeValueForKey:@"comboListMA"];
+            [comboListMA insertObject:dict atIndex:CMDrow];
+            [self didChangeValueForKey:@"comboListMA"];
+            [comboListAC setSelectionIndex:999];
+            
+        }else{
+            
+            [self willChangeValueForKey:@"comboListMA"];
+            [comboListMA insertObject:dict atIndex:comboListMA];
+            [self didChangeValueForKey:@"comboListMA"];
+            [comboListAC setSelectionIndex:999];
+        }
+        
+        
+    }
+
+
+
+
+
+}
+-(IBAction)comboListRemove:(id)sender{
+
+    if(1){
+        if([comboListMA count] == 0){
+            return;
+        }else if(CMBrow == -1){
+            
+            [self willChangeValueForKey:@"comboListMA"];
+            [comboListMA removeObjectAtIndex:[comboListMA count]-1];
+            [self didChangeValueForKey:@"comboListMA"];
+            [comboListAC setSelectionIndex:999];
+            
+        }else if(CMBrow > 0){
+            
+            [self willChangeValueForKey:@"comboListMA"];
+            [comboListMA removeObjectAtIndex:CMBrow];
+            [self didChangeValueForKey:@"comboListMA"];
+            [comboListAC setSelectionIndex:999];
+            
+            
+        }else{
+            
+            [self willChangeValueForKey:@"comboListMA"];
+            [comboListMA removeObjectAtIndex:CMBrow];
+            [self didChangeValueForKey:@"comboListMA"];
+            [comboListAC setSelectionIndex:999];
+            
+            
+        }
+        
+    }
+    
+    CMBrow = -1;
+
+
+}
 
 
 -(IBAction)addSubjMark:(id)sender{
@@ -7373,6 +7613,10 @@ int omfgErase() {
 -(IBAction)attackEffectPreviewBtn:(id)sender{
     
     
+    
+    
+    
+    
     ATTACK *A;
     
     if(EQmodeFlag){
@@ -7522,6 +7766,8 @@ int omfgErase() {
             }
         }
         [ATEffectAniWindow makeKeyAndOrderFront:nil];
+        attackEffectPreviewBtnFlag = true;
+        [UCLtime invalidate];
     }
 }
 
@@ -7683,6 +7929,13 @@ int omfgErase() {
 -(IBAction)attackEffectAniCloseBtn:(id)sender{
     
     frameRunFlag = false;
+    UCLtime  = [NSTimer
+                scheduledTimerWithTimeInterval:1.0/30
+                target:self
+                selector:@selector(EventLoopUCL:)
+                userInfo:nil
+                repeats:YES
+                ];
     [ATEffectAniWindow close];
     
 }
@@ -8018,79 +8271,7 @@ int omfgErase() {
 
 -(void)EventLoopANI:(NSTimer*)time{
     
-    static int frameCnt = 0;
-    
-    if(!frameRunFlag){
-        frameCnt = 0;
-        return;
-    }
-    
-    ATTACK *A;
-    
-    if(EQmodeFlag){
-        A = EQ[clickIndexEQ].A;
-    }else{
-        if(!loadChipSideFlag){
-        A = UC[clickIndex].A;
-        }else{
-        A = LC[cil].A;
-        }
-        
-    }
-    atkTop = A;
-    
-    for(int i = 0;i < clickIndexAL;i++){
-        A = A->next;
-    }
     
-    if(frameCnt == 0){
-        
-        ani = A->AN.ANI;
-        ANI *aniTop = ani;
-        
-        for (int i = 0; i < frameNum-1;i++) {
-            ani = ani->next;
-        }
-        
-        if(ani->snd){
-            [ani->snd setCurrentTime:0];
-            [ani->snd play];
-            ani->snd.loops = NO;
-        }
-        ani = aniTop;
-        
-        A->AN.ANI = ani;
-    }
-    
-    if(frameCnt < A->AN.frame){
-        frameCnt++;
-    }else{
-        
-        frameCnt = 0;
-        
-        if(frameNum < frameMax){
-            frameNum++;
-        }else{
-            frameNum = 1;
-            
-            A->AN.ANI = ani;
-        }
-        [ATframeCntTF setStringValue:[NSString stringWithFormat:@"%d/%d", frameNum, frameMax]];
-        
-    }
-    
-    A = atkTop;
-    
-    if(EQmodeFlag){
-        EQ[clickIndexEQ].A = atkTop;
-    }else{
-        if(!loadChipSideFlag){
-        UC[clickIndex].A = atkTop;
-        }else{
-        LC[cil].A = atkTop;
-        }
-    
-    }
 }
 
 -(IBAction)attackEffectRun:(id)sender{
@@ -8143,7 +8324,9 @@ int omfgErase() {
 }
 
 
-
+-(void)aniTFChanged{
+    [ATframeCntTF setStringValue:[NSString stringWithFormat:@"%d/%d", frameNum, frameMax]];
+}
 
 
 
@@ -8176,7 +8359,7 @@ int omfgErase() {
     
     if (self) {
         timer  = [NSTimer
-                 scheduledTimerWithTimeInterval:0.015f
+                 scheduledTimerWithTimeInterval:1.0/30
                  target:self
                  selector:@selector(EventLoopAN:)
                  userInfo:nil
@@ -8189,6 +8372,80 @@ int omfgErase() {
 }
 
 -(void)EventLoopAN:(NSTimer*)timer{
+    static int frameCnt = 0;
+    
+    if(!frameRunFlag){
+        frameCnt = 0;
+        return;
+    }
+    
+    ATTACK *A;
+    
+    if(EQmodeFlag){
+        A = EQ[clickIndexEQ].A;
+    }else{
+        if(!loadChipSideFlag){
+            A = UC[clickIndex].A;
+        }else{
+            A = LC[cil].A;
+        }
+        
+    }
+    atkTop = A;
+    
+    for(int i = 0;i < clickIndexAL;i++){
+        A = A->next;
+    }
+    
+    if(frameCnt == 0){
+        
+        ani = A->AN.ANI;
+        ANI *aniTop = ani;
+        
+        for (int i = 0; i < frameNum-1;i++) {
+            ani = ani->next;
+        }
+        
+        if(ani->snd){
+            [ani->snd setCurrentTime:0];
+            [ani->snd play];
+            ani->snd.loops = NO;
+        }
+        ani = aniTop;
+        
+        A->AN.ANI = ani;
+    }
+    
+    if(frameCnt < A->AN.frame){
+        frameCnt++;
+    }else{
+        
+        frameCnt = 0;
+        
+        if(frameNum < frameMax){
+            frameNum++;
+        }else{
+            frameNum = 1;
+            
+            A->AN.ANI = ani;
+        }
+        [UnitChipListInst aniTFChanged];
+        
+    }
+    
+    A = atkTop;
+    
+    if(EQmodeFlag){
+        EQ[clickIndexEQ].A = atkTop;
+    }else{
+        if(!loadChipSideFlag){
+            UC[clickIndex].A = atkTop;
+        }else{
+            LC[cil].A = atkTop;
+        }
+        
+    }
+    
     [self setNeedsDisplay:YES];
 }