Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battle Panel Multi Resolution #203

Merged
merged 5 commits into from
Aug 20, 2023

Conversation

andrzejfalkowski
Copy link
Contributor

@andrzejfalkowski andrzejfalkowski commented Aug 19, 2023

Battle panel in different variants for each main vertical resolution and 720 widescreen.

If there's not enough space to display all mercs due to increased limits compared to vanilla, mercs will be displayed page by page, scrollable with Page Up/Page Down (similar to the team assignments panel).

Related fixes:

  • some UI elements like sort buttons wouldn't be rendered during animated prebattle interface transition if prebattle dialogue was skipped
  • in 720 widescreen it was possible to pick up inventory items behind prebattle interface
  • in 720 widescreen autoresolve overlay wasn't rendered on the entire screen

Comparison:

640x480
battle_panel_640_old
battle_panel_640_new

1280x720 Widescreen
battle_panel_720_old
battle_panel_720_new

1024x768
battle_panel_768_old
battle_panel_768_new

720 Widescreen - Auto-resolve fix
auto_battle_720_old
auto_battle_720_new

Transition fix
transition_640_old
transition_640_new

Corresponding gamedir PR:
1dot13/gamedir#46

@Asdow
Copy link
Contributor

Asdow commented Aug 20, 2023

This looks great! One thing I did notice, is that it's not taking into account localized versions of prebattlepanel graphics.

For example, in German version, the panel column titles are not replaced by graphics from Data\german\PREBATTLEPANEL_GERMAN.sti

Current:
jagged_alliance_2-2023-08-20-12_22_24

Pull request:
jagged_alliance_2-2023-08-20-12_20_13

Same thing happens with the other languages as well.
Localized files are in repository https://github.com/1dot13/gamedir-languages

@@ -482,31 +495,70 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
fMapScreenBottomDirty = TRUE;
ChangeSelectedMapSector( gubPBSectorX, gubPBSectorY, gubPBSectorZ );
// Headrock: Added FALSE argument, We might need TRUE but not sure. Will need to initiate battle :)
RenderMapScreenInterfaceBottom( FALSE );
//RenderMapScreenInterfaceBottom( FALSE );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this function call is no longer needed, simply delete it and the accompanying comment related to it. There's plenty of old, commented out code in the repo. We don't need to add to it :)

Copy link
Contributor Author

@andrzejfalkowski andrzejfalkowski Aug 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool cool, deleted.

Localization: 1dot13/gamedir-languages#10
BTW looks like Dutch PREBATTLEPANEL_DUTCH.STI was already only in English, so I just added other resolution variants also in English for Dutch in PR.

@@ -203,6 +212,15 @@ BOOLEAN GetMLGFilename( SGPFILENAME filename, UINT16 usMLGGraphicID )
case MLG_PREBATTLEPANEL:
sprintf( filename, "GERMAN\\PreBattlePanel_german.sti" );
return TRUE;
case MLG_PREBATTLEPANEL_800x600:
sprintf(filename, "INTERFACE\\PreBattlePanel_800x600_german.sti");
Copy link
Contributor

@Asdow Asdow Aug 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct path should be GERMAN\PreBattlePanel_800x600_german.sti, similar to the original prebattle sti file. Right now the game will error out on the assert at line 546 in PreBattle Interface.cpp as it fails to fails to find the file on higher resolutions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, resolved

@Asdow Asdow merged commit 2060022 into 1dot13:master Aug 20, 2023
@andrzejfalkowski andrzejfalkowski deleted the battle-panel-multi-res branch August 20, 2023 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants