Commit Graph

908 Commits

Author SHA1 Message Date
nhmall
bfc46cbcdb Merge branch 'winX-comment-typo' of https://github.com/nikolas/NetHack into nikolas 2018-09-19 23:40:31 -04:00
Mak Kolybabi
60ea2874ed Fix other spelling issues. 2018-09-19 21:46:07 -05:00
nhmall
7123812327 try to coax an error code for display on tile_file failure
If the underlying error is that Windows LoadImage() just
wasn't happy with the format of the image file, you'll just
get a 0x0 result, which won't help much.

If, however, it shows a 0x2 result that means it couldn't
find the file to load it.
2018-09-17 15:46:47 -04:00
Pasi Kallinen
bd23a56f29 Update commented out perm_invent stuff 2018-09-15 11:29:13 +03:00
PatR
3eded06669 fix #H7156 - perm_invent
Bug report #H7156 listed three items, all relating to perm_invent:
1) it shouldn't persist across save/restore since restore might be
   on a system which doesn't have enough room to display it (report
   actually complained that config file setting was ignored when
   restoring old games, which is an expected side-effect for options
   that persist across save/restore);
2) permanent inventory wasn't updated when using scroll of charging;
3) attempts to update permanent inventory during restore could lead
   to crash if it tries to access shop cost for unpaid items.
Items (2) and (3) have already been fixed.  This fixes (1).

Replace 'flags.perm_invent' with a dummy flag, preserving save files
while removing it from flags.  Add 'iflags.perm_invent' to hold the
value of the perm_invent option.

The win32 files that are updated here haven't been tested.  Whichever
branch contains the curses interface needs to be updated; ditto for
any other pending/potential interfaces which support perm_invent.
2018-09-14 17:34:33 -07:00
nhmall
7d4a7a1f42 tty column placement of BL_HUNGER and BL_CAP could collide
Change the placement of the code that makes a replica of the
current status fields for later comparison.

A loop shortcut was causing it to be skipped under some
circumstances and that was negatively impacting the placement
of status field values that were further to the right.
2018-09-12 19:42:45 -04:00
Pasi Kallinen
b33b66aa29 Qt: Remember the tile and font size
The QT_TILEWIDTH and QT_TILEHEIGHT read from NetHack config file
override the remembered settings.
Also set the smallest tile size to 6x6
2018-09-12 18:43:10 +03:00
Ray Chason
c13eed7369 Qt4: Hide buttons not matching typed command
There are way too many buttons on the extended command window.
Let the user type a letter or two, and hide the buttons that don't
match.
2018-09-10 21:13:32 +03:00
Ray Chason
3479c471dd Qt on Win32: changes needed for Win32
* Fix an include directory
* Use strchr instead of index
* play_usersound conflicts with another function
2018-09-10 21:13:24 +03:00
Ray Chason
8dbaafbb7b Ignore Win32 build products 2018-09-10 21:13:10 +03:00
Pasi Kallinen
2ef07ad178 Qt4: Fix compile warning 2018-09-10 21:09:58 +03:00
nhmall
4be2467cc9 win32 gui bits
fix an index out-of-bounds
status hitpoint bar behavior at zero hp to match tty
2018-09-08 08:54:35 -04:00
nhmall
c00b698b4a hitpointbar bit for prior commit 2018-09-05 20:47:16 -04:00
nhmall
ec43a80e9e stop tty hitpointbar from jumping to 100% health at zero hit points 2018-09-05 20:21:59 -04:00
nhmall
878823ad8a another mswproc bit - remove enum values from comments 2018-09-03 08:52:16 -04:00
nhmall
ec2258ae70 mswproc.c bit 2018-09-03 08:49:47 -04:00
nhmall
a417d67572 status_update distinguish new BL_RESET from BL_FLUSH
This adds BL_RESET to status_update to send a flag to a window
port that every field should be updated because something has
happened in the core to make current values shown to be
untrustworthy or potentially obliterated.

That is now distinguished from BL_FLUSH, which now has no
bearing on whether every field needs to be redone, and instead
can be used by a window port indicator that it is time to render
any buffered status field changes to the display.

tty port now sets WC2_FLUSH_STATUS indicator for BL_FLUSH support
and now does one rendering per bot() call, instead of up to 22.

Side note: The tty hitpoint bar code was relying on the old
behavior of redrawing everything upon BL_FLUSH apparently, so it
initially had some color change lag issues, corrected by marking
BL_STATUS as dirty (in need of updating) in tty_status_update()
whenever BL_HP was marked as dirty.
2018-09-03 08:18:18 -04:00
nhmall
1462f69f54 reports on windows of partial status lines after level change
tty: turn off an optimization that is the suspected cause of Windows reported
	partial status lines following level changes. It was turned on for
        non-unix platforms only
2018-09-01 14:52:47 -04:00
nhmall
6311985d57 don't highlight the leading space before gold field on the status line 2018-05-21 09:35:38 -04:00
nhmall
2b66b5ecd1 bump version ID values 2018-05-16 23:06:44 -04:00
PatR
fa0a136b06 tty/wintty.c w/o TEXTCOLOR
With TEXTCOLOR disabled, compiler warnings about term_start_color()
and term_end_color() not being declared were followed by link failure
because they weren't available.

This tries to simplify color handling in the tty status code without
resorting to #if TEXTCOLOR (the proper fix, but somewhat intrusive).
For the usual case where TEXTCOLOR is defined, there were instances
of
  if (color != NO_COLOR && color != CLR_MAX)
    term_start_color();
  ...
  if (color != NO_COLOR)
    term_end_color();
and also of
  if (color != NO_COLOR)
    term_start_color();
  ...
  if (color != NO_COLOR)
    term_end_color();
I've changed both types to be
  if (color != NO_COLOR && color != CLR_MAX)
    term_start_color();
  ...
  if (color != NO_COLOR && color != CLR_MAX)
    term_end_color();
so that start/end pairing will always be consistent.

Also, ((color_and_attr & 0xFF00) >> 8) might not work as intended if
using 16-bit int and color_and_attr happened to have its sign bit set.
Change to ((color_and_attr >> 8) & 0x00FF) to ensure just the desired
bits.

Also also, a couple more formatting bits.
2018-05-15 17:09:47 -07:00
PatR
d752a4ad93 X11/winX.c w/o TEXTCOLOR
Avoid warnings when TEXTCOLOR isn't enabled.
2018-05-15 17:08:40 -07:00
nhmall
c2103b84db fix a couple of status items, gold highlighting and a boundary check
typo
gold highlighting
boundary check on tty_curs()
2018-05-15 09:03:35 -04:00
PatR
5586cca8b9 tty status
Started by removing two or three unused variables, ended up cleaning
up a lot of formatting (tabs, trailing spaces, indentation, a few
wide lines, 'if (test) return' on same line).  Marked some static
functions as static in their definitions instead of leaving it hidden
in their prototypes.  Moved a pair of short-circuit checks to skip
several initializations.
2018-05-15 04:16:40 -07:00
nhmall
80218a7855 boundary bit 2018-05-15 01:29:36 -04:00
nhmall
589bdb4e2d Merge branch 'win-tty-status' into win-minor 2018-05-15 00:26:26 -04:00
nhmall
26654ef079 a few cut-and-paste errors 2018-05-14 22:25:25 -04:00
nhmall
2e8b69d5ff some tty per field rendering and optimization 2018-05-14 21:13:37 -04:00
nhmall
860b9c35c1 testing build with STATUS_HILITES 2018-05-13 21:24:14 -04:00
Bart House
0afd2570cb Removing temporary debugging code and fixing compiler warnings. 2018-05-13 13:29:13 -07:00
nhmall
0d23e7b44d Merge branch 'tty-status' into win-tty-status 2018-05-13 15:21:46 -04:00
nhmall
3b2f7e86e0 more status updates
- prevent an overflow
- add make_things_fit()
2018-05-13 15:19:39 -04:00
Bart House
650d5230ec Fix memory leak. See bug 1169. 2018-05-12 19:45:16 -07:00
Bart House
1d31a49661 Some nttty.c clean-up. 2018-05-12 15:58:44 -07:00
nhmall
99474c864f Merge branch 'tty-status' into win-tty-status 2018-05-12 14:44:12 -04:00
nhmall
149fc5a4dd empty field suppression caught condition values unintentionally 2018-05-12 14:42:19 -04:00
nhmall
3598fcc929 more status handling updates
Suppress unneeded spaces from a couple of fields
	BL_LEVELDESC	- trailing spaces.
	BL_CAP		- it only contains a space
2018-05-12 14:10:52 -04:00
nhmall
9a87064cca some build fixes for compile issues reported 2018-05-12 06:57:34 -04:00
nhmall
ba057ef3de condition shrinkage when required 2018-05-12 02:18:42 -04:00
nhmall
a3ba46d732 remove some debug code 2018-05-12 01:10:43 -04:00
nhmall
dd04f5fcb5 more tty-status updates 2018-05-12 01:04:57 -04:00
nhmall
8c2dc7bb1c add some logging to debug 2018-05-10 18:48:02 -04:00
nhmall
1a19e449c7 Revert "some cross platform testing"
This reverts commit 3d1e086648.
2018-05-09 18:51:49 -04:00
nhmall
4dd535cbd2 cross platform testing 2018-05-09 18:47:19 -04:00
nhmall
3d1e086648 some cross platform testing 2018-05-09 18:31:18 -04:00
nhmall
778c8a56ab remove a commented out code line 2018-05-09 13:25:46 -04:00
nhmall
9bca6ecb8e tty status updates
some status code cleanup

It should be ready to merge tty-status changes into NetHack-3.6.0.
2018-05-09 13:12:11 -04:00
Bart House
f7e665be98 Fix for bug H7132.
In nethackw, there can be conflicts between menu accelerators and an extra
choice accelerator.  For example, when engraving the using fingers options
conflicts with the unselect all menu accelerator.  The extra choice
accelerator should take precedence.
2018-05-08 07:25:24 -07:00
nhmall
b524c26da5 intermediate update to wintty.c as work continues 2018-05-07 18:52:50 -04:00
nhmall
71bead4e39 do some performance optimizations on highlighting of tty status 2018-05-05 19:43:10 -04:00