X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/FreeShisen/blobdiff_plain/92b19250a620252d642c0abaf8dd3d733c299f3d..07fd4c9f7cc4b5ba98994f9c153213adf7c01a44:/src/de/cwde/freeshisen/ShisenSho.java diff --git a/src/de/cwde/freeshisen/ShisenSho.java b/src/de/cwde/freeshisen/ShisenSho.java index f4ee58e..9d5d1dd 100644 --- a/src/de/cwde/freeshisen/ShisenSho.java +++ b/src/de/cwde/freeshisen/ShisenSho.java @@ -14,6 +14,7 @@ public class ShisenSho extends Application { public int[] boardSize=new int[2]; public int difficulty=1; // 1=Easy, 2=Hard public int size=3; // 1=Small, 2=Medium, 3=Big + public int tilesetid = R.drawable.classic; public boolean gravity=true; public boolean timeCounter=true; @@ -83,6 +84,7 @@ public class ShisenSho extends Application { int difficulty = Integer.parseInt(sharedPref.getString("pref_diff", "1")); boolean gravity = sharedPref.getBoolean("pref_grav", true); boolean timeCounter = sharedPref.getBoolean("pref_time", true); + int tilesetid = tilesetStringToRes(sharedPref.getString("pref_tile", "")); boolean needsReset = false; @@ -101,14 +103,34 @@ public class ShisenSho extends Application { needsReset = true; } - if (timeCounter != this.timeCounter) { + if ((timeCounter != this.timeCounter) && (view != null)) { this.timeCounter = timeCounter; view.onTimeCounterActivate(); } + if ((tilesetid != this.tilesetid) && (view != null)) { + this.tilesetid = tilesetid; + view.loadTileset(); + } + if (needsReset && (view != null)) { view.reset(); } + } + private int tilesetStringToRes(String s) + { + if (s.equals("classic")) { + return R.drawable.classic; + } else if (s.equals("jade")) { + return R.drawable.jade; + } else if (s.equals("traditional")) { + return R.drawable.traditional; + } else if (s.equals("pixel")) { + return R.drawable.pixel; + } else { + return R.drawable.classic; + } + } }