Exemple #1
0
        // Constructor
        public ImageBrowserControl()
        {
            // Initialize
            InitializeComponent();
            items = new List <ImageBrowserItem>();

            //mxd
            StepsList sizes = new StepsList {
                4, 8, 16, 32, 48, 64, 96, 128, 196, 256, 512, 1024
            };

            filterWidth.StepValues  = sizes;
            filterHeight.StepValues = sizes;

            //mxd. Looks like SplitterDistance is unaffected by DPI scaling. Let's fix that...
            if (MainForm.DPIScaler.Height != 1.0f)
            {
                splitter.SplitterDistance = splitter.Height - splitter.Panel2.Height - (int)Math.Round(splitter.SplitterWidth * MainForm.DPIScaler.Height);
            }
        }
 /// <summary>
 /// Constructor.
 /// </summary>
 public SteppedProgressManager()
 {
     ListLock = new object();
     Steps    = new StepsList(this);
 }
        // Constructor
        internal GameConfiguration(Configuration cfg)
        {
            object obj;

            // Initialize
            this.cfg                     = cfg;
            this.thingflags              = new Dictionary <string, string>();
            this.defaultthingflags       = new List <string>();
            this.thingcategories         = new List <ThingCategory>();
            this.things                  = new Dictionary <int, ThingTypeInfo>();
            this.linedefflags            = new Dictionary <string, string>();
            this.sortedlinedefflags      = new List <string>();
            this.linedefactions          = new Dictionary <int, LinedefActionInfo>();
            this.actioncategories        = new List <LinedefActionCategory>();
            this.sortedlinedefactions    = new List <LinedefActionInfo>();
            this.linedefactivates        = new List <LinedefActivateInfo>();
            this.genactioncategories     = new List <GeneralizedCategory>();
            this.sectoreffects           = new Dictionary <int, SectorEffectInfo>();
            this.sortedsectoreffects     = new List <SectorEffectInfo>();
            this.geneffectoptions        = new List <GeneralizedOption>();
            this.enums                   = new Dictionary <string, EnumList>();
            this.skills                  = new List <SkillInfo>();
            this.texturesets             = new List <DefinedTextureSet>();
            this.makedoorargs            = new int[Linedef.NUM_ARGS];
            this.maplumps                = new Dictionary <string, MapLumpInfo>();
            this.thingflagstranslation   = new List <FlagTranslation>();
            this.linedefflagstranslation = new List <FlagTranslation>();
            this.thingfilters            = new List <ThingsFilter>();
            this.thingflagscompare       = new List <ThingFlagsCompare>();
            this.brightnesslevels        = new StepsList();
            this.makedoorflags           = new Dictionary <string, bool>();

            // Read general settings
            configname               = cfg.ReadSetting("game", "<unnamed game>");
            enginename               = cfg.ReadSetting("engine", "");
            defaultsavecompiler      = cfg.ReadSetting("defaultsavecompiler", "");
            defaulttestcompiler      = cfg.ReadSetting("defaulttestcompiler", "");
            defaulttexturescale      = cfg.ReadSetting("defaulttexturescale", 1f);
            defaultflatscale         = cfg.ReadSetting("defaultflatscale", 1f);
            scaledtextureoffsets     = cfg.ReadSetting("scaledtextureoffsets", true);
            formatinterface          = cfg.ReadSetting("formatinterface", "");
            mixtexturesflats         = cfg.ReadSetting("mixtexturesflats", false);
            generalizedactions       = cfg.ReadSetting("generalizedlinedefs", false);
            generalizedeffects       = cfg.ReadSetting("generalizedsectors", false);
            start3dmodethingtype     = cfg.ReadSetting("start3dmode", 0);
            linedefactivationsfilter = cfg.ReadSetting("linedefactivationsfilter", 0);
            testparameters           = cfg.ReadSetting("testparameters", "");
            testshortpaths           = cfg.ReadSetting("testshortpaths", false);
            makedoortrack            = cfg.ReadSetting("makedoortrack", "-");
            makedooraction           = cfg.ReadSetting("makedooraction", 0);
            makedooractivate         = cfg.ReadSetting("makedooractivate", 0);
            linetagindicatesectors   = cfg.ReadSetting("linetagindicatesectors", false);
            decorategames            = cfg.ReadSetting("decorategames", "");
            skyflatname              = cfg.ReadSetting("skyflatname", "F_SKY1");
            maxtexturenamelength     = cfg.ReadSetting("maxtexturenamelength", 8);
            leftboundary             = cfg.ReadSetting("leftboundary", -32768);
            rightboundary            = cfg.ReadSetting("rightboundary", 32767);
            topboundary              = cfg.ReadSetting("topboundary", 32767);
            bottomboundary           = cfg.ReadSetting("bottomboundary", -32768);
            doomlightlevels          = cfg.ReadSetting("doomlightlevels", true);
            for (int i = 0; i < Linedef.NUM_ARGS; i++)
            {
                makedoorargs[i] = cfg.ReadSetting("makedoorarg" + i.ToString(CultureInfo.InvariantCulture), 0);
            }

            // Flags have special (invariant culture) conversion
            // because they are allowed to be written as integers in the configs
            obj = cfg.ReadSettingObject("soundlinedefflag", 0);
            if (obj is int)
            {
                soundlinedefflag = ((int)obj).ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                soundlinedefflag = obj.ToString();
            }
            obj = cfg.ReadSettingObject("singlesidedflag", 0);
            if (obj is int)
            {
                singlesidedflag = ((int)obj).ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                singlesidedflag = obj.ToString();
            }
            obj = cfg.ReadSettingObject("doublesidedflag", 0);
            if (obj is int)
            {
                doublesidedflag = ((int)obj).ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                doublesidedflag = obj.ToString();
            }
            obj = cfg.ReadSettingObject("impassableflag", 0);
            if (obj is int)
            {
                impassableflag = ((int)obj).ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                impassableflag = obj.ToString();
            }
            obj = cfg.ReadSettingObject("upperunpeggedflag", 0);
            if (obj is int)
            {
                upperunpeggedflag = ((int)obj).ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                upperunpeggedflag = obj.ToString();
            }
            obj = cfg.ReadSettingObject("lowerunpeggedflag", 0);
            if (obj is int)
            {
                lowerunpeggedflag = ((int)obj).ToString(CultureInfo.InvariantCulture);
            }
            else
            {
                lowerunpeggedflag = obj.ToString();
            }

            // Get map lumps
            maplumpnames = cfg.ReadSetting("maplumpnames", new Hashtable());

            // Get texture and flat sources
            textureranges  = cfg.ReadSetting("textures", new Hashtable());
            flatranges     = cfg.ReadSetting("flats", new Hashtable());
            patchranges    = cfg.ReadSetting("patches", new Hashtable());
            spriteranges   = cfg.ReadSetting("sprites", new Hashtable());
            colormapranges = cfg.ReadSetting("colormaps", new Hashtable());

            // Map lumps
            LoadMapLumps();

            // Skills
            LoadSkills();

            // Enums
            LoadEnums();

            // Things
            LoadThingFlags();
            LoadDefaultThingFlags();
            LoadThingCategories();

            // Linedefs
            LoadLinedefFlags();
            LoadLinedefActions();
            LoadLinedefActivations();
            LoadLinedefGeneralizedActions();

            // Sectors
            LoadBrightnessLevels();
            LoadSectorEffects();
            LoadSectorGeneralizedEffects();

            // Universal fields
            linedeffields = LoadUniversalFields("linedef");
            sectorfields  = LoadUniversalFields("sector");
            sidedeffields = LoadUniversalFields("sidedef");
            thingfields   = LoadUniversalFields("thing");
            vertexfields  = LoadUniversalFields("vertex");

            // Defaults
            LoadTextureSets();
            LoadThingFilters();

            // Make door flags
            LoadMakeDoorFlags();
        }