Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- The previous game save database has been rewritten using Room. The old database is not migrated, so existing saves may not longer be discoverable. That's not a huge concern though, as they're so out of date that they won't be usable with the new CTH engine anyway, and there's no plans to support them. - Save games can be deleted by swiping left on either the save or load views. There is a grace period during which the deletion can be undone. - Add screenshots and save game locations to the configuration. These are both stored in the app's file storage, and may be backed up. - Autosave games appear when loading a game but do not appear when saving, to prevent them from being overwritten. - A confirmation is presented when attempting to overwrite an existing save game.
- Loading branch information
1 parent
1a4dda1
commit 6093e07
Showing
26 changed files
with
1,048 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule src
updated
12 files
+23 −16 | Android/androidevents.cpp | |
+1 −0 | Android/androidevents.h | |
+74 −11 | Android/androidhooks.cpp | |
+30 −5 | CorsixTH/Lua/app.lua | |
+2 −4 | CorsixTH/Lua/config_finder.lua | |
+10 −2 | CorsixTH/Lua/dialogs/resizables/android_menu.lua | |
+2 −1 | CorsixTH/Lua/dialogs/resizables/main_menu.lua | |
+8 −5 | CorsixTH/Lua/game_ui.lua | |
+11 −13 | CorsixTH/Lua/persistance.lua | |
+2 −1 | CorsixTH/Lua/ui.lua | |
+2 −1 | CorsixTH/Src/sdl_core.cpp | |
+50 −31 | CorsixTH/Src/th_gfx_sdl.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content"> | ||
|
||
<EditText | ||
android:id="@+id/newSaveName" | ||
android:inputType="text|textCapWords" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="16dp" | ||
android:layout_marginLeft="4dp" | ||
android:layout_marginRight="4dp" | ||
android:layout_marginBottom="4dp" | ||
android:hint="@string/new_save_name" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/list" | ||
android:name="uk.co.armedpineapple.cth.SaveLoadFragment" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_marginLeft="16dp" | ||
android:layout_marginRight="16dp" | ||
app:layoutManager="LinearLayoutManager" | ||
tools:context=".files.SaveLoadFragment" | ||
tools:listitem="@layout/save_list_item" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/saveLayout" | ||
android:layout_width="match_parent" | ||
android:layout_height="80dp" | ||
android:layout_marginVertical="4dp" > | ||
|
||
<ImageView | ||
android:id="@+id/imageView2" | ||
android:layout_width="120dp" | ||
android:layout_height="80dp" | ||
android:src="@drawable/baseline_add_24" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
android:contentDescription="Plus Icon" /> | ||
|
||
<TextView | ||
android:id="@+id/textView" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="16dp" | ||
android:text="@string/new_save" | ||
android:textSize="20sp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toEndOf="@+id/imageView2" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
<FrameLayout | ||
android:id="@+id/save" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"/> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:id="@+id/saveLayout" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginVertical="4dp"> | ||
|
||
<ImageView | ||
android:id="@+id/saveImage" | ||
android:layout_width="90dp" | ||
android:layout_height="60dp" | ||
android:contentDescription="@string/screenshot_contentdesc" | ||
android:scaleType="centerCrop" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
tools:srcCompat="@tools:sample/avatars" /> | ||
|
||
<TextView | ||
android:id="@+id/saveName" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="8dp" | ||
android:ellipsize="marquee" | ||
android:maxLines="1" | ||
android:textSize="20sp" | ||
app:layout_constraintEnd_toStartOf="@+id/guideline2" | ||
app:layout_constraintStart_toEndOf="@+id/saveImage" | ||
app:layout_constraintTop_toTopOf="parent" | ||
tools:text="SaveGameName" /> | ||
|
||
<TextView | ||
android:id="@+id/saveDate" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="2dp" | ||
android:ellipsize="marquee" | ||
android:textSize="12sp" | ||
app:layout_constraintStart_toStartOf="@+id/saveName" | ||
app:layout_constraintTop_toBottomOf="@+id/saveName" | ||
tools:text="2022/07/06 11:53PM" /> | ||
|
||
<ImageView | ||
android:id="@+id/moneyImage" | ||
android:layout_width="16dp" | ||
android:layout_height="16dp" | ||
android:layout_marginStart="8dp" | ||
android:layout_marginBottom="4dp" | ||
android:contentDescription="@string/money_contentdesc" | ||
app:layout_constraintBottom_toTopOf="@+id/guideline3" | ||
app:layout_constraintStart_toStartOf="@+id/guideline2" | ||
app:srcCompat="@drawable/baseline_attach_money_24" /> | ||
|
||
<TextView | ||
android:id="@+id/money" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="2dp" | ||
android:ellipsize="end" | ||
android:maxLines="1" | ||
android:textSize="12sp" | ||
app:layout_constraintBottom_toBottomOf="@+id/moneyImage" | ||
app:layout_constraintStart_toEndOf="@+id/moneyImage" | ||
app:layout_constraintTop_toTopOf="@+id/moneyImage" | ||
tools:text="-1.395m" /> | ||
|
||
<androidx.constraintlayout.widget.Guideline | ||
android:id="@+id/guideline2" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
app:layout_constraintGuide_percent="0.76" /> | ||
|
||
<ImageView | ||
android:id="@+id/repImage" | ||
android:layout_width="16dp" | ||
android:layout_height="16dp" | ||
android:layout_marginTop="4dp" | ||
android:contentDescription="@string/rep_contentdesc" | ||
app:layout_constraintStart_toStartOf="@+id/moneyImage" | ||
app:layout_constraintTop_toTopOf="@+id/guideline3" | ||
app:srcCompat="@drawable/baseline_thumbs_up_down_24" /> | ||
|
||
<TextView | ||
android:id="@+id/rep" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="2dp" | ||
android:ellipsize="end" | ||
android:maxLines="1" | ||
android:textSize="12sp" | ||
app:layout_constraintBottom_toBottomOf="@+id/repImage" | ||
app:layout_constraintEnd_toEndOf="@+id/money" | ||
app:layout_constraintStart_toEndOf="@+id/repImage" | ||
app:layout_constraintTop_toTopOf="@+id/repImage" | ||
tools:text="154" /> | ||
|
||
<TextView | ||
android:id="@+id/level" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="2dp" | ||
android:textSize="12sp" | ||
app:layout_constraintStart_toStartOf="@+id/saveName" | ||
app:layout_constraintTop_toBottomOf="@+id/saveDate" | ||
tools:text="Level 1" /> | ||
|
||
<androidx.constraintlayout.widget.Guideline | ||
android:id="@+id/guideline3" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal" | ||
app:layout_constraintGuide_percent="0.5" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<dimen name="text_margin">16dp</dimen> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.