aboutsummaryrefslogtreecommitdiffstats
path: root/test/jake2
diff options
context:
space:
mode:
Diffstat (limited to 'test/jake2')
-rw-r--r--test/jake2/qcommon/Q2TestDataUtil.java51
-rw-r--r--test/jake2/render/DancingQueens.java4
-rw-r--r--test/jake2/render/TestMap.java4
-rw-r--r--test/jake2/render/TestRenderer.java4
4 files changed, 54 insertions, 9 deletions
diff --git a/test/jake2/qcommon/Q2TestDataUtil.java b/test/jake2/qcommon/Q2TestDataUtil.java
new file mode 100644
index 0000000..e273215
--- /dev/null
+++ b/test/jake2/qcommon/Q2TestDataUtil.java
@@ -0,0 +1,51 @@
+package jake2.qcommon;
+
+import jake2.Jake2;
+
+import java.util.Locale;
+
+/** @author Patrick Woodworth */
+public class Q2TestDataUtil {
+
+ private static final boolean USE_DATA_DIALOG = Boolean.getBoolean("jake.data.dialog");
+
+ public static final void initQ2DataTool() {
+ if (USE_DATA_DIALOG) {
+ Q2DataDialogWrapper tmpq2DataTool = new Q2DataDialogWrapper();
+ Locale.setDefault(Locale.US);
+ tmpq2DataTool.setVisible(true);
+ Jake2.q2DataTool = tmpq2DataTool;
+ } else {
+ Jake2.q2DataTool = new Q2DataTool();
+ Locale.setDefault(Locale.US);
+ }
+ }
+
+ public static class Q2DataDialogWrapper extends Q2DataTool {
+
+ private final Q2DataDialog m_data = new Q2DataDialog();
+
+ public Q2DataDialogWrapper() {
+ super();
+ }
+
+ @Override
+ public void testQ2Data() {
+ m_data.testQ2Data();
+ }
+
+ @Override
+ void dispose() {
+ m_data.dispose();
+ }
+
+ @Override
+ void setStatus(String text) {
+ m_data.setStatus(text);
+ }
+
+ public void setVisible(boolean b) {
+ m_data.setVisible(b);
+ }
+ }
+}
diff --git a/test/jake2/render/DancingQueens.java b/test/jake2/render/DancingQueens.java
index 4097d21..1b98ea0 100644
--- a/test/jake2/render/DancingQueens.java
+++ b/test/jake2/render/DancingQueens.java
@@ -67,9 +67,7 @@ public class DancingQueens {
void init() {
Globals.dedicated = Cvar.Get("dedicated", "0", Qcommon.CVAR_NOSET);
- Jake2.Q2Dialog = new Q2DataDialog();
- Locale.setDefault(Locale.US);
- Jake2.Q2Dialog.setVisible(true);
+ Q2TestDataUtil.initQ2DataTool();
String DRIVER = "lwjgl";
diff --git a/test/jake2/render/TestMap.java b/test/jake2/render/TestMap.java
index 3dd89fd..10112d1 100644
--- a/test/jake2/render/TestMap.java
+++ b/test/jake2/render/TestMap.java
@@ -75,9 +75,7 @@ public class TestMap
// open the q2dialog, if we are not in dedicated mode.
if (Globals.dedicated.value != 1.0f)
{
- Jake2.Q2Dialog = new Q2DataDialog();
- Locale.setDefault(Locale.US);
- Jake2.Q2Dialog.setVisible(true);
+ Q2TestDataUtil.initQ2DataTool();
}
Qcommon.Init(new String[] { "TestMap" });
diff --git a/test/jake2/render/TestRenderer.java b/test/jake2/render/TestRenderer.java
index 3c0bb7f..f12edd6 100644
--- a/test/jake2/render/TestRenderer.java
+++ b/test/jake2/render/TestRenderer.java
@@ -72,9 +72,7 @@ public class TestRenderer {
void init() {
Globals.dedicated = Cvar.Get("dedicated", "0", Qcommon.CVAR_NOSET);
- Jake2.Q2Dialog = new Q2DataDialog();
- Locale.setDefault(Locale.US);
- Jake2.Q2Dialog.setVisible(true);
+ Q2TestDataUtil.initQ2DataTool();
String DRIVER = "joglgl2";