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

Add missing button shadows in dialogs #4350

Merged
merged 50 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
46a601f
Add missing shadow from config button in game info dialog
a1exsh Oct 9, 2021
f93f7eb
copy over shadow from existing button
a1exsh Oct 10, 2021
c263118
Merge branch 'master' into config-btn-drop-shadow
a1exsh Oct 12, 2021
4729e8c
add shadows for okay/restart buttons in battle summary
a1exsh Oct 12, 2021
a342dff
add shadow for buttons in game config and ext. settings dialogs
a1exsh Oct 12, 2021
7fac619
remove corner-cutting code for config button: it's not needed
a1exsh Oct 12, 2021
f88a702
extract common function: drawButtonWithShadow
a1exsh Oct 12, 2021
b961f69
remove extra newline
a1exsh Oct 12, 2021
1ef1f90
remove unused include
a1exsh Oct 12, 2021
dee3cf9
move #include to the header: fix compilation
a1exsh Oct 12, 2021
469f00c
fix shadow and position of the OKAY button in battle-only screen
a1exsh Oct 12, 2021
4a088d5
Merge branch 'master' into config-btn-drop-shadow
a1exsh Oct 15, 2021
12c9cab
add buttons shadow in town portal spell dialog
a1exsh Oct 15, 2021
36ea566
better shadow in town portal dialog
a1exsh Oct 16, 2021
bb4a700
add button shadows
a1exsh Oct 30, 2021
f002314
Merge branch 'master' into config-btn-drop-shadow
a1exsh Oct 30, 2021
2d6ea30
remove debug code
a1exsh Oct 30, 2021
6f42218
Add shadows to the buttons on surrender dialog
a1exsh Oct 30, 2021
98a8a48
add captureBackground() to button
a1exsh Oct 31, 2021
33b722e
less code duplication
a1exsh Oct 31, 2021
2771d5c
Merge branch 'master' into config-btn-drop-shadow
a1exsh Oct 31, 2021
542b89a
fix button corners
a1exsh Oct 31, 2021
6b1958d
remove unneeded include
a1exsh Oct 31, 2021
28ec4ea
display is default for capture background anyway
a1exsh Nov 1, 2021
ba21e6c
Merge branch 'master' into config-btn-drop-shadow
a1exsh Nov 2, 2021
e262ef0
don't change ICNs used for okay button on game settings dialog
a1exsh Nov 2, 2021
cca6337
fix too bold shadow on pressed market and army buttons
a1exsh Nov 2, 2021
03e552d
Merge branch 'master' into config-btn-drop-shadow
a1exsh Nov 13, 2021
a4f4b08
remove debug code
a1exsh Nov 13, 2021
012cfad
AutoShadowButton
a1exsh Nov 13, 2021
58ac02c
fix ok/restart buttons
a1exsh Nov 13, 2021
2d5401d
use one memcpy
a1exsh Nov 13, 2021
64609d5
add shadows in button group
a1exsh Nov 14, 2021
ff3bbcd
add shadows in button group
a1exsh Nov 14, 2021
a6231f3
add comment
a1exsh Nov 14, 2021
c7fb156
remove capturebackground calls
a1exsh Nov 14, 2021
0ae7669
use AutoShadowButton for config button as well
a1exsh Nov 14, 2021
599850d
tidy
a1exsh Nov 14, 2021
d0370fe
add AutoBackgroundButton
a1exsh Nov 14, 2021
53c7d2d
sprite offset correction
a1exsh Nov 14, 2021
f991982
fix okay button shadow in battle summary dialog
a1exsh Nov 15, 2021
f101b27
fix TODO
a1exsh Nov 15, 2021
6b1d01d
it compiled!!
a1exsh Nov 21, 2021
419eab4
put back missing reset() call
a1exsh Nov 21, 2021
2d4ba45
put back shadows for button groups
a1exsh Nov 21, 2021
6e06938
remove move-constructor from ButtonBase
a1exsh Nov 21, 2021
cb4de6f
address review comments
a1exsh Nov 23, 2021
d074aa0
restore private access in ButtonBase
a1exsh Nov 23, 2021
4fa8b21
fix review comments
a1exsh Nov 28, 2021
759838c
Merge branch 'master' into config-btn-drop-shadow
a1exsh Dec 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add missing shadow from config button in game info dialog
Relates to #4349
  • Loading branch information
a1exsh committed Oct 9, 2021
commit 46a601f0bfab1e0cdb7e0118d078dc635db59bed
13 changes: 13 additions & 0 deletions src/fheroes2/agg/agg_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,19 @@ namespace fheroes2
Sprite & out = _icnVsSprite[id][i];
out = GetICN( ICN::REQUESTS, 1 + i );

// cut out top-left and bottom-right corners
if ( !out.singleLayer() ) {
const int cornerSize = 3;
for ( int y = 0; y < cornerSize; ++y ) {
for ( int x = 0; x < cornerSize; ++x ) {
if ( x >= y ) {
SetTransformPixel( out, cornerSize - x, y, 1 );
SetTransformPixel( out, ( out.width() - 1 ) - cornerSize + x, ( out.height() - 1 ) - y, 1 );
}
}
}
}

// add 'config'
Blit( GetICN( ICN::BTNDCCFG, 4 + i ), 31 - i, 20, out, 10 - i, 4, 77, 16 );
}
Expand Down
4 changes: 4 additions & 0 deletions src/fheroes2/dialog/dialog_gameinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "game.h"
#include "game_over.h"
#include "icn.h"
#include "image_tool.h"
#include "localevent.h"
#include "maps.h"
#include "player_info.h"
Expand Down Expand Up @@ -113,6 +114,9 @@ void Dialog::GameInfo( void )
fheroes2::Button buttonOk( pt.x + 178, pt.y + 426, ICN::REQUESTS, 1, 2 );
fheroes2::Button buttonCfg( pt.x + 50, pt.y + 426, ICN::BTNCONFIG, 0, 1 );

const fheroes2::Sprite configBtnShadow = fheroes2::addShadow( fheroes2::AGG::GetICN( ICN::BTNCONFIG, 0 ), fheroes2::Point( -4, 4 ), 3 );
fheroes2::Blit( configBtnShadow, display, buttonCfg.area().x - 4, buttonCfg.area().y );

buttonOk.draw();
buttonCfg.draw();

Expand Down