Пример #1
0
		public Theater(TheaterType theaterType, EngineType engine) {
			_theaterType = theaterType;
			_engine = engine;
			if (engine == EngineType.RedAlert2 || engine == EngineType.TiberianSun) {
				_rules = VFS.Open<IniFile>("rules.ini");
				_art = VFS.Open<IniFile>("art.ini");
			}
			else if (engine == EngineType.YurisRevenge) {
				_rules = VFS.Open<IniFile>("rulesmd.ini");
				_art = VFS.Open<IniFile>("artmd.ini");
			}
			else if (engine == EngineType.Firestorm) {
				_rules = VFS.Open<IniFile>("rules.ini");
				var fsRules = VFS.Open<IniFile>("firestrm.ini");
				Logger.Info("Merging Firestorm rules with TS rules");
				_rules.MergeWith(fsRules);
				_art = VFS.Open<IniFile>("artmd.ini");
			}
		}
Пример #2
0
		// Starkku: Added support for custom ini filenames declared in mod config.
		public bool LoadInis(List<string> customRulesIniFiles, List<string> customArtIniFiles) {

			if (customRulesIniFiles.Count < 1) {
				if (Engine == EngineType.YurisRevenge) {
					_rules = VFS.Open<IniFile>("rulesmd.ini");
				}
				else if (Engine == EngineType.Firestorm) {
					_rules = VFS.Open<IniFile>("rules.ini");
					Logger.Info("Merging Firestorm rules with TS rules");
					_rules.MergeWith(VFS.Open<IniFile>("firestrm.ini"));
				}
				else {
					_rules = VFS.Open<IniFile>("rules.ini");
				}
			}
			else {
				_rules = LoadCustomInis(customRulesIniFiles);

			}

			if (customArtIniFiles.Count < 1) {
				if (Engine == EngineType.YurisRevenge) {
					_art = VFS.Open<IniFile>("artmd.ini");
				}
				else if (Engine == EngineType.Firestorm) {
					_art = VFS.Open<IniFile>("art.ini");
					Logger.Info("Merging Firestorm art with TS art");
					_art.MergeWith(VFS.Open<IniFile>("artfs.ini"));
				}
				else {
					_art = VFS.Open<IniFile>("art.ini");
				}
			}
			else {
				_art = LoadCustomInis(customArtIniFiles);
			}

			if (_rules == null || _art == null) {
				Logger.Fatal("Rules or art config file could not be loaded! You cannot render a YR/FS map" +
							" without the expansion installed");
				return false;
			}
			return true;
		}