mega12345mega / NBT-Editor

Edit items, blocks, and entities in-game.
MIT License
49 stars 16 forks source link

Optimization and improvement #80

Closed Xantrisse closed 8 months ago

Xantrisse commented 8 months ago

I suggest optimizing the modification. When opening medium-sized items, my ping increases significantly. When expanding a small item, fps drops significantly (this is about expanding the entire NBT data). If you don't know what I mean, I can simulate the situation. Another thing that can be improved is adding a scroll bar on all larger screens because some people may have a damaged scroll on their mouse. 20240114151226213606-image

THX :D

mega12345mega commented 8 months ago

For the performance stuff, that's covered in #59. I'm not sure why the ping would increase, though. If the client is freezing when opening the item, then that might increase the ping as the client isn't responding. I'm not sure which screen(s) are missing a scrollbar; can you specify which?

Xantrisse commented 8 months ago

I don't see the sliders on the selected NBT edit screen (For example, after clicking the expand button)

Xantrisse commented 8 months ago

New translation for https://github.com/mega12345mega/NBT-Editor/actions/runs/7579421678 https://github.com/Xantrisse/NBT-Editor-Mod-Polish-translation

From now on, I use my own program for translation, so there will be no spaces between lines for some time. I will try to improve this program :D

mega12345mega commented 8 months ago

I've just added (theoretically) the last lang entries before this update, so if you could translate those that would be great! For the spacing, I've just written a somewhat janky formatter that assumes all the keys are in the same order. If you're interested in adding it directly to your program, here it is:

Expand ``` public static void main(String[] args) throws IOException { if (args.length < 2) { System.out.println("Usage: "); return; } File ref = new File(args[0]); File toFormat = new File(args[1]); if (!ref.exists() || !toFormat.exists() || !ref.isFile() || !toFormat.isFile()) { System.out.println("Make sure both files exist and are files!"); return; } String[] refLines = Files.readString(ref.toPath()).replace("\r", "").split("\n"); List formattedLines = Stream.of(Files.readString(toFormat.toPath()).replace("\r", "").split("\n")).collect(Collectors.toList()); for (int i = 0; i < refLines.length; i++) { if (refLines[i].isBlank()) formattedLines.add(i, "\t"); else { String formattedLine = formattedLines.get(i); if (!formattedLine.startsWith("\t") && !formattedLine.equals("{") && !formattedLine.equals("}")) { while (formattedLine.startsWith(" ")) formattedLine = formattedLine.substring(1); formattedLines.set(i, "\t" + formattedLine); } } } Files.writeString(toFormat.toPath(), String.join(System.lineSeparator(), formattedLines)); } ```
Xantrisse commented 8 months ago

I use python... :D

Xantrisse commented 8 months ago

I've just added (theoretically) the last lang entries before this update, so if you could translate those that would be great!

Updated :D The link is in the previous comment

image

mega12345mega commented 8 months ago

I've now added scrollbars to the multi-line text fields in v1.13.0, which seems to have been the only scrollable GUI missing them. In the process, I also took the chance to improve scrollbars in general, so you can now move your mouse away from the bar.

Thanks for keeping the language file constantly updated btw! It's pretty cool being able to support other languages.