ElectronMV

Discussion in 'Useful Development Tools' started by Quxios, Dec 2, 2016.

  1. Arise

    Arise Veteran Veteran

    Messages:
    130
    Likes Received:
    18
    Hi Quxios!

    I've been playing a little today with the Electron wrapper and I've got mixed feelings. It looks nice, but it makes us insecure enough to jump the boat, because some of the plugins we use in development depends on nwjs and those fails to load under electron.

    However I think the main project could be vastly simplified by using a single index.html file maybe for both wrappers (nwjs and electron).

    After some searching I've found that there is a free version available for testing of the Sakan Tileset Builder in japanese language I think. After installing it, it went under C:\Program Files (x86)\KADOKAWA\TilesetBuilder

    I played a little with this and I've isolated the main files of the tool, and I've replaced them (Icon, hint/description and executable).
    The executable (TilesetBuilder.exe) was replaced with a stub that prints the parameter received from the RPG Maker and is the full path to the .rpgproject file.
    The executable must not be renamed, i think is hardcoded to use TilesetBuilder.exe

    You can add multiple tools if you want.

    Test Tool can be downloaded here:
    Electron.zip
    Contains:
    TilesetBuilder.exe (dummy replacer)
    Identification\toolbar\icon.png (for the electron icon)
    Identification\app (file with the tooltip hint)

    So the whole idea would be to keep the original button Playtest for nwjs while the Electron button for ... Electron. :)
    That to prevent messing with index.html...

    Screenshot below.
    [​IMG]



    Later edit:
    I've built another TilesetBuilder replacer, this one will actually execute the nwjsToEMV.bat file found in the previous folder where Game.rpgproject is located. Not much checking and exception handling, haven't touch C language in ages so sorry if this will not work properly.

    Electron.zip (includes sourcecode)

    Multiple YEP plugins seems to include this piece of code:
    Code:
    Yanfly.Util.displayError = function(e, code, message) {
      console.log(message);
      console.log(code || 'NON-EXISTENT');
      console.error(e);
      if (Utils.isNwjs() && Utils.isOptionValid('test')) {
        if (!require('nw.gui').Window.get().isDevToolsOpen()) {
          require('nw.gui').Window.get().showDevTools();
        }
      }
    };
    
    I would say this function should be a candidate for QYanfly-patches.js, for now I've removed the if block.
    What would be the equivalent of the if block in Electron? Need some help here to see what plugins could be patched to support crossover between nwjs and electron.
     
    Last edited: Jan 22, 2018
    #21

Share This Page