/// <summary>
        /// Applies the check-box's associated code to the map INI file.
        /// </summary>
        /// <param name="mapIni">The map INI file.</param>
        /// <param name="gameMode">Currently selected gamemode, if set.</param>
        public void ApplyMapCode(IniFile mapIni, GameMode gameMode)
        {
            if (Checked == reversed || String.IsNullOrEmpty(customIniPath))
            {
                return;
            }

            MapCodeHelper.ApplyMapCode(mapIni, customIniPath, gameMode);
        }
Beispiel #2
0
        /// <summary>
        /// Applies the drop down's associated code to the map INI file.
        /// </summary>
        /// <param name="mapIni">The map INI file.</param>
        /// <param name="gameMode">Currently selected gamemode, if set.</param>
        public void ApplyMapCode(IniFile mapIni, GameMode gameMode)
        {
            if (dataWriteMode != DropDownDataWriteMode.MAPCODE || SelectedIndex < 0 || SelectedIndex >= Items.Count)
            {
                return;
            }

            string customIniPath;

            if (Items[SelectedIndex].Tag != null)
            {
                customIniPath = Items[SelectedIndex].Tag.ToString();
            }
            else
            {
                customIniPath = Items[SelectedIndex].Text;
            }

            MapCodeHelper.ApplyMapCode(mapIni, customIniPath, gameMode);
        }