Permalink
Browse files

Added mockups of combatant details pane. Fixed misc. issues.

  • Loading branch information...
1 parent 138de6f commit 6e244cd517299dd00c948f05fe0e492f0405f089 @cgranade committed Feb 19, 2011
@@ -27,17 +27,19 @@
android:normalScreens="false"
android:largeScreens="false"
android:xlargeScreens="true" />
+
+ <application android:theme="@android:style/Theme.Holo" android:label="@string/app_title">
- <application
- android:theme="@android:style/Theme.Holo"
- android:label="@string/app_title">
-
- <activity android:name="com.cgranade.shadowtable.InitTableActivity">
+ <activity android:name="com.cgranade.shadowtable.InitTableActivity" android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
+ <activity
+ android:name=".DMPolicyPreferences"
+ android:label="DM Policies"
+ />
</application>
@@ -65,6 +65,117 @@
style="@style/SeparatorBar"
/>
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingTop="8sp"
+ >
+ <TextView
+ android:id="@+id/comb_details_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Placeholder"
+ style="@style/TextAppearance.BigName"
+ />
+ <TextView
+ android:id="@+id/comb_details_name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Player Character"
+ android:paddingBottom="16sp"
+ />
+
+ <TextView
+ android:text="Initiative"
+ style="@style/SmallSeparatorBar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ />
+
+ <TableLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="8sp"
+ android:paddingBottom="16sp"
+ android:stretchColumns="0"
+ >
+ <TableRow>
+ <ToggleButton
+ android:textOn="@string/inittype_phys"
+ android:textOff="@string/inittype_phys"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ />
+ <com.cgranade.shadowtable.widgets.InitiativeEditor>
+ </com.cgranade.shadowtable.widgets.InitiativeEditor>
+ </TableRow>
+ <TableRow>
+ <ToggleButton
+ android:textOn="@string/inittype_astr"
+ android:textOff="@string/inittype_astr"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ />
+ <com.cgranade.shadowtable.widgets.InitiativeEditor>
+ </com.cgranade.shadowtable.widgets.InitiativeEditor>
+ </TableRow>
+ <TableRow>
+ <ToggleButton
+ android:textOn="@string/inittype_matr"
+ android:textOff="@string/inittype_matr"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ />
+ <com.cgranade.shadowtable.widgets.InitiativeEditor>
+ </com.cgranade.shadowtable.widgets.InitiativeEditor>
+ </TableRow>
+ </TableLayout>
+
+ <TextView
+ android:text="Condition Monitors"
+ style="@style/SmallSeparatorBar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ />
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingBottom="16sp"
+ >
+ <TextView
+ android:text="10P / 12"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_weight="0.5"
+ android:textSize="26sp"
+ android:padding="6sp"
+ />
+ <TextView
+ android:text="10S / 12"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_weight="0.5"
+ android:textSize="26sp"
+ android:padding="6sp"
+ />
+ </LinearLayout>
+
+ <TextView
+ android:text="Player Information"
+ style="@style/SmallSeparatorBar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ />
+ <TextView
+ android:text="No player is connected to $CHARNAME."
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ />
+ </LinearLayout>
+
</LinearLayout>
<LinearLayout
@@ -31,5 +31,10 @@
<string name="inittype_phys">Physical</string>
<string name="inittype_astr">Astral</string>
<string name="inittype_matr">Matrix</string>
+ <string name="prefcat_init_policies">Initiative Order Policies</string>
+ <string name="inittype_phys_header">Initiative(<i>Physical</i>)</string>
+
+ <string name="dmgtype_phys">Physical</string>
+ <string name="dmgtype_stun">Stun</string>
</resources>
@@ -32,6 +32,23 @@
<style name="TextAppearance.SeparatorBar">
<item name="android:textColor">#ffffff</item>
+ <item name="android:textSize">20sp</item>
+ </style>
+
+ <style name="SmallSeparatorBar">
+ <item name="android:background">#007000</item>
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:textAppearance">@style/TextAppearance.SmallSeparatorBar</item>
+ <item name="android:padding">4dip</item>
+ <item name="android:paddingTop">16dip</item>
+ </style>
+
+ <style name="TextAppearance.SmallSeparatorBar">
+ <item name="android:textColor">#cfcfcf</item>
+ </style>
+
+ <style name="TextAppearance.BigName">
+ <item name="android:textSize">24sp</item>
</style>
</resources>
@@ -36,8 +36,14 @@
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
import android.os.Bundle;
+import android.preference.PreferenceManager;
import android.util.Log;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
@@ -47,13 +53,17 @@
import android.widget.TextView;
public class InitTableActivity extends Activity {
-
+
+ // INNER TYPES ////////////////////////////////////////////////////////////
+
private static enum InputState {
IDLE,
TYPING_DAMAGE,
DAMAGE_TO_WHOM
}
+ // MEMBER VARIABLES ///////////////////////////////////////////////////////
+
private InputState inputState = InputState.IDLE;
private String dmgSeq = "";
private DamageType dmgType = DamageType.P;
@@ -64,8 +74,35 @@
private TextView cmdLineDisp, curTurn, curIP;
+ //private SharedPreferences dmPolicies = PreferenceManager.getDefaultSharedPreferences(this);
+
+ // CONSTRUCTORS ///////////////////////////////////////////////////////////
+
public InitTableActivity() { }
+ // UTILITY METHODS ////////////////////////////////////////////////////////
+
+ private void updateCmdLineDisplay() {
+ String text = "";
+
+ switch (inputState) {
+ case IDLE:
+ break;
+
+ case TYPING_DAMAGE:
+ text = "dmg " + dmgSeq;
+ break;
+
+ case DAMAGE_TO_WHOM:
+ text = "dmg " + dmgSeq + dmgType.toString() + " to whom?";
+ break;
+ }
+
+ cmdLineDisp.setText("> " + text);
+ }
+
+ // EVENT HANDLERS /////////////////////////////////////////////////////////
+
/** Called with the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -120,25 +157,6 @@ public void onClick(View v) {
}
});
}
-
- private void updateCmdLineDisplay() {
- String text = "";
-
- switch (inputState) {
- case IDLE:
- break;
-
- case TYPING_DAMAGE:
- text = "dmg " + dmgSeq;
- break;
-
- case DAMAGE_TO_WHOM:
- text = "dmg " + dmgSeq + dmgType.toString() + " to whom?";
- break;
- }
-
- cmdLineDisp.setText("> " + text);
- }
public void applyDamageBtnListener(View v) {
if (inputState == InputState.IDLE) {
@@ -187,6 +205,7 @@ public void onClick(View v) {
c = new Combatant(name, scores);
charAdapter.add(c);
+ // TODO: respect policy as to where to add combatants.
dialog.dismiss();
Log.d("SerializationTest", charAdapter.serializeToJson());
@@ -195,4 +214,24 @@ public void onClick(View v) {
dialog.show();
}
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ MenuInflater inflater = getMenuInflater();
+ inflater.inflate(R.menu.inittable_options, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // TODO Auto-generated method stub
+ switch (item.getItemId()) {
+ case R.id.dm_policies:
+ Intent prefsIntent = new Intent(this, DMPolicyPreferences.class);
+ startActivity(prefsIntent);
+ return true;
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }
}

0 comments on commit 6e244cd

Please sign in to comment.