Skip to content

Commit 25376ff

Browse files
committed
Fix 'Made with GDevelop' sometimes shown when reloading the 3D editor
1 parent a925ee5 commit 25376ff

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

GDJS/GDJS/IDE/ExporterHelper.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ gd::String ExporterHelper::ExportProjectData(
351351
fs.MkDir(fs.DirNameFrom(filename));
352352

353353
gd::SerializerElement projectDataElement;
354-
ExporterHelper::StriptAndSerializeProjectData(project, projectDataElement,
354+
ExporterHelper::StripAndSerializeProjectData(project, projectDataElement,
355355
isInGameEdition,
356356
inGameEditorResources);
357357

@@ -537,15 +537,25 @@ void ExporterHelper::SerializeProjectData(gd::AbstractFileSystem &fs,
537537
resourcesMergingHelper.PreserveDirectoriesStructure(false);
538538
resourcesMergingHelper.PreserveAbsoluteFilenames(false);
539539
}
540+
541+
if (!options.fullLoadingScreen) {
542+
// Most of the time, we skip the logo and minimum duration so that
543+
// the preview start as soon as possible.
544+
clonedProject.GetLoadingScreen()
545+
.ShowGDevelopLogoDuringLoadingScreen(false)
546+
.SetMinDuration(0);
547+
clonedProject.GetWatermark().ShowGDevelopWatermark(false);
548+
}
549+
540550
gd::ResourceExposer::ExposeWholeProjectResources(clonedProject,
541551
resourcesMergingHelper);
542552

543-
ExporterHelper::StriptAndSerializeProjectData(clonedProject, rootElement,
553+
ExporterHelper::StripAndSerializeProjectData(clonedProject, rootElement,
544554
options.isInGameEdition,
545555
inGameEditorResources);
546556
}
547557

548-
void ExporterHelper::StriptAndSerializeProjectData(
558+
void ExporterHelper::StripAndSerializeProjectData(
549559
gd::Project &project, gd::SerializerElement &rootElement,
550560
bool isInGameEdition,
551561
const std::vector<gd::InGameEditorResourceMetadata> &inGameEditorResources) {

GDJS/GDJS/IDE/ExporterHelper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ class ExporterHelper {
762762
/**
763763
* \brief Strip a project and serialize it to JSON.
764764
*/
765-
static void StriptAndSerializeProjectData(gd::Project &project,
765+
static void StripAndSerializeProjectData(gd::Project &project,
766766
gd::SerializerElement &rootElement,
767767
bool isInGameEdition,
768768
const std::vector<gd::InGameEditorResourceMetadata> &inGameEditorResources);

GDJS/Runtime/debugger-client/hot-reloader.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ namespace gdjs {
2020
_reloadedScriptElement: Record<string, HTMLScriptElement> = {};
2121
_logs: HotReloaderLog[] = [];
2222
_alreadyLoadedScriptFiles: Record<string, boolean> = {};
23+
_isHotReloading: boolean = false;
2324

2425
/**
2526
* @param runtimeGame - The `gdjs.RuntimeGame` to be hot-reloaded.
@@ -153,6 +154,13 @@ namespace gdjs {
153154
projectData: ProjectData;
154155
runtimeGameOptions: RuntimeGameOptions;
155156
}): Promise<HotReloaderLog[]> {
157+
if (this._isHotReloading) {
158+
console.error('Hot reload already in progress, skipping.');
159+
return [];
160+
}
161+
162+
this._isHotReloading = true;
163+
156164
logger.info('Hot reload started');
157165
const wasPaused = this._runtimeGame.isPaused();
158166
this._runtimeGame.pause(true);
@@ -270,6 +278,7 @@ namespace gdjs {
270278
}
271279
}
272280

281+
this._isHotReloading = false;
273282
logger.info(
274283
'Hot reload finished with logs:',
275284
this._logs.map((log) => '\n' + log.kind + ': ' + log.message)

0 commit comments

Comments
 (0)