mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-27 09:58:45 +01:00
include bonus square summaries in grey
Conflicts: xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardView.java
This commit is contained in:
parent
c0819c5a9f
commit
e55bb462d9
2 changed files with 23 additions and 1 deletions
|
@ -268,6 +268,10 @@
|
|||
<string name="bonus_l3x">Triple letter</string>
|
||||
<string name="bonus_w2x">Double word</string>
|
||||
<string name="bonus_w3x">Triple word</string>
|
||||
<string name="bonus_l2x_summary">2L</string>
|
||||
<string name="bonus_l3x_summary">3L</string>
|
||||
<string name="bonus_w2x_summary">2W</string>
|
||||
<string name="bonus_w3x_summary">3W</string>
|
||||
<string name="trading_text">Exchanging tiles. Select\n\'Turn done\' when ready.</string>
|
||||
<string name="tile_back">Tile background</string>
|
||||
<string name="empty">Empty cell/background</string>
|
||||
|
|
|
@ -111,9 +111,11 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
|
||||
private static final int BLACK = 0xFF000000;
|
||||
private static final int WHITE = 0xFFFFFFFF;
|
||||
private static final int GREY = 0xFF7F7F7F;
|
||||
private int[] m_bonusColors;
|
||||
private int[] m_playerColors;
|
||||
private int[] m_otherColors;
|
||||
private String[] m_bonusSummaries;
|
||||
private ZoomButtonsController m_zoomButtons;
|
||||
private boolean m_useZoomControl;
|
||||
private boolean m_canZoom;
|
||||
|
@ -201,6 +203,16 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
m_bonusColors = prefs.bonusColors;
|
||||
m_otherColors = prefs.otherColors;
|
||||
|
||||
m_bonusSummaries = new String[5];
|
||||
m_bonusSummaries[1] =
|
||||
getResources().getString( R.string.bonus_l2x_summary );
|
||||
m_bonusSummaries[2] =
|
||||
getResources().getString( R.string.bonus_l3x_summary );
|
||||
m_bonusSummaries[3] =
|
||||
getResources().getString( R.string.bonus_w2x_summary );
|
||||
m_bonusSummaries[4] =
|
||||
getResources().getString( R.string.bonus_w3x_summary );
|
||||
|
||||
m_viewHandler = new Handler();
|
||||
m_zoomButtons = new ZoomButtonsController( this );
|
||||
ZoomButtonsController.OnZoomListener lstnr =
|
||||
|
@ -502,6 +514,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
int backColor;
|
||||
boolean empty = 0 != (flags & (CELL_DRAGSRC|CELL_ISEMPTY));
|
||||
boolean pending = 0 != (flags & CELL_HIGHLIGHT);
|
||||
String bonusStr = null;
|
||||
|
||||
figureFontDims();
|
||||
|
||||
|
@ -517,6 +530,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
backColor = m_otherColors[CommonPrefs.COLOR_BKGND];
|
||||
} else {
|
||||
backColor = m_bonusColors[bonus];
|
||||
bonusStr = m_bonusSummaries[bonus];
|
||||
}
|
||||
} else if ( pending ) {
|
||||
backColor = BLACK;
|
||||
|
@ -531,7 +545,10 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
if ( (CELL_ISSTAR & flags) != 0 ) {
|
||||
m_origin.setBounds( rect );
|
||||
m_origin.draw( m_canvas );
|
||||
}
|
||||
} else if ( null != bonusStr ) {
|
||||
m_fillPaint.setColor( GREY );
|
||||
drawCentered( bonusStr, rect, m_fontDims );
|
||||
}
|
||||
} else {
|
||||
m_fillPaint.setColor( foreColor );
|
||||
drawCentered( text, rect, m_fontDims );
|
||||
|
@ -540,6 +557,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
|
|||
if ( (CELL_ISBLANK & flags) != 0 ) {
|
||||
markBlank( rect, pending );
|
||||
}
|
||||
// frame the cell
|
||||
m_canvas.drawRect( rect, m_strokePaint );
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue