Skip to content

Commit 36545c5

Browse files
slimbuckstechdrive
authored andcommitted
Add warning popup when loading LCC files (playcanvas#834)
1 parent 075fa41 commit 36545c5

10 files changed

Lines changed: 23 additions & 1 deletion

File tree

src/file-handler.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { CreateDropHandler } from './drop-handler';
44
import { ElementType } from './element';
55
import { Events } from './events';
66
import { BrowserFileSystem, MappedReadFileSystem } from './io';
7+
import { Model } from './model';
78
import { Scene } from './scene';
89
import { Splat } from './splat';
910
import { serializePly, serializePlyCompressed, SerializeSettings, serializeSog, serializeSplat, serializeViewer, SogSettings, ViewerExportSettings } from './splat-serialize';
@@ -354,13 +355,25 @@ const initFileHandler = (scene: Scene, events: Events, dropTarget: HTMLElement)
354355
return [];
355356
}
356357

357-
const result = [];
358+
const result: Array<Splat | Model> = [];
358359

359360
if (isPlySequence(filenames)) {
360361
// handle ply sequence
361362
events.fire('plysequence.setFrames', files.map(f => f.contents));
362363
events.fire('timeline.frame', 0);
363364
} else if (isSog(filenames) || isLcc(filenames)) {
365+
if (isLcc(filenames)) {
366+
const response = await events.invoke('showPopup', {
367+
type: 'okcancel',
368+
header: 'LCC',
369+
message: localize('popup.lcc-upload-warning'),
370+
link: `${window.location.origin}/upload`
371+
});
372+
if (response.action === 'cancel') {
373+
return result;
374+
}
375+
}
376+
364377
// import multi-file splat model (SOG or LCC)
365378
const model = await importSplatModel(files, animationFrame);
366379
if (model) {

static/locales/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"popup.no": "Nein",
111111
"popup.error": "Fehler",
112112
"popup.error-loading": "Fehler beim Laden der Datei",
113+
"popup.lcc-upload-warning": "Für eine bessere Veröffentlichung auf superspl.at laden Sie Ihre LCC-Datei direkt über die Upload-Seite hoch.",
113114
"popup.export": "Exportieren",
114115
"popup.copy-to-clipboard": "Link in die Zwischenablage kopieren",
115116
"popup.render-image.header": "Bild Einstellungen",

static/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@
235235
"popup.no": "No",
236236
"popup.error": "Error",
237237
"popup.error-loading": "Error Loading File",
238+
"popup.lcc-upload-warning": "For better publishing to superspl.at, upload your LCC file directly via the upload page.",
238239
"cameraSave.exportFailed": "Failed to export camera presets.",
239240
"cameraSave.emptyPresets": "Camera list is empty.",
240241
"cameraSave.importNotAllowedDuringRender": "Import is unavailable while rendering/exporting is in progress.",

static/locales/es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
"popup.no": "No",
110110
"popup.error": "Error",
111111
"popup.error-loading": "Error al cargar archivo",
112+
"popup.lcc-upload-warning": "Para una mejor publicación en superspl.at, suba su archivo LCC directamente a través de la página de carga.",
112113
"popup.export": "Exportar",
113114
"popup.copy-to-clipboard": "Copiar enlace al portapapeles",
114115
"popup.render-image.header": "Configuración de imagen",

static/locales/fr.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"popup.no": "Non",
111111
"popup.error": "Erreur",
112112
"popup.error-loading": "Erreur de chargement du fichier",
113+
"popup.lcc-upload-warning": "Pour une meilleure publication sur superspl.at, téléchargez votre fichier LCC directement via la page de téléchargement.",
113114
"popup.export": "Exporter",
114115
"popup.copy-to-clipboard": "Copier le lien dans le presse-papiers",
115116
"popup.render-image.header": "Paramètres Image",

static/locales/ja.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@
235235
"popup.no": "いいえ",
236236
"popup.error": "エラー",
237237
"popup.error-loading": "ファイルの読み込みエラー",
238+
"popup.lcc-upload-warning": "superspl.atへの公開には、アップロードページから直接LCCファイルをアップロードすることをお勧めします。",
238239
"cameraSave.exportFailed": "カメラリストの書き出しに失敗しました。",
239240
"cameraSave.emptyPresets": "カメラリストが空です。",
240241
"cameraSave.importNotAllowedDuringRender": "書き出し(レンダリング)中は読み込みできません。",

static/locales/ko.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"popup.no": "아니요",
111111
"popup.error": "오류",
112112
"popup.error-loading": "파일 로드 오류",
113+
"popup.lcc-upload-warning": "superspl.at에 더 나은 게시를 위해 업로드 페이지를 통해 LCC 파일을 직접 업로드하세요.",
113114
"popup.export": "내보내기",
114115
"popup.copy-to-clipboard": "클립 보드에 링크 복사",
115116
"popup.render-image.header": "이미지 설정",

static/locales/pt-BR.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"popup.no": "Não",
111111
"popup.error": "Erro",
112112
"popup.error-loading": "Erro ao Carregar Arquivo",
113+
"popup.lcc-upload-warning": "Para uma melhor publicação no superspl.at, envie seu arquivo LCC diretamente pela página de upload.",
113114
"popup.export": "Exportar",
114115
"popup.copy-to-clipboard": "Copiar Link para Área de Transferência",
115116
"popup.render-image.header": "Configurações de Imagem",

static/locales/ru.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"popup.no": "Нет",
111111
"popup.error": "Ошибка",
112112
"popup.error-loading": "Ошибка загрузки файла",
113+
"popup.lcc-upload-warning": "Для лучшей публикации на superspl.at загрузите LCC-файл напрямую через страницу загрузки.",
113114
"popup.export": "Экспорт",
114115
"popup.copy-to-clipboard": "Скопировать ссылку в буфер обмена",
115116
"popup.render-image.header": "Настройки изображения",

static/locales/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
"popup.no": "",
111111
"popup.error": "错误",
112112
"popup.error-loading": "加载文件错误",
113+
"popup.lcc-upload-warning": "为了更好地发布到 superspl.at,请通过上传页面直接上传您的 LCC 文件。",
113114
"popup.export": "导出",
114115
"popup.copy-to-clipboard": "复制链接到剪贴板",
115116
"popup.render-image.header": "图像设置",

0 commit comments

Comments
 (0)