Skip to content

Commit

Permalink
add preview on save for Dora XML. [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Jan 24, 2024
1 parent 1a66497 commit eaabff1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Assets/Script/Dev/Entry.yue
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ export enterEntryAsync = (entry)->
Content\insertSearchPath 1, Path scriptPath, "Script"
result = require file
result! if "function" == type result
nil
catch msg
err = debug.traceback msg
allClear!
Expand Down
9 changes: 8 additions & 1 deletion Tools/dora-dora/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,13 @@ export default function PersistentDrawerLeft() {
column: 1
};
break;
case ".xml":
content = "<!-- @preview-file off -->\n<Dora>\n\t\n</Dora>\n";
position = {
lineNumber: 3,
column: 2
};
break;
default:
break;
}
Expand Down Expand Up @@ -1759,7 +1766,7 @@ export default function PersistentDrawerLeft() {
setFiles(prev => [...prev]);
const ext = path.extname(file.key).toLowerCase();
switch (ext) {
case ".ts": case ".tsx": case ".lua": case ".tl": case ".yue": {
case ".ts": case ".tsx": case ".lua": case ".tl": case ".yue": case ".xml": {
if (contentModified.search(/@preview-file on\b/) >= 0) {
onPlayControlClick("Run This", true);
} else if (contentModified.search(/@preview-project on\b/) >= 0) {
Expand Down

0 comments on commit eaabff1

Please sign in to comment.