[feature-136] add warning for models breaks (due to openxr)

This commit is contained in:
MathieuG-P
2023-05-21 17:00:11 +02:00
parent bc2c716111
commit af0ec409a0
5 changed files with 36 additions and 3 deletions
@@ -13,6 +13,7 @@ import { useOnUpdate } from "renderer/hooks/use-on-update.hook";
import { NotificationService } from "renderer/services/notification.service";
import { ConfigurationService } from "renderer/services/configuration.service";
import { useTranslation } from "renderer/hooks/use-translation.hook";
import { gte, lt } from "semver";
export function ModelsPanel({version, isActive, goToMods}: {version?: BSVersion, isActive: boolean, goToMods?: () => void}) {
@@ -44,6 +45,16 @@ export function ModelsPanel({version, isActive, goToMods}: {version?: BSVersion,
});
}, [isActive]);
useOnUpdate(() => {
if(!isActive || !version || lt(version.BSVersion, "1.29.4")){ return; }
if(config.get("not-remind-models-breaks")){ return; }
notification.notifyWarning({ title: "models.notifications.prevent-for-models-breaks.title", desc: "models.notifications.prevent-for-models-breaks.desc", actions: [
{id: "0", title: "models.notifications.prevent-for-mods.not-remind", cancel: true}
], duration: 12_000 }).then(res => {
if(res === "0"){ config.set("not-remind-models-breaks", true); }
});
}, [isActive, version])
const exportModels = () => {
const selectedModels = modelsGridRefs.map(ref =>(ref.current?.getSelectedModels() as BsmLocalModel[])).flat()
modelsManager.exportModels(selectedModels, version);