kwikEditor Plugin

%AppData%\Roaming\Corona Labs\Corona Simulator\Skins
%AppData%\Roaming\Corona Labs\Corona Simulator\Plugins\plugin
  • symbolic link to cdkwik5-plugin

    win runAsAdminstrator

    mklink /D "C:\Users\ymmtny\Documents\GitHub\kwik5-sample-books\Solar2D\plugin" "C:\Users\ymmtny\Documents\GitHub\kwik5-plugin"

    or

    runas /user:Administrator "cmd /c mklink /D C:\Users\ymmtny\Documents\GitHub\kwik5-sample-books\Solar2D\plugin C:\Users\ymmtny\Documents\GitHub\kwik5-plugin"
  • win bat

    • backup_lua.bat.tmplt
    • copy_lua.bat.tmplt
    • copy_page.bat.tmplt
    • create_book.bat.tmplt
    • create_book_bg.bat.tmplt
    • create_book_page.bat
    • create_page.bat.tmplt
    • delete_lua.bat.tmplt
    • delete_pages.bat.tmplt
    • rename_audio.bat.tmplt
    • rename_book.bat.tmplt
    • rename_group.bat.tmplt
    • rename_joint.bat.tmplt
    • rename_layer.bat.tmplt
    • rename_page.bat.tmplt
    • rename_timer.bat.tmplt
    • rename_variable.bat.tmplt
    • undo_lua.bat.tmplt
  • https://github.com/solar2d/plugin-template

  • plugin/kwikEditor

    _kwikPath = "plugin/kwikEditor/"
    kwikPath = system.pathForFile(kwikPath, system.ResourceDirectory)
    --
    -- kwikPath: /Users/ymmtny/Documents/GitHub/kwik-visual-code/develop/Solar2D/kwik-editor_plugin/.
    --
    kwikRoot = "plugin.kwikEditor."

    pacage.path

    these folders in plugin/kwikEditor are required from App/**/*.lua

    local folders = {
      ".",
      "commands",
      "commands/app",
      "commands/common",
      "commands/kwik",
      "components",
      "components/bookstore",
      "components/bookstore/controller",
      "components/bookstore/model",
      "components/bookstore/smc",
      "components/bookstore/view",
      "components/common",
      "components/custom",
      "components/kwik",
      "components/mui",
      "controller",
      "extlib",
      "extlib/com",
      "extlib/com/gieson",
      "extlib/lustache",
      "extlib/materialui",
      "extlib/materialui/material-design-icons",
      "extlib/nanostores",
      "extlib/nanostores/lib",
      "extlib/nanostores/scripts",
      "extlib/plugin",
      "extlib/plugin/mouseHover",
      "extlib/pretty",
      "extlib/pretty/json",
      "extlib/robotlegs",
      "extlib/spyric",
      "extlib/transition2lib",
      "installer",
      "installer/lustache",
      "installer/Skins",
      "lib",
    }

    require for extlib

    lib.original_require = require
    
    require = function(...)
      local modName = ...
      -- modName = modName:gsub("com.gieson", "extlib.com.gieson")
      -- modName = modName:gsub("Tools", "extlib.com.gieson.Tools")
      -- modName = modName:gsub("TouchHandlerObj", "extlib.com.gieson.TouchHandlerObj")
      modName = modName:gsub("checks", kwikRoot.."extlib.checks")
      modName = modName:gsub("metalua.", kwikRoot.."extlib.metalua.")
      modName = modName:gsub("materialui", kwikRoot.."extlib.materialui")
      modName = modName:gsub("nanostores.index", "nanostores.nanostores")
      modName = modName:gsub("lib.clean%-stores", kwikRoot.."extlib.nanostores.lib.clean-stores")
      modName = modName:gsub("lib.create%-derived", kwikRoot.."extlib.nanostores.lib.create-derived")
      modName = modName:gsub("lib.create%-map", kwikRoot.."extlib.nanostores.lib.create-map")
      modName = modName:gsub("lib.create%-store", kwikRoot.."extlib.nanostores.lib.create-store")
      modName = modName:gsub("lib.define%-map", kwikRoot.."extlib.nanostores.lib.define-map")
      modName = modName:gsub("lib.effect", kwikRoot.."extlib.nanostores.lib.effect")
      modName = modName:gsub("lib.get%-value", kwikRoot.."extlib.nanostores.lib.get-value")
      modName = modName:gsub("lib.keep%-active", kwikRoot.."extlib.nanostores.lib.keep-active")
      modName = modName:gsub("lib.lualib_bundle", kwikRoot.."extlib.nanostores.lib.lualib_bundle")
      modName = modName:gsub("lib.update", kwikRoot.."extlib.nanostores.lib.update")
      return lib.original_require(modName)
    end
  • contorller.Application.newModule

    for example, editor/layerTable.lua

    local name = ...
    local parent,  root = newModule(name)
    --
    -- parent: plugin.kwikEditor.editor.parts.	root: plugin.kwikEditor.editor.
    --
    local Props = {
      name = "layerTable",
      anchorName = "selectLayer",
      id = "layer"
    }
    
    local M = require(parent .."baseTable").new(Props)
    local commands = require(parent.."layerTableCommands")

build.sh is modified

  • skip template folder
  • tar -czvf plugin.data.tgz -C ./build/plugins/2017.3032/lua/lua_51/plugin .

install

tar -xzf plugin.data.tgz -C ~/Library/Application\ Support/Corona/Simulator/Plugins/plugin

for downloading from simulator?

  • tar -czvf data.tgz -C ./build/plugins/2017.3032/lua .

makeself not work well

makeself plugin_bundle/ kwikEditor_plugin_installer.sh "Solar2D Plugin Installer" ./installer.sh