summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/macro.cc
Commit message (Collapse)AuthorAgeFilesLines
* Add pseudocommand CMD_NO_CMD_DEFAULT for overriding the vi keys.Johanna Ploog2010-01-161-4/+3
| | | | | | | | CMD_NO_CMD is handled specially in many different ways, but the new command's sole purpose is to allow key bindings involving invalid commands, so as to override the vi keys for players who don't need them, don't want to replace them with other keys, but are worried about typos making their character walk into a fatal ambush.
* Use the dynamic command key names for some commands on the help screen.Johanna Ploog2010-01-151-2/+2
| | | | | | | | | More to follow! :) It appears the command screen has been optimized for space. Whereever possible, the key has been capitalized in the description, and often alternative keys are mentioned. All of that may not apply for reassigned keys. What do we do about this?
* New method _command_to_string() returning human-readable key names.Johanna Ploog2010-01-151-0/+88
| | | | | | | | | | | | | | | The plan is to replace the hardcoded command key names on the help screen and in the tutorial with these dynamic ones respecting redefined keys. Unfortunately, several commands have multiple assignments and macro.cc's command_to_key() only returns the last one, which might not be what the player is actually using. For example, I don't have a Numpad, so all mentions of it are of no use to me, and I'd rather have the vi keys listed, which in turn many other players have no interest in. You can check the current key assignments if you comment out the DEBUG_DUMP_COMMANDS definition in chardump.cc and then create a character dump. This will be removed once I'm finished here.
* New class pause_all_key_recordersMatthew Cline2009-11-221-0/+15
| | | | | | If declared on the stack, it will pause all key recorders as soon as declared, then return them to their previous pausing state when it goes out of scope.
* Add formatting fixes.David Lawrence Ramsey2009-11-211-4/+4
| | | | This mostly puts && and || on the proper lines, per the style guide.
* Remove trailing whitespace.David Lawrence Ramsey2009-11-201-1/+1
|
* macro_buf_add_cmd() to add commands to key bufferMatthew Cline2009-11-181-4/+16
| | | | | | Commands (command_type) are now added to the keypress buffer as negative numbers, which should hopefully take care of the problem with arrow keys not working.
* Key press buffer can hold raw commandsMatthew Cline2009-11-181-0/+31
| | | | | | Raw commands (command_type enumerations) can be added to the key press buffer with macro_buf_add(), and key_to_command() will return them unaltered. This is useful for commands which have no key bidnings.
* Split game_options from externs.h into options.h.Robert Vollmert2009-11-041-0/+1
|
* versioning: remove SVN-specific revision data, add Git versioningSteven Noonan2009-10-181-1/+0
| | | | Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* Remove a lot of unneccessary includes.Robert Vollmert2009-10-091-1/+0
| | | | | | | The console version still compiles on Linux; both console and tiles version compile in OS X. I haven't been able to test the DOS and Windows compiles -- please fix or tell me about any errors that show up.
* Drop obsolete CVS last-committed headers ($Author$).Adam Borowski2009-10-061-2/+0
|
* Add more spelling fixes.David Lawrence Ramsey2009-09-241-9/+9
|
* Add spelling fixes.David Lawrence Ramsey2009-09-231-3/+3
|
* Reimplementing playing with dolls ('-' command). Keys are mostly the same ↵ennewalker2009-08-181-0/+5
| | | | | | | | | | | | | | as the 0.4 version and are documented. Dolls are no longer limited in what features they can force, so your character can always look like a flaming centaur with wings if that's how you want to present yourself. This shouldn't cause any major breakage with save games or dolls.txt files, although expect some weirdness. Sorry. Also, fixed a bug where barding wasn't appearing on nagas or centaurs. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10568 c06c8d41-db1a-0410-9941-cceddc491573
* Apply my previous two commits to trunk.j-p-e-g2009-07-231-16/+10
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10390 c06c8d41-db1a-0410-9941-cceddc491573
* Another step on the way to player doll customization. Including somej-p-e-g2009-06-181-21/+0
| | | | | | | | predefined doll settings in dolls.txt, so players can actually use this. TODO: Save choice back into file. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9999 c06c8d41-db1a-0410-9941-cceddc491573
* * More steps on the path to reintroducing player doll customization.j-p-e-g2009-06-171-1/+13
| | | | | | | Also apply my two previous commits to trunk. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9995 c06c8d41-db1a-0410-9941-cceddc491573
* Add minor cosmetic fixes.dolorous2009-05-081-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9753 c06c8d41-db1a-0410-9941-cceddc491573
* * Fix 2744875 (mutation screen assert).j-p-e-g2009-04-111-36/+36
| | | | | | | | | | * Rename KeymapContext KC_* -> KMC_* to avoid overlap with kill_category KC_*. * Increase odds for chaos brands mimicking brands that hurt the defender. * Tweak chaos_affects_attacker(). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9595 c06c8d41-db1a-0410-9941-cceddc491573
* Call flush_prev_message() before getch(), cancelable_get_line() andj-p-e-g2009-02-281-0/+1
| | | | | | | mpr_formatted_output(). Fixes 2647846. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9275 c06c8d41-db1a-0410-9941-cceddc491573
* Give a message when you don't succeed in writing a macro file.haranp2009-02-081-2/+8
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8977 c06c8d41-db1a-0410-9941-cceddc491573
* Adding REVISION() macro to all source files.ennewalker2009-01-041-0/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8217 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 2026005: macros being loaded in the wrong order.haranp2008-10-031-5/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7110 c06c8d41-db1a-0410-9941-cceddc491573
* Remove pre-Stone Soup change history from source files, and push it allj-p-e-g2008-09-141-6/+0
| | | | | | | | | | into a file crawlhistory.txt in docs/obsolete. I used a perl script to do this under the assumption that all these change logs used the same system following the keyword "Change History". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6930 c06c8d41-db1a-0410-9941-cceddc491573
* Adding back in a menu keymap context so (for example) numpad telnet users ↵ennewalker2008-09-061-1/+7
| | | | | | can map numpad enter to normal enter. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6876 c06c8d41-db1a-0410-9941-cceddc491573
* Apply Yelve Yakut's patch (2020369) to list monsters and items in view.j-p-e-g2008-08-021-1/+1
| | | | | | | | | | | | | | The command to do so is xx, and you can select an entry for more details, which will be the database description ('v') for items and the more detailed 'x' description for monsters, which I think is more useful. What's still needed is some kind of sorting by, I guess, difficulty for monsters and respecting sort_menus for the items. Also, the item listing is not terribly useful at the moment but surely soon someone will think of a way to change that. :) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6755 c06c8d41-db1a-0410-9941-cceddc491573
* Do "keypress -> command_type" via keybindings. Solves bug 2018200,zelgadis2008-07-171-0/+195
| | | | | | | | | | | | | | | | where you couldn't do macros with the old 3.4 keymap since the 3.4 keys were done via macros and macros can't recursively invoke macros. Has the little snag that it doesn't exactly reproduce the 3.4 "fire ammo" command since 3.4 automatically goes to the inventory list but 4.0 doesn't. TODO: * Get levelmap commands to use keybindings instead of hardcoded mappings. * Let function keys and alt keys be bound to commands. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6587 c06c8d41-db1a-0410-9941-cceddc491573
* Large tiles-related changes. Platform-specific rendering removed and ↵ennewalker2008-07-151-2/+0
| | | | | | replaced with SDL/OpenGL. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6550 c06c8d41-db1a-0410-9941-cceddc491573
* Save macro.txt and wininit.txt in the settings folder, both using thej-p-e-g2008-07-081-7/+4
| | | | | | | macro_dir option. We might want to rename said option. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6447 c06c8d41-db1a-0410-9941-cceddc491573
* For functions that return char*'s, don't return a c_str() of an dolorous2008-06-251-4/+4
| | | | | | | | | | | | | | | std::string, since as soon as the function returns, the std::string goes out of scope, and the c_str() becomes a dangling pointer, which usually points to the same area as before, but occasionally points to garbage. Instead, make them return std::string's, and call c_str() on the return value outside the functions. Among other things, this should fix [1999515]. Note that I've only fixed direct c_str() returns for now. There might be some indirect ones that I missed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6139 c06c8d41-db1a-0410-9941-cceddc491573
* [1909218] Fixing issue where keymaps were affecting menu choices done by ↵ennewalker2008-06-121-2/+4
| | | | | | | | | keyboard or through the tiles mouse interface. I couldn't think of any reason why keymaps should ever apply to menu selections (and certainly not the KC_DEFAULT map), so I added a new special keymap context called KC_NONE which doesn't apply keymaps to new input. This is used for all menus. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5739 c06c8d41-db1a-0410-9941-cceddc491573
* Another code cleanup.j-p-e-g2008-04-151-20/+29
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4244 c06c8d41-db1a-0410-9941-cceddc491573
* Another one of those pesky spacing changes.j-p-e-g2008-04-151-91/+91
| | | | | | | | One of these days Crawl *will* win the Cleanest Code Championship, just you wait... :p git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4242 c06c8d41-db1a-0410-9941-cceddc491573
* [1896152] Fixed infinite loops when repeating commands (the repeat buffer ↵dshaligram2008-03-311-19/+3
| | | | | | was seeing keys not intended for the command being repeated). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3975 c06c8d41-db1a-0410-9941-cceddc491573
* For 1909388: command key changespauldubois2008-03-101-5/+19
| | | | | | | | | | Added init.txt option additional_macro_file, which does what you expect. Macros are read after the player's macro.txt. Documented new option. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3565 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed macro bug reported on the antichri^W^W Windows Vista.dshaligram2008-01-121-29/+9
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3254 c06c8d41-db1a-0410-9941-cceddc491573
* Tiles!ennewalker2008-01-051-1/+5
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3194 c06c8d41-db1a-0410-9941-cceddc491573
* Attempt to fix [1850593] by reverting r3020, as getch_ck() acts dolorous2007-12-141-1/+1
| | | | | | | differently under Windows and Unix-line systems. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3063 c06c8d41-db1a-0410-9941-cceddc491573
* Use c_getch() instead of m_getch() in getch_mul(), as the translation dolorous2007-12-071-1/+1
| | | | | | | | | provided by c_getch() makes Ctrl-H act as expected on Unix-like terminals where Ctrl-H returns KEY_BACKSPACE, instead of producing the "Unknown command." message. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3020 c06c8d41-db1a-0410-9941-cceddc491573
* Input buffer needs to be flushed if the first iteration of commandzelgadis2007-09-191-1/+1
| | | | | | | | | | | repetition is canceled. Repetitions of searching and go-nowhere weren't being interrupted. Wasn't generating activity interrupts for AI_FULL_MP and AI_FULL_HP. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2150 c06c8d41-db1a-0410-9941-cceddc491573
* Added new commands "re-do previous command" (bound to `) and "repeatzelgadis2007-09-191-9/+184
| | | | | | | | | | next command" (bound to 0). Though this is just an interface change, it changes code in the core input processing function (input() in acr.cc), and also messes around with the input buffer, so it could probably do with more testing before merging it into the 0.3 branch. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2137 c06c8d41-db1a-0410-9941-cceddc491573
* Split off portions of externs.h and enum.h into other files. Thezelgadis2007-09-151-0/+1
| | | | | | | | | | | | | crawl_environment, player and monsters classes have been left in externs.h, which necessitates that all of the enums references by those classes stay in enums.h, since you can't forward declare an enum. However, it's a start. Also, portions of misc.{cc,h} have been split off into traps.{cc,h}, place.{cc,h} and terrain.{cc,h} git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2095 c06c8d41-db1a-0410-9941-cceddc491573
* 1622385: there is now a Confirm keymap context for yesno() andharanp2007-07-021-5/+14
| | | | | | | yesnoquit(). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1714 c06c8d41-db1a-0410-9941-cceddc491573
* Experimental mouse support for ncurses (enable with mouse_input=yes indshaligram2007-06-201-10/+7
| | | | | | .crawlrc). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1610 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed broken macros on Windows (Erik).dshaligram2007-06-091-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1565 c06c8d41-db1a-0410-9941-cceddc491573
* Flush macro input buffer when fire command fails (Erik).dshaligram2007-06-081-36/+117
| | | | | | | | | Allow using the special sequence \{!more} in macros to disable -more- prompts while processing the macro expansion. Fixed a couple of off-by-one errors in the level-map. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1557 c06c8d41-db1a-0410-9941-cceddc491573
* Allow Mac users to double-click to launch Crawl:dshaligram2007-05-041-1/+1
| | | | | | | | | - Use argv[0] to figure out where Crawl lives and where to find data files. The Mac Finder sets the working directory to / and the full path to the executable is available in argv[0] when the user double-clicks. - Converted some of the old char*s to std::string. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1407 c06c8d41-db1a-0410-9941-cceddc491573
* Cleaned up a lot of code which was using info[] to use mprf() directlyharanp2007-04-231-13/+8
| | | | | | | | | instead. Fixed a bug with affix_weapon_enchantment messaging (mea culpa.) Fixed shatter() messages getting surpressed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1347 c06c8d41-db1a-0410-9941-cceddc491573
* Tweaked to allow building without CLUA_BINDINGS, but allowingdshaligram2007-04-161-2/+0
| | | | | | Lua-conditionalised search patterns. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1320 c06c8d41-db1a-0410-9941-cceddc491573