コード例 #1
0
    public static void BuildDev()
    {
        if (!EditorUtility.DisplayDialog("", "是否开始打包?", "确定", "取消"))
        {
            Debug.Log("取消打包");
            return;
        }

        if (EditorUtility.DisplayDialog("", "是否先设置Assetbundle名字", "确定", "取消"))
        {
            AutoSetAssetBundleName.Init(true);
        }

        EditorUtility.DisplayProgressBar("打包中", "打包中...", 0f);
        string[] outputPathArray = new string[] {
            "assetbundle/sprite/",
            "assetbundle/data/",
            "assetbundle/ui/",
        };

        foreach (string outputPath in outputPathArray)
        {
            if (Directory.Exists(EditorConfig.GetoutputPath() + "/" + outputPath))
            {
                Directory.Delete(outputPath, true);
            }
            Directory.CreateDirectory(outputPath);
        }
        BuildPipeline.BuildAssetBundles(EditorConfig.GetoutputPath(), BuildAssetBundleOptions.None, EditorUserBuildSettings.activeBuildTarget);

        BuildDll();
        EditorUtility.ClearProgressBar();
        AssetDatabase.Refresh();
    }
コード例 #2
0
ファイル: Startup.cs プロジェクト: PatrizioG/MediplusSqlite
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApi api)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            //app.UseHttpsRedirection();

            app.UseStatusCodePagesWithRedirects("/cms/statusCode?code={0}");

            app.UseSendGridModule();

            // Initialize Piranha
            App.Init(api);

            // Build content types
            new ContentTypeBuilder(api)
            .AddAssembly(typeof(Startup).Assembly)
            .Build()
            .DeleteOrphans();

            // Configure Tiny MCE
            EditorConfig.FromFile("editorconfig.json");

            RegisterBlocks();

            // Middleware setup
            app.UsePiranha(options =>
            {
                options.UseManager();
                options.UseTinyMCE();
                options.UseIdentity();
            });
        }
コード例 #3
0
    private void AddLayerStyleLayout(FeatureStyle.FilterStyle filterStyle, string name)
    {
        EditorConfig.SetColor(EditorConfig.AddButtonColor);
        if (GUILayout.Button(EditorConfig.AddButtonContent, EditorConfig.SmallButtonWidth))
        {
            // Layers within a filter are identifier by their layer name
            var queryLayer = filterStyle.LayerStyles.Where(layerStyle => name == layerStyle.LayerName);

            if (name.Length == 0)
            {
                Debug.LogError("Layer name can't be empty");
            }
            else if (queryLayer.Count() > 0)
            {
                Debug.LogError("A layer with name " + name + " already exists");
            }
            else
            {
                var layerStyle = new FeatureStyle.LayerStyle(name);

                // Default configuration for the layer
                layerStyle.PolygonBuilderOptions  = PolygonBuilderEditor.DefaultOptions();
                layerStyle.PolylineBuilderOptions = PolylineBuilderEditor.DefaultOptions();
                layerStyle.Material = new Material(Shader.Find("Diffuse"));

                filterStyle.AddLayerStyle(layerStyle);

                // Create the associated layer editor
                layerStyleEditors.Add(new LayerStyleEditor(layerStyle));
            }
        }
        EditorConfig.ResetColor();
    }
コード例 #4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApi api)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Initialize Piranha
            App.Init(api);

            // Build content types
            new ContentTypeBuilder(api)
            .AddAssembly(typeof(Startup).Assembly)
            .Build()
            .DeleteOrphans();

            // Configure Tiny MCE
            EditorConfig.FromFile("editorconfig.json");

            // Middleware setup
            app.UsePiranha(options => {
                options.UseManager();
                options.UseTinyMCE();
                options.UseIdentity();
            });
        }
コード例 #5
0
 public TagPainter(EditorConfig config, StandardNodeDimensionsAndColor dimensions, XmlNode node, bool isClosingTagVisible)
 {
     this.config              = config;
     this.dimensions          = dimensions;
     this.node                = node;
     this.isClosingTagVisible = isClosingTagVisible;
 }
コード例 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EditorProviderSettings"/> class.
        /// </summary>
        public EditorProviderSettings()
        {
            OverrideFileOnUpload = false;
            UseAnchorSelector    = true;
            FileListPageSize     = 20;
            FileListViewMode     = FileListView.DetailView;
            SettingMode          = SettingsMode.Portal;
            DefaultLinkMode      = LinkMode.RelativeURL;
            InjectSyntaxJs       = true;
            BrowserRootDirId     = -1;
            UploadDirId          = -1;
            ResizeHeight         = -1;
            ResizeWidth          = -1;
            BrowserRoles         = "0;Administrators;";
            Browser      = "standard";
            ToolBarRoles = new List <ToolbarRoles> {
                new ToolbarRoles {
                    RoleId = 0, Toolbar = "Full"
                }
            };
            UploadSizeRoles = new List <UploadSizeRoles>
            {
                new UploadSizeRoles {
                    RoleId = 0, UploadFileLimit = -1
                }
            };

            Config = new EditorConfig();
        }
コード例 #7
0
ファイル: Startup.cs プロジェクト: timgriff84/PiranhaCMS
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApi api)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Initialize Piranha
            App.Init(api);

            // Register custom blocks
            Piranha.App.Blocks.Register <CodeBlock>();

            // Configure cache level
            App.CacheLevel = Piranha.Cache.CacheLevel.Basic;

            // Build content types
            new ContentTypeBuilder(api)
            .AddAssembly(typeof(Startup).Assembly)
            .Build()
            .DeleteOrphans();

            // Configure Tiny MCE
            EditorConfig.FromFile("editorconfig.json");

            // Middleware setup
            app.UsePiranha(options => {
                options.UseManager();
                options.UseTinyMCE();
                options.UseIdentity();
            });

            App.Modules.Manager().Scripts.Add("~/assets/js/code-block.js");
        }
コード例 #8
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApi api)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Initialize Piranha
            App.Init(api);

            // Configure cache level
            App.CacheLevel = Piranha.Cache.CacheLevel.Basic;

            // Let's not build any content types here, let
            // the client handle that.

            // Configure Tiny MCE
            EditorConfig.FromFile("editorconfig.json");

            // Middleware setup
            app.UsePiranha(options => {
                options.UseManager();
                options.UseTinyMCE();
                options.UseIdentity();
            });
        }
コード例 #9
0
ファイル: ReminderCheck.cs プロジェクト: vandewy/radarsim
        static ReminderCheck()
        {
            string lastDate = EditorPrefs.GetString(EditorConstants.KEY_REMINDER_DATE);
            string date     = System.DateTime.Now.ToString("yyyyMMdd"); // every day

            //string date = System.DateTime.Now.ToString("yyyyMMddHHmm"); // every minute (for tests)

            if (!date.Equals(lastDate))
            {
                int count = EditorPrefs.GetInt(EditorConstants.KEY_REMINDER_COUNT) + 1;

                if (Util.Constants.DEV_DEBUG)
                {
                    Debug.Log("Current count: " + count);
                }

                //if (count % 1 == 0) // for testing only
                if (count % 13 == 0 && EditorConfig.REMINDER_CHECK)
                {
                    if (Util.Config.DEBUG)
                    {
                        Debug.Log("Reminder active...");
                    }

                    int option = EditorUtility.DisplayDialogComplex(Util.Constants.ASSET_NAME + " - Reminder",
                                                                    "Please don't forget to rate " + Util.Constants.ASSET_NAME + " or even better write a little review – it would be very much appreciated!",
                                                                    "Yes, let's do it!",
                                                                    "Not right now",
                                                                    "Don't ask again!");

                    if (option == 0)
                    {
                        Application.OpenURL(EditorConstants.ASSET_URL);
                        EditorConfig.REMINDER_CHECK = false;

                        Debug.LogWarning("+++ Thank you for rating " + Util.Constants.ASSET_NAME + "! +++");
                    }
                    else if (option == 1)
                    {
                        // do nothing!
                    }
                    else
                    {
                        EditorConfig.REMINDER_CHECK = false;
                    }

                    EditorConfig.Save();
                }
                else
                {
                    if (Util.Config.DEBUG)
                    {
                        Debug.Log("No reminder needed.");
                    }
                }

                EditorPrefs.SetString(EditorConstants.KEY_REMINDER_DATE, date);
                EditorPrefs.SetInt(EditorConstants.KEY_REMINDER_COUNT, count);
            }
        }
コード例 #10
0
        protected override void SaveConfig()
        {
            base.SaveConfig();

            //刷新编辑器配置
            EditorConfig.GetCustomControlPropertyConfig(true);
        }
コード例 #11
0
    public override void OnInspectorGUI()
    {
        LoadPreferences();

        TileDataFoldout();

        base.OnInspectorGUI();

        bool valid = IsValid();

        EditorConfig.SetColor(valid ?
                              EditorConfig.DownloadButtonEnabledColor :
                              EditorConfig.DownloadButtonDisabledColor);

        if (GUILayout.Button("Download"))
        {
            if (valid)
            {
                LogWarnings();

                mapzenMap.DownloadTiles();
            }
            else
            {
                LogErrors();
            }
        }

        EditorConfig.ResetColor();

        SavePreferences();
    }
コード例 #12
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApi api)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Initialize Piranha
            App.Init(api);

            // Configure cache level
            App.CacheLevel = Piranha.Cache.CacheLevel.Basic;

            // Build content types
            new ContentTypeBuilder(api)
            .AddAssembly(typeof(Startup).Assembly)
            .Build()
            .DeleteOrphans();

            // Configure Tiny MCE
            EditorConfig.FromFile("editorconfig.json");

            app.UsePiranha(options => {
                options.UseIdentity();
            });

            // Middleware setup
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
                endpoints.MapRazorPages();
            });
        }
コード例 #13
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApi api)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Initialize Piranha
            App.Init(api);

            // register GIFs as a media type
            App.MediaTypes.Images.Add(".gif", "image/gif");

            // Configure cache level
            App.CacheLevel = Piranha.Cache.CacheLevel.Basic;

            // Build content types
            new ContentTypeBuilder(api)
            .AddAssembly(typeof(Startup).Assembly)
            .Build()
            .DeleteOrphans();

            // Configure Tiny MCE
            EditorConfig.FromFile("editorconfig.json");

            // Middleware setup
            app.UsePiranha(options =>
            {
                options.UseManager();
                options.UseTinyMCE();
                options.UseIdentity();
            });

            app.UseHttpsRedirection();
        }
コード例 #14
0
    void DrawText()
    {
        string luaFile = File.ReadAllText(assetPath);
        string text;

        if (base.targets.Length > 1)
        {
            text = Path.GetFileName(assetPath);
        }
        else
        {
            var MaxTextPreviewLength = EditorConfig.Instance().MConfig.MaxTextPreviewLength;
            text = luaFile;
            if (text.Length > MaxTextPreviewLength + 3)
            {
                text = text.Substring(0, MaxTextPreviewLength) + "...";
            }
        }

        GUIStyle style = "ScriptText";
        Rect     rect  = GUILayoutUtility.GetRect(new GUIContent(text), style);

        rect.x     = 0f;
        rect.y    -= 3f;
        rect.width = EditorGUIUtility.currentViewWidth + 1f;
        GUI.Box(rect, text, style);
    }
コード例 #15
0
        public static Handler GetHandler(string action, HttpContext context)
        {
            switch (action)
            {
            case AppConsts.Action.UploadImage:
                return(new UploadHandler(context, new UploadConfig
                {
                    AllowExtensions = EditorConfig.GetStringList("imageAllowFiles"),
                    UrlPrefix = EditorConfig.GetString("imageUrlPrefix"),
                    PathFormat = EditorConfig.GetString("imagePathFormat"),
                    SizeLimit = EditorConfig.GetInt("imageMaxSize"),
                    UploadFieldName = EditorConfig.GetString("imageFieldName")
                }));

            case AppConsts.Action.UploadScrawl:
                return(new UploadHandler(context, new UploadConfig()
                {
                    AllowExtensions = new string[] { ".png" },
                    UrlPrefix = EditorConfig.GetString("scrawlUrlPrefix"),
                    PathFormat = EditorConfig.GetString("scrawlPathFormat"),
                    SizeLimit = EditorConfig.GetInt("scrawlMaxSize"),
                    UploadFieldName = EditorConfig.GetString("scrawlFieldName"),
                    Base64 = true,
                    Base64Filename = "scrawl.png"
                }));

            case AppConsts.Action.UploadVideo:
                return(new UploadHandler(context, new UploadConfig()
                {
                    AllowExtensions = EditorConfig.GetStringList("videoAllowFiles"),
                    UrlPrefix = EditorConfig.GetString("videoUrlPrefix"),
                    PathFormat = EditorConfig.GetString("videoPathFormat"),
                    SizeLimit = EditorConfig.GetInt("videoMaxSize"),
                    UploadFieldName = EditorConfig.GetString("videoFieldName")
                }));

            case AppConsts.Action.UploadFile:
                return(new UploadHandler(context, new UploadConfig()
                {
                    AllowExtensions = EditorConfig.GetStringList("fileAllowFiles"),
                    UrlPrefix = EditorConfig.GetString("fileUrlPrefix"),
                    PathFormat = EditorConfig.GetString("filePathFormat"),
                    SizeLimit = EditorConfig.GetInt("fileMaxSize"),
                    UploadFieldName = EditorConfig.GetString("fileFieldName")
                }));

            case AppConsts.Action.ListImage:
                return(new ListFileManager(context, EditorConfig.GetString("imageManagerListPath"), EditorConfig.GetStringList("imageManagerAllowFiles")));

            case AppConsts.Action.ListFile:
                return(new ListFileManager(context, EditorConfig.GetString("fileManagerListPath"), EditorConfig.GetStringList("fileManagerAllowFiles")));

            case AppConsts.Action.CatchImage:
                return(new CrawlerHandler(context));

            default:
                return(new NotSupportedHandler(context));
            }
        }
コード例 #16
0
    public override void Sync2ToolsProjectDir()
    {
        string bytesDataPath = EditorConfig.ToolsProjectDirRoot + "/Resources/ConfigData/";
        string genCodePath   = EditorConfig.ToolsProjectDirRoot + "/Scripts/GenerateCodes/";

        EditorConfig.CopyDir(CreatedFilePath, bytesDataPath);
        EditorConfig.CopyDir(CreatedCsFilePath, genCodePath);
    }
コード例 #17
0
        public void OnGUI()
        {
            tab = GUILayout.Toolbar(tab, new[] { "Config", "Prefabs", "TD", "Help", "About" });

            if (tab != lastTab)
            {
                lastTab = tab;
                GUI.FocusControl(null);
            }

            switch (tab)
            {
            case 0:
            {
                showConfiguration();

                EditorHelper.SeparatorUI();

                GUILayout.BeginHorizontal();
                {
                    if (GUILayout.Button(new GUIContent(" Save", EditorHelper.Icon_Save, "Saves the configuration settings for this project.")))
                    {
                        save();
                    }

                    if (GUILayout.Button(new GUIContent(" Reset", EditorHelper.Icon_Reset, "Resets the configuration settings for this project.")))
                    {
                        if (EditorUtility.DisplayDialog("Reset configuration?", "Reset the configuration of " + Util.Constants.ASSET_NAME + "?", "Yes", "No"))
                        {
                            Util.Config.Reset();
                            EditorConfig.Reset();
                            save();
                        }
                    }
                }
                GUILayout.EndHorizontal();

                GUILayout.Space(6);
                break;
            }

            case 1:
                showPrefabs();
                break;

            case 2:
                showTestDrive();
                break;

            case 3:
                showHelp();
                break;

            default:
                showAbout();
                break;
            }
        }
コード例 #18
0
        public void OnGUI()
        {
            tab = GUILayout.Toolbar(tab, new string[] { "Config", "Prefabs", "TD", "Help", "About" });

            if (tab != lastTab)
            {
                lastTab = tab;
                GUI.FocusControl(null);
            }

            if (tab == 0)
            {
                showConfiguration();

                EditorHelper.SeparatorUI();

                GUILayout.BeginHorizontal();
                {
                    if (GUILayout.Button(new GUIContent(" Save", EditorHelper.Icon_Save, "Saves the configuration settings for this project.")))
                    {
                        save();

                        GAApi.Event(typeof(ConfigWindow).Name, "Save configuration");
                    }

                    if (GUILayout.Button(new GUIContent(" Reset", EditorHelper.Icon_Reset, "Resets the configuration settings for this project.")))
                    {
                        if (EditorUtility.DisplayDialog("Reset configuration?", "Reset the configuration of " + Util.Constants.ASSET_NAME + "?", "Yes", "No"))
                        {
                            Util.Config.Reset();
                            EditorConfig.Reset();
                            save();

                            GAApi.Event(typeof(ConfigWindow).Name, "Reset configuration");
                        }
                    }
                }
                GUILayout.EndHorizontal();

                GUILayout.Space(6);
            }
            else if (tab == 1)
            {
                showPrefabs();
            }
            else if (tab == 2)
            {
                showTestDrive();
            }
            else if (tab == 3)
            {
                showHelp();
            }
            else
            {
                showAbout();
            }
        }
コード例 #19
0
        /// <summary>
        /// 根据CodeGenID找到关联信息打开编辑器,如果是内建编辑器会找不到CodeGen信息 这时候再重写一下GetCodeGen函数即可
        /// </summary>
        /// <param name="codeGenID"></param>
        /// <returns></returns>
        public virtual IMultipleWindow OpenOutlinkWindow(int codeGenID)
        {
            //TODO: 这里先暂时这样处理
            var editorName = EditorConfig.GetCodeGenConfig().SearchByOrderKey(codeGenID).EditorName;

            IMultipleWindow e = Data.CurrentAssembly.CreateInstance(editorName) as IMultipleWindow;

            return(e);
        }
コード例 #20
0
        public void CreateActionNode(Vector2 mousePosition, Type type)
        {
            var action     = Activator.CreateInstance(type) as ActionBase;
            var actionNode = new ActionNode(action, mousePosition, EditorConfig.GetDefaultNodeDimensions());

            nodes.Add(actionNode);
            actionNodes.Add(actionNode);
            Signals.Get <AddAction>().Dispatch(mousePosition, action);
        }
コード例 #21
0
    //拷贝manifest文件到指定的目录中
    public static void CopyManifestToDevEnvirment()
    {
        string DestPath = EditorConfig.DevProjectDirRoot + "/StreamingAssets/" + EditorConfig.GetoutputPath(bFolderOnly: true) + "/" + EditorConfig.GetoutputPath(bFolderOnly: true);

        File.Copy(EditorConfig.GetoutputPath() + "/" + EditorConfig.GetoutputPath(bFolderOnly: true), DestPath, true);

        DestPath = EditorConfig.DevProjectDirRoot + "/StreamingAssets/" + EditorConfig.GetoutputPath(bFolderOnly: true) + "/" + EditorConfig.GetoutputPath(bFolderOnly: true) + ".manifest";
        File.Copy(EditorConfig.GetoutputPath() + "/" + EditorConfig.GetoutputPath(bFolderOnly: true) + ".manifest", DestPath, true);
    }
コード例 #22
0
    public void OnInspectorGUI()
    {
        EditorGUILayout.BeginHorizontal();
        {
            filterName = EditorGUILayout.TextField("Filter name: ", filterName);

            EditorConfig.SetColor(EditorConfig.AddButtonColor);
            if (GUILayout.Button(EditorConfig.AddButtonContent, EditorConfig.SmallButtonWidth))
            {
                // Filters within a style are identified by their filter name
                var queryFilterStyleName = style.FilterStyles.Where(filterStyle => filterStyle.Name == filterName);

                if (filterName.Length == 0)
                {
                    Debug.LogError("The filter name can't be empty");
                }
                else if (queryFilterStyleName.Count() > 0)
                {
                    Debug.LogError("Filter with name " + filterName + " already exists");
                }
                else
                {
                    var filterStyle = new FeatureStyle.FilterStyle(filterName);
                    style.AddFilterStyle(filterStyle);
                    filterStyleEditors.Add(new FilterStyleEditor(filterStyle));
                }
            }
            EditorConfig.ResetColor();
        }
        EditorGUILayout.EndHorizontal();

        EditorGUI.indentLevel++;

        for (int i = filterStyleEditors.Count - 1; i >= 0; i--)
        {
            var editor      = filterStyleEditors[i];
            var filterStyle = editor.FilterStyle;

            var state = FoldoutEditor.OnInspectorGUI(editor.GUID.ToString(), filterStyle.Name);

            if (state.show)
            {
                editor.OnInspectorGUI();
            }

            if (state.markedForDeletion)
            {
                style.RemoveFilterStyle(filterStyle);

                // Remove the editor for this filter
                filterStyleEditors.RemoveAt(i);
            }
        }

        EditorGUI.indentLevel--;
    }
コード例 #23
0
 //[MenuItem("武当剑工具/资源打包/拷贝/ Assetbundle 到开发环境(程序编程环境)", false, 3)]
 public static void CopyABResourceToDevEnvirment()
 {
     foreach (string folder in EditorConfig.FolderNames)
     {
         string DestPath = EditorConfig.DevProjectDirRoot + "/StreamingAssets/" + EditorConfig.GetoutputPath(bFolderOnly: true) + "/" + folder + "/";
         string ResPath  = EditorConfig.ABExportPath + EditorConfig.GetoutputPath(bFolderOnly: true) + "/" + folder;
         EditorConfig.CopyDir(ResPath, DestPath);
     }
     CopyManifestToDevEnvirment();
 }
コード例 #24
0
 public Configuration(
     File file,
     IServiceProvider serviceProvider
     )
 {
     Document           = serviceProvider.GetService <DocumentConfig>();
     Document.Info.File = file;
     EditorConfig       = serviceProvider.GetService <EditorConfiguration>();
     EditorConfig.SetConfiguration(this);
 }
コード例 #25
0
ファイル: Configuration.cs プロジェクト: ONLYOFFICE/AppServer
 public Configuration(
     File <T> file,
     IServiceProvider serviceProvider
     )
 {
     Document = serviceProvider.GetService <DocumentConfig <T> >();
     Document.Info.SetFile(file);
     EditorConfig = serviceProvider.GetService <EditorConfiguration <T> >();
     EditorConfig.SetConfiguration(this);
 }
コード例 #26
0
ファイル: ConfigBase.cs プロジェクト: enginerds/EQual
        protected static void save()
        {
            Util.Config.Save();
            EditorConfig.Save();

            if (Util.Config.DEBUG)
            {
                Debug.Log("Config data saved");
            }
        }
コード例 #27
0
        public static EditorConfig Load(string key)
        {
            EditorConfig config = new EditorConfig();

            config.key = key;
            var save = EditorPrefs.GetString(key, "{}");

            EditorJsonUtility.FromJsonOverwrite(save, config);
            return(config);
        }
コード例 #28
0
 /// <summary>
 /// 合成器が使用可能かどうかを元に、メニューのアイコンを更新する
 /// </summary>
 /// <param name="config">エディタの設定情報</param>
 public void updateRendererAvailability( EditorConfig config )
 {
     string wine_prefix = config.WinePrefix;
     string wine_top = config.WineTop;
     Image icon = null;
     if ( !VSTiDllManager.isRendererAvailable( kind_, wine_prefix, wine_top ) ) {
         icon = Properties.Resources.slash;
     }
     if ( track_menu_ != null ) { track_menu_.Image = icon; }
     if ( context_menu_ != null ) { context_menu_.Image = icon; }
 }
コード例 #29
0
        private static void PreferencesGUI()
        {
            if (cp == null)
            {
                cp = CreateInstance(typeof(ConfigPreferences)) as ConfigPreferences;
            }

            tab = GUILayout.Toolbar(tab, new[] { "Configuration", "Help", "About" });

            if (tab != lastTab)
            {
                lastTab = tab;
                GUI.FocusControl(null);
            }

            switch (tab)
            {
            case 0:
            {
                cp.showConfiguration();

                EditorHelper.SeparatorUI();

                if (GUILayout.Button(new GUIContent(" Reset", EditorHelper.Icon_Reset, "Resets the configuration settings for this project.")))
                {
                    if (EditorUtility.DisplayDialog("Reset configuration?", $"Reset the configuration of {Util.Constants.ASSET_NAME}?", "Yes", "No"))
                    {
                        Util.Config.Reset();
                        EditorConfig.Reset();
                        save();
                    }
                }

                GUILayout.Space(6);
                break;
            }

            case 1:
                cp.showHelp();
                break;

            default:
                cp.showAbout();
                break;
            }

            if (GUI.changed)
            {
                save();
            }
        }
コード例 #30
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApi api)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Initialize Piranha
            App.Init(api);

            // Configure cache level
            App.CacheLevel = Piranha.Cache.CacheLevel.Basic;

            // Build content types
            var pageTypeBuilder = new Piranha.AttributeBuilder.PageTypeBuilder(api)
                                  .AddType(typeof(Models.BlogArchive))
                                  .AddType(typeof(Models.StandardPage));

            pageTypeBuilder.Build()
            .DeleteOrphans();
            var postTypeBuilder = new Piranha.AttributeBuilder.PostTypeBuilder(api)
                                  .AddType(typeof(Models.BlogPost));

            postTypeBuilder.Build()
            .DeleteOrphans();
            var siteTypeBuilder = new Piranha.AttributeBuilder.SiteTypeBuilder(api)
                                  .AddType(typeof(Models.BlogSite));

            siteTypeBuilder.Build()
            .DeleteOrphans();

            // Configure Tiny MCE
            EditorConfig.FromFile("editorconfig.json");

            // Register middleware
            app.UseStaticFiles();
            app.UseAuthentication();
            app.UsePiranha();
            app.UsePiranhaManager();
            app.UseMvc(routes =>
            {
                routes.MapRoute(name: "areaRoute",
                                template: "{area:exists}/{controller}/{action}/{id?}",
                                defaults: new { controller = "Home", action = "Index" });

                routes.MapRoute(
                    name: "default",
                    template: "{controller=home}/{action=index}/{id?}");
            });
        }
コード例 #31
0
        private static void PreferencesGUI()
        {
            if (cp == null)
            {
                cp = ScriptableObject.CreateInstance(typeof(ConfigPreferences)) as ConfigPreferences;
            }

            tab = GUILayout.Toolbar(tab, new string[] { "Configuration", "Help", "About" });

            if (tab != lastTab)
            {
                lastTab = tab;
                GUI.FocusControl(null);
            }

            if (tab == 0)
            {
                cp.showConfiguration();

                EditorHelper.SeparatorUI();

                if (GUILayout.Button(new GUIContent(" Reset", EditorHelper.Icon_Reset, "Resets the configuration settings for this project.")))
                {
                    if (EditorUtility.DisplayDialog("Reset configuration?", "Reset the configuration of " + Util.Constants.ASSET_NAME + "?", "Yes", "No"))
                    {
                        Util.Config.Reset();
                        EditorConfig.Reset();
                        save();

                        GAApi.Event(typeof(ConfigPreferences).Name, "Reset configuration");
                    }
                }

                GUILayout.Space(6);
            }
            else if (tab == 1)
            {
                cp.showHelp();
            }
            else
            {
                cp.showAbout();
            }

            if (GUI.changed)
            {
                save();
            }
        }
コード例 #32
0
        public void initConfig()
        {
            keyForward = KeyCode.W;
            keyBack = KeyCode.S;
            keyRight = KeyCode.D;
            keyLeft = KeyCode.A;
            keyUp = KeyCode.E;
            keyDown = KeyCode.Q;
            keyRun = KeyCode.Space;
            keySneak = KeyCode.LeftControl;
            keySwitchMode = KeyCode.Alpha5;

            enableExperimentalEditorExtensionsCompatibility = true;
            defaultCamera = true;
            enforceBounds = true;
            mouseWheelActive = true;

            sensitivity = 14;
            acceleration = 150;
            friction = 10;
            runMultiplier = 2;
            sneakMultiplier = 0.3f;
            mouseWheelAcceleration = 1.75f;

            //vab = cfg.vab;
            vab = new EditorConfig();
            sph = new EditorConfig();

            vab.initialPosition = new Vector3(-6.1f,17.7f, -1.9f);
            vab.initialPitch = 16.386f;
            vab.initialYaw = 72.536f;
            Vector3 min = new Vector3(-28.8f, 0.8f, -22.5f);
            Vector3 max = new Vector3(29.7f, 70f, 22.7f);
            var result = new Bounds();
            result.SetMinMax(min, max);
            vab.bounds = result;

            // sph = cfg.sph;
            sph.initialPosition = new Vector3(-8.6f, 14.4f,  2.7f);
            sph.initialPitch = 14.080f;
            sph.initialYaw = 120.824f;

            min = new Vector3(-43.2f, 1.4f, -56f);
            max = new Vector3(43.0f, 30.3f, 56.0f);
            result = new Bounds();
            result.SetMinMax(min, max);
            sph.bounds = result;
        }
コード例 #33
0
ファイル: Form1.cs プロジェクト: kistvan/geditor
        private void openFileMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();
            String current = Directory.GetCurrentDirectory();
            dialog.InitialDirectory = current + @"\projects\" + projectName + @"\data";

            if(dialog.ShowDialog() == DialogResult.OK) {
                floorMap.dispose();
                floorMap = new FloorMap(device);

                EditorConfig editorConfig = new EditorConfig();
                Boolean result = editorConfig.fromFile(dialog.FileName);
                if(!result) {
                    MessageBox.Show("ファイルの読み込みが正常に終了しませんでした。");
                }

                drawFloorModel = editorConfig.drawFloorModel;
                showAlwaysFloorMap = editorConfig.showAlwaysFloorMap;

                floorMap.setX(editorConfig.mapXsize);
                floorMap.setY(editorConfig.mapYsize);
                mapSizeX.Value = editorConfig.mapXsize;
                mapSizeY.Value = editorConfig.mapYsize;

                //コントロールの読み込み
                showFloorModelcheckBox.Checked = drawFloorModel;
                showAlwaysFloorModelcheckBox.Checked = showAlwaysFloorMap;
                mapSizeX.Enabled = !editorConfig.lockMapSize;
                mapSizeY.Enabled = !editorConfig.lockMapSize;
                encountRatioUpDown.Value = editorConfig.encounterRatio;

                //enableの構築
                for (int i = 0; i < editorConfig.mapXsize - 1; i++)
                {
                    List<Boolean> bl = editorConfig.edgeXListEnable.ElementAt(i);
                    List<MapEdge> el = floorMap.MapPosition.EdgeXList.ElementAt(i);
                    for (int j = 0; j < editorConfig.mapYsize; j++)
                    {
                        Boolean b = bl.ElementAt(j);
                        el.ElementAt(j).Enabled = b;
                    }
                }
                for (int i = 0; i < editorConfig.mapXsize; i++ )
                {
                    List<Boolean> bl = editorConfig.edgeYListEnable.ElementAt(i);
                    List<MapEdge> el = floorMap.MapPosition.EdgeYList.ElementAt(i);
                    for (int j = 0; j < editorConfig.mapYsize - 1; j++)
                    {
                        Boolean b = bl.ElementAt(j);
                        el.ElementAt(j).Enabled = b;
                    }

                }
            }
        }
コード例 #34
0
ファイル: Form1.cs プロジェクト: kistvan/geditor
        private void saveWithNameMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog dialog = new SaveFileDialog();
            String current = Directory.GetCurrentDirectory();
            dialog.InitialDirectory = current + @"\projects\" + projectName + @"\data";
            dialog.FileName = "samplefloor.bin";

            if(dialog.ShowDialog() == DialogResult.OK) {
                //editorの設定
                EditorConfig editorConfig = new EditorConfig();
                editorConfig.drawFloorModel = drawFloorModel;
                editorConfig.showAlwaysFloorMap = showAlwaysFloorMap;
                editorConfig.lockMapSize = !mapSizeX.Enabled;
                editorConfig.mapXsize = floorMap.getXsize();
                editorConfig.mapYsize = floorMap.getYsize();

                List<List<Boolean>> xb = new List<List<bool>>();
                foreach(List<MapEdge> ll in floorMap.MapPosition.EdgeXList) {
                    List<Boolean> l = new List<Boolean>();
                    foreach(MapEdge me in ll) {
                        l.Add(me.Enabled);
                    }
                    xb.Add(l);
                }
                editorConfig.edgeXListEnable = xb;

                List<List<Boolean>> yb = new List<List<bool>>();
                foreach(List<MapEdge> ll in floorMap.MapPosition.EdgeYList) {
                    List<Boolean> l = new List<bool>();
                    foreach(MapEdge me in ll) {
                        l.Add(me.Enabled);
                    }
                    yb.Add(l);
                }
                editorConfig.edgeYListEnable = yb;

                editorConfig.encounterRatio = (int)encountRatioUpDown.Value;

                editorConfig.toFile(dialog.FileName);
            }
        }
コード例 #35
0
        public void setConfig(Config cfg)
        {
            keyForward = cfg.keyForward;
            keyBack = cfg.keyBack;
            keyRight = cfg.keyRight;
            keyLeft = cfg.keyLeft;
            keyUp = cfg.keyUp;
            keyDown = cfg.keyDown;
            keyRun = cfg.keyRun;
            keySneak = cfg.keySneak;
            keySwitchMode = cfg.keySwitchMode;

            enableExperimentalEditorExtensionsCompatibility = cfg.enableExperimentalEditorExtensionsCompatibility;
            defaultCamera = cfg.defaultCamera;
            enforceBounds = cfg.enforceBounds;
            mouseWheelActive = cfg.mouseWheelActive;

            sensitivity = cfg.sensitivity;
            acceleration = cfg.acceleration;
            friction = cfg.friction;
            runMultiplier = cfg.runMultiplier;
            sneakMultiplier = cfg.sneakMultiplier;
            mouseWheelAcceleration = cfg.mouseWheelAcceleration;

            vab = cfg.vab;
            sph = cfg.sph;
        }
コード例 #36
0
        public void parseConfigNode(ConfigNode root)
        {
            //Config config = new Config ();
            Log.Info("parseConfigNode");
            try {
                enableExperimentalEditorExtensionsCompatibility = Boolean.Parse (root.GetValue ("enableExperimentalEditorExtensionsCompatibility"));
            } catch {
            }
            try {
                defaultCamera = Boolean.Parse (root.GetValue ("defaultCamera"));
            } catch {
            }
            try {
                mouseWheelActive = Boolean.Parse (root.GetValue ("mouseWheelActive"));
            } catch {
            }
            try {
                enforceBounds = Boolean.Parse (root.GetValue ("enforceBounds"));
                Log.Info("enforceBounds: " + enforceBounds.ToString());
            } catch {
            }

            try {
                sensitivity = Single.Parse (root.GetValue ("sensitivity"));
            } catch {
            }
            try {
                acceleration = Single.Parse (root.GetValue ("acceleration"));
            } catch {
            }
            try {
                mouseWheelAcceleration = Single.Parse (root.GetValue ("mouseWheelAcceleration"));
            } catch {
            }
            try {
                friction = Single.Parse (root.GetValue ("friction"));
            } catch {
            }
            try {
                runMultiplier = Single.Parse (root.GetValue ("runMultiplier"));
            } catch {
            }
            try {
                sneakMultiplier = Single.Parse (root.GetValue ("sneakMultiplier"));
            } catch {
            }

            var keys = root.GetNode ("KEYS");
            try {
                keyForward = (KeyCode)ConfigNode.ParseEnum (typeof(KeyCode), keys.GetValue ("forward"));
            } catch {
            }
            try {
                keyBack = (KeyCode)ConfigNode.ParseEnum (typeof(KeyCode), keys.GetValue ("back"));
            } catch {
            }
            try {
                keyRight = (KeyCode)ConfigNode.ParseEnum (typeof(KeyCode), keys.GetValue ("right"));
            } catch {
            }
            try {
                keyLeft = (KeyCode)ConfigNode.ParseEnum (typeof(KeyCode), keys.GetValue ("left"));
            } catch {
            }
            try {
                keyUp = (KeyCode)ConfigNode.ParseEnum (typeof(KeyCode), keys.GetValue ("up"));
            } catch {
            }
            try {
                keyDown = (KeyCode)ConfigNode.ParseEnum (typeof(KeyCode), keys.GetValue ("down"));
            } catch {
            }
            try {
                keyRun = (KeyCode)ConfigNode.ParseEnum (typeof(KeyCode), keys.GetValue ("run"));
            } catch {
            }
            try {
                keySneak = (KeyCode)ConfigNode.ParseEnum (typeof(KeyCode), keys.GetValue ("sneak"));
            } catch {
            }
            try {
                keySwitchMode = (KeyCode)ConfigNode.ParseEnum (typeof(KeyCode), keys.GetValue ("switchMode"));
            } catch {
            }

            var editors = root.GetNode ("EDITORS");
            try {
                vab = ParseEditorConfig (editors.GetNode ("VAB"));
            } catch {
            }
            try {
                sph = ParseEditorConfig (editors.GetNode ("SPH"));
            } catch {
            }

            //return config;
        }
コード例 #37
0
        private TabPage AddPage(EditorConfig config)
        {
            SettingsPanel settings = new SettingsPanel();
            if (config.Extension == null)
            {
                config.Extension = String.Empty;
            }
            settings.All = config;

            // copied from SettingsDialog.Designer.cs
            settings.AutoSize = true;
            settings.Dock = System.Windows.Forms.DockStyle.Fill;
            settings.Location = new System.Drawing.Point(3, 3);
            settings.MinimumSize = new System.Drawing.Size(248, 114);
            settings.Padding = new System.Windows.Forms.Padding(0, 7, 0, 7);
            settings.Size = new System.Drawing.Size(440, 172);

            TabPage tabPage = new TabPage();
            tabPage.Text = settings.Extension;

            // copied from SettingsDialog.Designer.cs
            tabPage.Location = new System.Drawing.Point(4, 22);
            tabPage.Padding = new System.Windows.Forms.Padding(3);
            tabPage.Size = new System.Drawing.Size(446, 178);
            tabPage.UseVisualStyleBackColor = true;

            tabPage.Controls.Add(settings);
            tabControlSettings.Controls.Add(tabPage);

            settings.OnDelete += new EventHandler(settings_OnDelete);
            settings.OnExtensionChanged += new EventHandler(settings_OnExtensionChanged);

            return tabPage;
        }