Just some guy's blog

One peculiar corner of the web

Code

IHMN in Numbers

One of the things that I realised from our first test game of In Her Majesty’s Name was that I had mad some mistakes adding up the cost of my company. Not difficult to do really but I figured that if I was going to play the game some more that I might want to make sure that I was able to accurately total up my company.

Now normally one might do this in Excel or Access (do they even make Access any more?) but since I am on my Mac I decided to use Numbers, the Apple spreadsheet app, to create it. I could have used Google Docs or Open Office to do it but both of those have exceptionally crappy UIs and they create really ugly looking documents.
(more…)

Mage Wars forum bbcode

The Mage Wars game by Arcane Wonders allows players to create spellbooks from several hundred spell cards. The Mage Wars forum allows fans to discuss the game and as part of that Arcane Wonders wants a way to display card data inside the forums.

Their forum software solution is SMF which makes it quite easy to include custom BBCode tags. As the first part of the solution I quickly made a custom BBCode tag and rendered it out into HTML. That HTML then had some custom CSS added as well as some JQuery code to handle displaying a div with the card preview and then hiding it again on mouseenter and mouseleave events.
(more…)

The worst time to be a developer

Probably the worst part of doing software development is the testing period. You work for ages to create an application and then people get their hands on it and you spend weeks having total strangers tell you that your work isn’t good enough, has bugs, doesn’t have a proper UX etc, etc.

I generally hate the entire process. Some people find good bugs. Some people have insightful things to say about how they use the application. And these are valuable. Especially user feedback on how they want to, or do, use your code.

But those gems are typically hidden in a pool of less than helpful, and sometimes hostile, comments that make the public testing process, for me, to be the least rewarding part of my work.

Edit a text value with jQuery

Had an idea to allow me to quickly edit a text value without any complicated dialogs or modals. Managed to do it all in jQuery. I placed the input and text span in the same div and then hid the input. When I click on the text it hides the text, reveals the input and then I reverse the process when you blur the input.

Check it out on JS Bin

jQuery and Bootstrap popovers update

Things are never as easy as you assume they will be. I got the Bootstrap popovers working in one part of my application but when I added them to the data table that I was dynamically creating they stopped working.

Popover

The issue was that the Datatables code was rewriting the inner HTML of the row that I was updated each time I updated it. Meaning that the events attached to that HTML were removed each time.

The solution was easy enough after I figured the problem out, reset the events each time I wrote a new row or updated one, but it seems kludgy and I am going to check to see if there is a better solution.

That is the future’s problem though as I still have features that I need to add.

jQuery and Bootstrap popovers

I had a bit of an issue with the Mage Wars Spellbook Builder I am coding. The application provides a small preview of a card when a user clicks on it. The preview is placed in an accordion panel so that the user can show or hide the preview as they see fit. Sadly the area where the users will be wanting previews is lower in the screen than the preview area

Card preview

I decided to use the popover class in Bootstrap to enable a preview when the user clicked on the card name. There were a few issues.
(more…)

Applescript is my enemy

One of the things I need to do for the current project with Arcane Wonders is to take a large amount of Excel data and turn it into HTML.

In the past I would have done this sort of thing in Director and built a quick Lingo function to read in some CSV data and then spit out the HTML. For years I did this sort of thing and it was the main reason why, despite not using it for any projects, that Director stayed on my hard-drive. Whatever one might think of Director, Lingo is actually a wonderfully adept language that is easy to use.
(more…)

Mage Wars spellbuilder

I think that if, a year or so ago, you would have told me that I would be building a data driven web application in jQuery and Javascript I would have not taken you seriously.

And yet that is what is currently happening.

As part of my work for Arcane Wonders, the publishers and developers of Mage Wars, I am writing a spell book building web application using Bootstrap and jQuery. The original code was created by another developer and I have taken it and used it as the basis for a new application.

The original was quite nice but I am expanding the use of Bootstrap to create a more traditional application and also updating the code to use Bootstrap 3 and add some addition functionality like multiple export formats.

It has been an unusual process since, prior to this, I really don’t like working in Javascript but jQuery is another thing entirely. It removes a lot of the issues with selecting HTML elements and the library is used for a huge number of plugins and expansions like the Datatable plugin that is being used to turn HTML tables into sortable, live dataviews.

Once I have the beta version ready for testing I will post a link and some more information.

Just some guy's blog © 2014 Frontier Theme