Browse Source

Updated folder hierarchy and save and restore

Chris Cromer 3 years ago
parent
commit
822099c90c

+ 10
- 0
INSTALL View File

@@ -0,0 +1,10 @@
1
+To compile the game you must run:
2
+	$ make
3
+
4
+To install the game use the command:
5
+	# make install
6
+
7
+To uninstall:
8
+	# make uninstall
9
+
10
+The compilation requires gcc and maven to be installed on the system.

+ 3
- 0
README.md View File

@@ -6,6 +6,9 @@ A Java recreation of the classic game Robot Odyssey I
6 6
 
7 7
 Copyright (c) 2000 Thomas Foote
8 8
 
9
+Optimization to compile, install, and run under linux:
10
+Copyright (c) 2015 Chris Cromer
11
+
9 12
 Permission is hereby granted, free of charge, to any person obtaining
10 13
 a copy of this software and associated documentation files (the
11 14
 "Software"), to deal in the Software without restriction, including

src/main/resources/chips/4NodeL2R.chip → chips/4NodeL2R.chip View File


src/main/resources/chips/4NodeR2L.chip → chips/4NodeR2L.chip View File


src/main/resources/chips/4ORL2R.chip → chips/4ORL2R.chip View File


src/main/resources/chips/4ORR2L.chip → chips/4ORR2L.chip View File


src/main/resources/chips/6BitCounter.chip → chips/6BitCounter.chip View File


src/main/resources/chips/Bus.chip → chips/Bus.chip View File


src/main/resources/chips/Clock.chip → chips/Clock.chip View File


BIN
chips/CountToN.chip View File


src/main/resources/chips/Delay.chip → chips/Delay.chip View File


src/main/resources/chips/FullAdder.chip → chips/FullAdder.chip View File


src/main/resources/chips/Monomer.chip → chips/Monomer.chip View File


src/main/resources/chips/OneShot.chip → chips/OneShot.chip View File


src/main/resources/chips/RSflipflop.chip → chips/RSflipflop.chip View File


src/main/resources/chips/Token.chip → chips/Token.chip View File


BIN
chips/WallHugger.chip View File


BIN
chips/gates.chip View File


src/main/resources/chips/old_WallHugger.chip → chips/old_WallHugger.chip View File


BIN
chips/oscillator.chip View File


src/main/resources/chips/quarter.chip → chips/quarter.chip View File


+ 2
- 1
src/com/droidquest/DQ.java View File

@@ -11,6 +11,8 @@ import java.awt.*;
11 11
 import java.awt.event.*;
12 12
 import java.util.Set;
13 13
 
14
+import java.io.*;
15
+
14 16
 public class DQ extends JFrame implements ActionListener {
15 17
     private RoomDisplay myRoom;
16 18
 
@@ -276,7 +278,6 @@ public class DQ extends JFrame implements ActionListener {
276 278
         }
277 279
     }
278 280
 
279
-
280 281
     public void actionPerformed(ActionEvent e) {
281 282
         if (e.getActionCommand().equals("Save Level")) {
282 283
             FileDialog fd = new FileDialog(this, "Save Level", FileDialog.SAVE);

+ 2
- 2
src/com/droidquest/avatars/Player.java View File

@@ -136,8 +136,8 @@ public class Player extends Item implements Avatar {
136 136
                         + fd.getFile());
137 137
                 if (fd.getFile() != null) {
138 138
                     ((SmallChip) carrying).Empty();
139
-                    //((SmallChip) carrying).LoadChip(fd.getDirectory() + fd.getFile());
140
-                    ((SmallChip) carrying).LoadChip(fd.getFile(), false);
139
+                    ((SmallChip) carrying).LoadChip(fd.getDirectory() + fd.getFile(), false);
140
+                    //((SmallChip) carrying).LoadChip(fd.getFile(), false);
141 141
                 }
142 142
                 return true;
143 143
             }

+ 1
- 105
src/com/droidquest/devices/SmallChip.java View File

@@ -239,111 +239,7 @@ public class SmallChip extends GenericChip {
239 239
 			File file;
240 240
 			InputStream link;
241 241
 
242
-			if (!gameChip) {
243
-				filename = System.getProperty("user.home") + "/.DroidQuest/chips/" + filename;
244
-
245
-				/* Create default chips for user */
246
-				file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/");
247
-				if (!file.exists()) {
248
-					file.mkdirs();
249
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/CountToN.chip");
250
-					if (!file.exists()) {
251
-						link = getClass().getResourceAsStream("/chips/CountToN.chip");
252
-						Files.copy(link, file.getAbsoluteFile().toPath());
253
-					}
254
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/gates.chip");
255
-					if (!file.exists()) {
256
-						link = getClass().getResourceAsStream("/chips/gates.chip");
257
-						Files.copy(link, file.getAbsoluteFile().toPath());
258
-					}
259
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/oscillator.chip");
260
-					if (!file.exists()) {
261
-						link = getClass().getResourceAsStream("/chips/oscillator.chip");
262
-						Files.copy(link, file.getAbsoluteFile().toPath());
263
-					}
264
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/WallHugger.chip");
265
-					if (!file.exists()) {
266
-						link = getClass().getResourceAsStream("/chips/WallHugger.chip");
267
-						Files.copy(link, file.getAbsoluteFile().toPath());
268
-					}
269
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/4NodeL2R.chip");
270
-					if (!file.exists()) {
271
-						link = getClass().getResourceAsStream("/chips/4NodeL2R.chip");
272
-						Files.copy(link, file.getAbsoluteFile().toPath());
273
-					}
274
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/4NodeR2L.chip");
275
-					if (!file.exists()) {
276
-						link = getClass().getResourceAsStream("/chips/4NodeR2L.chip");
277
-						Files.copy(link, file.getAbsoluteFile().toPath());
278
-					}
279
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/4ORL2R.chip");
280
-					if (!file.exists()) {
281
-						link = getClass().getResourceAsStream("/chips/4ORL2R.chip");
282
-						Files.copy(link, file.getAbsoluteFile().toPath());
283
-					}
284
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/4ORR2L.chip");
285
-					if (!file.exists()) {
286
-						link = getClass().getResourceAsStream("/chips/4ORR2L.chip");
287
-						Files.copy(link, file.getAbsoluteFile().toPath());
288
-					}
289
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/6BitCounter.chip");
290
-					if (!file.exists()) {
291
-						link = getClass().getResourceAsStream("/chips/6BitCounter.chip");
292
-						Files.copy(link, file.getAbsoluteFile().toPath());
293
-					}
294
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/Bus.chip");
295
-					if (!file.exists()) {
296
-						link = getClass().getResourceAsStream("/chips/Bus.chip");
297
-						Files.copy(link, file.getAbsoluteFile().toPath());
298
-					}
299
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/Clock.chip");
300
-					if (!file.exists()) {
301
-						link = getClass().getResourceAsStream("/chips/Clock.chip");
302
-						Files.copy(link, file.getAbsoluteFile().toPath());
303
-					}
304
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/Delay.chip");
305
-					if (!file.exists()) {
306
-						link = getClass().getResourceAsStream("/chips/Delay.chip");
307
-						Files.copy(link, file.getAbsoluteFile().toPath());
308
-					}
309
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/FullAdder.chip");
310
-					if (!file.exists()) {
311
-						link = getClass().getResourceAsStream("/chips/FullAdder.chip");
312
-						Files.copy(link, file.getAbsoluteFile().toPath());
313
-					}
314
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/Monomer.chip");
315
-					if (!file.exists()) {
316
-						link = getClass().getResourceAsStream("/chips/Monomer.chip");
317
-						Files.copy(link, file.getAbsoluteFile().toPath());
318
-					}
319
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/old_WallHugger.chip");
320
-					if (!file.exists()) {
321
-						link = getClass().getResourceAsStream("/chips/old_WallHugger.chip");
322
-						Files.copy(link, file.getAbsoluteFile().toPath());
323
-					}
324
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/OneShot.chip");
325
-					if (!file.exists()) {
326
-						link = getClass().getResourceAsStream("/chips/OneShot.chip");
327
-						Files.copy(link, file.getAbsoluteFile().toPath());
328
-					}
329
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/quarter.chip");
330
-					if (!file.exists()) {
331
-						link = getClass().getResourceAsStream("/chips/quarter.chip");
332
-						Files.copy(link, file.getAbsoluteFile().toPath());
333
-					}
334
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/RSflipflop.chip");
335
-					if (!file.exists()) {
336
-						link = getClass().getResourceAsStream("/chips/RSflipflop.chip");
337
-						Files.copy(link, file.getAbsoluteFile().toPath());
338
-					}
339
-					file = new File(System.getProperty("user.home") + "/.DroidQuest/chips/Token.chip");
340
-					if (!file.exists()) {
341
-						link = getClass().getResourceAsStream("/chips/Token.chip");
342
-						Files.copy(link, file.getAbsoluteFile().toPath());
343
-					}
344
-				}
345
-			}
346
-			else {
242
+			if (gameChip) {
347 243
 				filename = "/usr/share/DroidQuest/chips/" + filename;
348 244
 			}
349 245
 

+ 1
- 1
src/com/droidquest/levels/MainMenu.java View File

@@ -267,7 +267,7 @@ public class MainMenu extends Level {
267 267
         player = gameCursor;
268 268
         currentViewer = player;
269 269
 
270
-        File f = new File(System.getProperty("user.home") + "/.DroidQuest/" + "ROlevels/");
270
+        File f = new File(System.getProperty("user.home") + "/.DroidQuest/ROlevels/");
271 271
         if (!f.exists()) {
272 272
             f.mkdir();
273 273
         }

Loading…
Cancel
Save