Commit Graph

889 Commits

Author SHA1 Message Date
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
f4c9d98808 Generalize the special node types dealing with fields.
- IF_FIELDS (formerly IF_OBJECTS) can now deal with any kind of field (apart from special spots, which aren't technically a field but share some implementation details).
- The twelve RECT_PLACE_XXX field nodes (well, one of them was RECT_CLEANSE) have been collapsed into one, allowing the placement of any kind of field (apart from special spots). In particular, antimagic fields can now be placed! (There wasn't a node for them before.) As a bonus, since it exists in the field type enum, RECT_PLACE_FIELDS can also smash fragile wall terrains (like the Move Mountains spell).
2014-12-22 23:34:28 -05:00
fb1f97e2f1 Preset town fields now use the field type enum 2014-12-22 22:46:30 -05:00
c768b2557c More operator= -> append for legacy data conversion 2014-12-22 22:17:23 -05:00
0aaf7636a4 Rearrange special node dialog XML into a more logical order 2014-12-22 22:13:36 -05:00
d193c0da7b Fix crash when loading party death dialog 2014-12-22 20:15:12 -05:00
18a78e9526 Attempt to fix monster combat poses not displaying 2014-12-22 20:14:55 -05:00
6499923ab5 Fix preset fields (and special spots) not appearing 2014-12-22 18:37:59 -05:00
9f7846c3bb Fix seeing monsters through walls in combat mode 2014-12-22 18:27:30 -05:00
37a8b27209 Fix missile and explosion animations 2014-12-22 18:20:16 -05:00
da975d6e3e Dragging in a text field now selects the dragged-over text
Note: Seems to need optimization, may not work when text overruns field boundaries
2014-12-22 16:37:36 -05:00
6f04844c89 Shift-clicking in a text field now sets the selection endpoint where you clicked 2014-12-22 16:31:48 -05:00
6bad9f57d5 Clicking in a text field now sets the insertion point where you clicked 2014-12-22 16:27:24 -05:00
99f8da734b Fix several dialogxml error messages naming the wrong element tag name 2014-12-22 13:22:25 -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
5e762147bd Typos 2014-12-22 09:53:10 -05:00
e54c67aaa1 DialogXML header extensions -> .hpp 2014-12-22 09:52:58 -05:00
317a01afa1 Look up saved talk/encounter strings when loading a legacy savegame 2014-12-22 09:29:01 -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
8e26881331 Unification of petrification abilities
- Note: Petrification from higher-level monsters is now harder to resist!
- AFFECT_DEADNESS special node now has an additional option to allow PCs a saving throw (based on things like luck and items with life-saving ability) when killing them, and to specify the difficulty of resisting when petrifying monsters or PCs
- AFFECT_DEADNESS special node now triggers monster death specials when petrifying them (in addition to when killing them), and substitutes ash for the normal sfx when turning them to dust
2014-12-19 03:25:38 -05:00
d41616db6a Some tweaking of monster spell mechanics to bring them more in line with the PC versions
- Spark now deals magic damage and Wound deals unblockable damage
- Damage is capped for Flame as for the PC version; the damage is still calculated differently though
- Poison and Minor Poison damage now depends on the monster's level
2014-12-18 20:36:11 -05:00
d36f00eb3d Use slow_monst, curse_monst, slow_pc, and curse_pc for all blessing and hasting from spells
- This means the cap of 8 is automatically respected; most of the monster versions did not respect the cap before.
- The functions also automatically print messages, so there'll be more messages than before.
- A previously unused instant help message is now used! (For when you're blessed.)
2014-12-18 20:03:56 -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
2f64789003 Rearrange the new graphics on the terrain sheets and add all of the graphics Mistb0rn made for the project
- Also add credits and fill in termap.png
2014-12-17 18:48:35 -05:00
5de6d3d661 Convert two more dialogs 2014-12-17 13:13:23 -05:00
e864d9f7eb Replace living statue and crystal soul graphics with versions that don't have a background
- Also included is details on how this was done, in case someone else can improve on it.
- Living statue attack graphic is derived from Exile III.
2014-12-17 11:39:07 -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
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
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
2ef6d01ec7 Update spell data
- Fireball mistakenly required you to select a PC target while Haste did not.
- Forgot the two special monster priest spells
- Changed display name of ICE_WALL_BALL
2014-12-16 18:40:54 -05:00
d376d97de9 Remove a useless function 2014-12-16 18:20:45 -05:00
6866bf70c5 Fix special spots not being properly cleared from the previous town
(And get rid of the old forwarder functions for the field bitfields.)
2014-12-16 18:18:58 -05:00
bfafc42d46 Fix some issue with dialog picture display, mainly in special node dialogs 2014-12-16 17:34:00 -05:00
58c34423ac Rearrange field types enum and use it when setting fields on a space 2014-12-16 17:33:28 -05:00
ba1f385227 Fix dialogs looking up the wrong strings when not in town 2014-12-16 15:14:26 -05:00
c4136c862a Fix unseen mask 2014-12-16 14:57:59 -05:00
d88ace968f Use the spell enum for monster spells
- Enemy priests now cast Goo instead of Stumble; this was changed to match the effect of the spell.
- Enemy priests now cast Minor Heal instead of Light Heal; this is merely a name change to match the equivalent PC spell.
- PCs now cast Bless All instead of Bless Party; this is merely a name change to match the equivalent monster spell.
2014-12-16 14:45:32 -05:00