public override void _EnterTree()
    {
        // Settings
        foreach (String key in settings.Keys)
        {
            String property_name = $"ink/{key}";
            if (!ProjectSettings.HasSetting(property_name))
            {
                ProjectSettings.SetSetting(property_name, settings[key]);
                ProjectSettings.SetInitialValue(property_name, settings[key]);
            }
        }
        ProjectSettings.Save();

        // Resources
        importPlugin = (ResourceLoader.Load(importPluginScriptPath) as GDScript).New() as EditorImportPlugin;
        AddImportPlugin(importPlugin);

        // Custom types
        AddCustomType("Ink Story", "Node", ResourceLoader.Load(customTypeScriptPath) as Script, ResourceLoader.Load(customTypeIconPath) as Texture);

        // Editor
        dock = (ResourceLoader.Load(dockScene) as PackedScene).Instance() as Control;
        AddControlToBottomPanel(dock, "Ink");
    }
Exemplo n.º 2
0
    public override void _EnterTree()
    {
        // Settings
        foreach (String key in settings.Keys)
        {
            String property_name = $"ink/{key}";
            if (!ProjectSettings.HasSetting(property_name))
            {
                Dictionary setting = settings[key] as Dictionary;
                ProjectSettings.SetSetting(property_name, setting["default"]);
                ProjectSettings.AddPropertyInfo(new Dictionary()
                {
                    { "name", property_name },
                    { "type", setting["type"] },
                    { "hint", setting["hint"] },
                    { "hint_string", setting["hint_string"] },
                });
            }
        }
        ProjectSettings.Save();

        // Resources
        importPlugin = GD.Load <GDScript>(importPluginScriptPath).New() as EditorImportPlugin;
        AddImportPlugin(importPlugin);

        // Custom types
        AddCustomType("Ink Story", "Node", GD.Load <Script>(customTypeScriptPath), GD.Load <Texture>(customTypeIconPath));

        // Editor
        dock = GD.Load <PackedScene>(dockScene).Instance() as Control;
        AddControlToBottomPanel(dock, "Ink");
    }
Exemplo n.º 3
0
    public override void _EnterTree()
    {
        base._EnterTree();

        _importPlugin = GD.Load <EditorImportPlugin>("CustomResourcePlugin.cs");
        AddImportPlugin(_importPlugin);
    }