Commit graph

248 commits

Author SHA1 Message Date
Christoph Oelckers
2a5b26c27c - removed native option menu controls. Note that this commit will not compile! 2017-02-11 21:28:48 +01:00
Christoph Oelckers
fc4e1ffcdf - separated the savegame menu code into an internal class managing the savegame data and the actual menu.
The manager class cannot be scriptified because it provides the internal implementation which may change at some point in the future. It also encapsulates all access to the file level because if that part is not protected, modders could write malware mods.
2017-02-11 17:20:12 +01:00
Christoph Oelckers
947b625c50 - all menu items scriptified, but not yet active. 2017-02-11 16:11:48 +01:00
Christoph Oelckers
f91d91d6e8 - all optionmenu items scriptified, but not integrated yet. 2017-02-11 00:36:53 +01:00
Christoph Oelckers
65174af544 - moved the backdrop for the player box into the texture manager so that the menu doesn't have to bother with managing the texture itself. 2017-02-10 14:07:21 +01:00
Christoph Oelckers
8c780ab7ff - exported the drawer function of the colorpicker menu. 2017-02-10 13:21:35 +01:00
alexey.lysiuk
04e2b3be4a Fixed compilation with GCC/Clang
No more 'enumeration previously declared with fixed underlying type' error
2017-02-10 13:34:28 +02:00
Christoph Oelckers
be9b2b38fc - ColorpickerMenu.MouseEvent exported. 2017-02-10 11:44:46 +01:00
Christoph Oelckers
07ba75762b - the first menu function has been scriptified. 2017-02-10 00:25:50 +01:00
Christoph Oelckers
7efa9cd70d - made the menu descriptors garbage collectable and started exporting some fields as preparation for script work on the menu. 2017-02-09 20:18:53 +01:00
Christoph Oelckers
17a2666bd4 - moved DisplayName, the last remaining PlayerPawn meta property, to PClassActor so that PClassPlayerPawn could be removed.
Now all actors have the same metaclass and therefore it will always be the same size which will finally allow some needed changes to the type system which couldn't be done because it was occasionally necessary to replace tentatively created classes due to size mismatches.
2017-02-08 19:42:24 +01:00
Christoph Oelckers
68e9918ed5 - moved player color sets and pain flashes into global variables.
There's simply never enough of them and they are used far too infrequently to justify the hassle of tagging along two TMaps per class.
For what they provide, single global lists that handle all player classes at once are fully sufficient.
2017-02-08 19:10:11 +01:00
Christoph Oelckers
2ca0e34785 - turned many of PClassPlayerPawn's strings into names and moved all scalar properties into APlayerPawn.
The goal is to get rid of PClassPlayerPawn and PClassInventory so that the old assumption that all actor class descriptors have the same size can be restored
This is important to remove some code that seriously blocks optimization of the type table because that can only be done if types do not need to be replaced.
2017-02-08 16:42:13 +01:00
Christoph Oelckers
5cfac78116 - added write barriers to the menu code.
The GC was causing some crash issues with the items not having been subjected to a write barrier.
2017-02-05 01:52:09 +01:00
Christoph Oelckers
470dc138c6 - got rid of all DTA_Translation uses. 2017-02-05 00:17:29 +01:00
Christoph Oelckers
dadc8e2ec2 - removed all uses of DTA_Translation except for the single one that passes a custom built table.
This means that with the exception of 3 pointers the DrawTexture interface only accepts numeric values now.
Still need to get rid of the last 3 to have this ready for scripting.
2017-02-04 23:26:28 +01:00
Christoph Oelckers
d3ed83942f - did some preparations to ParseDrawTextureTags to allow using the same code for parsing tag lists generated by the VM.
- removed the fixed point alpha tag from DrawTexture and replaced all uses with the floating point version.
2017-02-04 13:11:12 +01:00
Christoph Oelckers
d5b908186c - some work on the base classes for menus. None of this is being used yet. 2017-02-04 00:19:25 +01:00
Christoph Oelckers
d5962b290c - turned all menu items into actual objects.
This is needed for script export.
2017-02-03 21:35:42 +01:00
Christoph Oelckers
bc29f61bfd - set the default for menu mouse input to 'touchscreen-like' because there's too much hardware out there which doesn't play nice with mouse input events. 2017-02-01 11:25:28 +01:00
Christoph Oelckers
6d28aa3541 - do not use strtol for parsing critical values that can get large.
This function will truncate everything that is larger than LONG_MAX or smaller than LONG_MIN to fit into a long variable, but longs are 32 bit on Windows and 64 bit elsewhere, so to ensure consistency and the ability to parse larger values better use strtoll which does not truncate 32 bit values.
2017-02-01 11:19:55 +01:00
Christoph Oelckers
7b7623d2c4 - split DObject::Destroy into the main method, a native OnDestroy and a scripted OnDestroy method and made the main method non-virtual
This was done to ensure it can be properly overridden in scripts without causing problems when called during engine shutdown for the type and symbol objects the VM needs to work and to have the scripted version always run first.
Since the scripted OnDestroy method never calls the native version - the native one is run after the scripted one - this can be simply skipped over during shutdown.
2017-01-12 22:49:18 +01:00
alexey.lysiuk
bc492a0b7f Autoaim is now updated when adjusting slider with mouse
Fixes #208 Autoaim slider in Player Setup does not save if changed with cursor
2017-01-09 16:52:15 +02:00
Christoph Oelckers
cd7986b1b1 - refactored global sides array to be more VM friendly.
- moved FLevelLocals to its own header to resolve some circular include conflicts.
2017-01-08 18:46:17 +01:00
Christoph Oelckers
21e3aba1c7 - optionally allow passing a script position object to V_GetColor and subfunctions for better error output. Implemented this for all occurences where this info was available. 2016-12-03 16:27:53 +01:00
Christoph Oelckers
66d28a24b8 - disabled the scripted virtual function module after finding out that it only works if each single class that may serve as a parent for scripting is explicitly declared.
Needless to say, this is simply too volatile and would require constant active maintenance, not to mention a huge amount of work up front to get going.
It also hid a nasty problem with the Destroy method. Due to the way the garbage collector works, Destroy cannot be exposed to scripts as-is. It may be called from scripts but it may not be overridden from scripts because the garbage collector can call this function after all data needed for calling a scripted override has already been destroyed because if that data is also being collected there is no guarantee that proper order of destruction is observed. So for now Destroy is just a normal native method to scripted classes
2016-11-25 00:25:26 +01:00
Leonard2
7dbc4710f1 Add the new argument to all uses of the implement macro 2016-11-09 17:45:55 +01:00
Leonard2
bb2d61de50 Replaced the many implement macros with a single one that takes arguments instead 2016-11-09 17:45:53 +01:00
Leonard2
0b3585c83f Separate the pointer list from the implement macro 2016-11-09 17:45:52 +01:00
Christoph Oelckers
272dff6b8f Merge branch 'master' into zscript 2016-11-05 10:35:00 +01:00
Christoph Oelckers
7755a3525a - do not allow menu slider values very close to zero. They not only can produce a glitched number display but also some weird inconsistencies when operating a slider. 2016-11-04 11:17:22 +01:00
Christoph Oelckers
b1a83bfd26 - started with cleanup and separation of DECORATE code.
* everything related to scripting is now placed in a subdirectory 'scripting', which itself is separated into DECORATE, ZSCRIPT, the VM and code generation.
 * a few items have been moved to different headers so that the DECORATE parser definitions can mostly be kept local. The only exception at the moment is the flags interface on which 3 source files depend.
2016-10-12 19:22:33 +02:00
Marisa Heit
e3be6e4819 Fixed: The menu no longer refreshed the screen border 2016-09-27 18:58:09 -05:00
Christoph Oelckers
c17da32dbd - added object deserialization. It seems to work, at least the stuff I sampled looked like it was properly reatored and it triggers no error condition.
- always make the top level object randomaccess when opening a JSON file for reading. Some things won't work right if this is opened for sequential access.
2016-09-23 00:45:41 +02:00
Christoph Oelckers
d9dbf26f63 - do not list savegames for different IWADs. 2016-09-22 17:39:09 +02:00
Christoph Oelckers
88c27e2cc0 - allow the compact and pretty writers for JSON to coexist by wrapping the whole stuff into another class that calls the proper one as needed. Due to the implementation it is not possible to decide at run time how this should behave so there have to be two different objects for either mode.
- savegame code handles new format.
2016-09-21 21:57:24 +02:00
Christoph Oelckers
ac3c00883d - implemented saving of new format savegames as zips. The code for that was adapted from zipdir.c. 2016-09-21 17:37:56 +02:00
Christoph Oelckers
810ef8f775 - save global savegame data to JSON as well.
This is incomplete and untested, just a safety commit before going on.
2016-09-21 12:19:13 +02:00
Magnus Norddahl
48f491cfd1 Fix video mode selection bug 2016-09-15 07:52:53 +02:00
Christoph Oelckers
759753eadc - replaced more copystrings with FString. 2016-07-28 09:06:49 +02:00
Christoph Oelckers
66006a5c14 - use an FString to handle the new message. 2016-07-28 08:54:51 +02:00
yqco
58a6d7df1f Added optional prompt argument to MENUDEF's SafeCommand 2016-07-28 08:41:55 +02:00
alexey.lysiuk
8369833dc5 Fixed setting of custom color for static text in menu 2016-07-17 17:28:46 +02:00
Christoph Oelckers
c6fb35ed52 - added per-item colors for static text items in the menu.
For option menus this replaces the 'highlighted' parameter with an actual color, for list menus it adds a new parameter.
2016-06-30 10:27:14 +02:00
Christoph Oelckers
7642c2cdaa - fixed: Opening a non-existent menu left the engine in an invalid state. 2016-05-18 12:02:54 +02:00
Randy Heit
e96ed6bf8d Add FBaseCVar::GetHumanString()
- For most cvars, this is equivalent to calling GetGenericRep() to get a
  string.
- For float cvars, it uses %g instead of %H, because %H is generally more
  information than is needed.
2016-04-23 22:30:08 -05:00
nashmuhandes
a30eb4d709 Fixed a potential NULL assignment in FOptionMenuItemSafeCommand::Activate 2016-04-18 16:30:13 +02:00
nashmuhandes
6bfdd10a5c Show the command label when choosing a SafeCommand (like Reset2Defaults) in the menu. 2016-04-18 16:30:12 +02:00
Christoph Oelckers
c83ad9df6c - removed special treatment for not using stdint.h with MSVC. Current compiler versions have this file.
- removed use of finesine for creating the player backdrop for the menu display. This mostly uses the code from the old 2.0 floating point version but fixes some of the constants in there which were not correct.
2016-03-24 11:30:11 +01:00
Christoph Oelckers
4e60ea0252 - made AActor::alpha a floating point value
- replaced some uses of FRACUNIT with OPAQUE when it was about translucency.
- simplified some overly complicated translucency multiplications in the SBARINFO code.
2016-03-21 12:18:46 +01:00
Christoph Oelckers
ada5097e34 - converted scale variables in AActor, FMapThing and skin to float. 2016-03-20 12:13:00 +01:00
Michael Labbe
a28c8091fc UI support for 21:9
- Can specify aspect ratio 21:9 in video menu
 - menu_screenratios cvar can now force 21:9
2016-03-03 17:31:12 -06:00
Christoph Oelckers
74c326e9b2 - fixed: An option value with an invalid value type would eat all key events when being selected. 2016-03-03 10:52:56 +01:00
Christoph Oelckers
4d2b9fbe1b - don't freeze if the menu item search can't find anything selectable. 2016-03-03 10:47:11 +01:00
MaxED
81a5273b58 Added "Miscellaneous Options" -> "Save/Load confirmation" option (defaults to true). When disabled, confirmation dialog won't be shown when performing quicksave/quickload. 2016-03-03 09:59:26 +01:00
Randy Heit
55142078d8 Normalize line endings 2016-03-01 09:47:10 -06:00
Christoph Oelckers
6c37ab2310 - changed: If the IWAD contains a MENUDEF lump the one in zdoom.pk3 should not print texture warnings.
The reason is that in such a case it is very likely that the IWAD defines its own menu and will most likely not provide all assets for the base definitions. See 'Adventures of Square' for an example.
2016-02-29 10:45:14 +01:00
John Palomo Jr
92697659be Expose SafeCommand confirmation string to language. 2016-02-20 20:04:30 +01:00
John Palomo Jr
88f6157984 Fixed: Player color slider size/position was wrong when using language strings. 2016-02-09 02:49:28 -05:00
John Palomo Jr
0619245280 Fixed: ValueText didn't read language strings from OptionValues when using the third parameter. 2016-02-07 03:21:18 -05:00
Randy Heit
09a17c2198 Quiet some narrowing conversion warnings from VS2015 2016-02-05 22:18:53 -06:00
Christoph Oelckers
8da6483223 - fixed some places where FStrings were incorrectly used.
- replace all implicit conversions from FString to const char * in the header files (so that it can be test compiled with the implicit type conversion turned off without throwing thousands of identical errors.)
2016-02-05 10:40:45 +01:00
Randy Heit
b3b0886b64 Merge branch 'scripting'
Conflicts:
	src/actor.h
	src/g_doom/a_doomweaps.cpp
	src/g_hexen/a_blastradius.cpp
	src/p_enemy.cpp
	src/p_enemy.h
	src/thingdef/thingdef.h
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/constants.txt
2016-02-04 15:17:22 -06:00
Christoph Oelckers
afcd755c7a - changed autoaim menu option to a slider which allows a more precise control of the property.
- having a value of 5000 as the default for autoaim makes no sense, since this is an angle value that will always be clamped to [0..35]. So now 35 is both the default and the maximum.
2016-01-30 13:43:39 +01:00
rheit
f36bdc474d Merge pull request #421 from alexey-lysiuk/video_mode_menu
Fixed selection of empty items in Video Mode menu
2016-01-27 13:30:05 -06:00
Christoph Oelckers
0dabaca7df - added some range checks to PgUp(PgDown code for option menus. 2016-01-23 21:23:02 +01:00
Christoph Oelckers
bf747075e8 Merge branch 'master' into scripting
Conflicts:
	src/actor.h
	src/g_hexen/a_clericstaff.cpp
	src/p_enemy.cpp
	src/p_interaction.cpp
	src/p_local.h
	src/p_mobj.cpp
	src/thingdef/thingdef_codeptr.cpp
2016-01-17 20:57:55 +01:00
Christoph Oelckers
fbaab5044d Merge commit '38df0665e3a2018cf1d0028a36357df6c7e908e9' into scripting
Conflicts:
	src/d_dehacked.cpp
	src/decallib.cpp
	src/g_hexen/a_clericstaff.cpp
	src/p_interaction.cpp
	src/p_local.h
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/constants.txt
	wadsrc/static/actors/shared/inventory.txt
2016-01-17 19:50:34 +01:00
Christoph Oelckers
5207aa6cc0 Merge commit '125afcf3defb901e23bd44d32fa86681ef1748f6' into scripting
Conflicts:
	src/p_local.h
	src/p_mobj.cpp
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/shared/inventory.txt
2016-01-17 19:09:05 +01:00
Randy Heit
efaaccc030 Added $ check for language support for drawing Option Values 2016-01-07 12:59:16 -06:00
Randy Heit
cd4076dc1b Added $ check for language support for StaticTextSwitchable 2016-01-07 12:59:16 -06:00
Christoph Oelckers
888f356e58 - use the recently added text input menu item to add the config file for GUS, the patch set for Fluidsynth and the timidity.exe path for Timidity++ to the menu. Even though there is no proper file select box, this is still better than nothing.
- changed the text input item so that it realigns itself to show the entire text when in text input mode.
2015-11-28 12:43:01 +01:00
alexey.lysiuk
3e517ad4d0 Fixed selection of empty items in Video Mode menu
See http://forum.zdoom.org/viewtopic.php?t=49794
2015-10-24 11:58:57 +03:00
alexey.lysiuk
bad9961376 Fixed crash when clicking on back button in main menu
If menu item selection overlaps back button in main menu, clicking on back button with mouse caused a crash
See http://forum.zdoom.org/viewtopic.php?t=49711
2015-10-10 15:03:14 +03:00
alexey.lysiuk
99dd664029 Print warning to console if unknown texture found in menu definition 2015-10-07 12:13:11 +03:00
alexey.lysiuk
005e468fa9 Fixed crash when menu item uses non-existent texture
See http://forum.zdoom.org/viewtopic.php?t=49696
2015-10-07 12:11:27 +03:00
Edward Richardson
8ec4d431cf Fixed memory leak in joystick menu 2015-09-05 14:12:52 +12:00
Christoph Oelckers
3efbf6c74e - fixed: am_restorecolors did not work
This CCMD tried to access the current menu to decide which colors to reset but that is not available at all when this function gets called. It now uses the automap's own CVAR arrays.
2015-08-09 09:03:12 +02:00
Christoph Oelckers
7ba577e1b0 Merge branch 'master' into scripting
Conflicts:
	src/g_heretic/a_hereticweaps.cpp
	src/thingdef/thingdef_codeptr.cpp
2015-06-07 09:43:54 +02:00
Christoph Oelckers
65cc361e9b - added Zandronum's text input menu items. 2015-05-28 09:22:48 +02:00
Christoph Oelckers
2e0f999fea Merge branch 'master' into scripting
Conflicts:
	src/p_effect.cpp
	src/p_effect.h
	src/p_local.h
	src/p_map.cpp
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/actor.txt
	wadsrc/static/actors/shared/inventory.txt
	zdoom.vcproj
2015-04-28 14:45:13 +02:00
Christoph Oelckers
56989d3422 Merge commit 'ec5817869592660af6837b9f4e20ed140972a2b2' into scripting
Conflicts:
	src/p_enemy.cpp
	src/p_enemy.h
	wadsrc/static/actors/constants.txt

(Scripting branch update part 1)
2015-04-28 09:34:51 +02:00
Christoph Oelckers
aecff68a4d - cleanup of sound system startup and menu handling:
* added global functions that check whether FMod and OpenAL are present, without initializing the sound backend.
* make sound init code more fault tolerant. It will now try to switch between FMod and OpenAL if the currently active one cannot be found but the other one can.
* added 'ifoption' checks for sound backend to menu code.
* only show sound backends which are present and hide the options for the ones which are not.
2015-04-26 12:13:21 +02:00
Christoph Oelckers
1f2a431d15 Merge branch 'master' into openal 2015-04-24 09:21:06 +02:00
Randy Heit
ca16d99445 Fixed: FOptionMenuItem::GetIndent() did not handle localized strings 2015-04-22 22:57:15 -05:00
Randy Heit
fd7ed2bc25 Undo most of ZzZombo's changes
- "If it ain't broke, don't fix it."
- Some of the changes were downright wrong and some were pointless, so undo
  everything that doesn't look like an actual improvement.
2015-02-08 20:44:18 -06:00
ZzZombo
322742d4b1 - Fixed various instances of unused variables, accessing arrays out of bounds, initialization of non-primitive members in constructor's body, dead code, passing parameters by value instead of reference, usage of uninitialized variables, as reported by cppcheck. 2015-02-07 23:35:23 +08:00
Chris Robinson
90ed80abe5 Merge remote-tracking branch 'zdoom/master' into openal 2015-02-01 22:48:40 -08:00
Randy Heit
dc6b45804d Don't lose the cursor when scrolling up in option menus
- Fixed: If the menu cursor was on the topmost-displayed item, pressing up
  would not scroll the view up. The check for scrolling only tested if the
  newly selected item was the topmost one, since the menu code had
  assumed the only time the cursor would be on the topmost visible line
  was when it was the very first line of the menu. Using PgDn breaks this
  assumption.
2015-01-31 20:10:18 -06:00
Randy Heit
775e33ede7 Merge branch 'master' into scripting
Conflicts:
	src/actor.h
	src/g_doom/a_archvile.cpp
	src/g_shared/a_morph.cpp
	src/p_enemy.h
	src/p_local.h
	src/p_mobj.cpp
	src/sc_man_tokens.h
	src/thingdef/thingdef_codeptr.cpp
	src/thingdef/thingdef_exp.h
	src/thingdef/thingdef_expression.cpp
	src/thingdef/thingdef_states.cpp
	wadsrc/static/actors/actor.txt
2015-01-29 20:53:08 -06:00
Chris Robinson
a8348b13de Merge remote-tracking branch 'zdoom/master' into openal
Conflicts:
	output_sdl/CMakeLists.txt
	src/namedef.h
2015-01-15 13:08:05 -08:00
Randy Heit
1aa00f1b0e Draw player setup cursor equivalently to options menu cursors
- Explicitly size and position the text cursor in
  FListMenuItem::DrawSelector() the same way that the options menu does it
  using M_DrawConText(): By sizing it to a scaled 8x8 cell.
2014-12-26 19:22:09 -06:00
Randy Heit
2d87eb0ba2 Merge branch 'master' into gonesolong
Conflicts:
	src/CMakeLists.txt
	src/actor.h
	src/g_heretic/a_hereticmisc.cpp
	src/g_heretic/a_hereticweaps.cpp
	src/g_heretic/a_ironlich.cpp
	src/info.h
	src/namedef.h
	src/p_buildmap.cpp
	src/p_enemy.cpp
	src/p_map.cpp
	src/p_mobj.cpp
	src/thingdef/thingdef_codeptr.cpp
	zdoom.vcproj
2014-12-20 19:13:14 -06:00
Braden Obrzut
965d602d26 - Improve letterboxing in fullscreen by taking into account animorphic ratio settings.
- Added more resolutions to the hard coded table (up to 5K).
- Since we're using scaling for fullscreen, we should probably just use the hard coded table for fullscreen resolutions as well.
- Fixed: Resolution menu used fake aspect ratio to determine which aspect to file a resolution under.
- Added a way to use SDL surface blitting instead of accelerated textures.
2014-12-11 01:35:27 -05:00
Chris Robinson
7ff7c151a8 Merge remote-tracking branch 'origin/master' into openal
Conflicts:
	src/CMakeLists.txt
2014-06-15 12:04:15 -07:00
Christoph Oelckers
65e8563cf4 replaced all character arrays for lump/texture names in the level_info_t and FLevelLocals structures with FStrings as first preparation for allowing long texture names. 2014-05-13 11:33:59 +02:00
Braden Obrzut
efa9e0c3ee Merge branch 'maint' 2014-01-18 18:10:48 -05:00
Braden Obrzut
7af8b78b9f - Applied Chilly's patch to fix excessive name change notifications. 2014-01-18 15:18:35 -05:00
Braden Obrzut
d8ff4ec281 - Fixed: All clang 5.0 warnings.
- Renamed autostart/autozend since Xcode’s build process links in strictly alphabetical order.
2014-01-05 19:50:09 -05:00
Braden Obrzut
97d7b1e59e Merge branch 'origin/maint'
Conflicts:
	src/sound/fmodsound.cpp
2013-10-23 19:39:22 -04:00