Skip to content

Commit 54944c9

Browse files
authored
Merge pull request #192 from entrylabs/develop
오프라인 2.1.11
2 parents b9904ee + d0d8d19 commit 54944c9

File tree

11 files changed

+108166
-28316
lines changed

11 files changed

+108166
-28316
lines changed

build/entryx64.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
!define MUI_UNICON "icon.ico"
1414
!define PRODUCT_NAME "Entry"
1515
!define APP_NAME "Entry.exe"
16-
!define PRODUCT_VERSION "2.1.10"
16+
!define PRODUCT_VERSION "2.1.11"
1717
!define PRODUCT_PUBLISHER "EntryLabs"
1818
!define PRODUCT_WEB_SITE "http://www.playentry.org/"
1919

build/entryx86.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
!define MUI_UNICON "icon.ico"
1414
!define PRODUCT_NAME "Entry"
1515
!define APP_NAME "Entry.exe"
16-
!define PRODUCT_VERSION "2.1.10"
16+
!define PRODUCT_VERSION "2.1.11"
1717
!define PRODUCT_PUBLISHER "EntryLabs"
1818
!define PRODUCT_WEB_SITE "http://www.playentry.org/"
1919

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"productName": "Entry",
44
"name": "entry",
5-
"version": "2.1.10",
5+
"version": "2.1.11",
66
"description": "Entry for offline",
77
"main": "src/main_build/main.bundle.js",
88
"scripts": {
@@ -36,8 +36,8 @@
3636
"async-csv": "^2.1.3",
3737
"axios": "^0.19.2",
3838
"cross-spawn": "^7.0.3",
39-
"entry-hw": "git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.48",
40-
"entry-js": "git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.10",
39+
"entry-hw": "git+https://github.com/entrylabs/entry-hw.git#dist/v1.9.49",
40+
"entry-js": "git+https://github.com/entrylabs/entryjs.git#dist/offline_v2.1.11",
4141
"entry-tool": "git+https://github.com/entrylabs/entry-tool.git#dist/20231026",
4242
"excel4node": "^1.7.0",
4343
"fs-extra": "^8.1.0",

src/main/dataTable/dataTableManager.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ type ITableData = {
1010
rows: number;
1111
data: string[][];
1212
name: string;
13-
}
13+
};
1414

1515
class DataTableManager {
16-
private _tables: { [hash: string]: { name: string, data: ITableData } } = {};
16+
private _tables: { [hash: string]: { name: string; data: ITableData } } = {};
1717

18+
// TODO: otherTypes 추가
1819
async makeTableInfo(file: string): Promise<{ id: string; name: string } | undefined> {
1920
try {
2021
const { name, table } = this._createTable(file);
@@ -29,7 +30,7 @@ class DataTableManager {
2930
name,
3031
};
3132

32-
this._tables[hashId] = ({ name, data: result });
33+
this._tables[hashId] = { name, data: result };
3334
return { id: hashId, name };
3435
} catch (e) {
3536
console.warn('getTable error', e);

src/renderer/components/workspace.tsx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class Workspace extends Component<IProps> {
9494
'error',
9595
RendererUtils.getLang('Workspace.loading_fail_msg'),
9696
RendererUtils.getLang('Workspace.fail_contact_msg'),
97-
{ height: 190, width: 365, padding: 30 }
97+
{ height: 190, width: 365, padding: 30 },
9898
);
9999
await RendererUtils.clearTempProject();
100100

@@ -120,7 +120,7 @@ class Workspace extends Component<IProps> {
120120
'progress',
121121
RendererUtils.getLang('Workspace.uploading_msg'),
122122
RendererUtils.getLang('Workspace.fail_contact_msg'),
123-
{ width: 220 }
123+
{ width: 220 },
124124
);
125125
const project = await readProjectFunction;
126126
await this.loadProject(project);
@@ -216,7 +216,7 @@ class Workspace extends Component<IProps> {
216216
'',
217217
{
218218
width: 220,
219-
}
219+
},
220220
);
221221
this.isSavingCanvasData = true;
222222
try {
@@ -244,7 +244,7 @@ class Workspace extends Component<IProps> {
244244
console.log(Constants.sep);
245245
const savePath = `${dirPath}${Constants.sep}`;
246246
await ipcRendererHelper.captureBlockImage(images, savePath);
247-
})
247+
});
248248
} catch (err) {
249249
console.error(err);
250250
}
@@ -363,7 +363,7 @@ class Workspace extends Component<IProps> {
363363
'progress',
364364
RendererUtils.getLang('Workspace.saving_msg'),
365365
RendererUtils.getLang('Workspace.fail_contact_msg'),
366-
{ width: 220 }
366+
{ width: 220 },
367367
);
368368

369369
try {
@@ -387,15 +387,15 @@ class Workspace extends Component<IProps> {
387387
Entry.stateManager.addStamp();
388388
Entry.toast.success(
389389
RendererUtils.getLang('Workspace.saved'),
390-
`${projectName} ${RendererUtils.getLang('Workspace.saved_msg')}`
390+
`${projectName} ${RendererUtils.getLang('Workspace.saved_msg')}`,
391391
);
392392
} catch (err) {
393393
console.error(err);
394394
this.showModalProgress(
395395
'error',
396396
RendererUtils.getLang('Workspace.saving_fail_msg'),
397397
RendererUtils.getLang('Workspace.fail_contact_msg'),
398-
{ height: 190, width: 365, padding: 30 }
398+
{ height: 190, width: 365, padding: 30 },
399399
);
400400
} finally {
401401
this.isSaveProject = false;
@@ -407,12 +407,17 @@ class Workspace extends Component<IProps> {
407407
await saveFunction(this.projectSavedPath);
408408
} else {
409409
const targetPath = this.projectSavedPath || '*';
410+
let defaultPath = this.projectSavedPath ? targetPath : projectName;
411+
if (key !== 'save') {
412+
defaultPath = defaultPath.replace('.ent', '');
413+
defaultPath += '의 리메이크';
414+
}
410415
RendererUtils.showSaveDialog(
411416
{
412-
defaultPath: `${targetPath}/${projectName}`,
417+
defaultPath,
413418
filters: [{ name: 'Entry File', extensions: ['ent'] }],
414419
},
415-
saveFunction
420+
saveFunction,
416421
);
417422
}
418423
LocalStorageManager.clearSavedProject();
@@ -435,7 +440,7 @@ class Workspace extends Component<IProps> {
435440
}).then(({ filePaths }) => {
436441
resolve(filePaths[0]);
437442
});
438-
})
443+
}),
439444
);
440445
}
441446
};
@@ -449,7 +454,7 @@ class Workspace extends Component<IProps> {
449454
'progress',
450455
RendererUtils.getLang('Workspace.uploading_msg'),
451456
RendererUtils.getLang('Workspace.fail_contact_msg'),
452-
{ width: 220 }
457+
{ width: 220 },
453458
);
454459

455460
try {
@@ -467,7 +472,7 @@ class Workspace extends Component<IProps> {
467472
'error',
468473
RendererUtils.getLang('Workspace.loading_fail_msg'),
469474
RendererUtils.getLang('Workspace.fail_contact_msg'),
470-
{ height: 190, width: 365, padding: 30 }
475+
{ height: 190, width: 365, padding: 30 },
471476
);
472477
}
473478
}
@@ -612,7 +617,7 @@ class Workspace extends Component<IProps> {
612617
await this._loadProjectFromFile(filePath);
613618
} else {
614619
EntryModalHelper.getAlertModal(
615-
RendererUtils.getLang('Workspace.upload_not_supported_file_msg')
620+
RendererUtils.getLang('Workspace.upload_not_supported_file_msg'),
616621
);
617622
}
618623
}}

src/renderer/helper/databaseManager.ts

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ import TableDatum from '../resources/db/projectTables.json';
66
import RendererUtils from './rendererUtils';
77

88
interface BaseObject {
9-
label: { ko: string, en: string, jp?: string, vn?: string };
10-
category: { main: string, sub: string };
9+
label: { ko: string; en: string; jp?: string; vn?: string };
10+
category: { main: string; sub: string };
1111
name: string;
1212
specials: [];
1313
created: string;
1414
_id: string;
1515
}
1616

1717
export interface DBSoundObject extends BaseObject {
18-
path?: string
18+
path?: string;
1919
ext: string;
2020
duration: number;
2121
filename: string;
2222
}
2323

2424
export interface DBPictureObject extends BaseObject {
25-
dimension: { height: number, width: number };
25+
dimension: { height: number; width: number };
2626
filename: string;
2727
}
2828

@@ -41,9 +41,13 @@ export interface DBTableObject {
4141
description: string;
4242
rows: number;
4343
projectTable: string; // projectTable hashID
44+
hasOtherTypes?: Boolean;
45+
otherTypes?: Array<any>;
46+
fieldInfos?: Array<any>;
47+
selected?: DBTableObject;
4448
}
4549

46-
type TableObjectsArray = DBPictureObject[] | DBSpriteObject[] | DBSoundObject[] | DBTableObject[]
50+
type TableObjectsArray = DBPictureObject[] | DBSpriteObject[] | DBSoundObject[] | DBTableObject[];
4751

4852
/**
4953
* sprite, pictures, sounds 등의 데이터베이스 추출본을 가지고 CRUD 를 흉내내는 클래스.
@@ -59,28 +63,31 @@ export default class {
5963
* @param type 테이블명
6064
* @return {Array<string>} 결과 리스트
6165
*/
62-
static findAll({ sidebar, subMenu, type }: { sidebar: string, subMenu: string, type: string }) {
66+
static findAll({ sidebar, subMenu, type }: { sidebar: string; subMenu: string; type: string }) {
6367
const table = this._selectTable(type);
6468
return new Promise((resolve) => {
6569
// 타입이 table 인 경우는 필터링을 거치지 않는다. 카테고리 정렬이 없기때문
6670
const findList =
67-
type === 'table' ? table : table.filter((object) => {
68-
if (!object.category) {
69-
return false;
70-
}
71+
type === 'table'
72+
? table
73+
: table
74+
.filter((object) => {
75+
if (!object.category) {
76+
return false;
77+
}
7178

72-
const { main = '', sub = '' } = object.category;
73-
return main === sidebar && (subMenu === 'all' || subMenu === sub);
74-
})
75-
.sort((prev, next) => {
76-
if (!next.name || prev.name > next.name) {
77-
return 1;
78-
} else if (!prev.name || prev.name < next.name) {
79-
return -1;
80-
} else {
81-
return 0;
82-
}
83-
}) || [];
79+
const { main = '', sub = '' } = object.category;
80+
return main === sidebar && (subMenu === 'all' || subMenu === sub);
81+
})
82+
.sort((prev, next) => {
83+
if (!next.name || prev.name > next.name) {
84+
return 1;
85+
} else if (!prev.name || prev.name < next.name) {
86+
return -1;
87+
} else {
88+
return 0;
89+
}
90+
}) || [];
8491

8592
resolve(findList);
8693
});
@@ -97,16 +104,21 @@ export default class {
97104
const lowerCaseSearchQuery = searchQuery.toString().toLowerCase();
98105

99106
return new Promise((resolve) => {
100-
const findList = table.filter((object) => {
101-
const { label = {}, name = '' } = object;
102-
const objectName =
103-
label[RendererUtils.getLangType()] ||
104-
label[RendererUtils.getFallbackLangType()] ||
105-
name;
107+
const findList =
108+
table.filter((object) => {
109+
const { label = {}, name = '' } = object;
110+
const objectName =
111+
label[RendererUtils.getLangType()] ||
112+
label[RendererUtils.getFallbackLangType()] ||
113+
name;
106114

107-
return objectName.toString().toLowerCase()
108-
.indexOf(lowerCaseSearchQuery) > -1;
109-
}) || [];
115+
return (
116+
objectName
117+
.toString()
118+
.toLowerCase()
119+
.indexOf(lowerCaseSearchQuery) > -1
120+
);
121+
}) || [];
110122

111123
resolve(findList);
112124
});
@@ -118,14 +130,14 @@ export default class {
118130
});
119131
}
120132

121-
static _selectTable(type ?: string): TableObjectsArray | any[] {
133+
static _selectTable(type?: string): TableObjectsArray | any[] {
122134
switch (type) {
123135
case 'picture':
124136
return Pictures as DBPictureObject[];
125137
case 'sprite':
126-
return Sprites as unknown as DBSpriteObject[];
138+
return (Sprites as unknown) as DBSpriteObject[];
127139
case 'sound':
128-
return Sounds as unknown as DBSoundObject[];
140+
return (Sounds as unknown) as DBSoundObject[];
129141
case 'table':
130142
return TableInfos as DBTableObject[];
131143
default:

0 commit comments

Comments
 (0)