Add support to be able to open SNBT using the Open Menu option
This commit is contained in:
parent
c53b060739
commit
fc6a268792
3 changed files with 9 additions and 4 deletions
|
@ -1 +1 @@
|
|||
const VERSION = "1.1.012325+1215";
|
||||
const VERSION = "1.1.012425+0821";
|
||||
|
|
|
@ -109,7 +109,8 @@ class EditorState extends State<Editor> {
|
|||
ListTile(
|
||||
title: const Text("O P E N"),
|
||||
leading: const Icon(Icons.folder),
|
||||
subtitle: const Text("Open an existing NBT Document for editing"),
|
||||
subtitle:
|
||||
const Text("Open an existing NBT/SNBT Document for editing"),
|
||||
onTap: () async {
|
||||
if (await needsPermissionsPage()) {
|
||||
Navigator.pushNamed(context, "/perms");
|
||||
|
@ -130,6 +131,10 @@ class EditorState extends State<Editor> {
|
|||
return;
|
||||
} else {
|
||||
// String!!
|
||||
CompoundTag ct = CompoundTag();
|
||||
if (filePath.endsWith(".txt") || filePath.endsWith(".snbt")) {
|
||||
ct = await SnbtIo.readFromFile(filePath) as CompoundTag;
|
||||
} else
|
||||
CompoundTag ct = await NbtIo.read(filePath);
|
||||
|
||||
SessionData.ROOT_TAG = ct;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
name: nbteditor
|
||||
description: A Minecraft NBT Editor written in Flutter
|
||||
publish_to: "none"
|
||||
version: 1.1.012325+1215
|
||||
version: 1.1.012425+0821
|
||||
|
||||
environment:
|
||||
sdk: ^3.6.1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue