File tree Expand file tree Collapse file tree
app/src/main/java/com/mokkachocolata/pcsimulatorsaveeditorandroidport Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,7 +137,14 @@ class MainActivity2 : AppCompatActivity() {
137137 if (lines.size != 2 ) return false
138138 try {
139139 JSONObject (lines[0 ])
140- JSONObject (lines[1 ])
140+ val sec_line = JSONObject (lines[1 ])
141+ sec_line.getJSONArray(" itemData" )
142+ val plrdata = sec_line.getJSONObject(" playerData" )
143+ plrdata.getDouble(" x" )
144+ plrdata.getDouble(" y" )
145+ plrdata.getDouble(" z" )
146+ plrdata.getDouble(" ry" )
147+ plrdata.getDouble(" rx" )
141148 } catch (_: Exception ) {
142149 return false
143150 }
@@ -425,10 +432,10 @@ class MainActivity2 : AppCompatActivity() {
425432 input.setText(lines[0 ] + " \n " + jsonObject.toString())
426433 }
427434 private val pickBannerMedia = registerForActivityResult(ActivityResultContracts .PickVisualMedia ()) { uri ->
428- spawnPicture(uri!! , " BannerStand" )
435+ spawnPicture(uri ? : return @registerForActivityResult , " BannerStand" )
429436 }
430437 private val pickPaperMedia = registerForActivityResult(ActivityResultContracts .PickVisualMedia ()) { uri ->
431- spawnPicture(uri!! , " Paper" )
438+ spawnPicture(uri ? : return @registerForActivityResult , " Paper" )
432439 }
433440
434441 private val pickFile = registerForActivityResult(ActivityResultContracts .OpenDocument ()) {data ->
You can’t perform that action at this time.
0 commit comments