Commit Graph

143 Commits

Author SHA1 Message Date
Peter Nelson
1180c95372 Codechange: Add parameters to change range of slider widget. 2022-11-12 18:28:39 +00:00
Peter Nelson
d35f1d3d06 Codechange: Rename slider widget functions to be less specific. 2022-11-12 18:28:39 +00:00
Peter Nelson
b6ed595176 Codechange: Prefer suggested widget padding. 2022-11-12 18:28:39 +00:00
Peter Nelson
6f95e04005 Change: Use Rect helpers for widget drawing.
This replaces repetitive and sometimes unwieldy use of constants.
2022-11-12 18:28:39 +00:00
Jonathan G Rennison
0fae0599b7 Fix: Data race on effect volume setting with mixer thread 2022-11-11 23:48:24 +01:00
PeterN
0bac74ec2b
Fix #10038: Missing upper bounds check when loading custom playlists (#10039) 2022-09-21 08:31:59 +01:00
Peter Nelson
8321ef0061 Codechange: Set specific widgets dirty instead of window. 2021-05-08 09:52:54 +01:00
rubidium42
6bca9e090d Codechange: add SetDParamStr that accepts std::string& 2021-05-06 21:45:36 +02:00
Niels Martin Hansen
785e42a6f9 Feature: Volume sliders in Game Options window 2021-04-09 12:18:52 +02:00
Niels Martin Hansen
88c92f7b7c Codechange: Move volume control slider logic to separate functions 2021-04-09 12:18:52 +02:00
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Michael Lutz
a49fdb7ebb Codechange: Store base set related texts in std::strings. 2020-05-21 20:02:34 +02:00
Milek7
a411ce18c9 Fix: avoid using string pointer after scope end 2020-01-12 15:20:08 +01:00
Niels Martin Hansen
f02b643a44 Change: Show volume sliders with wedges instead of boxy slider 2020-01-07 18:13:58 +01:00
S. D. Cloudt
13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Michael Lutz
c7b9987d08 Codechange: Switch DropDownList to directly use std::vector, thus making AutoDeleteSmallVector obsolete.
DropDownListItem are strongly managed using std::unique_ptr to ensure leak-free handling. Appropriate use
of move-semantics make intent a lot clearer than parameter comments and allows the compiler to generate
copy-free code for most situations.
2019-04-09 22:45:15 +02:00
peter1138
317f69c152 Codechange: Use override specifier in Window-derived classes. 2019-03-24 16:10:04 +01:00
Peter Nelson
6dfe36b5cd Change: Make volume slider widget capture mouse when clicked.
This makes the slider continue to respond even when mouse cursor
is no longer over the widget.
2019-02-21 08:11:35 +00:00
Niels Martin Hansen
c618a7c093 Fix 6298b96: Changing music set did not save new setting 2018-11-25 00:47:56 +01:00
Charles Pigott
52ed3bcbaa Remove: A few bits of dead code 2018-10-31 12:41:49 +01:00
Niels Martin Hansen
336d6cab68 Fix 6298b96: Playlist window not drawing playlist
Copy-paste error in change to remove C++11 usage...
2018-06-25 00:00:56 +02:00
Niels Martin Hansen
6298b96571 Change: Modernise music control logic implementation (#6839)
Rewrite of almost the entire music control logic to a more modern style, hopefully also easier to understand. The old playlist handling made it look like arcane magic, which it doesn't have to be.

- Playlists are now stored in std::vector of objects instead of arrays of bytes with magic sentinel values, that need to be rotated around all the time. Position in playlist is stored as a simple index.
- The theme song is now reserved for the title screen, it doesn't play on any of the standard playlists, but is still available for use on custom playlists.
- When the player enters/leaves the game from the main menu, the music always restarts.
- Playback state (playing or not) is kept even if music becomes unavailable due to an empty playlist (or an empty music set), so it can restart immediately if music becomes available again.
- The shuffle algorithm was changed to a standard Fisher-Yates.
- Possibly better behavior when editing a custom playlist while it's playing.
- Custom playlists should be compatible.
- Framework for supporting custom playlists with songs from multiple music sets.
2018-06-24 20:06:05 +02:00
Niels Martin Hansen
a1b7812c7e Change: Improved looping of title song 2018-06-15 23:09:17 +02:00
Niels Martin Hansen
f946b3da56 Codechange: Pass a MusicSongInfo struct instead of bare filename to music drivers.
Preparation for later extending the info passed to music drivers.
2018-06-05 22:58:35 +02:00
Niels Martin Hansen
19f5a6cbb0 Feature #6090: Change music set during gameplay 2018-04-29 19:26:05 +02:00
Niels Martin Hansen
430e20f7e4 Fix: Clipping issues with volume sliders in Music GUI
Tested with various languages and GUI font sizes, should look good everywhere.

Also clamps near-end values to minimum and maximum so 0 and 127 are possible to achieve even on small GUI sizes (like the default.)
2018-04-29 19:26:05 +02:00
Niels Martin Hansen
bb809e35ce Change: Less intrusive "no music" message from Music window 2018-04-29 19:26:05 +02:00
Niels Martin Hansen
e172794947 Change: Disable music control buttons when there is no music 2018-04-29 19:26:05 +02:00
Niels Martin Hansen
76cccc64c9 Codechange: Music GUI comments and function naming 2018-04-29 19:26:05 +02:00
rubidium
771dcf3b7b (svn r27003) -Cleanup: fix the use of spaces and asterices "around" some comments 2014-10-12 18:41:53 +00:00
rubidium
4438821b80 (svn r26809) -Fix: do not dereference the -1 index of the file names array of music files. It definitely breaks on m68k, and might cause failures on other platforms as well 2014-09-10 16:33:42 +00:00
rubidium
b476086c39 (svn r26538) -Codechange: remove double accounting of the drivers 2014-04-28 21:06:51 +00:00
rubidium
21f991e235 (svn r26489) -Codechange: properly account for the end of buffers in the file io code instead of assuming MAX_PATH is okay 2014-04-23 21:23:21 +00:00
rubidium
0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
planetmaker
247feca247 (svn r25776) -Add [FS#5743]: Sticky and shade buttons for jukebox window (retro) 2013-09-15 15:56:46 +00:00
frosch
8157a8afd8 (svn r25290) -Add: Assign string names to notable windows. 2013-05-26 19:25:01 +00:00
frosch
56e4a8c4d6 (svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction. 2013-05-26 19:23:42 +00:00
frosch
03736af2ae (svn r24700) -Cleanup: Remove WDF_UNCLICK_BUTTONS and make it the default. 2012-11-11 16:10:43 +00:00
truebrain
e2d8abeec5 (svn r23544) -Codechange: document and rename widgets to be consistent and understandable 2011-12-16 18:02:27 +00:00
truebrain
2aa774e831 (svn r23528) -Codechange: move widget enums to widgets/NNN_type.h 2011-12-15 22:22:55 +00:00
rubidium
58423b26d1 (svn r23474) -Codechange: move the declaration error related functions to error.h 2011-12-10 13:54:10 +00:00
glx
634796b860 (svn r23430) -Fix (r23219): also consider the old directories when playing a song 2011-12-04 14:17:51 +00:00
rubidium
2b897b4fa0 (svn r23219) -Change: different directories for basesets and newgrfs. So data to baseset or newgrf, and gm to baseset 2011-11-14 21:34:27 +00:00
rubidium
99ed5eb7c5 (svn r23035) -Fix (r23034): compile failure 2011-10-16 19:59:07 +00:00
rubidium
0656660f22 (svn r23034) -Fix: make sure the custom playlists are 0 terminated 2011-10-16 19:56:47 +00:00
rubidium
f04746a9ff (svn r23033) -Fix [FS#4776]: the last custom playlist items went lost when the files in the .obm are not contiguous 2011-10-16 19:53:02 +00:00
planetmaker
ba7611ed13 (svn r22694) -Cleanup [FS#4579]: Remove unused but confusing widget 2011-07-30 07:38:38 +00:00
frosch
5e449b8fae (svn r22429) -Add: some constants for specific palette colours used in the GUI. 2011-05-06 21:13:29 +00:00
frosch
22286bd7b6 (svn r22421) -Fix: Replace various references to Windows palette greyscale indices with the DOS palette indices. 2011-05-04 17:45:16 +00:00
frosch
ec9540a12a (svn r22241) -Codechange: Add additional to-be-used parameter to OnInvalidateData(). 2011-03-13 21:31:29 +00:00