Commit Graph

25 Commits

Author SHA1 Message Date
c1268e8d57 Start reorganising for multiple games 2020-06-01 01:08:53 +01:00
c7a2fa80e7 Internalise the map rect 2020-05-20 01:43:44 +01:00
04bdf3e352 Make i18n optional, add SoW note 2020-05-19 11:07:10 +01:00
9d0750d134 Scenario viewpoint, Z index management, and arrow controls 2020-04-20 00:16:21 +01:00
6e70ddcb60 Fix some errors in iso->pix->iso conversions, add debugging
Maps now render a bit more properly, and our mouse position can be
correctly assigned to a cell. Kind of, mostly.
2020-04-18 00:12:15 +01:00
2b83ce4f7f Build a simple animation viewer 2020-04-16 15:30:47 +01:00
786d261f98 Allow dialogues to be hidden or shown
To do this, MENU and SUBMENU are split into two types (at last), and
a Widget type is introduced. This should allow lots of code to be
removed at some point.
2020-04-14 03:14:49 +01:00
dc131939f4 Make include directives work in .mnu files 2020-04-13 21:03:54 +01:00
5f8606377a Integrate view-map into ordoor
Now we can view scenario maps from the main game interface. We can't
cancel out of a scenario yet, though.
2020-04-11 00:13:28 +01:00
bb3ddc4896 First pass at custom cursor display 2020-04-10 19:55:16 +01:00
aa43011e8d Set options from defaults on first start
Data/GenericData.dat specifies what the default values for some options
should be. Respect them on startup if the options in config are unset.
2020-04-02 01:21:32 +01:00
8ce24ce5f8 Display listbox text 2020-04-01 19:45:57 +01:00
b5a722eef0 Make a start on font rendering
I was hopeful I could use ebiten/text, but font.Face doesn't seem set
up for fixed-colour fonts.
2020-03-30 00:15:19 +01:00
e4ce932324 Display overlay text in the UI
We still have fonts to do, so this is very ugly, but it at least shows
*something* on the screen now.
2020-03-26 22:09:26 +00:00
69971b2825 Rework the UI framework
Interface is now Driver, and Widget is now a set of interfaces with a
struct per widget type. This should make it easier to add other types.
2020-03-24 20:21:55 +00:00
ba7c06e5fd Show tooltips when hovering 2020-03-22 15:37:48 +00:00
bfe9fbdf7d Start work on menu interactivity.
With this commit, we get a ui.Interface and ui.Widget type. The
interface monitors hover and mouse click state and tells the widgets
about them; the widgets execute code specified by the application when
events occur.

Next step: have wh40k load the main menu and play sound, etc.
2020-03-22 02:58:52 +00:00
bcaf3d9b58 Get view-menu to play the interface sound 2020-03-21 23:45:51 +00:00
83aa1c4768 Remove unwanted debugging prints 2020-03-21 23:14:15 +00:00
46925c09d1 Make the menu buttons work 2020-03-21 18:50:26 +00:00
be4229b8fe Remove internal/conv
This sets font rendering back a little bit, but not much.
2020-03-21 13:37:20 +00:00
8b02f534f1 Eager load used sprites 2020-03-21 10:59:07 +00:00
7a8e9dbd97 Respect sprite X and Y offsets
This makes menus display more correctly, and also fixes trees and other
objects on the main map, although it messes up bounds clipping (sigh).
2020-03-21 00:56:35 +00:00
576ac0570d Better logging 2020-03-20 00:02:27 +00:00
5fccf97f4b Lazily load sprite image data
This cuts memory use significantly, since many sprites in an object are
never used. We can get savings over time by evicting sprites when they
go out of scope, but that's, well, out of scope.

To achieve this, I introduce an assetstore package that is in charge of
loading things from the filesystem. This also allows some lingering
case-sensitivity issues to be handled cleanly.

I'd hoped that creating fewer ebiten.Image instances would help CPU
usage, but that doesn't seem to be the case.
2020-03-19 22:24:21 +00:00