Commit Graph

340 Commits

Author SHA1 Message Date
ddbc143c84 The select town/sector dialogs now offer a Choose button 2014-12-27 16:18:05 -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
0aaf7636a4 Rearrange special node dialog XML into a more logical order 2014-12-22 22:13:36 -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
e88eb9b949 Convert more dialogs related to town settings 2014-12-19 16:29:15 -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
c1d489c636 Convert area description dialogs 2014-12-18 12:51:28 -05:00
5de6d3d661 Convert two more dialogs 2014-12-17 13:13:23 -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
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
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
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
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
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
13d00cd27a Convert the edit special item dialog 2014-11-29 12:12:01 -05:00
c855983de4 Convert item type editing dialogs 2014-11-29 02:13:49 -05:00
07ff864f4b Convert monster abilities dialog 2014-11-28 02:19:07 -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
002ee640da Remove the global TextStyle; this should fix some of the textual glitches 2014-04-21 01:49:07 -04:00
f449b47f36 Fix a lot of bugs in the PC editor
- Alchemy dialog had black text on dark background
- Buttons didn't depress when clicked
- Edit XP button just said "Edit"
- Two menuitems in Special Edit menu had been left with default names
- Callbacks in Special Edit and Free Extras menu weren't correctly assigned
- Edit XP dialog put the XP to next level in the wrong place
- Fixed alchemy dialog LED naming

Supporting changes in the dialog engine:
- Getting or setting control text as a number now uses the long long type to allow maximal precision
- When adding a label to a button, the dialog's default text colour is used instead of the button's text colour if the dialog's background is dark
2014-04-17 02:24:35 -04:00
eb2e8f3536 Fix button label in one of the PC editor dialogs 2014-04-16 17:50:16 -04:00
199f84e0db Make dialog preview stylesheet default to dark background 2014-04-16 17:49:13 -04:00
caa461f8e7 Tear out most of the legacy code in the PC editor - see below for details
(Scenario Editor is unaffected by this commit.)

- Menubar converted to a .xib file
- Don't include the Info.plist in "Copy Files" stage
- Several more dialogs converted; as before, the source resources have had their resource name changed to the new filename
- One more converted STR# has been included

There were several functions in the PC Editor code that also existed in the BoE game code. I've moved these into the pc.editors.cpp file, so that there's only one copy of each.
- display_alchemy() functions changed signatures
- moved keyToChar() function into a common file (winutil)
- Several constants and globals moved to pc.editors.cpp

Supporting changes to dialog framework:
- New formatting option to set the frame style; this because the PC editor uses a different frame style in some contexts
- Added global default dialog background setting
--> This was necessary to correctly set the default text colour
--> Will also be needed for the scenario editor, which uses a different default background

Other changes:
- Add option to load_scenario to skip loading the strings
- Fix for crash in soundtool in the event of initialization before playing the first sound
2014-04-16 17:07:08 -04:00
48f3335160 Fix "missing" Done button in PC info dialog
- Also fix wrong resource name - the pc-spell-info DITL was mistakenly named pc-info
2014-04-14 15:51:30 -04:00
dd02dcc5d3 Realign PC spell list dialog 2014-04-14 15:51:30 -04:00
7b194c26ba Fix mage/priest spell buttons in PC info dialog being labelled with the level of the skill 2014-04-14 15:51:30 -04:00
152f828e44 XSL dialog preview now shows default-state LEDs 2014-04-14 13:55:53 -04:00
8d76aed26c Add preferences option to skip splash screen on startup 2014-04-14 13:55:52 -04:00
85afa07382 Prefs dialog alignment tweaks 2014-04-14 13:55:52 -04:00
860305df91 Organize preferences dialog so that the elements are in display order 2014-04-14 13:55:51 -04:00
fccc1a8c54 Zap fancy apostrophes in strings and dialogs 2014-04-14 13:55:50 -04:00
f79a300e76 Fix incorrect ID in 2str dialogs 2014-04-14 13:55:49 -04:00
68c8ef7ba7 Import the TinyXML dependency into the repository 2014-04-14 13:52:03 -04:00
57abf3ab68 Make the XML validation phase check against the schema, and fixed all the errors it found 2014-04-14 13:52:03 -04:00
1b72d25d52 Replace DialogXML DTD with an XSD schema 2014-04-14 13:52:03 -04:00
c413d292a9 Tear out most of the legacy code in the game - see below for details
(PC Editor and Scenario Editor are unaffected by this commit.)

Things removed:
- All references to Carbon and QuickDraw are gone.
- No more Resource Manager; the game no longer relies on old resource files at all
- The old dialog framework (from dlogtool.c, functions usually prefixed with cd_) is no longer used.
- Files that weren't being compiled
- Boost libraries that are now in the C++ library (function, shared_ptr)
- Obsolete build settings

Replacement dependencies:
- Boost Filesystem replaces references to things like FSSpec
- SFML replaces all the QuickDraw code and most window management
- Cocoa replaces AppleEvent management, menu management, and some window management
- I wrote a resource manager interface to mimick the important aspects of the behaviour of the Mac Resource Manager
- I had to rewrite some functions that QuickDraw provided natively, such as clipping regions; not all of these are tested

Things added:
- Every referenced dialog has been converted from a DITL resource into the new XML-based dialog format.
- All referenced STR# resources have been extracted into simple text files
- Now compiles against Mac OSX 10.7 SDK and libc++
- The first item in the Help menu opens the docs on Sylae's website
- It seems all the constants for soundtool vanished somewhere, so I added them back from the original Mac source

Other changes:
- Updated to XCode 4(?) project format
- Added the xcschemes created by XCode 4; I'm not sure how important these are, but they seem like they might be important
- Added document on converting dialogs to the XML format.
- Make string formatting mismatches into errors instead of warnings
- Disable error limit
- Graphics sheets that previously used masking now have alpha transparency
- Converted all graphics sheets to 8-bit PNG
- Trimmed white border from intro image
- Converted dialogs in the resource file have their resource name set to the name of the XML file of the converted version
- Referenced string resources in the resource file have their resource name set to the name of the text file of the extracted version
- Add the black-and-white patterns from the PAT resources to the pixpats.png; at least one of them is used somewhere in the game
- Recreated the menu.xib as a Cocoa xib file instead of a Carbon xib file
- Disable GNU C++ extensions; maybe this'll make it easier to compile with cl.exe later
- Add marks to the enormous handle_action function to make it easier to navigate\
- A build step to validate the XML dialogs using xmllint (doesn't quite work properly yet but does at least catch dialogs that are not well-formed)- Fix a lot of warnings about assigning string constants to non-const char pointers
- Fixed the file and application icons (which had somehow become corrupted at some point)
- Lots of additional functions in the custom location and rectangle classes, including implicit conversion to and from SFML rects and vectors; also they now store coordinates as int instead of char
- A new enum for encounter note types
- Much tweaking of the encounter note recording mechanisms
- To ease porting, I added a simple function that converts from classic Mac ticks (about 1/60 of a second) to the SFML time type
- Python script to convert STR# resources to txt files, replacing newlines with vertical bars
- Extracted the Mac font (Dungeon Bold) from the resource file and also added the Windows font (MaidenWord)

XML Dialog Framework changes:
- Remove the static initialization object in favour of manually calling cDialog::init()
- {set,get}Format() no longer used for colour; there's a dedicated {set,get}Colour() instead
- draw() methods unprotected in the control classes so that controls can be drawn in the main window
- There's no longer a friend relationship between the dialogs and the controls
- Fixed buttons duplicating the "depressed" boolean
- Buttons now properly offset the label for tiny and push buttons, and for LEDs
- Buttons no longer assume that either none or both of "width" and "height" are given in the XML
- Add {get,set}BtnType() to cButton
- cLedGroup now overrides handleClick(), which has also been made virtual; this was necessary for LEDs within a group to properly hilite while being clicked
- Add addChoice() to cLedGroup to insert additional LED choices
- Moved the key enums and cKey to a separate file
- Add a method to get a control's attached key
- Add methods to get and set a control's rect and position
- Controls can now directly take a window as a parent rather than a dialog
- Add addLabelFor() method to cDialog which adds a static text control as a label for another control
- Remove hack for storing a dialog result of arbitrary type in favour of boost::any
- Add method to get default text colour for a dialog
- Add method to get a dialog's rect
- Add method to add the same event handler to multiple controls in a dialog
- Add concept of default button to dialogs
- Add enum for text field type (currently either number or text)
- Implement the text field without use of native controls, including somewhat decent text input and a flashing insertion point
- cPict no longer stores references to every sheet; it fetches them as needed from the resource manager
- The many draw functions in cPict are no longer static, since they need to access the window containing the pict (before they could only be static due to QuickDraw's global state)
- Add setPict() without a type argument to change the graphic without changing the type, which is a common operation
- Add a scrollbar control; the specifics aren't implemented yet
- Change signature of the record callback for cStrDlog; it will no longer be passed the strings
- Publicize the no-button constructor of cChoiceDlog; it'll assume "okay" is the only button
- Add operator-> to cPictChoice for accessing the underlying dialog
- Add constructor to cPictChoice that takes a starting and ending pic num
- Remove err parameter from giveError
- Many more keys handled, plus support for catching copy, paste, cut, and select all keyboard shortcuts
- Text input fields take priority, overriding any other keyboard shortcuts in the dialog, but they never catch help (F1), escape, or enter
- Some changes to the format itself:
-> keys go in the "def-key" attribute, but modifiers go in "key-mod"
-> "clickable" is no longer a recognized attribute
-> "title" is now a recognized text size (18pt, even larger than "large" at 12pt)
-> "defbtn" attribute on the root element
2014-04-14 13:52:01 -04:00