Commit Graph

71 Commits

Author SHA1 Message Date
ddbc143c84 The select town/sector dialogs now offer a Choose button 2014-12-27 16:18:05 -05:00
d00e44f650 Introduce a shop type enum and a shop class
- Shop scrollbar now only visible when needed
- Outdoor shop special node now supports junk shops
- Outdoor shop special node now uses correct title string
- Fix minor issue with framing rects
2014-12-27 16:17:03 -05:00
d5575ee8fa Dialog engine now appends the XML file extension automatically.
- This creates the possibility of changing the file extension later
2014-12-26 23:23:33 -05:00
57a0e728bb Reform the dialog special node types.
- Any picture type is now possible; the nodes split by picture type alone were merged
- Town portal now honours your chosen picture. Town stairway also allows you to choose.
- The two one-shot dialogs now use msg3 where they previously used msg2; this is to make way for later expansion
2014-12-26 23:04:09 -05:00
131093f1bc Remove fire barrier from list of field graphics in choose_graphic, because it's on a different sheet now.
(Selecting a field graphic was never actually used, though.)
2014-12-26 02:04:18 -05:00
bdcd2fc67c Complete rewrite of special node edit dialog
- Now has space for the additional fields that have been added.
- The dialog text has been updated so that labels, names, etc reflect all (or at least most) changes that have been made to specials so far.
- A lot more fields provide a Choose button than previously. A few of these are still unimplemented though.
- Rect specials have their own button now, instead of being filed under Town specials.
- New help button (not yet implemented)
- You can now cancel when deep into a node chain. You're given a choice of discarding the entire chain or just the current node; choosing the latter is similar to clicking "Go Back", but doesn't save your changes.
- Nodes are no longer saved prior to clicking OK (which saves all the nodes you were working on) or "Go Back" (which saves just the current node). So, choosing the first option when clicking Cancel could lead to a lot lost.
- Incidental change: The arithmetic special nodes now use the message 1 and 2 fields in the standard way.

Supporting dialog engine changes:
- Picture choice dialog now has a way to get the index of the selection, rather than just the picture selected.
- Picture choice dialog no longer sorts the list of pictures. If sorting is desired, the list should be sorted prior to passing it in.
- Picture and string choice dialogs now support attaching a "select handler" to be called when the selected item changes, because the normal way to do this would override the all-important focus handler that the dialog uses to track the currently selected item.
2014-12-26 02:02:56 -05:00
d6cc7bae53 Nuke special node dialog globals 2014-12-23 00:09:36 -05:00
d7e3e3bd71 Fix many of the buttons doing nothing in the special node dialog 2014-12-23 00:04:03 -05:00
fb1f97e2f1 Preset town fields now use the field type enum 2014-12-22 22:46:30 -05:00
dcd28b363b Finally implemented the stack control, and used it for town comments in the town details dialog 2014-12-22 13:22:06 -05:00
e54c67aaa1 DialogXML header extensions -> .hpp 2014-12-22 09:52:58 -05:00
4b96f579b7 Embark on an epic journey to make both the game and the two editors load the entire scenario into memory.
Some other tweaks and fixes got pulled in along the way.
Details:
- Improved const-correctness
- The scenario is now part of the universe, so now there's no global scenario object in the game or the PC editor. (Of course, the scenario editor has no universe, so it still has a global scenario object.)
- Towns and outdoors now store a reference to the scenario; the party, current town, and current outdoors store a reference to the universe. Altogether this means that the data module has no need for global scenario or universe objects.
- The fileio routines now take a scenario or universe reference as a parameter, so they don't need the global scenario or universe objects either.
- cCurOut now has an arrow operator for accessing the current outdoor section, instead of a 2x2 subset of the outdoors; this replaces using i_w_c to index the 2x2 subset. (And it's much less verbose!)
- cCurTown no longer stores a pointer to the town record, since it can simply access it through the universe instance which it stores a reference to.
- Tweaked how the monster roster menu works (it now caches up to 60 monsters)
- The operator= functions that convert from legacy to new scenario/save format are now ordinary functions rather than operators.
- The bizarre use of assigning a cCreature to itself to populate certain fields has been nuked.
- When at the corner of an outdoor sector, the scenario editor now shows the cornermost terrain in the diagonally adjacent sector.
- There was a missing check to prevent horses entering dangerous terrain (eg, swamp) while in town.
- Fix cancelling load party dialog causing a party to appear
2014-12-22 00:20:37 -05:00
e88eb9b949 Convert more dialogs related to town settings 2014-12-19 16:29:15 -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
e471750c6b Fix up text placement in the scenario edit tool buttons area 2014-12-18 19:24:30 -05:00
7a2b6e2349 Add a field to outdoor details dialog for editing the sector's comment string (which has been uneditable since I reformed the string system). 2014-12-18 19:05:46 -05:00
72200a57f3 Convert several more dialogs, mostly related to outdoors stuff 2014-12-18 18:55:21 -05:00
a672ec050d Re-indent stuff touched by recent commits 2014-12-18 12:55:45 -05:00
5d8f974742 Catch all exceptions in the editors in order to show an error dialog.
(This is the same as what the game already does.)
2014-12-18 12:52:01 -05:00
c1d489c636 Convert area description dialogs 2014-12-18 12:51:28 -05:00
150feed662 Fix scenario editor not handling keystrokes in the main window 2014-12-18 01:39:00 -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
5de6d3d661 Convert two more dialogs 2014-12-17 13:13:23 -05:00
8bb96396a5 Remove the RECT typedef for my custom rectangle class 2014-12-17 00:30:02 -05:00
23b2414c0d Name most converted editor DITL resources with the filename of the dialog that replaces them 2014-12-16 23:18:20 -05:00
045e49543c Convert the last two core scenario dialogs
- Edit special encounter dialog now expects a parent and returns false if the user cancelled.
2014-12-16 21:47:07 -05:00
65c6919b1d Organize talking strings rather than stuffing them all in one big array
(Note: This seems to break recording talking/encounter strings.)
2014-12-15 20:06:08 -05:00
c6d960d078 Remove the string forwarders that were introduced to allow use of the original string indices
(A few things might be broken, probably just related to recording talk/encounter notes.)
2014-12-15 13:55:00 -05:00
5af865368f Mass reformatting (braces from next line) 2014-12-15 11:09:56 -05:00
d7d08cbaa3 Mass reformatting (space after keywords) 2014-12-15 10:09:23 -05:00
140e0b58ef Mass re-indentation
(Also removes some trailing whitespace)
2014-12-15 09:59:43 -05:00
aaad894ccb Simplify tons of comparisons to true/false 2014-12-15 08:46:48 -05:00
c8889a9989 Prevent party from getting a victory dialog if they die during special node processing in a chain that contains an end scenario node 2014-12-15 08:46:43 -05:00
a198c232bb Strictify skill enum 2014-12-14 02:51:01 -05:00
1200ff47d4 Strictify item ability enum 2014-12-12 15:18:43 -05:00
6151a24916 FIx linker error in editors 2014-12-12 13:25:39 -05:00
0b15937bb9 Clean up tons of commented fileio code 2014-12-12 11:11:36 -05:00
76ccb66786 Beep beep 2014-12-11 00:47:04 -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
0d7ad2c718 Finish strictifying special node type enum (forgot the scenario editor) 2014-12-07 17:53:30 -05:00
0629a70419 Strictiy terrain special enum 2014-12-06 20:59:50 -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
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
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
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
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