Skip to content

Commit

Permalink
Merge pull request #14 from ufdada/minor
Browse files Browse the repository at this point in the history
Merge version 1.3 into master
  • Loading branch information
ufdada committed Mar 25, 2015
2 parents 1f87af9 + bcbc789 commit 09c254f
Show file tree
Hide file tree
Showing 45 changed files with 2,452 additions and 4,638 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
tests/images/**/*.png
37 changes: 37 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"asi": false,
"browser": true,
"curly": true,
"debug": false,
"devel": true,
"eqeqeq": false,
"es3": true,
"evil": true,
"expr": true,
"proto": true,
"regexdash": true,
"strict": false,
"scripturl": true,
"sub": true,
"trailing": true,
"undef": true,
"loopfunc": true,
"-W065": true,
"-W020": true,

"predef" : [
"exports",
"phantom",
"require",
"window",
"module",
"terrain",
"JSON",
"tiles",
"dataStorage",
"initOptions",
"Map",
"__dirname",
"store"
]
}
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: node_js
node_js:
- 0.12
before_script:
- npm install -g grunt-cli
cache:
directories:
- node_modules
notifications:
email:
on_success: change
on_failure: change
46 changes: 46 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module.exports = function (grunt) {
"use strict";

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: [
"js/**/*.js",
"tests/**/*.js",
"*.json"
],
options: {
jshintrc: '.jshintrc'
}
},
lint5: {
dirPath: "",
templates: [
"index.html",
"./tests/convert.html"
],
ignoreList: [
'\.wfto',
'\.csv'
]
},
dalek: {
dist: {
src: [
'./tests/suite/defaultMap.js' /*,
'./tests/suite/options.js',
'./tests/suite/tickets.js'*/
]
}
}
});

grunt.loadNpmTasks('grunt-lint5');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-dalek');

grunt.registerTask('test', ['validate', 'dalek']);
grunt.registerTask('validate', ['jshint', 'lint5']);

grunt.registerTask('default', ['test']);
};
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
# wfto-mapeditor
This map editor should make it fairly easy to create and share maps for "War for the Overworld"
[![Build Status](https://travis-ci.org/ufdada/wfto-mapeditor.svg)](https://travis-ci.org/ufdada/wfto-mapeditor)

### Release 1.3
#### New Features:
- Name input field for files (with versioning)
- Rotate Mirror 1 Feature
- Resizing of current Map

#### Improvements:
- Get rid of the position in the mapfile on bigger rooms and calculate it instead (saves filesize)
- Map gets cleaned from uncompleted rooms

### Release 1.2
#### New Features:
- Drag and drop import of mapfiles
- Google CSV import

### Bugfixes:
#### Bugfixes:
- Overall visual improvement of tiles
- Add missing tiles
- Replace siegeshrine asset with correct siegeshrine and add defence parts shrine
Expand All @@ -30,14 +41,10 @@ This map editor should make it fairly easy to create and share maps for "War for
- Creating a Path by holding the left mousebutton and moving the mouse (Only works for 1x1 tiles)

### Upcoming Features/Bugfixes:
- [ ] Resizing of current Map
- [ ] Rotate Mirror 1 Feature
- [ ] Undo/Redo
- [ ] Get rid of the position in the mapfile on bigger rooms and calculate it instead
- [ ] Name input field for files (with versioning)

### Known Issues:
- Bigger rooms are not shown if the cursor is too close the border (as they are not placeable anyway)

Special Thanks to:
- Marrados: for helping with the assets
- Marados: for helping with the assets
39 changes: 39 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ html, body {
font-size: 12px;
}

a {
text-decoration: none;
}

p{
margin: 0;
}
Expand Down Expand Up @@ -99,10 +103,13 @@ td:hover {
}

#mirrorMap {
border-spacing: 1;
border-collapse: separate;
display: inline-block;
}

#mirrorMap td {
width: 15px;
padding: 5px;
transition: all 0.3s;
border: 1px solid black;
Expand All @@ -117,6 +124,18 @@ td:hover {
cursor: pointer;
}

.rotate90 {
transform: rotate(90deg);
}

.rotate180 {
transform: rotate(180deg);
}

.rotate270 {
transform: rotate(270deg);
}

.mirrorVertical {
transform: scale(1, -1);
}
Expand Down Expand Up @@ -147,4 +166,24 @@ td:hover {
text-align: center;
margin-top: 20%;
font-size: 45px;
}

#versionInfo {
display: none;
margin-top: 3px;
}

.plus {
color: green;
font-weight: bold;
}

.minus {
color: red;
font-weight: bold;
}

#resizeTable td {
border: 1px solid #ccc;
font-size: 21px;
}
38 changes: 31 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,30 @@
</div>
<div id="toolBox">
<input type="button" id="optionButton" value="Options" onclick="toggleOptions(true)" />
<a href="https://github.com/ufdada/wfto-mapeditor/blob/gh-pages/README.md" target="_blank"><button>?</button></a>
<button onclick="window.location.href='https://github.com/ufdada/wfto-mapeditor/blob/gh-pages/README.md'">?</button>
<!-- here are the tile buttons -->
<div id="info">
<p>Size: <span id="mapsize"></span></p>
</div>
<table id="resizeTable" title="Resize Map">
<tr>
<td></td>
<td><a class="plus" id="topPlus" href="#" onclick="terrain.changeMap('top', true)">+</a> <a class="minus" id="topMinus" href="#" onclick="terrain.changeMap('top', false)">-</a></td>
<td></td>
</tr>
<tr>
<td><a class="plus" id="leftPlus" href="#" onclick="terrain.changeMap('left', true)">+</a> <a class="minus" id="leftMinus" href="#" onclick="terrain.changeMap('left', false)">-</a></td>
<td></td>
<td><a class="plus" id="rightPlus" href="#" onclick="terrain.changeMap('right', true)">+</a> <a class="minus" id="rightMinus" href="#" onclick="terrain.changeMap('right', false)">-</a></td>
</tr>
<tr>
<td></td>
<td><a class="plus" id="bottomPlus" href="#" onclick="terrain.changeMap('bottom', true)">+</a> <a class="minus" id="bottomMinus" href="#" onclick="terrain.changeMap('bottom', false)">-</a></td>
<td></td>
</tr>
</table>
</div>

<div id="options" style="display: none;">
<fieldset>
<legend>New Map</legend>
Expand All @@ -34,20 +52,24 @@
</fieldset>
<fieldset>
<legend>Import Map</legend>
<input type="file" id="mapFile" accept="*.wfto"/>
<input type="file" id="mapFile" accept=".wfto"/>
<input type="button" id="import" value="Import" onclick="importMap()" />
</fieldset>
<fieldset>
<legend>Import Google CSV</legend>
<input type="file" id="csv" accept="*.csv" /><br />
<input type="file" id="csv" accept=".csv" /><br />
<label for="csvborder">Border: </label><input size="3" type="text" id="csvborder" placeholder="border" value="3" /><br />
<input type="button" value="Import CSV" onclick="importCsv()" />
<input type="button" id="importcsv" value="Import CSV" onclick="importCsv()" />
</fieldset>
<fieldset>
<legend>Export Map</legend>
<!-- For now keep it short and simple -->
<!-- input type="text" id="author" placeholder="Your Name" / -->
<a href="#" id="export" onclick="exportMap()"><button>Export</button></a>
<label for="versioning">Versioning: </label><input title="Adds a version number to the name, starting with 001" type="checkbox" onchange="setVersioning(this)" id="versioning" /><br />
<p id="versionInfo">Current version: <span id="mapVersion"></span></p>
<label for="mapName">Mapname: </label><input type="text" id="mapName" value="Map"/><br />
<button id="export" onclick="exportMap()">Export</button>
<a href="" id="exportLink" style="display:none"></a>
</fieldset>
<fieldset id="general">
<legend>General Options</legend>
Expand All @@ -56,7 +78,7 @@
</fieldset>
<fieldset>
<legend>Mirror Map</legend>
<table id="mirrorMap" border="0" cellspacing="1" cellpadding="1">
<table id="mirrorMap">
<tr>
<td id="first">1</td><td id="second">2</td>
</tr>
Expand All @@ -65,13 +87,15 @@
</tr>
</table>
<div style="display: inline-block">
<input id="rotate" type="checkbox" value="rotate" />
<label for="rotate">Rotate</label><br />
<input id="reverse" type="checkbox" value="reverse" />
<label for="reverse">Reverse</label><br />
<input id="extend" type="checkbox" value="extend" />
<label for="extend">Extend Map</label>
</div>
<div style="display: inline-block">
<a href="#" id="mirrorButton" onclick="mirrorMap()"><button>Mirror map</button></a>
<button id="mirrorButton" onclick="mirrorMap()">Mirror map</button>
</div>
</fieldset>

Expand Down
Loading

0 comments on commit 09c254f

Please sign in to comment.