Chris Taylor
48e9061960
Make the listbox handlers return a window_event_result
...
Make the listbox handlers and all sub-handlers (when_selected callbacks) return a window_event_result. Makes code more readable and removes one use of window_close, making it easier to inform event system if a window closes in future.
2016-10-27 15:22:41 +08:00
Kp
dca790584f
Remove non-ASCII characters in newmenu.h
...
Some parsing scripts react badly to finding byte sequences that are not
valid UTF8 characters.
2016-08-25 04:05:31 +00:00
Kp
cbeb42e48c
Flatten some newmenu type hierarchy
2016-08-06 19:55:24 +00:00
Kp
6b4e639f65
Flatten newmenu_subfunction_t type
2016-08-06 19:55:24 +00:00
Kp
c772385f81
Fix check_header_includes=1 Linux build
2016-08-06 19:55:24 +00:00
Kp
7128141c55
Use enum for newmenu item type
2016-08-05 04:12:21 +00:00
Kp
3f051100a5
Move newmenu_item text_len into union
2016-07-31 22:25:51 +00:00
Kp
f5c6b0fbf6
Move newmenu_item min_value into union
2016-07-31 22:25:50 +00:00
Kp
c9aba5b04e
Move newmenu_item max_value into union
2016-07-31 22:25:50 +00:00
Kp
344a567d1b
Move newmenu_item group into union
2016-07-31 22:25:50 +00:00
Kp
c636dc4b98
Convert various static const
expressions to constexpr
2016-07-16 16:52:04 +00:00
zico
e335cdacb3
Reverted 81d7db279b
and rather removed the terminator byte from string length in nm_set_item_input(). This also fixes possible 9 character length for pilot callsigns. Had to fix up COOL_SAYING_LEN as it was not considering the termintor but considering the original D2 source, this was a mess to begin with (def = 50, text string = 60, input field len = 45). Made score saying 50 characters as this seems to be the maximum witdth without overlapping.
2016-05-30 14:54:51 +02:00
Kp
7386094bc3
Rename menu macros to reduce token pasting
2016-01-09 16:38:17 +00:00
Kp
00e52d382e
Fix Win32 build
2015-12-11 03:39:40 +00:00
Kp
ed55763603
Remove unused symbols
2015-12-04 03:36:31 +00:00
Kp
a49fc821a0
Restrict listbox_get_window to _WIN32
2015-12-04 03:36:31 +00:00
Kp
a47c6e599d
Shrink menu_bit_wrapper_t when B is empty
2015-10-09 02:46:11 +00:00
Kp
78de0ac119
Add fwd-event.h with forward declarations of event.h
2015-10-09 02:46:10 +00:00
Kp
15fb75c1c7
Fix check_header_includes build
2015-07-25 23:10:45 +00:00
Kp
cb873563c8
Move reticle menu to macro
2015-05-14 02:23:13 +00:00
Kp
12ad357b8d
Move Wimp Menu to macro
2015-03-28 17:18:02 +00:00
Kp
e1ff8afc88
Use ntstring for newmenu_item saved_text
2015-03-12 02:21:21 +00:00
Kp
d1b60c2324
Pass uint_fast32_t for newmenu_* items
2015-03-12 02:21:21 +00:00
Kp
a84a05c701
Move graphics menu to macro
2015-03-07 17:20:41 +00:00
Kp
335780758b
Remove unused DXX_*_INPUT argument MAX_TEXT_LEN
2015-02-28 19:36:02 +00:00
Kp
4c8f3a47b5
Convert frequently used casts to C++ casts
2015-02-05 03:03:49 +00:00
Kp
c6664a45a6
Add newmenu_do helper for array<newmenu_item, N>
2015-01-18 01:58:32 +00:00
Kp
6e0464a58c
Pass nm_set_item_slider arg by &
2015-01-18 01:58:32 +00:00
Kp
54ab069bb8
Pass nm_set_item_number arg by &
2015-01-18 01:58:32 +00:00
Kp
426fb16654
Pass nm_set_item_radio arg by &
2015-01-18 01:58:31 +00:00
Kp
fa10e51999
Add helper nm_item_text
2015-01-18 01:58:31 +00:00
Kp
4705c3f2d8
Pass nm_set_item_checkbox arg by &
2015-01-18 01:58:31 +00:00
Kp
f8163957ef
Add helper nm_item_input
2015-01-18 01:58:31 +00:00
Kp
67e503b9b7
Add helper nm_item_menu
2015-01-18 01:58:31 +00:00
Kp
eb09eb4396
Refactor newmenu reordering
2015-01-17 18:31:41 +00:00
Kp
c7ae54c62a
Use ntstring for CMLevelMusicPath
2014-12-22 04:35:47 +00:00
Kp
1344fb2779
Fix crash choosing jukebox directory
...
newmenu_listbox1 returns immediately
2014-12-22 04:35:47 +00:00
Kp
7c76c68255
Make unused_newmenu_userdata_t const
2014-10-16 02:13:09 +00:00
Kp
a8f853aa7a
Pass d_event arg by const&
2014-10-04 22:36:13 +00:00
Kp
c1d184240d
Use unique_ptr to manage fonts
2014-07-22 23:48:23 +00:00
Kp
3946be044c
Replace newmenu template specializations with free functions
2014-07-16 03:21:04 +00:00
zico
ad7cb106bc
Changed custom D1X license to GPLv3
2014-06-01 19:55:23 +02:00
Kp
073f00974a
Eliminate uses of the typedef struct X { ... } X; pattern
...
C++ does not require this pattern.
import re, fileinput
to = re.compile(r'^typedef struct ([a-z_A-Z]+)\s*{')
tc = re.compile(r'^}(.*?)\s*([a-z_A-Z]+);$')
osn = None
for line in fileinput.input(inplace=True):
m = to.match(line)
if m:
osn = m.group(1)
print 'struct %s\n{' % osn
continue
if osn:
m = tc.match(line)
if m:
csn = m.group(2)
if osn == csn:
print '}%s;' % m.group(1)
osn = None
continue
else:
osn = None
print line,
2013-12-28 22:48:07 +00:00
Kp
65657c6809
Use nm_messagebox_str instead of nm_messagebox where possible
2013-12-17 04:03:34 +00:00
Kp
38a5c03d5d
Add type checking for newmenu_listbox
2013-12-17 03:58:17 +00:00
Kp
92e8cb7a31
Add type checking to newmenu subfunction userdata
2013-12-15 21:54:38 +00:00
Kp
3908215e73
Add type checking to nm_messagebox format string
2013-12-15 21:54:17 +00:00
Kp
5d306d06be
Switch endlevel message dialog not to use nm_messagebox1
2013-12-15 19:00:59 +00:00
Kp
3fb0ffa19b
Add typedef for newmenu subfunction
2013-12-15 18:57:54 +00:00
Kp
9de54cfa74
Switch to C++ linkage
...
import fileinput
guard = 0
cxxguard = '#ifdef __cplusplus\n'
for line in fileinput.input(inplace=True):
if line == cxxguard:
guard = 1
continue
if guard:
if line == 'extern "C" {\n':
guard = 2
continue
if line == '}\n':
guard = 0
continue
if guard == 2:
assert(line == '#endif\n')
guard = 0
print cxxguard,
continue
print line,
2013-12-06 03:35:32 +00:00