Skip to content

Commit

Permalink
Code editor: Area Designer: Fix room counting
Browse files Browse the repository at this point in the history
Code editor: Fixed issue with progress dialog if completed before shown
  • Loading branch information
icewolfz committed Sep 1, 2024
1 parent a38c88c commit 8470cbd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 8 additions & 1 deletion build/code.editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
theme: (options ? (options.theme ? 'lpcThemeDark' : 'lpcTheme') : 'lpcTheme'),
model: null,
}, {

/*
codeEditorService: {
addCodeEditor: (editor) => {
console.log('addCodeEditor');
Expand All @@ -322,6 +322,7 @@
return Promise.resolve({});
}
},
*/
textModelService: {
createModelReference: resource => {
var model = monaco.editor.getModel(resource);
Expand Down Expand Up @@ -5108,6 +5109,11 @@ <h3>
}

ipcRenderer.on('progress', (event, ...args) => {
//already done so just close it
if (!_windows['progress.html']) {
ipcRenderer.send('progress', 'close');
window.setProgressBar(-1);
}
if (args[0] === 'canceled' || args[0] === 'closed') {
delete _windows['progress.html'];
if (manager.active && manager.active.editor && manager.active.editor.cancel)
Expand Down Expand Up @@ -10115,6 +10121,7 @@ <h3>
else if (type === 'designer') {
ipcRenderer.send('progress', 'close');
window.setProgressBar(-1);
delete _windows['progress.html'];
}
});
p.editor.on('output', (msg) => {
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Fix an issue when undoing a single room change
- Fixed paste for linux
- Fixed an issue with auto resize when auto walking and not grouping undo as one action
- Fix room counting
- Fixed a bug in diff view not correctly setting the height
- Fixed datagrid tooltips not updating when value changed and fall back to value formatting when customized
- Fixed virtual area creation wizard
Expand All @@ -39,6 +40,7 @@
- Fixed room/monster property code generation place temp properties as permanent properties
- Fixed Go to Definition and Peek Definition
- Fixed editor font list not allowing selection of system fonts
- Fixed issue with progress dialog if completed before shown
- Virtual area editor:
- Change code in generation of external room to use BASEROOM define
- Fixed extra map codes being added to rooms when building raw map files
Expand Down
4 changes: 2 additions & 2 deletions src/common/editor/area.designer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10983,7 +10983,7 @@ export class AreaDesigner extends EditorBase {
const base = this.$area.baseRooms[room.type] || this.$area.baseRooms[this.$area.defaultRoom];
const baseOld = this.$area.baseRooms[old.type] || this.$area.baseRooms[this.$area.defaultRoom];
if (!old.empty && !old.equals(baseOld, true)) this.$roomCount--;
if (!room.empty && !old.equals(base, true)) this.$roomCount++;
if (!room.empty && !room.equals(base, true)) this.$roomCount++;
this.doUpdate(UpdateType.status);
}
this.changed = true;
Expand Down Expand Up @@ -11745,7 +11745,7 @@ export class AreaDesigner extends EditorBase {
if (r.empty || r.equals(base, true)) continue;
this.write(this.generateRoomCode(r.clone(), files, copy(data)), path.join(p, files[`${r.x},${r.y},${r.z}`] + '.c'));
count++;
this.emit('progress', { type: 'designer', percent: 50 + Math.round(50 * count / this.$roomCount) });
this.emit('progress', { type: 'designer', percent: 50 + Math.round(50 * count / (this.$roomCount || 1)) });
}
}
}
Expand Down

0 comments on commit 8470cbd

Please sign in to comment.