コード例 #1
0
        public void Languages()
        {
            EditorGUI.BeginChangeCheck();

            Texture2D languages_icon = SA_EditorAssets.GetTextureAtPath(ISD_Skin.ICONS_PATH + "languages.png");

            using (new SA_WindowBlockWithIndent(new GUIContent("Languages", languages_icon))) {
                SA_EditorGUILayout.ReorderablList(ISD_Settings.Instance.Languages,
                                                  (SA_ISOLanguage lang) => {
                    return(lang.Code.ToUpper() + "     (" + lang.Name + ")");
                }
                                                  );

                EditorGUILayout.BeginHorizontal();
                s_newLangindex = EditorGUILayout.Popup(s_newLangindex, SA_LanguagesUtil.ISOLanguagesList.Names.ToArray());
                if (GUILayout.Button("Add Language", EditorStyles.miniButton, GUILayout.Width(100)))
                {
                    var lang = SA_LanguagesUtil.ISOLanguagesList.Languages[s_newLangindex];
                    ISD_Settings.Instance.Languages.Add(lang);
                }
                EditorGUILayout.EndHorizontal();
            }

            if (EditorGUI.EndChangeCheck())
            {
                if (ISD_Settings.Instance.Languages.Count == 0)
                {
                    ISD_API.RemoveInfoPlistKey(ISD_Settings.CF_LOCLIZATIONS_PLIST_KEY);
                }
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public override void OnGUI()
        {
            SA_EditorGUILayout.Header("PLIST VALUES");


            foreach (ISD_PlistKey plistKey in ISD_Settings.Instance.PlistVariables)
            {
                EditorGUILayout.BeginVertical(GUI.skin.box);
                DrawPlistVariable(plistKey, (object)plistKey, ISD_Settings.Instance.PlistVariables);
                EditorGUILayout.EndVertical();

                if (!ISD_Settings.Instance.PlistVariables.Contains(plistKey))
                {
                    return;
                }
            }
            EditorGUILayout.Space();


            EditorGUILayout.BeginVertical(GUI.skin.box);
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("New Variable Name");
            NewPlistValueName = EditorGUILayout.TextField(NewPlistValueName);
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.Space();
            if (GUILayout.Button("Add", GUILayout.Width(100)))
            {
                if (NewPlistValueName.Length > 0)
                {
                    ISD_PlistKey v = new ISD_PlistKey();
                    v.Name = NewPlistValueName;
                    ISD_API.SetInfoPlistKey(v);
                }
                NewPlistValueName = string.Empty;
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();
            EditorGUILayout.EndVertical();
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        public void Frameworks()
        {
            Texture2D framework_icon = SA_EditorAssets.GetTextureAtPath(ISD_Skin.ICONS_PATH + "frameworks.png");

            using (new SA_WindowBlockWithIndent(new GUIContent("Frameworks", framework_icon))) {
                IsDefFrameworksOpen = EditorGUILayout.Foldout(IsDefFrameworksOpen, "Show Default Unity Frameworks (17 Enabled)");
                if (IsDefFrameworksOpen)
                {
                    int indentLevel = EditorGUI.indentLevel;
                    EditorGUI.indentLevel = 0;
                    using (new SA_GuiBeginHorizontal()) {
                        GUILayout.Space(30);

                        using (new SA_GuiBeginVertical(GUI.skin.box)) {
                            foreach (ISD_Framework framework in ISD_FrameworkHandler.DefaultFrameworks)
                            {
                                SA_EditorGUILayout.SelectableLabel(framework.Type.ToString() + ".framework", "");
                            }
                        }
                    }

                    EditorGUI.indentLevel = indentLevel;
                    EditorGUILayout.Space();
                }


                IsDefLibrariesOpen = EditorGUILayout.Foldout(IsDefLibrariesOpen, "Default Unity Libraries (2 Enabled)");
                if (IsDefLibrariesOpen)
                {
                    int indentLevel = EditorGUI.indentLevel;
                    EditorGUI.indentLevel = 0;
                    using (new SA_GuiBeginHorizontal()) {
                        GUILayout.Space(30);

                        using (new SA_GuiBeginVertical(GUI.skin.box)) {
                            SA_EditorGUILayout.SelectableLabel("libiPhone-lib.a", "");
                            SA_EditorGUILayout.SelectableLabel("libiconv.2.dylib", "");
                        }
                    }
                    EditorGUI.indentLevel = indentLevel;


                    EditorGUILayout.Space();
                }

                //Frameworks List
                SA_EditorGUILayout.ReorderablList(ISD_Settings.Instance.Frameworks,
                                                  (ISD_Framework framework) => {
                    if (framework.IsOptional && framework.IsEmbeded)
                    {
                        return(framework.Name + "       (Optional & Embeded)");
                    }
                    else if (framework.IsOptional)
                    {
                        return(framework.Name + "        (Optional)");
                    }
                    else if (framework.IsEmbeded)
                    {
                        return(framework.Name + "        (Embeded)");
                    }
                    else
                    {
                        return(framework.Name);
                    }
                },
                                                  (ISD_Framework framework) => {
                    framework.IsOptional = SA_EditorGUILayout.ToggleFiled("Optional", framework.IsOptional, SA_StyledToggle.ToggleType.YesNo);
                    framework.IsEmbeded  = SA_EditorGUILayout.ToggleFiled("Embeded", framework.IsEmbeded, SA_StyledToggle.ToggleType.YesNo);
                }
                                                  );

                //Libraries List
                SA_EditorGUILayout.ReorderablList(ISD_Settings.Instance.Libraries,
                                                  (ISD_Library lib) => {
                    if (lib.IsOptional)
                    {
                        return(lib.Name + "    (Optional)");
                    }
                    else
                    {
                        return(lib.Name);
                    }
                },
                                                  (ISD_Library lib) => {
                    lib.IsOptional = SA_EditorGUILayout.ToggleFiled("Optional", lib.IsOptional, SA_StyledToggle.ToggleType.YesNo);
                }
                                                  );



                //Add New Framework
                EditorGUILayout.BeginHorizontal();
                NewBaseFrameworkIndex = EditorGUILayout.Popup(NewBaseFrameworkIndex, ISD_FrameworkHandler.BaseFrameworksArray());

                if (GUILayout.Button("Add Framework", EditorStyles.miniButton, GUILayout.Width(100)))
                {
                    var type = ISD_FrameworkHandler.BaseFrameworksArray()[NewBaseFrameworkIndex];
                    NewBaseFrameworkIndex = 0;

                    ISD_Framework f = new ISD_Framework(type);
                    ISD_API.AddFramework(f);
                }
                EditorGUILayout.EndHorizontal();


                //Add New Library
                EditorGUILayout.BeginHorizontal();
                NewLibraryIndex = EditorGUILayout.Popup(NewLibraryIndex, ISD_LibHandler.BaseLibrariesArray());

                if (GUILayout.Button("Add Library", EditorStyles.miniButton, GUILayout.Width(100)))
                {
                    ISD_iOSLibrary type = (ISD_iOSLibrary)ISD_LibHandler.enumValueOf(ISD_LibHandler.BaseLibrariesArray()[NewLibraryIndex]);
                    NewLibraryIndex = 0;
                    ISD_API.AddLibrary(type);
                }

                EditorGUILayout.EndHorizontal();
            }
        }