Coder Social home page Coder Social logo

chiefofgxbxl / ice-sickle Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 0.0 1.72 MB

ARCHIVED: This project is archived because updates are now being made to the original World Editor (reforged), and because HiveWE is making amazing progress.

License: MIT License

HTML 49.47% JavaScript 49.99% CSS 0.54%
editor electron warcraft warcraft3 wc3

ice-sickle's People

Contributors

chiefofgxbxl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ice-sickle's Issues

Create Utility class

Utility class will have helpful functions like converting a hex code #003399 to an RGB triplet [255,255,255] or vice versa. It would simply contain miscellaneous functions that can be used in windows and plugins.

Use app.getPath() for application settings directory

We are currently using app.getAppPath() as the location for storing plugins, scripting languages, etc. The problem is that while it works in dev, in production the app path includes the /resources/app.asar in the path. Rather than trimming that out only in production, use app.getPath('userData') as the directory to store settings, scripting, and plugins. This will be consistent across dev/prod environments.

See: https://github.com/electron/electron/blob/v1.1.0/docs/api/app.md#appgetpathname

war3map.j JASS generation

We established that the triggers the user writes in the Trigger Editor will simply be concatenated together and placed in the war3map.j file. However, there are other sections that need to be generated, like:

function config takes nothing returns nothing
    call SetMapName( "TRIGSTR_001" )
    call SetMapDescription( "TRIGSTR_003" )
    call SetPlayers( 1 )
    call SetTeams( 1 )
    call SetGamePlacement( MAP_PLACEMENT_USE_MAP_SETTINGS )

    call DefineStartLocation( 0, 2368.0, 256.0 )

    // Player setup
    call InitCustomPlayerSlots(  )
    call SetPlayerSlotAvailable( Player(0), MAP_CONTROL_USER )
    call InitGenericPlayerSlots(  )
endfunction

Some of these sections are obviously very straightforward, but I want to make sure we don't miss anything. Can you comment on any JASS oddities or things we need to be careful about?

An example of a confusing setup: call SetDayNightModels( "Environment\\DNC\\DNCFelwood\\DNCFelwoodTerrain\\DNCFelwoodTerrain.mdl", "Environment\\DNC\\DNCFelwood\\DNCFelwoodUnit\\DNCFelwoodUnit.mdl" ). I believe this is because I set a custom light environment in the map properties.

TreeView component

Create a simple TreeView component that shows a hierarchical display of items, like in Atom. This will be used for the object editor to categorize object entities into folders, and for the trigger editor to organize triggers.

Basic features:

  • Add items
  • Click to select an item; retrieve selected item; onSelected
  • Remove items (capture delete key)
  • Context-menu on right-click
  • Collapse folders
  • Drag and drop to reorganize an item/folder

There is a tutorial which implements a css-only one, but this requires <input> elements. A simple JavaScript implementation using nested <ol>'s would be fine.

Imported file manager

Create the next window: imported files. Users should be able to drag-and drop files onto the window to import, or use a file-viewer to select files.

A simple window would simply display the name and the path. Imports may also be categorized by type or organized as the user wishes.

Files imported to the project are stored under the /imports directory.

User input windows

The following user input windows are unimplemented (so they default to text):

  • abilityList
  • abilCode
  • heroAbilityList
  • stringList
  • icon
  • int
  • modelList
  • unreal
  • bool
  • real
  • shadowTexture
  • model
  • versionFlags
  • teamColor
  • uberSplat
  • shadowImage
  • defenseType
  • deathType
  • targetList
  • armorType
  • attackType
  • attackBits
  • weaponType
  • combatSound
  • tilesetList
  • moveType
  • pathingListPrevent
  • pathingListRequire
  • aiBuffer
  • pathingTexture
  • soundLabel
  • unitSound
  • attributeType
  • regenType
  • unitClass
  • unitRace
  • unitList
  • itemList
  • techList
  • intList
  • upgradeList
  • string
  • char

This list may not be complete. More windows may exist in the other object editor types that have not been implemented yet. So far I only checked the Unit fields.

Many of these are simply drop-down menus, so they can simply open a dropdown-single-select menu and specify the Enumeration of keys/values.

Object Editor Abilities - DataX# fields

Abilities is going to be the most difficult object editor type to implement because of confusing data fields:

  1. Data fields

By (1), I mean that it is unclear how Blizzard stores ability data. For example, take a look at the AbilityData.csv file found in WEdata/Units in this repo. On row 53 there is the Storm Bolt ability. The level 1 damage is stored in the DataA1 column (100).

But the ability Bash's DataA1 column actually stores the Chance to bash value. So it's not easy to say an ability's damage is stored in the A column. Is there anywhere in the war3.mpq where a file acts as a lookup table between ability fields and the column the data is stored in?

Map Properties field population

There are four tabs in the Map Properties window:

  • General
  • Options
  • Size & Camera Bounds
  • Loading Screen

The last 3 tabs' forms are not pre-populated when the window is opened, even though the data is there. Use the context to set the fields.

Fix ListView text overflow

If text is too large to fit in the ListView, it breaks the entire script. Instead, the text should be truncated and an ellipses (...) should be appended.

Pass Plugin class to all loaded plugins

When each plugin is loaded, they need to be given the Plugin class to use for all their functionality. The problem is that plugins loaded in the deployed application (not via npm start) try to require('...Plugin') and fail because that is part of the application's node_modules.

Plugins will have to be re-structured again to be in the following form:

var myPlugin = function(Plugin) {
  // can do stuff with Plugin

  return {
    init: function() {},
    onMenuClick: function() {},
    ...
  }
}

module.exports = myPlugin;

Prompt events

Implement a number of prompt requests to ask the user for input.

e.g. promptInput, promptOpenProject, promptYesNo, etc.

Fix dev/prod build discrepancies

The production version complains frequently about missing files, such as when the app is supposed to require() core application files. Evidently, these are not being included in the application build.

Previous ideas to resolve this included copying all that data to the user's machine (messy and non-standard), or using the extraFiles build option to include them in the app directory.

Ice Sickle - Settings

Add menu item to File menu bar to open a new Settings window. The user will be able to view and alter various settings for the editor. To get started, a few things can already be chosen:

  • # of most recent projects to list (0-10)
  • map author name to automatically set when creating a new project
  • maximize root window (if maximized, call root.maximize)

Help - Knowledge Base

Use Gitbook to develop a knowledge base of questions for Ice Sickle, plus misc. WC3 information like quirks and tips. The gitbook can then be opened in a Help window (via Ctrl-H, too!), since browserWindows can also open remote URLs. It may help, if the page time is too long, to load it and keep it hidden.

Fold enums into Plugin

The plugin class should contain an object called Enum which contains all the enumerations under the enum folder. This way, plugins can easily use these values.

Welcome screen re-design

The welcome screen could use a visual touch-up to better display recent maps, and make way for other content in the future.

Ensure user directories exist

The new Documents system needs to contain the folder icesickle, and sub-directories plugins and scripting/languages

Create Wiki page for image resources

To improve the Wiki, we'll be using more and more icons and images uploaded to GitHub content URL (drag-and-dropping into a textbox). There should be a master list to easily reference these image paths.

Place in sidebar or footer?

Auto-update

Implement Electron's autoUpdate. A Squirrel deployment system will need to be established to create releases. The application will automatically check for updates when it is launched, and close if it needs to apply updates. The user may also click a Check for Updates menu item in the Help menu.

It will be a while before this feature is implemented. The code base will need to become more stable, and release cycle and procedure established.

Object Entity Resolver class

Create a new class to resolve object entities, given a type and id. The resolver's job is to give back an object with the requested entity ID, but with unmodified/default fields filled in from the base object. This functionality is already implemented in the Object Editor, but would be good to put in its own class as other windows may need it.

Scenario Properties remains unimplemented

The parallel window to Map Properties is the Scenario Properties, which has the following forms:

  • Players
  • Ally Priorities
  • Forces
  • Techtree
  • Abilities
  • Upgrades

The priority for this form is the Players and Forces forms, as they are the two necessary ones to make a map functional. Implement this functionality along with form pre-populating.

Combine views and windows folders

The structure of the repo folder can be cleaned up by storing the window manifests (/windows) alongside the actual HTML views (/views). It may make more sense to place everything under a windows folder, where each view gets a sub-folder:

/ windows
  / object-editor
    object-editor.html
    manifest.json
  / trigger-editor
   ...

Generate hard-coded war3map.j file

For scripting compilation, simply copy over a hard-coded version from an empty map so we can get the merging set up and the map working.

Plugin logging via event

Create a new log event, which stores an array of log messages for the app or plugins to use

Types

  • info
  • warn
  • error

e.g. Plugin.event.send('log', { type: 'info', message: 'the plugin loaded successfully!' } )

Help - What would you like to do?

Implement a task window (e.g. Ctrl-G) which consists of a textbox where the user can enter virtually any possible action to perform. They can search for actions, object entities, world entities, etc. This would be similar to the new "Tell me what you'd like to do" bar in the latest Microsoft Office Suite (see Excel or Word for an example).

Plugin system

Plugins should be able to:

  • Be defined similarly to Node.js apps (package.json)
  • Be loaded automatically from the /plugins folder on app startup
  • Send and receive events
  • Register new windows
  • Store plugin settings
  • Add plugin sub-menu to main menu bar

Plugin log helper

After #40, add a .log section under the Plugin class as a shortcut / alias

e.g.

Plugin.log('info', 'the plugin successfully loaded!')

instead of having to send:

Plugin.event.send('log', {
  type: 'info',
  the plugin successfully loaded!
});

Both would be valid ways of logging. The first one is simply quicker.

See #40

Exit application when root window is closed

An event needs to be added to the root window so that when it closes, the entire application shuts down. It does not make sense that, for instance, the Object Editor can stay open without having root open, but that is how it currently works.

Auto update improvements

  • Don't show "checking for updates" window - we'll assume this always happens (silently)
  • Store when updates were last checked for in Settings
  • Display updates last-checked in About window
  • If an error occurs in downloading the update, notify user

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.