コード例 #1
0
        void map_background_Click(object sender, RoutedEventArgs e)
        {
            if (this.activeMap != null)
            {
                string           bg_scroll = this.activeMap.GetValue("background_scroll_rate") ?? "0";
                string           bg_image  = this.activeMap.GetValue("background_image") ?? "";
                BackgroundDialog dialog    = new BackgroundDialog(bg_image, bg_scroll);
                dialog.ShowDialog();
                if (dialog.Saved)
                {
                    bg_scroll = dialog.ScrollRate.Trim();
                    bg_scroll = bg_scroll == "" ? null : bg_scroll;

                    bg_image = dialog.File.Trim();
                    bg_image = bg_image == "" ? null : bg_image;

                    this.activeMap.SetValue("background_scroll_rate", bg_scroll);
                    this.activeMap.SetValue("background_image", bg_image);

                    this.RefreshBackground();
                }
            }
        }
コード例 #2
0
        void map_background_Click(object sender, RoutedEventArgs e)
        {
            if (this.activeMap != null)
            {
                string bg_scroll = this.activeMap.GetValue("background_scroll_rate") ?? "0";
                string bg_image = this.activeMap.GetValue("background_image") ?? "";
                BackgroundDialog dialog = new BackgroundDialog(bg_image, bg_scroll);
                dialog.ShowDialog();
                if (dialog.Saved)
                {
                    bg_scroll = dialog.ScrollRate.Trim();
                    bg_scroll = bg_scroll == "" ? null : bg_scroll;

                    bg_image = dialog.File.Trim();
                    bg_image = bg_image == "" ? null : bg_image;

                    this.activeMap.SetValue("background_scroll_rate", bg_scroll);
                    this.activeMap.SetValue("background_image", bg_image);

                    this.RefreshBackground();
                }
            }
        }