Commit 9b239ddc authored by deregges's avatar deregges

Added experimental checkBox, currently containing the rotation feature

parent 58ed076c
......@@ -124,6 +124,9 @@ class Settings : AppCompatActivity() {
}
}
enableExperimental.isChecked = Preferences.experimentalEnabled
enableExperimental.setOnCheckedChangeListener { _, new -> Preferences.experimentalEnabled = new }
btnClearHighscores.setOnClickListener {
AlertDialog.Builder(this)
.setTitle(R.string.settings_btnClearHighscoresDialogTitle)
......
......@@ -5,12 +5,10 @@ import android.graphics.PointF
import android.graphics.Region
import io.ender.pathchaser.GameActivity
import io.ender.pathchaser.Log
import io.ender.pathchaser.collectibles.Coin
import io.ender.pathchaser.collectibles.Shields
import io.ender.pathchaser.collectibles.SpeedDown
import io.ender.pathchaser.collectibles.SpeedUp
import io.ender.pathchaser.collectibles.*
import io.ender.pathchaser.enemys.Enemy
import io.ender.pathchaser.util.Constants
import io.ender.pathchaser.util.Preferences
import java.io.Serializable
class PathManager(val game: GameActivity) : Serializable {
......@@ -108,7 +106,7 @@ class PathManager(val game: GameActivity) : Serializable {
in 1..3 -> SpeedUp(this, p)
in 5..6 -> SpeedDown(this, p)
in 10..12 -> Shields(this, p)
//in 15..18 -> Rotation(this, p)
in 15..18 -> if (Preferences.experimentalEnabled) Rotation(this, p) else Coin(this, p)
else -> Coin(this, p)
}
)
......
......@@ -11,6 +11,7 @@ object Preferences : DefaultPreferences() {
var lastName by stringOrNullPref()
var inputMethod by enumPref(Constants.InputMethod.TOUCH)
var rotationSensitivity by floatPref(1f)
var experimentalEnabled by boolPref(false)
private fun <E : Enum<E>> enumPref(default: E) = object : ReadWriteProperty<Preferences, E> {
private val internal = intPref(default.ordinal)
......
......@@ -61,6 +61,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<CheckBox
android:id="@+id/enableExperimental"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="@string/settings_titleExperimental"/>
<Button
android:id="@+id/btnClearHighscores"
android:layout_width="match_parent"
......
......@@ -32,4 +32,5 @@
<string name="settings_btnClearHighscoresDialogTitle">Highscores entfernen</string>
<string name="settings_btnClearHighscoresDialogMessage">Damit werden alle highscores gelöscht. Fortfahren?</string>
<string name="settings_titleSensitivity">Neigungsempfindlichkeit</string>
<string name="settings_titleExperimental">Experimentelle Features</string>
</resources>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment