Commit Graph

77 Commits

Author SHA1 Message Date
e54c67aaa1 DialogXML header extensions -> .hpp 2014-12-22 09:52:58 -05:00
728c294d0e Expand on text field keyboard shortcuts
- Clipboard support
- Text will now wrap when a word is longer than the width of the destination rect (doesn't just apply to text fields, but is most relevant there)
- Edit menu stub added in scenario editor code
- Rich text keys (eg cut, copy, paste, select all) are no longer processed by the dialog itself; only the text field processes them; this just means that if they were set as button equivalents they would no longer work (you'd have to set the raw equivalent instead, eg ctrl+C instead of copy).
- Text fields now rely on SFML's TextEntered event for actual input - the practical result of this is that your keyboard layout is honoured (though non-ASCII characters just display as boxes).
- In a similar vein, shift is not auto-applied to the input keys, so you'd have to set shift+2 instead of @ as the key equivalent (this actually fixes some stuff, such as in the spellcasting dialog, since I was already setting shift+2 instead of @).
2014-12-19 03:44:18 -05:00
72200a57f3 Convert several more dialogs, mostly related to outdoors stuff 2014-12-18 18:55:21 -05:00
2a2326035e Fix up all the mini-map stuff!
- Preset animated graphics now start at 960 instead of 400, due to all the new preset terrains from the previous commit running into their range.
- Tore out some optimization in the automap drawing, because it made it harder to figure out why it wasn't working
- Both game and editor now use the larger 12x12 map graphics, and fall back to shrinking down the 28x36 terrain graphic if no map graphic is set
- Upon loading an old scenario, map graphic is automatically set the same as the main graphic if it's a preset graphic; for custom graphics it's set to none
- Scenario now has three zoom levels for mini-map - the original in which the entire town is visible, a slightly closer one that matches the in-game view, and a large one using the 12x12 map graphics at full size.
- Fix some map patterns having the wrong bounding rect
- Graphics (and sounds) now included in the project by folder reference, so that I don't need to manually every new sheet to the project
2014-12-18 01:38:22 -05:00
8bb96396a5 Remove the RECT typedef for my custom rectangle class 2014-12-17 00:30:02 -05:00
f60b3f7b8e Picture controls now calculate their bounding rect on load 2014-12-16 23:15:55 -05:00
d409c8b616 Fix tab/newline stripping in dialogs not inserting a space to replace a run of newlines 2014-12-16 23:15:33 -05:00
bfafc42d46 Fix some issue with dialog picture display, mainly in special node dialogs 2014-12-16 17:34:00 -05:00
d7d08cbaa3 Mass reformatting (space after keywords) 2014-12-15 10:09:23 -05:00
f1660cf7ed Fix the dialog flickering, and attempt to partially fix the issue of a dialog being momentarily drawn into the main window after it is closed 2014-12-12 12:15:39 -05:00
5bfdb5eafa Misc little bits of housekeeping and stuff 2014-12-11 01:51:22 -05:00
ae09fc518f Add a few item graphics 2014-12-11 01:36:31 -05:00
c0110adb40 New special nodes:
- Town set attitude for affecting single creature, adapted from Windows code; technically redundant, but maybe handy
- If numeric response
- Print nums (for debugging)
- SDF arithmetic - add, subtract, multiply, divide, exponentiate
- Store random to SDF (adapted from Windows code)
- Display picture (inspired by Windows code, but the implementation is completely different and totally incompatible)
2014-12-11 01:36:22 -05:00
eb2fb485ac Don't create a new texture every time tiling is requested, though sadly this introduces a new issue 2014-12-11 00:15:26 -05:00
869ca7b2d7 Clean up, fix, and tweak the spellcasting dialog
- Includes new status effect images for the forcecage and for hypothetical inverses of dumbfound and magic resistance, as well as icons for the whole-party statuses.
2014-12-11 00:15:05 -05:00
34be9a0233 Bring up Get Items dialog when retrieving stored items from the next scenario, so that you can pick and choose which items to keep.
Also some bugfixes and stuff:
- Fix specials sometimes being run twice in a row
- Holding Control while clicking Create also makes a debug party (as an alternative to holding Command)
- Fix "How Many" popup being non-dismissible
- Reduce loading time spent on checking for missing opcodes
2014-12-08 02:37:15 -05:00
ca23b2f976 Some dialog pict fixes
- Pict choice dialog didn't work for present monster graphics
- Icon control is a little smarter when setting its picnum
2014-12-06 13:37:57 -05:00
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
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
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
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
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
8a3db4177f Edit text fields now clip overflow and scroll 2014-12-01 03:44:15 -05:00
70696dc42f Text fields now support multiline editing! 2014-12-01 01:20:28 -05:00
9b626ccf44 Restore talk face 2014-11-30 21:20:35 -05:00
a9ea0a114c Make text drawing mode a strict enum 2014-11-29 19:41:54 -05:00
b537fabd13 Allow shift-tab to cycle backwards through tab order 2014-11-29 16:37:26 -05:00
84f53a8a7d Dialog tab order implementation
- Defaults to order of definition in file
- tab-order attribtue can be set to a postive number to force towards the start, or a negative number to force towards the end
2014-11-29 16:03:54 -05:00
ed056368c1 Make all the controls non-copyable so that I don't get weird, insidious, hard-to-track errors from forgetting a reference mark like I did when converting the edit item type dialogs 2014-11-29 02:14:48 -05:00
41c3396aa3 Tear out most of the legacy code in the scenario editor - see below for details
- All Carbon code is gone
- Many dialogs converted; some are still left unimplemented since they still need to be converted
- Menus converted to a xib file
- The giant arrays specifying the configuration of the special node dialog for each special node type have been replaced with maps and sets.

Changes to dialogs:
- pict choice dialog can now show picts of differing types; this was required for picking a monster graphic, as monsters of all sizes need to be shown in the same dialog
- string choice dialog can set the title, and properly shows the currently selected string
- LEDs now accept font format
- Fixed LED group's calculation of its rect
- Fixed LED group crashing if it has no selection
- Tabbing between text fields now works
- Fix display of larger monster graphics in dialogs
- Fix the script element content showing in the browser preview
2014-07-12 22:13:27 -04:00
a4430cdf5a Fix spellcasting and dynamic menus
- Spell targeting line and array draws nicely, though not the same as the original
- Fix targeting falsely complaining about being off the edge of town
- Monster info dialog works properly; attacks now display correctly
- Fix dialogs always showing the wrong terrain or monster graphic
- Spell menus, monster menus, and PC editor item menus all work
- Spellcasting dialog now chooses the correct spell
- Fix out-of-place LED in spellcasting dialog
2014-04-22 02:06:31 -04:00
e8022df514 Don't rely on exceptions for normal behaviour 2014-04-21 14:06:38 -04:00
446bb1550d Some more tweaks to cursor handling
- Fix cursor turning into a sword during universe shifts
- Hide cursor along with menubar during splash screen
- Add watch cursor, used during splash screen
- Properly restore cursor after a dialog
- Use sword cursor for dialogs
- Show ibeam cursor in dialog text fields
- Move everything cursor-related out of graphtool
2014-04-21 13:47:52 -04:00
002ee640da Remove the global TextStyle; this should fix some of the textual glitches 2014-04-21 01:49:07 -04:00
e2b8eac644 Make dialogs behave a bit more modal 2014-04-19 09:01:31 -04:00
d69a0b11d0 Fix transcript starting off scrolled up 2014-04-19 01:43:28 -04:00
ef58cd0601 Fix issues with custom dialogs (that is, special node ones) 2014-04-18 22:35:30 -04:00