mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2025-04-22 09:10:57 +00:00
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)
This commit is contained in:
parent
b54c0ffefd
commit
97aa34a2f2
1 changed files with 21 additions and 1 deletions
|
@ -1853,9 +1853,26 @@ void idPlayer::Spawn( void ) {
|
|||
}
|
||||
|
||||
// load cursor
|
||||
if ( spawnArgs.GetString( "cursor", "", temp ) ) {
|
||||
//Rev 2018 start. We need to have 2 cursor guis just like the main menu.
|
||||
//This is because the cordinate translation for crosshair position will not be correct if the cursor is 4:3 over a 16:9 renderview
|
||||
float aspectRatio = float(renderSystem->GetScreenWidth()) / float(renderSystem->GetScreenHeight());
|
||||
cursor = NULL;
|
||||
if ( aspectRatio > 1.49f ) {
|
||||
if ( spawnArgs.GetString( "cursor16_9", "", temp ) ) {
|
||||
cursor = uiManager->FindGui( temp, true, gameLocal.isMultiplayer, gameLocal.isMultiplayer );
|
||||
}
|
||||
}
|
||||
|
||||
// if the cursor is NULL we either aspectRatio < 1.49f or the 16:9 cursor wasn't found
|
||||
// either way, try to load the normal cursor
|
||||
if ( cursor == NULL && spawnArgs.GetString( "cursor", "", temp ) ) {
|
||||
cursor = uiManager->FindGui( temp, true, gameLocal.isMultiplayer, gameLocal.isMultiplayer );
|
||||
}
|
||||
//if ( spawnArgs.GetString( "cursor", "", temp ) ) {
|
||||
// cursor = uiManager->FindGui( temp, true, gameLocal.isMultiplayer, gameLocal.isMultiplayer );
|
||||
//}
|
||||
//Rev 2018 end
|
||||
|
||||
if ( cursor ) {
|
||||
cursor->Activate( true, gameLocal.time );
|
||||
}
|
||||
|
@ -1869,6 +1886,9 @@ void idPlayer::Spawn( void ) {
|
|||
combolist = uiManager->FindGui( temp, true );
|
||||
}
|
||||
if ( combolist ) {
|
||||
combolist->SetStateBool("scaleto43", true); //Rev 2018 don't strech the combo list
|
||||
combolist->StateChanged(gameLocal.time); //Rev 2018 don't strech the combo list
|
||||
|
||||
combolist->Activate( true, gameLocal.time );
|
||||
}
|
||||
combolistOpen = false;
|
||||
|
|
Loading…
Reference in a new issue