Single-player difficulty selection was implemented in a very hacky way.
Documents what's going on there and fixes a memory leak.
Memory leaks that this fixes looked like this:
```
Direct leak of 64 byte(s) in 1 object(s) allocated from:
#0 0x7f435b789f17 in operator new(unsigned long) (/lib/x86_64-linux-gnu/libasan.so.6+0xb1f17)
#1 0x5567766c62b8 in dvl::selgame_GameSelection_Select(int) ../SourceX/DiabloUI/selgame.cpp:163
#2 0x5567766d8ee8 in dvl::selhero_Load_Select(int) ../SourceX/DiabloUI/selhero.cpp:464
#3 0x5567766d6ed1 in dvl::selhero_List_Select(int) ../SourceX/DiabloUI/selhero.cpp:325
#4 0x556776692683 in dvl::UiFocusNavigationSelect() ../SourceX/DiabloUI/diabloui.cpp:396
#5 0x55677669158e in HandleMenuAction ../SourceX/DiabloUI/diabloui.cpp:223
#6 0x5567766917b9 in dvl::UiFocusNavigation(SDL_Event*) ../SourceX/DiabloUI/diabloui.cpp:277
#7 0x556776695dff in dvl::UiPollAndRender() ../SourceX/DiabloUI/diabloui.cpp:626
#8 0x5567766d94ef in UiSelHeroDialog ../SourceX/DiabloUI/selhero.cpp:512
#9 0x5567766d997f in dvl::UiSelHeroSingDialog(int (*)(int (*)(dvl::_uiheroinfo*)), int (*)(dvl::_uiheroinfo*), int (*)(dvl::_uiheroinfo*), void (*)(unsigned int, dvl::_uidefaultstats*), int*, char (*) [16], int*) ../SourceX/DiabloUI/selhero.cpp:547
#10 0x556776a44f45 in mainmenu_select_hero_dialog ../Source/mainmenu.cpp:98
#11 0x5567765f9f15 in SNetInitializeProvider ../SourceX/storm/storm_net.cpp:102
#12 0x556776c996b9 in multi_init_single ../Source/multi.cpp:826
#13 0x556776c98b1e in NetInit ../Source/multi.cpp:770
#14 0x5567767d0c0b in StartGame ../Source/diablo.cpp:375
#15 0x556776a4493d in mainmenu_init_menu ../Source/mainmenu.cpp:45
#16 0x556776a44c05 in mainmenu_single_player ../Source/mainmenu.cpp:61
#17 0x556776a454a9 in mainmenu_loop ../Source/mainmenu.cpp:152
#18 0x5567767d2892 in DiabloMain ../Source/diablo.cpp:602
#19 0x5567766e3c69 in main ../SourceX/main.cpp:34
#20 0x7f435a69ecb1 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28cb1)
```
This fixes the following issues:
- Missing text shadows
- Missing button graphics
- White boarder
- Not responding to controller input
- Button not giving visual feedback
- Clicking anywhere cancles
The original version of this had a min/max range, so `SelectedItem` could be compared to `m_value`
With the recent changes, `SelectedItem` now refers to an index in the array.
This unfortunately means the function that draws the list must now know about the potential existence of the scrollbar and consider its `ListOffset` into account.
Fixes#1006
The game will now autodetect if it should run in shareware mode or full
retail based on the found mpq file. Additionally it can beforced in the
shareware mode with --spawn even if the retail data is found.
This simplifies a lot of the spagetty code and lets us better refactor,
also worth noteing is that we won't have to setup a secound set of build
tests.
Still missing is the support screen (functionally identical to the
credit screen)
This also fixes a long standing issue with the menu code where it would
some times return the index and some times the value of the selected
menu item. It now always returns the index and reciver must look up the
value.
Text mode is on by default. Calling SDL_StartTextInput() will start the
virual keyboard, but does not allow for a default value. Calling it as
well as switch_start_text_input() will start the keyboard a secound
time.
We still turn TextInput off on other platforms when it's not needed as
it can require additional resources.
Text mode is on by default. Calling SDL_StartTextInput() will start the
virual keyboard, but does not allow for a default value. Calling it as
well as switch_start_text_input() will start the keyboard a secound
time.
We still turn TextInput off on other platforms when it's not needed as
it can require additional resources.