Beispiel #1
0
        public InstallMapDialogue(demoreading.mapstatus status)
        {
            InitializeComponent();

            globalStat = status;

            if (status.isWorkshop)
            {
                //Download the workshop object (only info)
                workshopfile = WorkshopFile.get(new WorkshopURI(globalStat.activeParser.Map));

                //Set mapname title
                target_mapname.Content = workshopfile.response.publishedfiledetails[0].title + "   |   " + workshopfile.response.publishedfiledetails[0].file_size / 1024 / 1024 + " mb";

                //Temporarily using the description for this box right now
                string desc = workshopfile.response.publishedfiledetails[0].description;
                if (desc.Length > 128)
                {
                    desc = desc.Substring(0, 128) + "...";
                }
                target_mapcreator.Content = desc;

                //Set the preview image
                target_previewImage.Source = Workshop.downloadUGCImage(workshopfile.response.publishedfiledetails[0].preview_url);
            }
        }
Beispiel #2
0
        private void DemoPanel_Drop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                // Note that you can have more than one file.
                string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);

                // MessageBox.Show(files[0]);

                demoreading.mapstatus status = demoreading.isDownloaded(files[0]);
                if (status.isDownloaded)
                {
                    //Process demo file config window
                    ProcessDemoDialogue procDemo = new ProcessDemoDialogue(status, this);
                    procDemo.Show();
                }
                else
                {
                    InstallMapDialogue insMap = new InstallMapDialogue(status);
                    insMap.Show();
                }
            }

            doLoadDemos();
        }
        public ProcessDemoDialogue(demoreading.mapstatus status, MainWindow handle)
        {
            InitializeComponent();
            sentfrom = handle;

            stat = status;

            target_demoname.Content = stat.filename;
        }