Skip to content

Commit 1af6a62

Browse files
committed
patch: For Clarity's Sake, Please Don't Say "Licensed under GNU GPL 2"!
1 parent 2efcdeb commit 1af6a62

File tree

4 files changed

+63
-63
lines changed

4 files changed

+63
-63
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Library is [here](https://github.com/BeboKhouja/PC-Simulator-Save-Editor).
3737
./gradlew library:assemble
3838
```
3939
### The App
40-
* Build the app
40+
* Build the app:
4141

4242
```
4343
./gradlew app:assembleDebug
@@ -52,11 +52,11 @@ Library is [here](https://github.com/BeboKhouja/PC-Simulator-Save-Editor).
5252
- Doing a lot of automated actions (Insert object, Cleanup, Save Options) could cause the save to be broken (Additional text after reading JSON)
5353

5454
# License
55-
PC Simulator Save Editor Android is licensed under [GPLv3.0](https://github.com/BeboKhouja/PCSimulatorSaveEditorAndroidPort/blob/master/LICENSE).
55+
PC Simulator Save Editor Android is licensed under [GPLv3.0-or-later](https://github.com/BeboKhouja/PCSimulatorSaveEditorAndroidPort/blob/master/LICENSE) license.
5656

5757
# Credits & Licenses (if available)
5858
- The [Stack Overflow](https://stackoverflow.com) community for resolving a lot of bugs.
59-
- [JSONJava](https://github.com/stleary/JSON-java) ([Public Domain](https://github.com/stleary/JSON-java/blob/master/LICENSE))
59+
- [JSONJava](https://github.com/stleary/JSON-java) (Public domain)
6060
- [AndroidX](https://github.com/androidx/androidx) ([Apache License 2.0](https://github.com/androidx/androidx/blob/androidx-main/LICENSE.txt))
6161
- [Android](https://android.googlesource.com/) ([Apache License 2.0](https://android.googlesource.com/trusty/vendor/google/aosp/+/master/LICENSE))
6262

app/src/main/assets/insertJSON.json

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -95,41 +95,44 @@
9595
{"name": "Printer Ink (M)", "spawnId": "PrinterInk_M"},
9696
{"name": "Printer Ink (Y)", "spawnId": "PrinterInk_Y"},
9797
{"name": "Used SSD", "spawnId": "SSD 128GB", "customData": {
98-
"storageName":"Local Disk",
99-
"password":"",
100-
"files":[
101-
{
102-
"path":"System/boot.bin",
103-
"content":"pcos",
104-
"hidden":true,
105-
"size":60000,
106-
"StorageSize":60000
107-
}
108-
,{
109-
"path":"App Downloader.exe",
110-
"content":"",
111-
"hidden":false,
112-
"size":432,
113-
"StorageSize":432
114-
},
115-
{
116-
"path":"Text Editor.exe",
117-
"content":"",
118-
"hidden":false,
119-
"size":264,
120-
"StorageSize":264
121-
},{
122-
"path":"Launcher.exe",
123-
"content":"",
124-
"hidden":false,
125-
"size":94,
126-
"StorageSize":94
127-
}
98+
"storageName": "Local Disk",
99+
"password": "",
100+
"files":[
101+
{
102+
"path": "System/boot.bin",
103+
"content": "pcos",
104+
"hidden": true,
105+
"size": 60000,
106+
"StorageSize": 60000
107+
},
108+
{
109+
"path": "App Downloader.exe",
110+
"content": "",
111+
"hidden": false,
112+
"size": 432,
113+
"StorageSize": 432
114+
},
115+
{
116+
"path": "Text Editor.exe",
117+
"content": "",
118+
"hidden": false,
119+
"size": 264,
120+
"StorageSize": 264
121+
},
122+
{
123+
"path": "Launcher.exe",
124+
"content": "",
125+
"hidden": false,
126+
"size": 94,
127+
"StorageSize": 94
128+
}
128129
],
129-
"uptime":2241.17017,
130-
"health":100.0,
131-
"damaged":false,
132-
"glue":false}},
130+
"uptime": 2241.17017,
131+
"health": 100.0,
132+
"damaged": false,
133+
"glue": false
134+
}
135+
},
133136
{"name": "Wooden Table", "spawnId": "Table"},
134137
{"name": "Modern Table", "spawnId": "Table_1"},
135138
{"name": "Chair (Toilet)", "spawnId": "ToiletBowl"},

app/src/main/java/com/mokkachocolata/pcsimulatorsaveeditorandroidport/MainActivity2.kt

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ import com.google.android.material.snackbar.Snackbar
6464
import com.mokkachocolata.library.pcsimsaveeditor.MainFunctions
6565
import org.json.JSONArray
6666
import org.json.JSONObject
67-
import org.luaj.vm2.Globals
6867
import org.luaj.vm2.LuaValue
6968
import org.luaj.vm2.lib.OneArgFunction
7069
import org.luaj.vm2.lib.ThreeArgFunction
@@ -110,7 +109,7 @@ class MainActivity2 : AppCompatActivity() {
110109
private lateinit var menus : Menu
111110
private lateinit var globalVars : GlobalVars
112111
var text = ""
113-
var saveString = "" // This way, we dont have to change the edittext, which reduces memory.
112+
var saveString = "" // This way, we don't have to change the edittext, which reduces memory.
114113
private var decrypt_after_opening = true
115114
private var encrypt_after_saving = true
116115
private lateinit var version : String
@@ -129,11 +128,11 @@ class MainActivity2 : AppCompatActivity() {
129128
)
130129
var lua_openFile_dat : Uri? = null
131130
var lua_openFile_picked = false
132-
lateinit var lua_global : Globals
131+
// lateinit var lua_global : Globals
133132

134-
val result = registerForActivityResult(ActivityResultContracts.OpenDocument()) {data ->
135-
if (data != null) {
136-
lua_openFile_dat = data
133+
val result = registerForActivityResult(ActivityResultContracts.OpenDocument()) {
134+
if (it != null) {
135+
lua_openFile_dat = it
137136
lua_openFile_picked = true
138137
} else {
139138
lua_openFile_picked = false
@@ -170,12 +169,12 @@ class MainActivity2 : AppCompatActivity() {
170169
val library = tableOf()
171170
library["Version"] = LuaValue.valueOf(globalVars.version)
172171
library["Platform"] = valueOf(0)
173-
library.set("Print", object : OneArgFunction() {
172+
library["Print"] = object : OneArgFunction() {
174173
override fun call(arg: LuaValue?): LuaValue {
175174
arg?.toString()?.let { Log.i("Script", it) }
176175
return NONE
177176
}
178-
})
177+
}
179178
library["DisplayDialog"] = object : TwoArgFunction() {
180179
override fun call(arg1: LuaValue?, arg2: LuaValue?): LuaValue {
181180
if (Build.VERSION.SDK_INT >= 31) {
@@ -195,9 +194,8 @@ class MainActivity2 : AppCompatActivity() {
195194
}
196195
}
197196
library["DecryptString"] = object : OneArgFunction() {
198-
override fun call(arg1: LuaValue?): LuaValue {
199-
return LuaValue.valueOf(MainFunctions().Decrypt(arg1?.toString()))
200-
}
197+
override fun call(arg1: LuaValue?): LuaValue =
198+
LuaValue.valueOf(MainFunctions().Decrypt(arg1?.toString()))
201199
}
202200
library["SetSaveContents"] = object : OneArgFunction() {
203201
override fun call(contents: LuaValue?): LuaValue {
@@ -206,9 +204,8 @@ class MainActivity2 : AppCompatActivity() {
206204
}
207205
}
208206
library["GetSaveContents"] = object : ZeroArgFunction() {
209-
override fun call(): LuaValue {
210-
return LuaValue.valueOf(edittext.text.toString())
211-
}
207+
override fun call(): LuaValue =
208+
LuaValue.valueOf(edittext.text.toString())
212209
}
213210
library["AddMenuItem"] = object : TwoArgFunction() {
214211
override fun call(name: LuaValue?, callback: LuaValue?): LuaValue {
@@ -727,7 +724,7 @@ class MainActivity2 : AppCompatActivity() {
727724
|Free, and open source.
728725
|Get beta builds at the Actions tab at the GitHub repository.
729726
|Report any issues at the Issues tab at the GitHub repository.
730-
|This app is licensed with GPLv3.0.
727+
|This app is licensed with GPLv3.0 or later.
731728
|This project is neither associated, affiliated, nor endorsed by Intel or AMD.
732729
|""".trimMargin(), {_,_->}, null // This way we won't get into trouble
733730
)
@@ -838,25 +835,24 @@ class MainActivity2 : AppCompatActivity() {
838835
var password : String
839836
val edittext = EditText(this)
840837
val dialogDriveName : String
841-
val size : Array<String>
842-
when (driveType) {
838+
val size = when (driveType) {
843839
"usb" -> {
844840
dialogDriveName = "USB"
845-
size = emptyArray()
841+
emptyArray()
846842
}
847843
"ssd" -> {
848844
dialogDriveName = "SATA SSD"
849-
size = arrayOf("128GB", "256GB", "512GB", "1TB", "2TB")
845+
arrayOf("128GB", "256GB", "512GB", "1TB", "2TB")
850846
}
851847
"nvme" -> {
852848
dialogDriveName = "M.2 NVMe SSD"
853-
size = arrayOf("128GB", "256GB", "512GB", "1TB")
849+
arrayOf("128GB", "256GB", "512GB", "1TB")
854850
}
855851
"hdd" -> {
856852
dialogDriveName = "HDD"
857-
size = arrayOf("500GB", "1TB", "2TB", "5TB")
853+
arrayOf("500GB", "1TB", "2TB", "5TB")
858854
}
859-
else -> throw UnsupportedOperationException("Thats not a supported type!")
855+
else -> throw UnsupportedOperationException("That's not a supported type!")
860856
}
861857
dialog("$dialogDriveName Drive Name", "Set the storage name that appears in Disk Management and when you hold it.", { _, _ ->
862858
driveName = edittext.text.toString()
@@ -917,14 +913,15 @@ class MainActivity2 : AppCompatActivity() {
917913
}
918914
R.id.license -> {
919915
dialog("Open Source Licenses", """
920-
This app is licensed with GPLv3.0.
916+
This app is licensed with GPLv3.0 or later.
921917
AndroidX (Apache License 2.0)
922918
Android (Apache License 2.0)
923919
JSONJava (Public Domain)
924920
""".trimIndent(), {_,_->}, null)
925921
}
926922
R.id.saveoptions -> {
927-
val optionList = arrayOf("AC Temperature",
923+
val optionList = arrayOf(
924+
"AC Temperature",
928925
"AC Power",
929926
"Version",
930927
"Money",
@@ -934,7 +931,8 @@ class MainActivity2 : AppCompatActivity() {
934931
"Playtime",
935932
"Light",
936933
"Sign",
937-
"Save name")
934+
"Save name"
935+
)
938936
val text = input.text.toString()
939937
lateinit var jsonObject : JSONObject
940938
val lines = text.lines()

0 commit comments

Comments
 (0)