Commit Graph

2499 Commits

Author SHA1 Message Date
Christoph Oelckers 1c8d698121 - added WeaponState enum for ZScript. 2017-04-13 02:42:31 +02:00
Christoph Oelckers 1712667ce2 Merge branch 'master' of https://github.com/coelckers/gzdoom 2017-04-13 02:18:16 +02:00
Christoph Oelckers fc9e304189 - separated class descriptors from VM types.
Combining these two groups of data has been the cause of many hard to detect errors because it allowed liberal casting between types that are used for completely different things.
2017-04-12 22:46:49 +02:00
alexey.lysiuk d8d7dc973c Added check for selected item in save/load menu
https://mantis.zdoom.org/view.php?id=570
2017-04-12 17:15:12 +03:00
Christoph Oelckers 6a3ddaa8fa - moved Restricted/ForbiddenToPlayerClass fully to the script side.
This required some fixes for allowing to read from metadata arrays.
2017-04-11 15:11:13 +02:00
alexey.lysiuk b0a0c62af1 Fixed state selection for weapon secondary fire
https://mantis.zdoom.org/view.php?id=552
2017-04-09 13:04:32 +03:00
Christoph Oelckers 5935dc706d - prevent infinite recursion in PlayerPawn.GetObituary when the inflictor is the same as the origin for the kill. 2017-04-09 00:06:23 +02:00
Magnus Norddahl 85a9984807 - Add OpenGL ES 3 support to GL renderer 2017-04-06 23:34:42 -04:00
Christoph Oelckers 74faacd218 - fixed: FxVMFunctionCall::GetDirectFunction did not perform any checks on the function's self pointer and failed to report a mismatch as an error.
- also fixed two places in the code where the above caused some incorrect definitions not to be detected.
2017-04-06 20:52:38 +02:00
alexey.lysiuk ca4888eb3d Added CVar.GetCVar() function to do player-dependent console variables lookup 2017-04-06 10:51:36 +03:00
alexey.lysiuk 26e4b74261 Restored initial behavior of CVar.FindCVar()
https://mantis.zdoom.org/view.php?id=537
2017-04-06 10:50:40 +03:00
Christoph Oelckers 4b127c7fcc - draw Doom weapon numbers one pixel lower. 2017-04-03 09:37:52 +02:00
Christoph Oelckers e074c75609 - added a generic TransformRect to the status bar so that the proper transformations can be applied to draw operations that require special parameters not supported by the stock functions. 2017-04-02 12:58:31 +02:00
alexey.lysiuk 1033976158 Fixed typo in status bar function name
https://mantis.zdoom.org/view.php?id=519
2017-04-02 11:47:10 +03:00
Christoph Oelckers 553906b186 - fixed: BaseStatusbar::GetAmount returned the default item's amount if the player held none of the given type. This should only be done for MaxAmount. 2017-04-01 13:33:42 +02:00
Christoph Oelckers 7dae43bf7f - fixed: The health chain in Hexen wasn't drawn on the main status bar. Did some reordering to ensure it won't get skipped. 2017-04-01 13:18:19 +02:00
Christoph Oelckers 699d4882d5 - fixed: The ammo display in Doom should not be drawn if the current weapon does not use ammo. 2017-04-01 13:08:45 +02:00
Christoph Oelckers 51d89740e3 - fixed mouse input for scale slider. 2017-03-30 20:12:39 +02:00
Christoph Oelckers 3a1228bf95 - exported the clipping rectangle to scripting and added a statusbar scaling wrapper for it.
- fixed: BaseStatusBar.Fill did not pass its flags parameter to the native function.
2017-03-30 12:13:28 +02:00
Christoph Oelckers a3ef711d1d - added a special slider type for the scaling options that prints a descriptive text instead of the slider for the special settings.
- fixed the adaptive scale calculation in GetUIScale which had the coordinates mixed up.
2017-03-30 11:30:09 +02:00
Christoph Oelckers f95c29ad28 cleaned up the scaling options.
- all 5 settings affected by uiscale have been changed to have the exact same semantics: -1, if supported means special scaling, this is available for HUD and status bar, 0 means to use uiscale, any larger value is a direct scaling factor.
- scaling is cut off when the factor is larger than screenwidth/320 or screenheight/200 because anything larger will definitely not fit.
- a lot of code has been cleaned up and consolidated. Especially the message code had an incredible amount of redundancy.
- all scaling options have been moved into a submenu. This menu is not complete, though - it still requires a special menu widget to convey the intended information without confusing the user.
2017-03-30 02:16:23 +02:00
Christoph Oelckers 1dcc017daf - reimplemented the position display, but changed its position a bit upward.
- activated the RenderOverlay event, now that it can be called from the correct spot, i.e. right after the top level HUD messages are drawn. The system's status output will still be drawn on top of them.
2017-03-29 23:51:53 +02:00
Christoph Oelckers 7011010ff2 - fixed the drain callback.
- changed the effect spawn prevention of the Hexen flame strike weapon and reverted the attempt to fix this in FastProjectile.

This cannot be fixed in the base class, which was doing everything right. It's the flame missile that was doing undefined things by stopping its movement without clearing its missile flag. This cannot work because missiles are given some minimal forced velocity to ensure collision detection and any attempt to address this without clearing the missile flag is doomed to fail.
2017-03-29 22:50:13 +02:00
Christoph Oelckers b38934b532 - fixed declaration of ACS getters for status bar.
- fixed some uninitialized variables in font print code.
2017-03-29 21:54:11 +02:00
Christoph Oelckers 01b095c911 - added colorization for untranslated fonts. This uses the light color of the vertices. The software rendered 2D code will ignore this infomation.
- added a virtual OnRetrun method to menus.
2017-03-29 21:22:05 +02:00
Christoph Oelckers d36f656caf - added a callback for when damage is drained from a target. 2017-03-29 20:25:54 +02:00
Christoph Oelckers 1d4ab0cc2a - implemented proper scaling for the status bar itself.
This allows using the UI scale or its own value, like all other scaling values.
In addition there is a choice between preserving equal pixel size or aspect ratio because the squashed non-corrected versions tend to look odd, but since proper scaling requires ununiform pixel sizes it is an option.

- changed how status bar sizes are being handled.

This has to recalculate all scaling and positioning factors, which can cause problems if the drawer leaves with some temporary values that do not reflect the status bar as a whole.
Changed it so that the status bar stores the base values and restores them after drawing is complete.
2017-03-29 19:23:40 +02:00
Christoph Oelckers 87479d3c2f -use the proper functions to calculate the position of the popup screen in Strife. 2017-03-29 14:28:46 +02:00
Christoph Oelckers 7ba6860102 - scriptified the automap HUD and made it obey hud_scale instead of always being fully scaled. 2017-03-29 14:20:22 +02:00
Christoph Oelckers 2f06c09681 - fixed map name display on the automap HUD
This would cut off overlong names and the handling for status bars with protruding elements was far too simplistic and worse, making assumptions based on game mode.
It now uses a virtual function to query the status bar itself for returning this information so it can be overridden and uses V_BreakLines to split the text if it is wider than the display.
2017-03-29 10:36:16 +02:00
Christoph Oelckers fabf8451e7 - use Fill to draw Strife's health bars. 2017-03-29 02:24:04 +02:00
Christoph Oelckers 598523a1de - moved all coordinate adjustment for the status bar mode into one function and use this function in all places where status bar related coordinate adjustments need to be performed, also in SBARINFO.
- fixed unscaled status bar placement.
- fixed inventory count display for Doom status bar.
2017-03-29 01:59:03 +02:00
Christoph Oelckers 19e7d60275 - removed DSBarInfo::Scaled because it tended to disagree with StatusBar->Scaled. 2017-03-29 00:35:35 +02:00
Christoph Oelckers fa893c082b - changed the default for hud_scale to 0 (i.e. use uiscale)
- allow calling Menu.SetMenu from play code so that in-game menus can be opened.
2017-03-28 22:51:37 +02:00
Christoph Oelckers d5772ff895 - fixed: SafeCommand did not work anymore because it failed the abuse prevention check for DoCommand. 2017-03-28 22:34:12 +02:00
Christoph Oelckers 224219dd66 - made ListMenuItem.DrawSelector virtual. 2017-03-28 21:39:03 +02:00
Christoph Oelckers 6870efe134 - added a GetCVarString ZScript/DECORATE function.
- fixed: loading a savegame triggered PlayerEntered events.
2017-03-28 21:37:43 +02:00
Christoph Oelckers bdf761e457 - moved th player resurrection code into a player_t method. 2017-03-28 21:29:14 +02:00
Christoph Oelckers 6816902a09 - forgot to save doom_sbar.txt 2017-03-28 13:27:59 +02:00
Christoph Oelckers e2e17f575c - added safeguards to all 2D drawing functions to throw an exception if used outside a valid 2D draw context.
This is necessary because the hardware accelerated renderers will hide the problem, but with pure software rendering to a locked hardware surface, like DirectDraw can result in a crash.
Note that ANY mod that gets caught in this did something wrong!
2017-03-28 13:25:17 +02:00
Christoph Oelckers b9485d4edf - ported the Hexen status bar to zscript.
Note that DrawBar with a background texture does not work yet because the clipping rectangle is not done yet.
2017-03-28 11:00:05 +02:00
Christoph Oelckers bac464f2b7 - added the inventory bar on Heretic's status bar. 2017-03-27 21:30:05 +02:00
Christoph Oelckers a6bf93c624 - implemented the Heretic status bar. 2017-03-27 21:01:40 +02:00
Christoph Oelckers 0fdd118906 - change statusbar drawers to use the top left of the virtual screen as origin, not the top left of the actual status bar, to bring this in line with SBARINFO.
The Strife status bar which was still native code had it differently and that was used as the initial guideline.
2017-03-27 09:52:30 +02:00
Christoph Oelckers a112b29c43 - implemented the inventory bar. This object is a bit special because it requires a lot of parameters, most of which are easily set to defaults. To make handling easier, most are passed through a container object which does some processing up front.
- finished work on the Doom status bar. I also took the opportunity to fix the layout of the inventory bar which is a bit broken in SBARINFO.
- tuned the selection rules for deciding what creates the status bar, so that the most recent definition that can be found is chosen.
2017-03-27 01:02:10 +02:00
Christoph Oelckers e791c957d9 - implemented the regular Doom status bar.
The DOOM status bar and HUD are complete, except the inventory bar.
2017-03-26 22:04:58 +02:00
Christoph Oelckers 08b3c38304 - simplified the parameters of the HUD draw functions by moving all booleans into one flags word and ordering them so that the less likely ones to be used can be made optional.
- got rid of the image list in the Doom status bar. The cost of the texture lookup is mostly irrelevant here so clearer and shorter code is preferrable.
- moved the box fitting code from DrawTexture into the native function to have all coordinate calculations in one place which is necessary to implement proper alignment default handling. Without higher level functions altering positioning the default can be set to automatic alignment determination, i.e. the value's sign decides where something is placed. Of course for special cases this can be overridden.
- use ANIMDEFS to animate the inventory arrow,
2017-03-26 18:41:24 +02:00
Christoph Oelckers 1c71d038dd - Doom keybar is working.
I did not implement an equivalent to SBARINFO's DrawKeyBar. This is too limiting because it needs to consider any possibility. It really is easier to let a mod implement this itself and custom adjust it to its needs.

- fixed some stuff, in particular use DrawInventoryIcon to get smarter icon lookup.
2017-03-25 23:43:19 +01:00
Christoph Oelckers 488fface50 - started port of Doom status bar to ZScript.
Fullscreen HUD done with the exception of key and inventory bar. I also used the opportunity to make it a bit more resistant against badly designed inventory icons.
2017-03-25 21:40:17 +01:00
Christoph Oelckers 3e67a8bafa - let hud_scale act like an override to uiscale, just like con_scale does.
- better handling of ForceScale for the fullscreen HUD that doesn't mess around with CVARs.
- moved the mug shot into the status bar, because this is global state that needs to be shared between different pieces of code which want to display a mug shot.
- SBARINFO should work off the current status bar settings instead of the ones stored in its script object
2017-03-25 18:32:47 +01:00