I see you're not using jQuery at all for this, so I don't know if you're interested, but I've had a lot of experience with jQuery UI and their drag/drop functionality is super easy to use, and they take a lot of care to make things work cross-browser. And while I've never personally used CoffeeScript, according to Google jQuery is still a snap to use with it.
Plus it would give you access to lots of (fairly easily customizable) fancy effects you can add once you've got all your basic functionality ironed out.
Just a suggestion. I may actually fork and take a crack at your source tonight or tomorrow myself and see if it's as simple as I think it will be to implement (assuming you don't mind). And it gives me an excuse to try my hand at CoffeeScript, so yay.
It's a Backbone.JS app, which uses jQuery under the hood for all the DOM interaction and heavy lifting. You can see all the vendor libs that I'm using on github.
Yep, the last large project I did with drag and drop used jQuery UI; the issue I ran into was IE6,IE7 support (admittedly probably not as much of a problem on this project). If you're going to take a crack at it I would recommend using the .sortables() function, which is what we ended up using on that project. Here's a jsfiddle from way back then that still works
I don't mind at all, that's why I created the code and pushed it up to github as a public repo. Go nuts and submit a pull request if you come up with something cool!
Also, if you're going to be running the app locally, you'll need Node.JS installed. I need to update the readme, but here's the short version of how to get it running.
1. Install Node.JS
2. Install Lineman using NPM in a terminal/command prompt: npm install -g lineman
3. In the directory you checked out the battle planner app to: npm install
4. To run the app: lineman run (it will show you the port and hostname to open in your browser)
Last edited by davemo; 03-04-2013 at 02:16 PM.
So, after a LOT of pain learning to use all the things I had previously only read about(CoffeeScript, Backbone.JS, and Underscore), I've got a working sortable lineup running locally. Now to see about adding drag/drop to add or replace units.
This is fffing amazing, thanks for the tool!
Got a plan for allowing builds that are only possible in older versions of the game? For example, next week, they're probably going to drop the max strength on my Warmaster, so 17/7 is no longer possible. Maybe a drop-down with dates/versions somewhere...
For those interested, I've got a variation of davemo's battle planner up and running here:
https://battleplanner-rarumberger.herokuapp.com/
It's the same thing, only with draggy-droppy bits.
And if anyone's interested in the source, the fork is here.
I think I'll probably just keep in sync with the latest version; my plan is to add a revision stamp in the encoded URL so if you try and load an build with old stats it will just notify you somehow. That seems the simplest solution rather than trying to keep track of old builds and stat revisions, or even trying to auto correct stats from outdated builds.
Just wanted to post that I pushed an update to support editing of Rank 1, 2 and 3 units from within the stat editor UI to match the features in build 1.6.21. I've been working on the side on some other features w/ analysis but this was easy to bang out.
I'm still working through Jawbones drag and drop implementation as well but I'm not 100% sure I want to integrate it as it's still proving pesky for me locally.
Keep it up davemo! We're counting on you (and Jawbone too), seriously.
Pushed a new build with the following changes from 1.6.29:
- Battle: Backbiters Max Strength reduced by 2, Max Will increased by 2
There is a small bug that I've come upon, but still should be looked into:
When in stat editing mode and swapping currently edited character with another one, you'll get current character's rank and stats also swapped (only for editing and display, no actual changes) and it influences editing stats as well.
To give an example - here I have my thrasher in editing mode, where he has 10/11 stats assigned. I swap him in the queue with SM, and you can see my thrasher displayed as rank2 12/12 stats instead of rank1 10/11. Also I can't add any stat for him until I actually click his portrait, so that the display would refresh.
Playing with this bug further, I've tried to lower my thrasher stats and then click his portrait. So he got like 6/8/4/2/2 but showing 10/11 assigned and can't be upped to his real maximum. Needs to exit editing and re-entering it.
If you don't know where to put it - put it in the pillage
Steelhammer Tribune issues collected here
Some of my Factions games can be observed here
Also possible streaming at http://www.twitch.tv/netnazgul
So I just pushed an update that adds a version string to both the CSS and JS paths, I think you may have been bitten by a cached copy of the script because I can't reproduce your bug in the current version and I do know that this was occurring in an old version.
Can you reload the app (hold shift and hit the reload button in your browser) and try this again and see if it still persists? Also, if you view the source of the page can you tell me what you see for the path of app.min.js? It should have v=0.2.29 like this image...
![]()
Recorded a video with the bug reproduction (ultra Warmaster in this case) to clarify the issue
Browser is FF 19.0.2, battle planner version 0.2.29 (reloaded with Ctrl+F5)
This bug is being exactly reproduced in IE 10
Last edited by netnazgul; 03-16-2013 at 06:20 AM.
If you don't know where to put it - put it in the pillage
Steelhammer Tribune issues collected here
Some of my Factions games can be observed here
Also possible streaming at http://www.twitch.tv/netnazgul
I just pushed version 0.2.30 which fixes your bug Netnazgul, can you test it out?
Would it be possible to add descriptions of the active abilities for each unit? e.g. What flail does on a level 1/2/3 thrasher?