/// <summary> /// Reads all Skin Settings and Imports into Database /// </summary> /// <param name="filename"></param> public static void Load(string filename) { // Check if File Exist if (!System.IO.File.Exists(filename)) { return; } XmlDocument doc = new XmlDocument(); try { doc.Load(filename); } catch (XmlException e) { MPTVSeriesLog.Write("Error: Cannot Load skin settings xml file: ", MPTVSeriesLog.LogLevel.Normal); MPTVSeriesLog.Write(e.Message); return; } SkinProperties.Clear(); // Read and Import Skin Settings into database GetVersion(doc); GetSupportedLayouts(doc); GetViews(doc); GetGraphicsQuality(doc); GetFormattingRules(doc); GetLogoRules(doc); GetVideoOSDImages(doc); GetVideoPlayImages(doc); GetThumbNewStampPositions(doc); GetDefines(doc); }
public void Start() { skinProperties = canvas.GetComponent <SkinProperties>(); skinList.Add(skin0); skinList.Add(skin1); skinList.Add(skin2); skinList.Add(skin3); skinList.Add(skin4); for (int i = 0; i < skinList.Count; i++) { if (PlayerPrefs.GetInt(IDs.hasSkin + i, 0) == 0) { skinList[i].color = Color.black; } } //sets the yellow frame to the currently equipped skin skinSelector.rectTransform.localPosition = skinList[PlayerPrefs.GetInt("SkinID")].rectTransform.localPosition; for (int i = 0; i < skinList.Count; i++) { Debug.Log(skinList[i].ToString()); } Debug.Log(PlayerPrefs.GetInt("SkinID")); SetTextFields(); }
/// <summary> /// Gets all properties used by this plugin /// </summary> /// <param name="skinfile"></param> static void GetSkinProperties(string filename) { string content = string.Empty; StreamReader r = new StreamReader(filename); content = r.ReadToEnd(); Regex reg = new Regex(@"(#TVSeries\.\w+(?:\.\w+)*)"); MatchCollection matches = reg.Matches(content); MPTVSeriesLog.Write("Skin uses " + matches.Count.ToString() + " fields", MPTVSeriesLog.LogLevel.Debug); for (int i = 0; i < matches.Count; i++) { string pre = string.Empty; string remove = string.Empty; if (matches[i].Value.Contains((remove = "#TVSeries.Episode."))) { pre = "Episode"; } else if (matches[i].Value.Contains((remove = "#TVSeries.Season."))) { pre = "Season"; } else if (matches[i].Value.Contains((remove = "#TVSeries.Series."))) { pre = "Series"; } string value = matches[i].Value.Trim().Replace(remove, string.Empty); if (pre.Length > 0) { if (SkinProperties.ContainsKey(pre)) { if (!SkinProperties[pre].Contains(value)) { SkinProperties[pre].Add(value); } } else { List <string> v = new List <string>(); v.Add(value); SkinProperties.Add(pre, v); } } } }