Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge version 1.3 into master #14

Merged
merged 78 commits into from
Mar 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
4ab5be3
calculate background-position without helper element
ufdada Mar 5, 2015
c59b560
update readme
ufdada Mar 5, 2015
1b59ba9
update readme
ufdada Mar 5, 2015
4ef88cc
remove position data from imported csv map data
ufdada Mar 6, 2015
24255a5
remove position data from exported map data
ufdada Mar 6, 2015
8c4d82d
update map version
ufdada Mar 6, 2015
41fe6c5
remove position data from mirroring
ufdada Mar 6, 2015
70c2c15
fix positioning of tiles while on mouseover (displaying the room)
ufdada Mar 6, 2015
0228575
add mapname input and versioning checkbox
ufdada Mar 2, 2015
d388db3
update readme
ufdada Mar 2, 2015
bcace6e
fix vars for elements and further improvments
ufdada Mar 8, 2015
748568a
better escape regex
ufdada Mar 9, 2015
875af36
fix logic mistake
ufdada Mar 9, 2015
992cb44
check for correct filename
ufdada Mar 9, 2015
876da6c
make version identification more stable
ufdada Mar 9, 2015
fe645ac
fix regex for maps with versioning
ufdada Mar 9, 2015
abf87b3
bugfix for having a dot in filename (not before the extension). Also …
ufdada Mar 9, 2015
8e2625b
add rotate option (not functional right now)
ufdada Mar 8, 2015
3840500
refactor enabling/disabling of checkboxes
ufdada Mar 9, 2015
6ff449c
Check for correct mapsize (otherwise it wouldn't make sense to rotate…
ufdada Mar 9, 2015
b0778ee
Make rotation option functional
ufdada Mar 10, 2015
c7960d4
fix breaking rooms if these are on the mirror line
ufdada Mar 10, 2015
9592d0e
fix rotate breaking not extended mirror options
ufdada Mar 10, 2015
f627f4a
adding a first prototype of dalek tests
ufdada Mar 10, 2015
ef84cb8
improve tests
ufdada Mar 11, 2015
c067253
remove chrome webdriver, as it doesn't like relative path
ufdada Mar 11, 2015
e8d115e
make converter more reliable
ufdada Mar 16, 2015
f3832c9
add test for new map
ufdada Mar 16, 2015
9b14e7c
update for continues integration
ufdada Mar 17, 2015
b3e67e7
a little beautify
ufdada Mar 17, 2015
5433050
add mirror1Map test
ufdada Mar 18, 2015
e07d9cf
update tests and improve converting of asserts
ufdada Mar 18, 2015
ea26e2c
workarround for PhantomJS confirm/alert messages
ufdada Mar 18, 2015
15a7079
change notifications
ufdada Mar 18, 2015
0111137
bugfix for converting tests
ufdada Mar 18, 2015
22d994c
add extended to mirror 1 test
ufdada Mar 18, 2015
48dc6c1
bugfix for new map (we want to set the whole value instead of just ty…
ufdada Mar 18, 2015
81e6212
add new mirror option test to suite
ufdada Mar 18, 2015
df3ba9e
Fix convert (error in chaining)
ufdada Mar 18, 2015
c0cf6df
update gitignore to ignore test screenshots
ufdada Mar 18, 2015
2131ea0
add mirror 2 test
ufdada Mar 18, 2015
74b9537
cache test map (reduces overall test time)
ufdada Mar 18, 2015
3506b89
fix assertions and make taking screenshots switching easier
ufdada Mar 18, 2015
506c6c7
update nodejs
ufdada Mar 18, 2015
803ba9b
remove selenium tests
ufdada Mar 19, 2015
b67e814
add mirror 3 test
ufdada Mar 19, 2015
514f946
add test messages and some asserts
ufdada Mar 19, 2015
cd59d9e
make tests a little more colorful
ufdada Mar 19, 2015
2cf08e8
fix map export
ufdada Mar 19, 2015
b16947a
add test for importing map
ufdada Mar 19, 2015
274a3b5
additional testing and cleanup
ufdada Mar 20, 2015
c1d2170
travis doesn't like relative path in file upload, so we give it an ab…
ufdada Mar 20, 2015
0932b8c
assert the correct map sizes
ufdada Mar 24, 2015
57f6cea
refactor helperfunctions for easier integration
ufdada Mar 24, 2015
d4877f9
add some more assert
ufdada Mar 24, 2015
a5a0010
add ticket test
ufdada Mar 24, 2015
a2fe345
check for uncomplete rooms
ufdada Mar 24, 2015
7e3fcd8
oops remove debug assert
ufdada Mar 24, 2015
6c09c2c
implement ticket test in general testing. Fixes #12
ufdada Mar 25, 2015
c7b93bf
quick fix
ufdada Mar 25, 2015
9655a77
Update readme
ufdada Mar 25, 2015
3fc1dfe
Update readme
ufdada Mar 25, 2015
5ac3ada
even it shouldn't happen, rooms can theoretically be larger than in t…
ufdada Mar 25, 2015
e8ebe12
Update readme
ufdada Mar 25, 2015
0cc53e6
update readme (link build status)
ufdada Mar 25, 2015
749b684
add cli for changing the map size dynamicly
ufdada Mar 25, 2015
e455eed
fix linting errors
ufdada Mar 25, 2015
6dd8304
add gui
ufdada Mar 25, 2015
ccd5586
add check that the mapsize doesn't exceed
ufdada Mar 25, 2015
d856fc5
add resize test prototype
ufdada Mar 25, 2015
f8be005
finish resize tests
ufdada Mar 25, 2015
6c810c0
refactor determination of tileid in map format
ufdada Mar 25, 2015
83d0fe1
resizer size should fit to tilesize
ufdada Mar 25, 2015
8888499
try to fix travis
ufdada Mar 25, 2015
b1fc865
move resizing to an extra file
ufdada Mar 25, 2015
fa1c0ce
disable the other tests
ufdada Mar 25, 2015
c92bd8a
Merge pull request #13 from ufdada/resize-map
ufdada Mar 25, 2015
bcbc789
update readme
ufdada Mar 25, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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