Exemplo n.º 1
0
        private void OpenVirtualCamTips()
        {
            var url = LanguageSelector.StringToLanguage(LanguageSelector.Instance.LanguageName) switch
            {
                Languages.Chinese => "https://malaybaku.github.io/VMagicMirror/tips/virtual_camera",
                _ => "https://malaybaku.github.io/VMagicMirror/en/tips/virtual_camera",
            };

            UrlNavigate.Open(url);
        }
Exemplo n.º 2
0
        internal LayoutSettingViewModel(
            LayoutSettingSync model, GamepadSettingSync gamepadModel, IMessageSender sender, IMessageReceiver receiver
            ) : base(sender)
        {
            _model        = model;
            _gamepadModel = gamepadModel;

            QuickSaveViewPointCommand = new ActionCommand <string>(async s => await _model.QuickSaveViewPoint(s));
            QuickLoadViewPointCommand = new ActionCommand <string>(_model.QuickLoadViewPoint);

            OpenTextureReplaceTipsUrlCommand = new ActionCommand(
                () => UrlNavigate.Open(LocalizedString.GetString("URL_tips_texture_replace"))
                );

            ResetCameraPositionCommand = new ActionCommand(() => SendMessage(MessageFactory.Instance.ResetCameraPosition()));

            ResetCameraSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetCameraSetting)
                );

            ResetDeviceLayoutCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetDeviceLayout)
                );

            ResetHidSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetHidSetting)
                );
            ResetCameraSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetCameraSetting)
                );
            ResetMidiSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetMidiSetting)
                );

            _model.SelectedTypingEffectId.PropertyChanged += (_, __) =>
            {
                TypingEffectItem = TypingEffectSelections
                                   .FirstOrDefault(v => v.Id == _model.SelectedTypingEffectId.Value);
            };

            _typingEffectItem         = TypingEffectSelections[0];
            receiver.ReceivedCommand += OnReceiveCommand;
        }
Exemplo n.º 3
0
        public MainWindowViewModel()
        {
            Model           = new RootSettingSync(MessageSender, MessageIo.Receiver);
            SettingFileIo   = new SettingFileIo(Model, MessageSender);
            SaveFileManager = new SaveFileManager(SettingFileIo, Model, MessageSender);

            WindowSetting          = new WindowSettingViewModel(Model.Window, MessageSender);
            MotionSetting          = new MotionSettingViewModel(Model.Motion, MessageSender, MessageIo.Receiver);
            GamepadSetting         = new GamepadSettingViewModel(Model.Gamepad, MessageSender);
            LayoutSetting          = new LayoutSettingViewModel(Model.Layout, Model.Gamepad, MessageSender, MessageIo.Receiver);
            LightSetting           = new LightSettingViewModel(Model.Light, MessageSender);
            WordToMotionSetting    = new WordToMotionSettingViewModel(Model.WordToMotion, MessageSender, MessageIo.Receiver);
            ExternalTrackerSetting = new ExternalTrackerViewModel(Model.ExternalTracker, Model.Motion, MessageSender, MessageIo.Receiver);
            SettingIo = new SettingIoViewModel(Model, Model.Automation, SaveFileManager, MessageSender);
            //オートメーションの配線: 1つしかないのでザツにやる。OC<T>をいじる関係でUIスレッド必須なことに注意
            Model.Automation.LoadSettingFileRequested += v =>
                                                         Application.Current.Dispatcher.BeginInvoke(new Action(
                                                                                                        () => SaveFileManager.LoadSetting(v.Index, v.LoadCharacter, v.LoadNonCharacter, true))
                                                                                                    );

            _runtimeHelper = new RuntimeHelper(MessageSender, MessageIo.Receiver, Model);

            LoadVrmCommand           = new ActionCommand(LoadVrm);
            LoadVrmByFilePathCommand = new ActionCommand <string>(LoadVrmByFilePath);
            ConnectToVRoidHubCommand = new ActionCommand(ConnectToVRoidHubAsync);

            OpenVRoidHubCommand      = new ActionCommand(() => UrlNavigate.Open("https://hub.vroid.com/"));
            AutoAdjustCommand        = new ActionCommand(() => MessageSender.SendMessage(MessageFactory.Instance.RequestAutoAdjust()));
            OpenSettingWindowCommand = new ActionCommand(() => SettingWindow.OpenOrActivateExistingWindow(this));

            ResetToDefaultCommand  = new ActionCommand(ResetToDefault);
            LoadPrevSettingCommand = new ActionCommand(LoadPrevSetting);

            TakeScreenshotCommand       = new ActionCommand(_runtimeHelper.TakeScreenshot);
            OpenScreenshotFolderCommand = new ActionCommand(_runtimeHelper.OpenScreenshotSavedFolder);

            MessageIo.Receiver.ReceivedCommand      += OnReceiveCommand;
            SaveFileManager.VRoidModelLoadRequested += id => LoadSavedVRoidModel(id, false);
        }
Exemplo n.º 4
0
        internal MotionSettingViewModel(MotionSettingSync model, IMessageSender sender, IMessageReceiver receiver) : base(sender)
        {
            _model = model;

            ResetFaceBasicSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(ResetFaceBasicSetting)
                );
            ResetFaceEyeSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetFaceEyeSetting)
                );
            ResetFaceBlendShapeSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetFaceBlendShapeSetting)
                );
            ResetArmMotionSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetArmSetting)
                );
            ResetHandMotionSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetHandSetting)
                );
            ResetWaitMotionSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetWaitMotionSetting)
                );

            CalibrateFaceCommand = new ActionCommand(() => SendMessage(MessageFactory.Instance.CalibrateFace()));
            OpenFullEditionDownloadUrlCommand = new ActionCommand(() => UrlNavigate.Open("https://baku-dreameater.booth.pm/items/3064040"));
            OpenHandTrackingPageUrlCommand    = new ActionCommand(() => UrlNavigate.Open(LocalizedString.GetString("URL_docs_hand_tracking")));

            ShowMicrophoneVolume = new RProperty <bool>(false, b =>
            {
                SendMessage(MessageFactory.Instance.SetMicrophoneVolumeVisibility(b));
                if (!b)
                {
                    MicrophoneVolumeValue.Value = 0;
                }
            });

            _model.KeyboardAndMouseMotionMode.PropertyChanged += (_, __) => UpdateKeyboardAndMouseMotionMode();
            UpdateKeyboardAndMouseMotionMode();
            _model.GamepadMotionMode.PropertyChanged += (_, __) => UpdateGamepadMotionMode();
            UpdateGamepadMotionMode();

            _model.EyeBoneRotationScale.PropertyChanged += (_, __) => UpdateEyeRotRangeText();
            _model.EnableLipSync.PropertyChanged        += (_, __) =>
            {
                if (!_model.EnableLipSync.Value)
                {
                    ShowMicrophoneVolume.Value = false;
                }
            };

            _model.FaceNeutralClip.PropertyChanged += (_, __) =>
                                                      _blendShapeNameStore.Refresh(_model.FaceNeutralClip.Value, _model.FaceOffsetClip.Value);
            _model.FaceOffsetClip.PropertyChanged += (_, __) =>
                                                     _blendShapeNameStore.Refresh(_model.FaceNeutralClip.Value, _model.FaceOffsetClip.Value);

            //両方trueのときだけポインターを表示したいので、それのチェック
            _model.KeyboardAndMouseMotionMode.PropertyChanged += (_, __) => UpdatePointerVisibility();
            _model.ShowPresentationPointer.PropertyChanged    += (_, __) => UpdatePointerVisibility();
            //通常発生しないが、VMの初期化時点でポインター表示が必要ならそうする
            UpdatePointerVisibility();

            UpdateEyeRotRangeText();

            receiver.ReceivedCommand    += OnReceivedCommand;
            ShowInstallPathWarning.Value = InstallPathChecker.HasMultiByteCharInInstallPath();
        }
 private void OnClickHyperLinkToGitHub(object sender, RoutedEventArgs e)
 => UrlNavigate.Open("https://github.com/malaybaku/VMagicMirror");
 private void OnClickHyperLinkToModelData(object sender, RoutedEventArgs e)
 => UrlNavigate.Open("https://sketchfab.com/3d-models/xbox-controller-fb71f28a6eab4a2785cf68ff87c4c1fc");
        private void OpenPerfectSyncTipsUrl()
        {
            string url = LocalizedString.GetString("URL_tips_perfect_sync");

            UrlNavigate.Open(url);
        }
Exemplo n.º 8
0
 //NOTE: オートメーションの説明ではあるけど設定ファイルタブ全体の設定に飛ばす。
 //どのみちファイルI/Oがどうなってるか説明する必要あるので
 private void OpenInstructionUrl()
 => UrlNavigate.Open(LocalizedString.GetString("URL_docs_setting_files"));