add pref to edit color used to draw bonus hints on cells

This commit is contained in:
Andy2 2011-08-25 18:13:42 -07:00
parent 79acccc6bf
commit 5acc2205be
5 changed files with 14 additions and 3 deletions

View file

@ -26,6 +26,7 @@
<string name="key_empty">key_clr_empty</string>
<string name="key_background">key_clr_background</string>
<string name="key_clr_crosshairs">key_clr_crosshairs</string>
<string name="key_clr_bonushint">key_clr_bonushint</string>
<string name="key_relay_host">key_relay_host</string>
<string name="key_redir_host">key_redir_host</string>

View file

@ -332,6 +332,7 @@
<string name="empty">Empty cell/background</string>
<string name="clr_crosshairs">Crosshairs color</string>
<string name="background">Board background</string>
<string name="key_bonushint">In-square bonus hint</string>
<string name="tab_relay">Internet/Relay</string>
<string name="tab_sms">SMS (broken)</string>

View file

@ -177,6 +177,13 @@
android:title="@string/clr_crosshairs"
android:defaultValue="0x7070FF"
/>
<org.eehouse.android.xw4.EditColorPreference
android:key="@string/key_clr_bonushint"
android:title="@string/key_bonushint"
android:defaultValue="0x7F7F7F"
/>
<org.eehouse.android.xw4.EditColorPreference
android:key="@string/key_tile_back"
android:title="@string/tile_back"

View file

@ -119,7 +119,6 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
private static final int BLACK = 0xFF000000;
private static final int WHITE = 0xFFFFFFFF;
private static final int FRAME_GREY = 0xFF101010;
private static final int GREY = 0xFF7F7F7F;
private int[] m_bonusColors;
private int[] m_playerColors;
private int[] m_otherColors;
@ -506,7 +505,8 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
m_origin.setBounds( rect );
m_origin.draw( m_canvas );
} else if ( null != bonusStr ) {
m_fillPaint.setColor( GREY );
m_fillPaint.
setColor( m_otherColors[CommonPrefs.COLOR_BONUSHINT] );
Rect brect = new Rect( rect );
brect.inset( 0, brect.height()/10 );
drawCentered( bonusStr, brect, m_fontDims );

View file

@ -36,7 +36,8 @@ public class CommonPrefs {
public static final int COLOR_NOTILE = 1;
public static final int COLOR_FOCUS = 2;
public static final int COLOR_BACKGRND = 3;
public static final int COLOR_LAST = 4;
public static final int COLOR_BONUSHINT = 4;
public static final int COLOR_LAST = 5;
private static CommonPrefs s_cp = null;
@ -101,6 +102,7 @@ public class CommonPrefs {
R.string.key_empty,
R.string.key_clr_crosshairs,
R.string.key_background,
R.string.key_clr_bonushint,
};
for ( int ii = 0; ii < idsOther.length; ++ii ) {
otherColors[ii] = prefToColor( context, sp, idsOther[ii] );