예제 #1
0
 private void MainWindow_Loaded(object sender, RoutedEventArgs e)
 {
     renderView.Model             = L2DFunctions.LoadModel(@"shizuku\shizuku.model.json");
     renderView.Model.UseBreath   = true;
     renderView.Model.UseEyeBlink = true;
     renderView.Target            = textID.MainBox;
 }
예제 #2
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            renderView.Model           = L2DFunctions.LoadModel(@"Pio\model.json");
            renderView.Model.UseBreath = true;

            Trigger.OnBreak       += Trigger_OnBreak;
            Trigger.OnComboRankUp += Trigger_OnComboRankUp;
            Trigger.OnStatus      += Trigger_OnStatus;

            idle_motion_timer = new Timer(OnIdleTimer, null, GetIdleNextTime(), Timeout.Infinite);
        }
예제 #3
0
        private void LoadModelJSON_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                OpenFileDialog dialog = new OpenFileDialog
                {
                    Filter = "JSON 모델 구성|*.json"
                };

                bool?result = dialog.ShowDialog();
                if (result == true)
                {
                    // Live2D
                    // 모델 불러오기
                    ReleaseCheck();
                    model = L2DFunctions.LoadModel(dialog.FileName);

                    // 설정 업데이트
                    UpdateConfig();

                    // Application
                    // 목록 초기화
                    ListMotion.Items.Clear();
                    ListExpression.Items.Clear();

                    // 모션 목록 갱신
                    if (model.Motion != null)
                    {
                        foreach (L2DMotion[] group in model.Motion.Values)
                        {
                            foreach (L2DMotion motion in group)
                            {
                                ListMotion.Items.Add(Path.GetFileName(motion.Path));
                            }
                        }
                    }

                    // 표정 목록 갱신
                    if (model.Expression != null)
                    {
                        for (int i = 0; i < model.Expression.Count; i++)
                        {
                            ListExpression.Items.Add(model.Expression.Keys.ElementAt(i));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "오류", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }