public static void DrawArrayValues(ISD_PlistKey plistKey) { plistKey.IsListOpen = EditorGUILayout.Foldout(plistKey.IsListOpen, "Array Values (" + plistKey.ChildrensIds.Count + ")"); if (plistKey.IsListOpen) { EditorGUI.indentLevel++; { foreach (string uniqueKey in plistKey.ChildrensIds) { ISD_PlistKey v = ISD_Settings.Instance.getVariableById(uniqueKey); DrawPlistVariable(v, uniqueKey, plistKey.ChildrensIds); if (!plistKey.ChildrensIds.Contains(uniqueKey)) { return; } } EditorGUILayout.BeginHorizontal(); EditorGUILayout.Space(); if (GUILayout.Button("Add Value", GUILayout.Width(100))) { ISD_PlistKey newVar = new ISD_PlistKey(); plistKey.AddChild(newVar); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); } EditorGUI.indentLevel--; } }
static void RegisterAppLanguages() { var CFBundleLocalizations = new ISD_PlistKey(); CFBundleLocalizations.Name = "CFBundleLocalizations"; CFBundleLocalizations.Type = ISD_PlistKeyType.Array; foreach (var lang in ISD_Settings.Instance.Languages) { var langItem = new ISD_PlistKey(); langItem.Type = ISD_PlistKeyType.String; langItem.StringValue = lang.Name; CFBundleLocalizations.AddChild(langItem); } ISD_API.SetInfoPlistKey(CFBundleLocalizations); }
static void RegisterAppLanguages() { //We have nothing to register, no point to add en empty CFBundleLocalizations key. if (ISD_Settings.Instance.Languages.Count == 0) { return; } var CFBundleLocalizations = new ISD_PlistKey(); CFBundleLocalizations.Name = ISD_Settings.CF_LOCLIZATIONS_PLIST_KEY; CFBundleLocalizations.Type = ISD_PlistKeyType.Array; foreach (var lang in ISD_Settings.Instance.Languages) { var langItem = new ISD_PlistKey(); langItem.Type = ISD_PlistKeyType.String; langItem.StringValue = lang.Name; CFBundleLocalizations.AddChild(langItem); } ISD_API.SetInfoPlistKey(CFBundleLocalizations); }
public static void DrawDictionaryValues(ISD_PlistKey plistKey) { plistKey.IsListOpen = EditorGUILayout.Foldout(plistKey.IsListOpen, "Dictionary Values"); if (plistKey.IsListOpen) { EditorGUI.indentLevel++; { foreach (string uniqueKey in plistKey.ChildrensIds) { ISD_PlistKey v = ISD_Settings.Instance.getVariableById(uniqueKey); DrawPlistVariable(v, uniqueKey, plistKey.ChildrensIds); if (!plistKey.ChildrensIds.Contains(uniqueKey)) { return; } } EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("New Key"); NewValueName = EditorGUILayout.TextField(NewValueName); if (GUILayout.Button("Add", GUILayout.Width(50))) { if (NewValueName.Length > 0) { ISD_PlistKey v = new ISD_PlistKey(); v.Name = NewValueName; plistKey.AddChild(v); } } EditorGUILayout.EndHorizontal(); } EditorGUI.indentLevel--; } }