Commit Graph

645 Commits

Author SHA1 Message Date
8ab9d06199 Animate graphics in dialogs
- Monster graphics are animated too, showing all four of their frames.
- Animated dialog graphics are currently enabled only in the scenario editor.
2014-12-06 13:37:56 -05:00
88cb60fb8d Embark on an epic journey to document the dialog engine in as much detail as possible.
... and the previous commits (from 56f73cb on) were by and large a result of things noticed during this process.
2014-12-06 13:37:43 -05:00
beacf9dadc Remove the need for all cControl subclasses to be friends of cDialog
(Now only cControl itself is a friend.)
2014-12-06 13:35:28 -05:00
edf755c7c9 Fix dialog parser considering XML comments to be illegal in some places. 2014-12-06 13:35:28 -05:00
13a9e6671d Add magic value constant for xBadVal exception 2014-12-06 13:35:27 -05:00
eea1624b0d Fix unfetchability of TXT_FRAMESTYLE in buttons and icons. 2014-12-06 13:35:27 -05:00
da20a7402c Add an operator-> to cStrDlog and cStringChoice, mainly for consistency since cPictChoice and cChoiceDlog already had one. 2014-12-06 13:35:26 -05:00
f904389be8 Move noAction to cLed since its purpose is mainly to prevent the default LED toggle-selected action without introducing any alternate behaviour. 2014-12-06 13:35:26 -05:00
d35b2137be Merge the two "load from file" constructors in cDialog (using defaulted parameter) 2014-12-06 13:35:26 -05:00
9e734d5c47 Remove redundantly duplicated functions in cButton 2014-12-06 13:35:26 -05:00
f9f90473f3 Fix garbled dialog graphics in custom special node dialogs 2014-12-05 23:49:01 -05:00
56f73cb156 Lots of little tweaks and fixes to various things, mostly dialog stuff.
- LED groups now trigger their own click handler in addition to the clicked LED's click handler (provided the latter returns true). If the handler returns false, the click has no effect.
- LED groups now cancel the selection change if their focus handler returns false; this mimics the behaviour when an individual LED's focus handler returns false.
- Move the dialog getResult() definitions inline - since there's only two of them now that I'm using boost::any, having them in a separate file is pointless.
- Changed how the pict choice dialog returns its result - now it returns only whether the user clicked cancel and provides getters to obtain the number and type.
- Pict and string choice dialogs now hide the arrow buttons when there is only one page of options.
- Fix pict choice dialog always returning the initially selected value (similar to how the string choice dialog did before I fixed it)
- When passed an invalid starting selection, the pict choice dialog now always starts with the first icon selected
- Fix wrong bounds for several typs of custom graphics in dialogs
- Fix wrong /source/ bounds for custom 28x36 graphics /everywhere in the game/.
- Fix select PC graphic dialog having a second page with an invalid graphic that can be selected.
2014-12-05 23:48:07 -05:00
4db81f1403 Implementation of parsing for the map format (untested)
- Some stubs inserted for loading new-format scenario data
2014-12-05 00:50:17 -05:00
cec15c1cce Fix an int overflow issue in the boats/horses dialogs 2014-12-04 22:35:03 -05:00
4f6ce11dd9 Convert create scenario dialogs, reimplement part of the scenario creation process, and allow text edit fields to contain default values in the XML definition.
- Note: This does not mean that scenario creation is now possible, since it relies on scenario saving which is still not implemented.
2014-12-04 22:34:37 -05:00
ecd0867b65 Convert scenario details dialog and make numeric fields validate their contents 2014-12-04 16:54:21 -05:00
d45a7d1c1b Clicking a text field now selects it as if you had tabbed into it 2014-12-04 14:18:48 -05:00
04cba387d5 Automatically trigger the focus handler for the active field when toasting the dialog, and don't toast if the handler returns false
- But provide an option to skip this step, for the purpose of cancel buttons
2014-12-04 13:54:23 -05:00
7e07d195f9 Fiddling with the style guide 2014-12-04 12:47:57 -05:00
94d8717a0b Nuke as many warnings as possible, and several globals as well
- Warnings completely suppressed for the included TinyXML and gzstream libraries
- Parentheses warnings are now errors, since there were several that looked like bugs
- Ditto for dangling else warnings

Some of these warnings were actually bugs:
- Town wandering monsters would have never spawned, because the code to do so was accidentally nested within a check for overall_mode == MODE_OUTDOORS
---> boe.monster.cpp, lines 105-137
- Monster's behaviour with respect to elemental fields did not correctly depend on their immunities (this is the same precedence issue Sylae messed up fixing in the Windows code)
---> boe.monsters.cpp, lines 345-359
- Display of damage blocked by armour appeared to be incorrect (needs verification)
---> boe.newgraph.cpp, line 1079
- Three-choice dialogs probably weren't dealing with unusual button types correctly, though that's a minor point since they aren't expected to use such buttons
2014-12-04 12:44:17 -05:00
e7d8a6d848 Fix PC editor not showing curse and slow status effects 2014-12-03 23:20:28 -05:00
47fc23928c Strictify status types enum 2014-12-03 23:18:12 -05:00
13116980fb Strictify race enum
- This incidentally fixes a lot of things that were broken in the previous commit due to the magic values changing
2014-12-03 20:21:24 -05:00
5b7649543f Merge race and monster type enums 2014-12-03 18:27:34 -05:00
efa552a366 Don't use CoreFoundation to check machine's endianness 2014-12-03 18:04:33 -05:00
7a2a0f93d3 Finally, a working parser!
--> At least, it parses the sample file correctly

- I reverted the choice of using a skip parser, because it was failing and I couldn't figure out why. This means there's a lot of *ws where whitespace can go.
- Grammar rearranged a little
2014-12-03 05:03:10 -05:00
62f2259fb9 Hacked at it until the parser stopped crashing.
It now seems even uglier than before.
And it still doesn't actually work.
2014-12-03 05:01:06 -05:00
c119ffc242 More little grammar simplifications 2014-12-02 22:23:31 -05:00
e51cdb5c1d Simplify grammar a bit by specifying a skip parser 2014-12-02 20:56:10 -05:00
1b97c6557b Finish up most of the semantic action type stuff
- The parser does not work at present; it does at least compile and link, though
2014-12-02 20:48:31 -05:00
9da92fb904 I'm thinking allowing names here might be a bad idea 2014-12-02 18:44:38 -05:00
4a68a5b293 Unminify the semantic actions 2014-12-02 18:33:51 -05:00
5fe8b28b2e Doing the opcodes as a symbol table seems better 2014-12-02 18:30:25 -05:00
d1a8db9b70 Sample nodes file, more semantic actions
- Note: This parser is still untested.
2014-12-02 17:07:39 -05:00
01f0a62160 Define a grammar for special node definition files 2014-12-02 15:59:38 -05:00
a95f1c5b93 Fix the line-of-sight stuff that was broken thanks to 0 being implicitly convertible to std::function 2014-12-02 15:54:50 -05:00
03c64ebd7b Eliminate use of __attribute__
Ideally this would be standard C++, but here I've settled for things that should be supported by both clang and VS/cl.exe:
- Deprecated attribute retained, but now uses __declspec syntax
- Packed attribute replaced with pragma pack, except one instance where it unnecessary
- Aligned attribute replaced with explicit padding bytes inserted in the structs where needed
- Unused attribute simply removed (though where possible, the unused entities were also removed)
2014-12-02 15:54:50 -05:00
d61c0a5c1e Convert five more dialogs and fix the string choice dialog
(The latter was always returning 0)
2014-12-02 09:44:21 -05:00
d64770b1e0 Use folder references for strings and dialogs.
This means I won't have to remember to explicitly add each new file to the build.
It also means they'll be automatically kept sorted.
2014-12-01 22:51:18 -05:00
73c3430f05 Argh! How did I forget to commit this file? 2014-12-01 22:13:42 -05:00
e6057387eb Strictify PC main status enum 2014-12-01 21:38:20 -05:00
4a68c16c2a Some little bits
- Check is_block as well as is_barrel in some places
(is_block is a feature new to OBoE, I have no idea if it works yet)
- Print an "equip bolts" message when trying to fire a crossbow without them
2014-12-01 20:12:45 -05:00
c62ac56702 More enumeration in the schema instead of arbitrary integers 2014-12-01 20:11:45 -05:00
e86362d294 Strictify the terrain trim enum 2014-12-01 20:04:30 -05:00
d900c7edef Enumify terrain blockage and generalize the line of sight function
This should probably be two separate commits, but they're tangled together and I don't want to spend the effort to disentangle them.
2014-12-01 19:50:19 -05:00
afd45b3774 Strictify item weapon type enum 2014-12-01 14:57:18 -05:00
3a1de0c890 Strictify item variety enum 2014-12-01 14:46:17 -05:00
f0ededde17 Somehow, these lines got out of order, throwing off the whole conditional
- If I read the code correctly, the result was that you could sell weapons other than crossbows bolts without dequipping them first
(Fortunately && has higher precedence than ||, otherwise it would've been a lot worse.)
2014-12-01 13:44:24 -05:00
8a3db4177f Edit text fields now clip overflow and scroll 2014-12-01 03:44:15 -05:00
3fa0a26ec3 no message 2014-12-01 02:01:24 -05:00