Commit graph

29 commits

Author SHA1 Message Date
Daniel Gibson
335858bd5a Fix lingering messages in HUD after loading savegame
If you save, you get a message like "Game Saved..." which goes away
after a few seconds. This happens at the very end of idPlayer::Save():
    if ( hud ) {
        hud->SetStateString( "message", /* .. left out .. */ );
        hud->HandleNamedEvent( "Message" );
    }
And handled in hud.gui, "onNamedEvent Message { ..."

However, if you save again before it's gone, it'll be shown after
loading the savegame and not go away until you save again..
This works around that issue by setting an empty message after loading
a savegame.

The underlying problem (which is not fixed!) seems to be that the
transition GUI command (that's executed when hud.gui handles the
"Message" event that's used to show this message) is probably not
properly saved/restored so fading out the message isn't continued
after loading.
2021-01-18 03:05:01 +01:00
revility
c793d85bcb Fixed no_stamina disabling shield gauge
Commented out the no_stamina bit.  Stamina in Rivensin is used for the energy shield and not running.  If this was set in a map, the shield was disabled.  Noticeable if playing some user made maps and Hell levels in vanilla campaign.
2020-02-14 03:30:06 +01:00
Daniel Gibson
53ab8e1031 Fix some (mostly Savegame-related) Crashes
Somehow I must have added that
savefile->WriteFloat( spreadCrouchFactor );
twice when merging the Ruiner/Rivensin changes into the SDK.. damn.
(As it's only read once, all data read from the savegame after it
 will be garbage)

I had a crash when creating a Savegame in idAnimState::Save(),
because animator was NULL - so I added a check for that.

The rest has been found with GCC address sanitizer (ASan)
2018-11-18 06:07:31 +01:00
Daniel Gibson
97aa34a2f2 cursor and ingame menu scaling
Cursor now uses 2 different guis based upon aspect ratio just like
the hud. This is due to the translations of of the cross hairs being
off if a 4:3 cursor is on top of a 16:9 render view.
Requires additional key in the player def just like the hud does.
In game menu no longer stretches. Looks much better.
This is the menu that displays the advanced controls.

(DG: based on revility's commit with same message, removed stuff already
 implemented here and cleaned up the rest a bit)
2018-11-11 23:51:42 +01:00
Daniel Gibson
b54c0ffefd Load guis/hud16_9.gui when using a widescreen resolution 2018-11-05 01:21:14 +01:00
revility
6117962437
offset view position
adds a new cvar pm_crossHairSideScale to move the view position origin sideways.  Useful if pm_crosshairorigin is set to 0 and aiming around corners.  weapon projectiles use this as their spawn position. cross hairs use it as the origin of the trace line. default is 0. player should adjust to their liking and current camera settings. If set too far over, the player can shoot around walls.
2018-10-30 18:55:54 -04:00
revility
83a1d2a83d
smoothen crosshairs when attached to bone
removed bobbing and jittering while the crosshair origin is set to use a joint on the player model (pm_crosshairorigin 1). Was very noticeable while looking at steps.
2018-10-29 20:47:57 -04:00
revility
de2705c680 enabled firstperson view when using guis
Game will go into first person while at a gui and then back to thirdperson when leaving.  Needed for maps which use gui consoles in them.  Check comments in code for full details.  Probably a better way to do this.
2018-10-21 04:31:15 +02:00
revility
10be5f2713 pm_crossHairOrigin added
Changes cross hair trace line origin from the camera's origin to a joint on the player's model defined in player.cpp file
Done this way because pm_modelview cvar has some kind of over ride going on when the levels start.  Consider this a work  around fix.
2018-10-21 04:31:15 +02:00
revility
63152f3283 Weapon firing bug fix
Not sure how or why it happened, but the code was causing the bow to use wrong cross hairs, and auto weapon switch.  I believe there was a mistake on my end when cleaning up the code in the player.cpp and playercursor.cpp files.
Additionally having a second weapon to use the soul cube hud notice is not needed as the planned weapon is not happening anytime soon.
2018-10-21 04:31:15 +02:00
revility
8d95330115 Added soulcube clone
Only the soul cube can display hud notifications when enough kills are done.  this adds support for a 2nd weapon to do so. weapon is not in 2010 but will be 2018 build.  Code should still be compatible with 2010 build.
2018-10-21 04:31:15 +02:00
revility
066c8b3263 always enable pm_modelview
fix pm_modelview resetting on map loads.  Cross hair fix.  Still needs some tweaks and test.
2018-10-21 04:31:15 +02:00
revility
5eb99fb857 Cleaned code
Removed commented code from early 2000's tests.  Was never used. 
Cleaned up my comments a bit too :)
2018-10-21 04:31:15 +02:00
revility
81931da8c5 Replaced stamina system with shield system
Stamina is now used for the player's shield spell.  hold down the old zoom key to activate while the player has stamina.  Calls are made to the player's script to UpdateSkin.  UpdateSkin is new and not apart of vanilla d3 or Rivensin 2010 build
Stamina use also is no longer associated with player's movement and does not adjust movement speed.
The telishield key is used via the player script file to check if active and change the torso animations to blocking/spell casting.
2018-10-21 04:31:15 +02:00
revility
864fa1fd3d Update Player.cpp
Added the telishield key for the player def and script to use.  This key disables the player taking damage and can be checked in the script for stuff like changing skins, etc.

cross hair fix:  pm_modelview .  This cvar changes the origin of the playerview to a joint for the crosshairs.  This is set to a joint close to the player weapons to prevent the trace line used for cross hairs stopping too early when shooting around corners. 
Additionally pm_modelview's axis is now the renderview axis and not the joint other wise the thirdperson crosshair is displayed in wrong directions.
pm_modelview is now on by default.
2018-10-21 04:31:15 +02:00
Daniel Gibson
bf931218cc Ruiner compiles 2018-08-27 15:13:36 +02:00
Daniel Gibson
0c717b0313 Import Ruiner source (doesn't build yet) 2018-08-27 15:13:17 +02:00
dhewg
e632cd030b Get rid of ID_DEMO_BUILD
There are no demo pk4s compatible to this 1.3.1 codebase.
2018-08-20 01:46:34 +02:00
dhewg
431415c51c s/ReadLong/ReadInt/ to match the return type 2018-08-20 01:46:33 +02:00
dhewg
814abb55b9 s/WriteLong/WriteInt/ to match the argument type 2018-08-20 01:46:33 +02:00
dhewg
c5c5762ae4 Fix "unreachable code" warnings 2018-08-20 01:46:32 +02:00
dhewg
afebd7e1e5 Untangle the epic precompiled.h mess
Don't include the lazy precompiled.h everywhere, only what's
required for the compilation unit.
platform.h needs to be included instead to provide all essential
defines and types.
All includes use the relative path to the neo or the game
specific root.
Move all idlib related includes from idlib/Lib.h to precompiled.h.
precompiled.h still exists for the MFC stuff in tools/.
Add some missing header guards.
2018-08-20 01:46:28 +02:00
dhewg
6ff59d90bf Fix -Wunused-value warnings
value computed is not used
left operand of comma operator has no effect
right operand of comma operator has no effect
2018-08-20 01:46:23 +02:00
dhewg
74f7302c71 Fix -Wunused-but-set-variable warnings
variable set but not used

Removes some CollisionModel code under _DEBUG which was probably a
leftover, since it was completely useless (its done later anyways).
2018-08-20 01:46:23 +02:00
dhewg
6f0fc9fcc1 Fix -Wunused-variable warnings
unused variable
2018-08-20 01:46:23 +02:00
dhewg
98fbe07684 Fix -Wpointer-arith warnings
NULL used in arithmetic
2018-08-20 01:46:23 +02:00
dhewg
c7c187e4dc Fix all whitespace errors
Excluding 3rd party files.
2018-08-20 01:46:22 +02:00
dhewg
eac3112d2d Fix quoting in GPL headers 2018-08-20 01:46:21 +02:00
Timothee 'TTimo' Besset
aa3dbca015 hello world 2011-11-22 15:28:15 -06:00