CleverRaven/Cataclysm-DDA — pull request #8973 by BevapDin (2014-09-13 16:55:44+00:00)
Title: Many small display fixes

Fixes a display bug (only with option MENU_SCROLL = true) in the construction menu (might need a smaller window, the construction list must show a scrollbar for this to be visible):

- Open the construction list, show all constructions, include unavailable ones. The list should show a scrollbar.
- Select the last entry.
- Switch to the next tab (press right arrow)
- The list should now be empty, but a description for a construction is shown, and scrolling the constructions changes the description as if actually selecting different constructions.

The replaced code in construction.cpp did not handle the situation when the scroll offset was > 0 and the number of items to show is less than the number of usable lines. It would leave the scroll offset as it is and that means the few items in the list are scrolled out of the view. The function `calcStartPos` handles this case.

The exact same code was present in ui.cpp, it had the same flaw and has been replaced, too.

----

In the overmap view: the game displays (in the top left corner) either the note text or the npcs or the name of the tracked vehicle, but if several of those things are present, only the first one is shown.

So if a npc moves onto the location of a tracked vehicle, that vehicle name would not be shown (only the npcs name), similar if a npc moves onto a location with a note, the note text will be shown, but not the npc name. Also the name length calculation for npcs did not consider UTF-8 at all.

I moved all three things into one box, so it displays the note, npcs and tracked vehicles at once.

----

Special game mods (defense/tutorial) change some properties of the items/monsters/recipes/constructions. The old values of those properties are stored and are restored when the game finishes. This is pointless because all data is (re)loaded upon starting a new game anyway - so there is no need to restore the old values.

I removed storing the old values and resetting it at the end of a game mode.

----

Fixes #8563 (long mod names were wrapped in the mod selection window) - I hope `utf8_truncate` is the function kevingranade had in mind.

----

Fixes the first part of #8508 (long option names and long option values wrap onto next line), again using `utf8_truncate`.

----

Fixes #8507:

Some dimwit broke this with 6f03b0ad60322d674206ff35f5f07a464706ab16. When the defense style is EASY (the default!), some members of the class would not be initialized (neither in the constructor, nor in the `defense_game::init_to_style` function). I moved the case statement so it initializes the members with the same data as for the custom style.

----

Removed the rule in the Makefile to generate SDLMain.o from SDLMain.m, which has been remove by 2bd95404f0654d72d8f93bed883020cfa7dced1b.

----

And fixes #8970 - redraw all the things when the player had visited the help screen, add the proper description to the key bindings:
- '+' and '-' are used to move the mods up/down in the list of selected mods.
- CONFIRM (enter key) is used to activate or deactivate the mod (depending on which list is active).
Long mod names are already reported as #8563 and fixed.

----

Everything only checked with the linux curses build.