MKelm / mct

"Mass Control Tycoon" a GPL game for Windows, Mac and Linux
Other
5 stars 1 forks source link

More interactions: Hotkeys / MouseWheel #20

Open MKelm opened 10 years ago

MKelm commented 10 years ago

The game uses jQuery for some additional functions now, the library can be used to add key events for hotkeys.

Here is an example code for an ESC key event: https://github.com/MKelm/mct/blob/48c7321d7019aab52eb290a419c23b99777a29c1/lib/display/init.js#L1

Ideas for planet hotkeys

E.g. all available planets with extensions can have a hot key:

Or all available planets with a trade connection:

If this is too complex a planet switch with:

Or using the Mousewheel in Combintation with Shift / Strg to scroll through planet screens. With WebGL that should be fast. Mouse wheel code for jQuery:

$(document).ready(function(){ $('#foo').bind('mousewheel', function(e){ if(e.originalEvent.wheelDelta /120 > 0) { $(this).text('scrolling up !'); } else{ $(this).text('scrolling down !'); } }); });

MKelm commented 10 years ago

The new popup manager should get a mousewheel scroll feature for list views ...

MKelm commented 10 years ago

I added a FPS counter, usable by pressing F1 ...

... I want to add another hotkey feature, a survey, depending on the current version of the game (e.g. a new survey each alpha release / month). I detected a survey in other indie alpha games and it can be useful to get a knowledge about, what the testers want and so on. And it can contain a text field for bug reports too, that is easier than to register on github to add an issue. Or a special bug report survey with only one textfield and a regular survey with another key. It is relative easy, I need to add/remove one IFrame element with the destination url with jQuery only in the hotkey function.

Update: Here is the implementation ... I have added a detection of the version hash, the node.js filesystem and crypto modules are very useful! The algorithm detects all file hashes and puts them together to one version hash, but from html, js and json files only to ignore large resource files, that would make the hash algorithm very slow, the choosen files should be enough for the validation.

Here is a screenshot of an earlier bug survey version ...

MKelm commented 10 years ago

The logic for version utils is now in a seperate util file https://github.com/mctteam/mct/blob/master/lib/base/util.js I have added a update logic for a local hash database to make verification of version hashes in combination with git commit hashes possible ...

Update: added some more system information to the bugs survey logic (os, cpu and webgl support)

MKelm commented 10 years ago

Spaces -> mouse scroll == zoom, dragNdrop == move space layer/panel