From 3b72e3ebf077dc80e55f4659bff5085a0b8cda8d Mon Sep 17 00:00:00 2001 From: Killery Date: Wed, 3 Aug 2016 11:36:18 +0900 Subject: [PATCH] =?utf8?q?=E7=AB=8B=E3=81=A1=E7=B5=B5=E3=83=8F=E3=82=99?= =?utf8?q?=E3=82=AF=E3=82=99=E5=AE=8C=E5=85=A8=E3=81=AB=E6=B2=BB=E3=81=97?= =?utf8?q?=E3=81=9Fw?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Awars III/EventScene.m | 16 +- Awars III/FieldScene.h | 4 + Awars III/FieldScene.m | 210 +++++++++- Awars III/ScenarioEditor.h | 42 +- Awars III/ScenarioEditor.m | 846 +++++++++++++++++++++++++++++++++------- Awars III/StandView.m | 5 +- Awars III/StringText.h | 11 +- Awars III/StringText.m | 8 +- Awars III/en.lproj/MainMenu.xib | 62 ++- 9 files changed, 998 insertions(+), 206 deletions(-) diff --git a/Awars III/EventScene.m b/Awars III/EventScene.m index 1c1ed94..39ae9f9 100755 --- a/Awars III/EventScene.m +++ b/Awars III/EventScene.m @@ -757,10 +757,24 @@ return; } } - data = [[data stringByAppendingFormat:@"%@,%@\n", ST->iNameWall, ST->iNameWallSort] retain]; + data = [[data stringByAppendingFormat:@"\n%@,%@", ST->iNameWall, @"取り込んだ画像"] retain]; [data writeToFile:pathDATA atomically:YES encoding:NSUTF8StringEncoding error:nil]; + pathDATA = @"data/StringList/preset2.txt"; + + data = [NSString stringWithContentsOfFile:pathDATA encoding:NSUTF8StringEncoding error:nil]; + + dataArray = [data componentsSeparatedByString:@"\n"]; + for(int i = 0;i < [dataArray count];i++){ + NSArray *item = [[dataArray objectAtIndex:i] componentsSeparatedByString:@","]; + if([[item objectAtIndex:0] isEqualToString:@"取り込んだ画像"]){ + return; + } + } + data = [[data stringByAppendingFormat:@"\n%@", @"取り込んだ画像"] retain]; + + [data writeToFile:pathDATA atomically:YES encoding:NSUTF8StringEncoding error:nil]; } diff --git a/Awars III/FieldScene.h b/Awars III/FieldScene.h index 76cb85b..3da369f 100755 --- a/Awars III/FieldScene.h +++ b/Awars III/FieldScene.h @@ -21,11 +21,13 @@ #import "SaveDataList.h" #import "LevelList.h" #import "LoadChipList.h" +#import "ScenarioEditor.h" #define SAVEDATADATMAX 4096 #define DATAFILE_NAME "data.dat" #define INSTANT_IMG "image.png" #define OPTIONFILE_NAME "opData.dat" +#define STANDFILE_NAME "stand.dat" #define FIELD_TYPE_A 0 #define FIELD_TYPE_B 1 @@ -1421,6 +1423,8 @@ int STErow; -(void)loadOptionMenu; -(void)saveOptionMenu; +-(void)loadStandImages; +-(void)saveStandImages; @end diff --git a/Awars III/FieldScene.m b/Awars III/FieldScene.m index 7741e31..bffa2ea 100755 --- a/Awars III/FieldScene.m +++ b/Awars III/FieldScene.m @@ -866,18 +866,21 @@ return strOut; } --(NSImage*)readNSImage:(FILE*)fp imgOut:(NSImage*)imgOut dcnt:(int)dcnt dfix:(int)dfix{ +-(NSImage*)readNSImage:(FILE*)fp imgOut:(NSImage*)imgOut dcnt:(int*)dcnt dfix:(int*)dfix{ unsigned char idat[1024]; int size = 0; + *dcnt = [self readInt:fp]; + *dfix = [self readInt:fp]; + NSMutableData *binaryData = [NSMutableData dataWithCapacity:sizeof(idat)]; fpos_t fpt = 0; - for(int i = 0;i < dcnt;i++){ + for(int i = 0;i < *dcnt;i++){ size += fread(idat, 1, 1024, fp); - if(dcnt-1 == i){ - fpt += dfix; + if(*dcnt-1 == i){ + fpt += *dfix; fsetpos(fp, &fpt); } @@ -906,8 +909,7 @@ sdd2[datRow].dB[r].dead = (int)[self readInt:fp]; /* - sdd2[datRow].dB[r].imgAdCnt = (int)[self readInt:fp]; - sdd2[datRow].dB[r].imgAdFix = (int)[self readInt:fp]; + sdd2[datRow].dB[r].img = [self readNSImage:fp imgOut:sdd2[datRow].dB[r].img dcnt:sdd2[datRow].dB[r].imgAdCnt dfix:sdd2[datRow].dB[r].imgAdFix]; */ [self readBuildChipD:fp val:&sdd2[datRow].dB[r].C]; @@ -958,8 +960,7 @@ sdd2[datRow].dU[r].army = [[self readNSString:fp strOut:sdd2[datRow].dU[r].army] retain]; /* - sdd2[datRow].dU[r].imgAdCnt = (int)[self readInt:fp]; - sdd2[datRow].dU[r].imgAdFix = (int)[self readInt:fp]; + sdd2[datRow].dU[r].img = [self readNSImage:fp imgOut:sdd2[datRow].dU[r].img dcnt:sdd2[datRow].dU[r].imgAdCnt dfix:sdd2[datRow].dU[r].imgAdFix]; */ @@ -2210,10 +2211,8 @@ sdd2[datRow].name = [[self readNSString:fpi strOut:sdd2[datRow].name] retain]; - - sdd2[datRow].imgAdressCnt = (int)[self readInt:fpi]; - sdd2[datRow].imgAdressFix = (int)[self readInt:fpi]; - sdd2[datRow].img = [[self readNSImage:fpi imgOut:sdd2[datRow].img dcnt:sdd2[datRow].imgAdressCnt dfix:sdd2[datRow].imgAdressFix] retain]; + + sdd2[datRow].img = [[self readNSImage:fpi imgOut:sdd2[datRow].img dcnt:&sdd2[datRow].imgAdressCnt dfix:&sdd2[datRow].imgAdressFix] retain]; sdd2[datRow].MFselectedRow = (int)[self readInt:fpi]; sdd2[datRow].storyNumb = (int)[self readInt:fpi]; @@ -2337,9 +2336,7 @@ wtfom.onlyOnceOpening = (int)[self readInt:fpi]; wtfom.newOpeningIsShown = (int)[self readInt:fpi]; - wtfom.adCntIT = (int)[self readInt:fpi]; - wtfom.adFixIT = (int)[self readInt:fpi]; - wtfom.imgTitle = [[self readNSImage:fpi imgOut:wtfom.imgTitle dcnt:wtfom.adCntIT dfix:wtfom.adFixIT] retain]; + wtfom.imgTitle = [[self readNSImage:fpi imgOut:wtfom.imgTitle dcnt:&wtfom.adCntIT dfix:&wtfom.adFixIT] retain]; directoryPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; @@ -2380,6 +2377,189 @@ fclose(fpi); } + + +-(void)saveStandImages{ + + int cntSTAND = 0; + int cntBASE = 0; + int cntLAYER = 0; + + I = Itop; + cntSTAND = 0; + while (I) { + IBtop = I->B; + + + + cntBASE = 0; + while(I->B){ + IBLtop = I->B->L; + + + + + cntLAYER = 0; + while(I->B->L){ + + + + + + I->B->L = I->B->L->next; + cntLAYER++; + }I->B->L = IBLtop; + I->B->cntLAYER = cntLAYER; + I->B = I->B->next; + cntBASE++; + }I->B = IBtop; + I->cntBASE = cntBASE; + I = I->next; + cntSTAND++; + }I = Itop; + + + while(I){ + stand.cntSTAND = cntSTAND; + I = I->next; + }I = Itop; + + + NSString *directoryPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; + [[NSFileManager defaultManager] changeCurrentDirectoryPath:directoryPath]; + + + NSString *Cpath = @"data/Scenario/"; + [[NSFileManager defaultManager] changeCurrentDirectoryPath:Cpath]; + + FILE *fp; + + fp = fopen(STANDFILE_NAME, "wb"); + if(!fp) + return; + + [self writeInt:fp val:stand.cntSTAND]; + while (I) { + [self writeInt:fp val:I->index]; + [self writeNSString:fp str:I->name]; + [self writeInt:fp val:I->registerNum]; + + + [self writeInt:fp val:I->cntBASE]; + IBtop = I->B; + while(I->B){ + [self writeInt:fp val:I->B->index]; + [self writeNSString:fp str:I->B->name]; + [self writeNSImage:fp str:I->B->img adCnt:&I->B->imgAdCnt adFix:&I->B->imgAdFix]; + [self writeInt:fp val:I->B->x]; + [self writeInt:fp val:I->B->y]; + [self writeInt:fp val:I->B->z]; + + [self writeInt:fp val:I->B->cntLAYER]; + IBLtop = I->B->L; + while(I->B->L){ + [self writeInt:fp val:I->B->L->index]; + [self writeNSString:fp str:I->B->L->name]; + [self writeNSImage:fp str:I->B->L->img adCnt:&I->B->L->imgAdCnt adFix:&I->B->L->imgAdFix]; + [self writeInt:fp val:I->B->L->x]; + [self writeInt:fp val:I->B->L->y]; + [self writeInt:fp val:I->B->L->z]; + [self writeInt:fp val:I->B->L->visible]; + [self writeInt:fp val:I->B->L->visibleInstant]; + + I->B->L = I->B->L->next; + }I->B->L = IBLtop; + I->B = I->B->next; + }I->B = IBtop; + I = I->next; + }I = Itop; + + fclose(fp); +} + +-(void)loadStandImages{ + + + NSString *directoryPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; + [[NSFileManager defaultManager] changeCurrentDirectoryPath:directoryPath]; + + + NSString *Cpath = @"data/Scenario/"; + [[NSFileManager defaultManager] changeCurrentDirectoryPath:Cpath]; + + FILE *fp; + + fp = fopen(STANDFILE_NAME, "rb"); + if(!fp) + return; + + stand.cntSTAND = (int)[self readInt:fp]; + for (int i = 0;i < stand.cntSTAND;i++){ + + if(i == 0){ + stand.S = calloc(1, sizeof(STAND)); + if(i + 1 < stand.cntSTAND) + stand.S->next = calloc(1, sizeof(STAND)); + Itop = stand.S; + }else if(i + 1 < stand.cntSTAND) + stand.S->next = calloc(1, sizeof(STAND)); + + stand.S->index = (int)[self readInt:fp]; + stand.S->name = [[self readNSString:fp strOut:stand.S->name] retain]; + stand.S->registerNum = (int)[self readInt:fp]; + + stand.S->cntBASE = (int)[self readInt:fp]; + IBtop = stand.S->B; + for (int j = 0;j < stand.S->cntBASE;j++){ + if(j == 0){ + stand.S->B = calloc(1, sizeof(BASE)); + if(j + 1 < stand.S->cntBASE) + stand.S->B->next = calloc(1, sizeof(BASE)); + IBtop = stand.S->B; + }else if(j + 1 < stand.S->cntBASE) + stand.S->B->next = calloc(1, sizeof(BASE)); + + stand.S->B->index = (int)[self readInt:fp]; + stand.S->B->name = [[self readNSString:fp strOut:stand.S->B->name] retain]; + stand.S->B->img = [[self readNSImage:fp imgOut:stand.S->B->img dcnt:&stand.S->B->imgAdCnt dfix:&stand.S->B->imgAdFix] retain]; + stand.S->B->x = (int)[self readInt:fp]; + stand.S->B->y = (int)[self readInt:fp]; + stand.S->B->z = (int)[self readInt:fp]; + + stand.S->B->cntLAYER = (int)[self readInt:fp]; + IBLtop = stand.S->B->L; + for (int k = 0;k < stand.S->B->cntLAYER;k++){ + if(k == 0){ + stand.S->B->L = calloc(1, sizeof(LAYER)); + if(k + 1 < stand.S->B->cntLAYER) + stand.S->B->L->next = calloc(1, sizeof(LAYER)); + IBLtop = stand.S->B->L; + }else if(k + 1 < stand.S->B->cntLAYER) + stand.S->B->L->next = calloc(1, sizeof(LAYER)); + + + stand.S->B->L->index = (int)[self readInt:fp]; + stand.S->B->L->name = [[self readNSString:fp strOut:stand.S->B->L->name] retain]; + stand.S->B->L->img = [[self readNSImage:fp imgOut:stand.S->B->L->img dcnt:&stand.S->B->L->imgAdCnt dfix:&stand.S->B->L->imgAdFix] retain]; + stand.S->B->L->x = (int)[self readInt:fp]; + stand.S->B->L->y = (int)[self readInt:fp]; + stand.S->B->L->z = (int)[self readInt:fp]; + stand.S->B->L->visible = (int)[self readInt:fp]; + stand.S->B->L->visibleInstant = (int)[self readInt:fp]; + + stand.S->B->L = stand.S->B->L->next; + }stand.S->B->L = IBLtop; + stand.S->B = stand.S->B->next; + }stand.S->B = IBtop; + stand.S = stand.S->next; + }stand.S = Itop; + + I = stand.S; + + fclose(fp); +} + + -(void)openingAVPVfunc{ if(openingAVP && openingAVPVisActive){ diff --git a/Awars III/ScenarioEditor.h b/Awars III/ScenarioEditor.h index dab75c5..86f1b6c 100755 --- a/Awars III/ScenarioEditor.h +++ b/Awars III/ScenarioEditor.h @@ -10,24 +10,26 @@ #import "StringText.h" typedef struct _STAND{ + int cntBASE; struct _STAND *next; struct _BASE *B; NSString *name; - NSString *fName; + int index; int registerNum; }STAND; typedef struct _BASE{ + int cntLAYER; struct _BASE *next; int index; struct _LAYER *L; NSString *name; - NSString *postName; - NSString *iName; NSImage *img; + int imgAdCnt; + int imgAdFix; int x; int y; @@ -39,9 +41,10 @@ typedef struct _LAYER{ int index; NSString *name; - NSString *postName; - NSString *iName; NSImage *img; + int imgAdCnt; + int imgAdFix; + bool visible; bool visibleInstant; @@ -51,6 +54,11 @@ typedef struct _LAYER{ int z; }LAYER; +typedef struct _STANDARRAY{ + int cntSTAND; + struct _STAND *S; + +}STANDARRAY; typedef struct _TEXT{ @@ -66,6 +74,8 @@ enum{ TEXT TX[TEXTMAX]; +STANDARRAY stand; + STAND *I; STAND *Itop; BASE *IBtop; @@ -100,10 +110,6 @@ NSInteger st; NSInteger sl; struct _STRING *STRtop[TEXTMAX]; -STANDIMAGE *SItop; -STANDIMAGE *si; -STANDIMAGE *siPost; - struct _STRING *STRSI; struct _STRING *STRSItop; @@ -111,15 +117,16 @@ int siCnt; int siPostNum; NSString *STANDADDSTRING; -STANDIMAGE *STANDADD; NSSound *testSnd; NSSound *testSndEff; +bool baseClickedFlag; +bool layerClickedFlag; + @interface ScenarioEditor : NSObject { IBOutlet NSImageView *testIV; - - + IBOutlet NSWindow *SEstandWindow; IBOutlet NSImageView *SEIV; @@ -285,6 +292,10 @@ NSSound *testSndEff; -(void)testSEtest; +-(void)setTFpos; +-(IBAction)TFposXsubmit:(id)sender; +-(IBAction)TFposYsubmit:(id)sender; + @end NSImage *SEstandImg; @@ -305,9 +316,12 @@ NSImage *SEstandImg; NSImage *SEstandImgST; int STSNUM; +int txNumb; +int txiNumb; +bool TXimgCaptured; +bool TXimgIsNull; + TEXT TXCPY[TEXTMAX]; -STRING *TXCPYStop; -STANDIMAGE *TXCPYSItop; bool TXCPYcpy; bool allowTXcpy; @interface SEstandViewST: NSView diff --git a/Awars III/ScenarioEditor.m b/Awars III/ScenarioEditor.m index 3e5eced..3589d50 100755 --- a/Awars III/ScenarioEditor.m +++ b/Awars III/ScenarioEditor.m @@ -52,11 +52,13 @@ [TV1 setTarget:self]; [TV1 setAction:@selector(TV1sgl:)]; + [TV1 setDoubleAction:@selector(TV1dbl:)]; MA1 = [NSMutableArray new]; [TV2 setTarget:self]; [TV2 setAction:@selector(TV2sgl:)]; + [TV2 setDoubleAction:@selector(TV2dbl:)]; MA2 = [NSMutableArray new]; @@ -70,6 +72,9 @@ deletedName = [NSMutableArray new]; baseListDC = @{@"1":baseListMA}; + + [self loadStandData]; + [self loadData]; } -(id)init{ @@ -101,18 +106,18 @@ TXCPY[i].fileName = NULL; } - OMFGflag = true; [self initText]; [self addLineList]; [self initFileDirectory]; - [self loadStandData]; - [self loadData]; + + OMFGflag = true; Irow = -1; IBrow = -1; IBLrow = -1; st = -1; [textListAC setSelectionIndex:9999]; + /* I = Itop; while(I){ @@ -137,7 +142,7 @@ I = I->next; }I = Itop; - + */ SEMArow = -1; TXCPYcpy = true; @@ -147,6 +152,28 @@ return self; } +-(void)TV1dbl:(id)sender{ + + TVCrow1 = -1; + TVCrow2 = -1; + IBrow = -1; + IBLrow = -1; + [AC1 setSelectionIndex:9999]; + +} + +-(void)TV2dbl:(id)sender{ + + TVCrow2 = -1; + IBLrow = -1; + [AC2 setSelectionIndex:9999]; +} + +-(void)setTFpos{ + + [TFposX setStringValue:[NSString stringWithFormat:@"%d",imgGx]]; + [TFposX setStringValue:[NSString stringWithFormat:@"%d",imgGy]]; +} -(void)ClickSETV:(id)sender{ @@ -514,37 +541,66 @@ -(void)TV1sgl:(id)sender{ - static NSInteger postClicedrow; - postClicedrow = TVCrow1; + IBrow = (int)[TV1 clickedRow]; + if(!b) return; - I = Itop; + TV1sglFlag = true; + TV2sglFlag = false; - for(int i = 0;i < Irow;i++){ + TVCrow1 = [TV1 clickedRow]; + TVCrow2 = [TV2 clickedRow]; + + [self initMA2]; + + layerClickedFlag = false; + baseClickedFlag = true; + + IBrow = (int)[TV1 clickedRow]; + + I = Itop; + for (int i = 0;i < Irow;i++) { I = I->next; } - b = I->B; + if(!I) + return; + IBtop = I->B; + for (int j = 0;j < IBrow;j++) { + I->B = I->B->next; + } - if(!b) return; + if(!I->B) + return; + [TFposX setStringValue:[NSString stringWithFormat:@"%d", I->B->x]]; + [TFposY setStringValue:[NSString stringWithFormat:@"%d", I->B->y]]; - TV1sglFlag = true; - TV2sglFlag = false; - TVCrow1 = [TV1 clickedRow]; - TVCrow2 = [TV2 clickedRow]; + I->B = IBtop; + I = Itop; +} + +-(void)initMA2{ [self willChangeValueForKey:@"MA2"]; [MA2 removeAllObjects]; [self didChangeValueForKey:@"MA2"]; - BASE *bTop = b; + I = Itop; + + for(int i = 0;i < Irow;i++){ + I = I->next; + } + + b = I->B; + + BASE *bTop = I->B; b = bTop; - for (int i = 0;i < TVCrow1;i++) { + for (int i = 0;i < IBrow;i++) { b = b->next; } - if(TVCrow1 >= 0 && b){ + if(IBrow >= 0 && b){ LAYER *lTop = b->L; @@ -565,31 +621,68 @@ } b = bTop; + [AC2 setSelectionIndex:9999]; I = Itop; - if(TVCrow1 != postClicedrow) layerLoadOver = true; } -(void)TV2sgl:(id)sender{ + IBLrow = (int)[TV2 clickedRow]; + TVCrow2 = [TV2 clickedRow]; //if(!b->L) return; TV2sglFlag = true; TV1sglFlag = false; + layerClickedFlag = true; + baseClickedFlag = false; + + IBLrow = (int)[TV2 clickedRow]; + + I = Itop; + for (int i = 0;i < Irow;i++) { + I = I->next; + } + + if(!I) + return; + IBtop = I->B; + for (int j = 0;j < IBrow;j++) { + I->B = I->B->next; + } + if(!I->B) + return; + IBLtop = I->B->L; + for (int j = 0;j < IBLrow;j++) { + I->B->L = I->B->L->next; + } + if(!I->B->L) + return; + + [TFposX setStringValue:[NSString stringWithFormat:@"%d",I->B->L->x]]; + [TFposY setStringValue:[NSString stringWithFormat:@"%d",I->B->L->y]]; + + I->B->L = IBLtop; + I->B = IBtop; + I = Itop; + } -(void)DoubleClickSTAND:(id)sender{ if(Irow < 0) return; + + /* + I = Itop; + for(int i = 0;i < [standListMA count];i++){ + I->name = [[standListMA[i] valueForKey:@"name"] retain]; + + I = I->next; + }I = Itop; + */ - if(![standListMA[Irow] valueForKey:@"file"]) - return; - if([[standListMA[Irow] valueForKey:@"file"] isEqualToString:@""]) - return; - if([[standListMA[Irow] valueForKey:@"file"] isEqualToString:@"(null)"]) - return; - [self initLineBaseLayer]; + //[self initLineBaseLayer]; IBrow = -1; IBLrow = -1; [baseListAC setSelectionIndex:9999]; @@ -600,11 +693,15 @@ [self loadStandData]; [self loadData]; [self initMA1MA2]; + + [AC1 setSelectionIndex:9999]; + [AC2 setSelectionIndex:9999]; [standEditorPanel makeKeyAndOrderFront:nil]; } -(void)ClickSTAND:(id)sender{ Irow = (int)[standListTV clickedRow]; + } -(void)DoubleClickBASE:(id)sender{ @@ -616,6 +713,9 @@ } -(void)ClickBASE:(id)sender{ + + + /* IBrow = (int)[baseListTV clickedRow]; [layerListAC setSelectionIndex:9999]; @@ -654,7 +754,112 @@ */ } +-(IBAction)TFposXsubmit:(id)sender{ + + if(baseClickedFlag && IBrow >= 0){ + + I = Itop; + for (int i = 0;i < Irow;i++) { + I = I->next; + } + + IBtop = I->B; + for (int j = 0;j < IBrow;j++) { + I->B = I->B->next; + } + + I->B->x = [TFposX intValue]; + + I->B = IBtop; + + I = Itop; + + }else if(layerClickedFlag && IBrow >= 0){ + + I = Itop; + for (int i = 0;i < Irow;i++) { + I = I->next; + } + + IBtop = I->B; + for (int j = 0;j < IBrow;j++) { + I->B = I->B->next; + } + + IBLtop = I->B->L; + for (int j = 0;j < IBLrow;j++) { + I->B->L = I->B->L->next; + } + + + I->B->L->x = [TFposX intValue]; + + I->B->L = IBLtop; + I->B = IBtop; + I = Itop; + + }else{ + + + + } + +} +-(IBAction)TFposYsubmit:(id)sender{ + + if(baseClickedFlag && IBrow >= 0){ + + I = Itop; + for (int i = 0;i < Irow;i++) { + I = I->next; + } + + IBtop = I->B; + for (int j = 0;j < IBrow;j++) { + I->B = I->B->next; + } + + I->B->y = [TFposY intValue]; + + I->B = IBtop; + + I = Itop; + + }else if(layerClickedFlag && IBrow >= 0){ + + I = Itop; + for (int i = 0;i < Irow;i++) { + I = I->next; + } + + IBtop = I->B; + for (int j = 0;j < IBrow;j++) { + I->B = I->B->next; + } + + IBLtop = I->B->L; + for (int j = 0;j < IBLrow;j++) { + I->B->L = I->B->L->next; + } + + + I->B->L->y = [TFposY intValue]; + + I->B->L = IBLtop; + I->B = IBtop; + I = Itop; + + }else{ + + + + } +} + -(void)ClickLAYER:(id)sender{ + + + /* IBLrow = (int)[layerListTV clickedRow]; @@ -922,6 +1127,8 @@ -(void)EventLoop2:(NSTimer *)timer{ + [SESTIV setImage:I->B->img]; + TX[st].S = STRtop[st]; if (st >= 0 && LLrow >= 0) { @@ -947,7 +1154,7 @@ if(SEstandImgST) [SESTIV setImage:SEstandImgST]; - if(standEditorFlag){ + while(standEditorFlag){ I = Itop; for(int i = 0;i < Irow;i++){ @@ -956,7 +1163,7 @@ if(!I) { I = Itop; - return; + break; } @@ -968,7 +1175,10 @@ b = b->next; } - if(TVCrow1 == -1) TVCrow2 = -1; + if(TVCrow1 == -1) { + TVCrow2 = -1; + break; + } if(TVCrow1 >= 0 && b && [MA1 count] > 0){ int value = [[[MA1 objectAtIndex:TVCrow1] valueForKeyPath:@"z"] intValue]; b->z = value; @@ -979,7 +1189,7 @@ b->img = [IV1 image]; } - if(TVCrow2 == -1) {b = bTop; return;} + if(TVCrow2 == -1) {b = bTop; break;} LAYER *lTop; if(b) lTop = b->L; @@ -1024,6 +1234,7 @@ I = Itop; layerLoadOver = false; + break; } STRtop[st] = STRtop[st]; @@ -1375,6 +1586,12 @@ [[NSFileManager defaultManager] createDirectoryAtPath:pathFOLDER withIntermediateDirectories:YES attributes:nil error:nil]; } + InitialData = [NSData dataWithContentsOfFile:@"data/StringList/preset2.txt"]; + + if(!InitialData){ + [[NSFileManager defaultManager] createDirectoryAtPath:@"data/StringList/preset2.txt" withIntermediateDirectories:YES attributes:nil error:nil]; + } + NSArray *Farray = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:pathFOLDER error:nil]; NSMutableArray *MA = [NSMutableArray new]; @@ -2054,6 +2271,13 @@ } -(IBAction)backStand:(id)sender{ + I = Itop; + for(int i = 0;i < [standListMA count];i++){ + I->name = [[standListMA[i] valueForKey:@"name"] retain]; + + I = I->next; + }I = Itop; + [self saveStandData]; [self saveData]; [self loadStandData]; @@ -2069,8 +2293,10 @@ -(IBAction)submitStand:(id)sender{ [standEditorPanel close]; //[self saveDataStand]; - [self saveStandData]; + I = Itop; [self loadStandData]; + IBrow = -1; + IBLrow = -1; TVCrow1 = -1; TVCrow2 = -1; [standPanel makeKeyAndOrderFront:nil]; @@ -2245,8 +2471,17 @@ } -(IBAction)removeLineStand:(id)sender{ - /* - Itop = I; + + + + + NSString *directoryPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; + [[NSFileManager defaultManager] changeCurrentDirectoryPath:directoryPath]; + + NSString *path = @"data/Scenario/img/"; + + + I = Itop; if(Irow == -1){ Irow = (int)[standListMA count] - 1; @@ -2256,18 +2491,66 @@ if(Irow == 0){ I = Itop; + for(int i = 0;i < Irow;i++){ + I= I->next; + } + IBtop = I->B; + while (I->B) { + + IBLtop = I->B->L; + while (I->B->L) { + + + I->B->L = I->B->L->next; + }I->B->L = IBLtop; + + I->B = I->B->next; + }I->B = IBtop; + + I = Itop; + I = I->next; Itop = I; + }else if(Irow == [standListMA count] - 1){ I = Itop; while(I->next->next){ I = I->next; } + + IBtop = I->next->B; + while (I->next->B) { + + IBLtop = I->next->B->L; + while (I->next->B->L) { + + I->next->B->L = I->next->B->L->next; + }I->next->B->L = IBLtop; + + I->next->B = I->next->B->next; + }I->next->B = IBtop; + + I->next = NULL; }else{ I = Itop; for (int i = 0; i < Irow - 1;i++) I = I->next; + + IBtop = I->next->B; + while (I->next->B) { + + IBLtop = I->next->B->L; + while (I->next->B->L) { + + + I->next->B->L = I->next->B->L->next; + }I->next->B->L = IBLtop; + + + I->next->B = I->next->B->next; + }I->next->B = IBtop; + I->next = I->next->next; } @@ -2281,13 +2564,11 @@ Inumb--; } I = Itop; - */ - NSString *directoryPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; - [[NSFileManager defaultManager] changeCurrentDirectoryPath:directoryPath]; + - NSString *path = @"data/Scenario/"; + /* I = Itop; if(1){ @@ -2355,7 +2636,7 @@ } Inumb--; Irow = -1; - + */ [self saveStandData]; [self saveData]; [self loadStandData]; @@ -2885,7 +3166,6 @@ bTop = calloc(1, sizeof(BASE)); b = bTop; b->name = [@"新キャラ" retain]; - b->postName = NULL; b->z = 100; b->L = NULL; [dict setValue:[NSString stringWithFormat:@"%@", b->name] forKey:@"name"]; @@ -2895,14 +3175,14 @@ [MA1 insertObject:dict atIndex:[MA1 count]]; [self didChangeValueForKey:@"MA1"]; [AC1 setSelectionIndex:999]; - }else if(TVCrow1 == -1){ + }else if(IBrow == -1){ while (b->next) { b = b->next; } b->next = calloc(1, sizeof(BASE)); b = b->next; b->name = [@"新キャラ" retain]; - b->postName = NULL; + b->z = 100; b->L = NULL; [dict setValue:[NSString stringWithFormat:@"%@", b->name] forKey:@"name"]; @@ -2913,8 +3193,8 @@ [self didChangeValueForKey:@"MA1"]; [AC1 setSelectionIndex:999]; - }else if(TVCrow1 > 0){ - for (int i = 0; i < TVCrow1-1; i++) { + }else if(IBrow > 0){ + for (int i = 0; i < IBrow-1; i++) { b = b->next; } @@ -2924,16 +3204,16 @@ b->next->next = tmp; b = b->next; b->name = [@"新キャラ" retain]; - b->postName = NULL; + b->z = 100; b->L = NULL; [dict setValue:[NSString stringWithFormat:@"%@", b->name] forKey:@"name"]; [dict setValue:[NSString stringWithFormat:@"%d", b->z] forKey:@"z"]; [self willChangeValueForKey:@"MA1"]; - [MA1 insertObject:dict atIndex:TVCrow1]; + [MA1 insertObject:dict atIndex:IBrow]; [self didChangeValueForKey:@"MA1"]; - [AC1 setSelectionIndex:999]; + [AC1 setSelectionIndex:IBrow]; }else{ bTop = b; @@ -2941,7 +3221,7 @@ tmp = *b; //LAYER *tmp2 = (LAYER*)malloc(sizeof(LAYER)); b->name = [@"新キャラ" retain]; - b->postName = NULL; + b->z = 100; b->L = NULL; b->next = calloc(1, sizeof(BASE)); @@ -2953,9 +3233,10 @@ [dict setValue:[NSString stringWithFormat:@"%d", b->z] forKey:@"z"]; [self willChangeValueForKey:@"MA1"]; - [MA1 insertObject:dict atIndex:TVCrow1]; + [MA1 insertObject:dict atIndex:IBrow]; [self didChangeValueForKey:@"MA1"]; - [AC1 setSelectionIndex:999]; + [AC1 setSelectionIndex:IBrow]; + } b = bTop; @@ -2963,6 +3244,8 @@ I = Itop; } I = Itop; + + [self initMA2]; } -(IBAction)insert2:(id)sender{ @@ -2990,7 +3273,7 @@ LAYER *l = b->L; blTop = l; - if(TVCrow1 == -1) return; + if(IBrow == -1) return; if(1){ NSMutableDictionary *dict = [NSMutableDictionary new]; @@ -2999,7 +3282,7 @@ blTop = calloc(1, sizeof(LAYER)); l = blTop; l->name = [@"新規レイヤー" retain]; - l->postName = NULL; + l->z = 150; [dict setValue:[NSString stringWithFormat:@"%@", l->name] forKey:@"name"]; @@ -3009,14 +3292,14 @@ [MA2 insertObject:dict atIndex:[MA2 count]]; [self didChangeValueForKey:@"MA2"]; [AC2 setSelectionIndex:999]; - }else if(TVCrow2 == -1){ + }else if(IBLrow == -1){ while (l->next) { l = l->next; } l->next = calloc(1, sizeof(LAYER)); l = l->next; l->name = [@"新規レイヤー" retain]; - l->postName = NULL; + l->z = 150; [dict setValue:[NSString stringWithFormat:@"%@", l->name] forKey:@"name"]; @@ -3027,8 +3310,8 @@ [self didChangeValueForKey:@"MA2"]; [AC2 setSelectionIndex:999]; - }else if(TVCrow2 > 0){ - for (int i = 0; i < TVCrow2-1; i++) { + }else if(IBLrow > 0){ + for (int i = 0; i < IBLrow-1; i++) { l = l->next; } @@ -3038,22 +3321,22 @@ l->next->next = tmp; l = l->next; l->name = [@"新規レイヤー" retain]; - l->postName = NULL; + l->z = 150; [dict setValue:[NSString stringWithFormat:@"%@", l->name] forKey:@"name"]; [dict setValue:[NSString stringWithFormat:@"%d", l->z] forKey:@"z"]; [self willChangeValueForKey:@"MA2"]; - [MA2 insertObject:dict atIndex:TVCrow2]; + [MA2 insertObject:dict atIndex:IBLrow]; [self didChangeValueForKey:@"MA2"]; - [AC2 setSelectionIndex:999]; + [AC2 setSelectionIndex:IBLrow]; }else{ blTop = l; LAYER tmp = *l; l->next = calloc(1, sizeof(LAYER)); l->name = [@"新規レイヤー" retain]; - l->postName = NULL; + l->z = 150; l = l->next; *l = tmp; @@ -3062,9 +3345,9 @@ [dict setValue:[NSString stringWithFormat:@"%d", l->z] forKey:@"z"]; [self willChangeValueForKey:@"MA2"]; - [MA2 insertObject:dict atIndex:TVCrow2]; + [MA2 insertObject:dict atIndex:IBLrow]; [self didChangeValueForKey:@"MA2"]; - [AC2 setSelectionIndex:999]; + [AC2 setSelectionIndex:IBLrow]; } @@ -3082,6 +3365,8 @@ } -(IBAction)remove1:(id)sender{ + + /* int cnt = 0; int coun = 0; @@ -3123,9 +3408,81 @@ }b = bbTop; } + BASE *bTop = b; + */ + if([MA1 count] <= 0) + return; + + NSString *directoryPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; + [[NSFileManager defaultManager] changeCurrentDirectoryPath:directoryPath]; + + NSString *path = @"data/Scenario/img/"; + + if(Irow == -1){ + Irow = (int)[standListMA count] - 1; + } + + for(int i = 0;i < Irow;i++) + I = I->next; + + if([MA1 count] > 0){ + + if(IBrow == 0){ + IBtop = I->B; + for(int i = 0;i < IBrow;i++){ + I->B = I->B->next; + } + + + I->B = I->B->next; + IBtop = I->B; + + }else if(IBrow == [MA1 count] - 1 || (IBrow < 0 && [MA1 count] > 0)){ + IBtop = I->B; + if(I->B->next) + while(I->B->next->next){ + I->B = I->B->next; + } + + + I->B->next = NULL; + + I->B = IBtop; + + }else{ + IBtop = I->B; + for (int i = 0; i < IBrow-1;i++) + I->B = I->B->next; + + I->B->next = I->B->next->next; + + I->B = IBtop; + + } + + [self willChangeValueForKey:@"MA1"]; + if(IBrow >= 0) [MA1 removeObjectAtIndex:IBrow]; + else + [MA1 removeObjectAtIndex:[MA1 count] - 1]; + [self didChangeValueForKey:@"MA1"]; + [AC1 setSelectionIndex:IBrow]; + + + if(IBrow >= 0) + TVCrow1--; + + [self initMA2]; + + if(IBrow < 0) [AC1 setSelectionIndex:9999]; + if(IBrow == 0) [AC1 setSelectionIndex:0]; + if(IBrow > 0) IBrow--; + } + I->B = IBtop; + I = Itop; + /* if(1){ if([MA1 count] == 0){ return; @@ -3199,7 +3556,7 @@ I = Itop; } - + */ @@ -3211,6 +3568,11 @@ } -(IBAction)remove2:(id)sender{ + + + if([MA2 count] <= 0) + return; + /* int cnt = 0; int coun = 0; @@ -3251,17 +3613,18 @@ }b = bbTop; } + /* BASE *bTop = b; for(int i = 0;i < TVCrow1;i++){ b = b->next; } LAYER *blTop = b->L; - /* + for(int i = 0;i < TVCrow2;i++){ b->L = b->L->next; } - */ + LAYER *l = b->L; blTop = l; @@ -3327,6 +3690,92 @@ I->B = b; b = bTop; I = Itop; + */ + + NSString *directoryPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; + [[NSFileManager defaultManager] changeCurrentDirectoryPath:directoryPath]; + + NSString *path = @"data/Scenario/img/"; + + + I = Itop; + + if(Irow == -1){ + Irow = (int)[standListMA count] - 1; + } + + if(Irow < 0) + return; + + for(int i = 0;i < Irow;i++) + I = I->next; + + if(IBrow == -1){ + IBrow = (int)[MA1 count] - 1; + } + + if(IBrow < 0) + return; + + IBtop = I->B; + for(int i = 0;i < IBrow;i++) + I->B = I->B->next; + + if([MA2 count] > 0){ + + if(IBLrow == 0){ + IBLtop = I->B->L; + for(int i = 0;i < IBLrow;i++){ + I->B->L = I->B->L->next; + } + + + I->B->L = I->B->L->next; + IBLtop = I->B->L; + + }else if(IBLrow == [MA2 count] - 1 || (IBLrow < 0 && [MA2 count] > 0)){ + IBLtop = I->B->L; + if(I->B->L->next) + while(I->B->L->next->next){ + I->B->L = I->B->L->next; + } + + + I->B->L->next = NULL; + + I->B->L = IBLtop; + + }else{ + IBLtop = I->B->L; + for (int i = 0; i < IBLrow-1;i++) + I->B->L = I->B->L->next; + + + + I->B->L->next = I->B->L->next->next; + + I->B->L = IBLtop; + + } + + [self willChangeValueForKey:@"MA2"]; + if(IBLrow >= 0) [MA2 removeObjectAtIndex:IBLrow]; + else + [MA2 removeObjectAtIndex:[MA2 count] - 1]; + [self didChangeValueForKey:@"MA2"]; + [AC2 setSelectionIndex:IBLrow]; + if(IBLrow < 0) [AC2 setSelectionIndex:9999]; + if(IBLrow == 0) [AC2 setSelectionIndex:0]; + if(IBLrow > 0) IBLrow--; + } + I->B->L = IBLtop; + I->B = IBtop; + I = Itop; + + if(IBLrow >= 0) + TVCrow2--; + + } -(IBAction)saveBtn:(id)sender{ @@ -3335,6 +3784,11 @@ -(void)saveData{ + + [fieldScene saveStandImages]; + I = Itop; + + /* NSString *directoryPath; directoryPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; @@ -3344,13 +3798,26 @@ NSString *fdata = @"data/Scenario/"; NSString *direct = @"data/Scenario/"; - /* + + + + + + + + + + + + [[NSFileManager defaultManager] createDirectoryAtPath:direct withIntermediateDirectories:YES attributes:nil error:nil]; - */ + + NSString *fileData = @""; + /* for(int i = 0;i < [deletedName count];i++){ NSString *dlPath = @"data/Scenario/img/"; @@ -3404,12 +3871,12 @@ f2Data = [brep representationUsingType:NSPNGFileType properties:nil]; NSString *dlPath = @"data/Scenario/img/"; - dlPath = [dlPath stringByAppendingFormat:@"%@#%d", b->postName, Standcount]; + dlPath = [dlPath stringByAppendingFormat:@"%@", b->postName]; [[NSFileManager defaultManager] removeItemAtPath:dlPath error:nil]; NSString *bcPath = @"data/Scenario/img/"; - bcPath = [bcPath stringByAppendingFormat:@"%@#%d", b->name, Standcount]; + bcPath = [bcPath stringByAppendingFormat:@"%@", b->name]; [f2Data writeToFile:bcPath atomically:YES]; @@ -3427,12 +3894,12 @@ f2Data = [brep representationUsingType:NSPNGFileType properties:nil]; NSString *dlPath = @"data/Scenario/img/"; - dlPath = [dlPath stringByAppendingFormat:@"%@#%d", b->L->postName, Standcount]; + dlPath = [dlPath stringByAppendingFormat:@"%@", b->L->postName]; [[NSFileManager defaultManager] removeItemAtPath:dlPath error:nil]; NSString *bcPath = @"data/Scenario/img/"; - bcPath = [bcPath stringByAppendingFormat:@"%@#%d", b->L->name, Standcount]; + bcPath = [bcPath stringByAppendingFormat:@"%@", b->L->name]; [f2Data writeToFile:bcPath atomically:YES]; @@ -3479,12 +3946,12 @@ f2Data = [brep representationUsingType:NSPNGFileType properties:nil]; NSString *dlPath = @"data/Scenario/img/"; - dlPath = [dlPath stringByAppendingFormat:@"%@#%d", b->postName, Standcount]; + dlPath = [dlPath stringByAppendingFormat:@"%@", b->postName]; [[NSFileManager defaultManager] removeItemAtPath:dlPath error:nil]; NSString *bcPath = @"data/Scenario/img/"; - bcPath = [bcPath stringByAppendingFormat:@"%@#%d", b->name, Standcount]; + bcPath = [bcPath stringByAppendingFormat:@"%@", b->name]; [f2Data writeToFile:bcPath atomically:YES]; @@ -3502,12 +3969,12 @@ f2Data = [brep representationUsingType:NSPNGFileType properties:nil]; NSString *dlPath = @"data/Scenario/img/"; - dlPath = [dlPath stringByAppendingFormat:@"%@#%d", b->L->postName, Standcount]; + dlPath = [dlPath stringByAppendingFormat:@"%@", b->L->postName]; [[NSFileManager defaultManager] removeItemAtPath:dlPath error:nil]; NSString *bcPath = @"data/Scenario/img/"; - bcPath = [bcPath stringByAppendingFormat:@"%@#%d", b->L->name, Standcount]; + bcPath = [bcPath stringByAppendingFormat:@"%@", b->L->name]; [f2Data writeToFile:bcPath atomically:YES]; @@ -3530,7 +3997,7 @@ } I = Itop; - Standcount = 0; + Standcount = 0;*/ } -(void)saveStandData{ @@ -3540,18 +4007,17 @@ I = Itop; for (int i = 0;i < Inumb && I && [standListMA count] > 0;i++) { I->name = [standListMA[i] valueForKey:@"name"]; - I->fName = [standListMA[i] valueForKey:@"file"]; I = I->next; }I = Itop; + [fieldScene saveStandImages]; + I = Itop; - - - + /* NSString *directoryPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; [[NSFileManager defaultManager] changeCurrentDirectoryPath:directoryPath]; @@ -3565,11 +4031,12 @@ }I = Itop; [string writeToFile:pathI atomically:YES encoding:NSUTF8StringEncoding error:nil]; - + */ } -(void)loadStandData{ + /* NSString *directoryPath; directoryPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; @@ -3591,7 +4058,7 @@ NSArray *IList = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:pathID error:nil]; Inumb = 0; - /* + for(NSString *path in IList){ if([path isEqualToString:@".DS_Store"]){ @@ -3631,7 +4098,7 @@ */ - + /* fileData = [NSString stringWithContentsOfFile:pathI encoding:NSUTF8StringEncoding error:nil]; fileDataArrayFirst = [fileData componentsSeparatedByString:@"\n"]; @@ -3664,7 +4131,10 @@ I = I->next; } I = Itop; - +*/ + + [fieldScene loadStandImages]; + I = Itop; [self willChangeValueForKey:@"standListMA"]; @@ -3675,7 +4145,6 @@ NSMutableDictionary *dict = [NSMutableDictionary new]; [dict setValue:[NSString stringWithFormat:@"%@", I->name] forKey:@"name"]; - [dict setValue:[NSString stringWithFormat:@"%@", I->fName] forKey:@"file"]; [self willChangeValueForKey:@"standListMA"]; [standListMA addObject:dict]; @@ -3754,7 +4223,9 @@ -(void)loadData{ + [fieldScene loadStandImages]; + /* NSString *directoryPath; directoryPath = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent]; @@ -3906,7 +4377,7 @@ I = I->next; } I = Itop; Standcount = 0; - + */ } -(void)initMA1MA2{ @@ -5485,6 +5956,9 @@ I = Itop; I = I->next; } + if(!I) + return; + b = I->B; int layerIndex = 0; @@ -5629,6 +6103,8 @@ I = Itop; TX[st].S->i = SItop; TX[st].S = STRtop[st]; + + } - (void)drawRect:(NSRect)dirtyRect @@ -5703,6 +6179,7 @@ I = Itop; -(void)EventLoopSV:(NSTimer*)time{ + if(!initMapFlag){ static int omfg = 0; @@ -5731,54 +6208,26 @@ I = Itop; -(void)IMGfnc{ - static int TXCPYS0 = 0; - static int TXCPYSI0 = 0; - - if(!allowTXcpy){ - if(TXCPYS0 == 0){ - TXCPY[STSNUM] = TX[STSNUM]; - TXCPYStop = TXCPY[STSNUM].S; - } - if(TXCPYS0 > 0){ - if(TXCPY[STSNUM].S){ - - if(TXCPYSI0 == 0){ - TXCPYSItop = TXCPY[STSNUM].S->i; - } - - if(TXCPY[STSNUM].S->i){ - TXCPY[STSNUM].S->i = TXCPY[STSNUM].S->i->next; - TXCPYSI0++; - }else{ - TXCPY[STSNUM].S->i = TXCPYSItop; - TXCPY[STSNUM].S = TXCPY[STSNUM].S->next; - TXCPYSI0 = 0; - } + static int initCnt = 0; - }else{ - TXCPY[STSNUM].S = TXCPYStop; - STSNUM++; - TXCPYS0 = -1; - for(int i = 0;i < TEXTMAX;i++){ - TX[i] = TXCPY[i]; - } - } - + if(initCnt == 0){ + TXCPY[STSNUM] = TX[STSNUM]; + initCnt++; } - TXCPYS0++; - + if(!TXCPY[STSNUM].fileName){ STSNUM = 0; + txNumb = -1; allowTXcpy = true; NSLog(@"TXCPY LoadComplete"); }else if(STSNUM > TEXTMAX){ STSNUM = 0; + txNumb = -1; allowTXcpy = true; NSLog(@"TXCPY LoadComplete"); } - } - TXCPY[STSNUM] = TXCPY[STSNUM]; + //TXCPY[STSNUM] = TXCPY[STSNUM]; } -(void)GetImageFromImageView2{ @@ -5824,9 +6273,42 @@ I = Itop; SEstandImgST = [[NSImage alloc] initWithData:fdata2]; + STRING *txtop = TXCPY[STSNUM].S; + for (int i = 0;i < txNumb;i++){ + + TXCPY[STSNUM].S = TXCPY[STSNUM].S->next; + } + + STANDIMAGE *txitop = TXCPY[STSNUM].S->i; + for(int i = 0;i < txiNumb;i++){ + + TXCPY[STSNUM].S->i = TXCPY[STSNUM].S->i->next; + } + + if(!TXCPY[STSNUM].fileName){ + TXCPY[STSNUM].S->i = txitop; + TXCPY[STSNUM].S = txtop; + + return; + } + if(!TXCPY[STSNUM].S){ + TXCPY[STSNUM].S->i = txitop; + TXCPY[STSNUM].S = txtop; + return; + } + if(!TXCPY[STSNUM].S->i){ + TXCPY[STSNUM].S->i = txitop; + TXCPY[STSNUM].S = txtop; + return; + } TXCPY[STSNUM].S->i->imgStand = SEstandImgST; + TXCPY[STSNUM].S->i = txitop; + TXCPY[STSNUM].S = txtop; [testScenarioEditor testSEtest]; + + TXimgCaptured = true; + return; } @@ -5864,14 +6346,104 @@ I = Itop; { - if(TX[STSNUM].fileName) - if(TX[STSNUM].S) - if(TX[STSNUM].S->i){ + if(txNumb < 0) + return; + + STRING *txtop = TXCPY[STSNUM].S; + + if(TXCPY[STSNUM].fileName){ + + if(!TXCPY[STSNUM].S){ + TXCPY[STSNUM].S = txtop; + STSNUM++; + txiNumb = 0; + txNumb = 0; + + return; + } + + for (int i = 0;i < txNumb;i++){ + - if(TX[STSNUM].S->i->SEMA1row-1 < 0) + TXCPY[STSNUM].S = TXCPY[STSNUM].S->next; + } + + if(!TXCPY[STSNUM].S){ + TXCPY[STSNUM].S = txtop; + STSNUM++; + txiNumb = 0; + txNumb = 0; + return; + } + + STANDIMAGE *txitop = TXCPY[STSNUM].S->i; + + if(!TXCPY[STSNUM].S->i){ + if(TXCPY[STSNUM].S->next){ + txNumb++; + TXimgIsNull = true; + TXCPY[STSNUM].S->i = txitop; + TXCPY[STSNUM].S = txtop; + return; + }else{ + TXCPY[STSNUM].S = txtop; + STSNUM++; + txNumb = 0; + TXimgCaptured = false; + return; + } + }else{ + for(int i = 0;i < txiNumb;i++){ + + TXCPY[STSNUM].S->i = TXCPY[STSNUM].S->i->next; + } + + if((TXCPY[STSNUM].S->i->imgStand && TXimgCaptured) || (!TXCPY[STSNUM].S->i->name)){ + TXimgCaptured = false; + if(TXCPY[STSNUM].S->i->next) { + txiNumb++; + TXimgIsNull = true; + TXCPY[STSNUM].S->i = txitop; + TXCPY[STSNUM].S = txtop; + return; + }else{ + txiNumb = 0; + + if(TXCPY[STSNUM].S->next){ + txNumb++; + TXimgIsNull = true; + TXCPY[STSNUM].S->i = txitop; + TXCPY[STSNUM].S = txtop; + return; + } + else{ + txNumb = 0; + TXimgIsNull = true; + TXCPY[STSNUM].S->i = txitop; + TXCPY[STSNUM].S = txtop; + STSNUM++; + return; + } + } + } + } + + + + if(TXCPY[STSNUM].fileName) + if(TXCPY[STSNUM].S) + if(TXCPY[STSNUM].S->i){ + + if(TXCPY[STSNUM].S->i->SEMA1row-1 < 0){ + TXCPY[STSNUM].S->i = txitop; + TXCPY[STSNUM].S = txtop; return; - if(TX[STSNUM].S->i->SEMA2row-1 < 0) + } + if(TXCPY[STSNUM].S->i->SEMA2row-1 < 0){ + TXCPY[STSNUM].S->i = txitop; + TXCPY[STSNUM].S = txtop; return; + } I = Itop; for(int i = 0;i < TXCPY[STSNUM].S->i->SEMA1row-1;i++){ @@ -5879,16 +6451,20 @@ I = Itop; } b = I->B; - + + TXimgIsNull = true; int layerIndex = 0; BASE *bTop = b; while(layerIndex <= 999){ - + for (int i = 0;b && i <= TXCPY[STSNUM].S->i->SEMA2row-1; i++) { - if(i == TX[STSNUM].S->i->SEMA2row-1){ + if(i == TXCPY[STSNUM].S->i->SEMA2row-1){ - if(layerIndex == b->z && b->img) [self DrawImage:b->img x:b->x y:b->y]; + if(layerIndex == b->z && b->img) { + [self DrawImage:b->img x:b->x y:b->y]; + TXimgIsNull = false; + } if(1){ LAYER *l = b->L; @@ -5898,10 +6474,11 @@ I = Itop; if(1/*l->visibleInstant*/){ //NSLog(@"%d[%d]", i0, *(TX[STSNUM].S->i->SEMA3flag + i0)); - if(TX[STSNUM].S->i->SEMA3flag) - if(*(TX[STSNUM].S->i->SEMA3flag + i0) > 1) + if(TXCPY[STSNUM].S->i->SEMA3flag) + if(*(TXCPY[STSNUM].S->i->SEMA3flag + i0) > 1) if(layerIndex == l->z && l->img){ [self DrawImage:l->img x:l->x y:l->y]; + TXimgIsNull = false; } @@ -5920,11 +6497,12 @@ I = Itop; b = bTop; layerIndex++; } - + I = Itop; } - - + TXCPY[STSNUM].S->i = txitop; + } + TXCPY[STSNUM].S = txtop; } @end diff --git a/Awars III/StandView.m b/Awars III/StandView.m index d6a42ad..426c909 100644 --- a/Awars III/StandView.m +++ b/Awars III/StandView.m @@ -214,6 +214,8 @@ I = Itop; [self setNeedsDisplay:YES]; + [testScenarioEditor setTFpos]; + } -(void)mouseUp:(NSEvent *)theEvent{ @@ -264,7 +266,8 @@ layerIndex++; } }*/ - + if(IBrow < 0) + return; I = Itop; diff --git a/Awars III/StringText.h b/Awars III/StringText.h index d93e94c..5193f0e 100755 --- a/Awars III/StringText.h +++ b/Awars III/StringText.h @@ -27,7 +27,7 @@ typedef struct _NVALUE{ }NVALUE; typedef struct _STANDIMAGE{ - + struct _STANDIMAGE *next; NSImage *imgStand; @@ -102,6 +102,15 @@ STRING *ST; STANDIMAGE *STItop; +STANDIMAGE *SItop; +STANDIMAGE *si; +STANDIMAGE *siPost; + +STANDIMAGE *STANDADD; + +STRING *TXCPYStop; +STANDIMAGE *TXCPYSItop; + bool mouseClicked; bool mouseDowned; bool mouseHolding; diff --git a/Awars III/StringText.m b/Awars III/StringText.m index 7f9364a..9cc1af5 100644 --- a/Awars III/StringText.m +++ b/Awars III/StringText.m @@ -210,6 +210,7 @@ ST->wallFadeOut = false; */ int STIcnt = 0; + int STcnt = 0; for(int i = 1;i<=[fileDataArray count];i++){ NSString *str = [fileDataArray objectAtIndex:i-1]; NSRange range = NSMakeRange(2, str.length - 2); @@ -257,12 +258,15 @@ if (rangeSearch2.location != NSNotFound) {commentSwitch = true; }else if (rangeSearch.location != NSNotFound || rangeSearch10.location != NSNotFound) {commentSwitch = false; + STcnt++; + if(STItop) ST->i = STItop; + STItop = NULL; if(!ST){ ST = calloc(1, sizeof(STRING)); ST->next = calloc(1, sizeof(STRING)); STtop = ST; } - if(STItop) ST->i = STItop; + STIcnt = 0; if(ST) if(ST->S) @@ -352,7 +356,7 @@ STRING *TXCPYINDEX = TXCPY[fileNameIndex].S; - for(int L = 0;L < dialogMax-1;L++){ + for(int L = 1;L < STcnt;L++){ TXCPY[fileNameIndex].S = TXCPY[fileNameIndex].S->next; } diff --git a/Awars III/en.lproj/MainMenu.xib b/Awars III/en.lproj/MainMenu.xib index d1d9a19..fd7aff4 100755 --- a/Awars III/en.lproj/MainMenu.xib +++ b/Awars III/en.lproj/MainMenu.xib @@ -11567,13 +11567,13 @@ - + - + @@ -11593,27 +11593,6 @@ - - - - - - - - - - - - - - - - - - - - - @@ -11794,15 +11773,6 @@ - - - - - - - - - @@ -11811,6 +11781,9 @@ + + + @@ -11880,7 +11853,7 @@ - + @@ -11964,6 +11937,18 @@ + + + + + + + + + + + + @@ -21832,28 +21817,29 @@ - + + - + - + - + - + -- 2.11.0