-
Notifications
You must be signed in to change notification settings - Fork 19
Add GUI to Memory Panels #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This commit adds a tinker menu to the memory panel, allowing users to paste in JSON data and write it to the component's storage. A new UI layout has been created for the tinker menu, along with a JSON library to handle parsing and serialization. The memory panel script has been updated to include the necessary client-side logic for the tinker menu.
|
I have some questions:
|
JuneCarya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some comments to some code segments.
This isn't a finalised review and I will leave up the decision to merge to one of the maintainers
0x57e11a
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feel free to ignore the nitpicks, they're mostly just style
Yes I used jules (gemini) and gpt to try to accelerate parts of the development. most of the code was fairly simple and I have adjusted, reviewed and tested. the validation part which was generated is: which upon review I can see has a little oversight in the fact that the LHS and RHS can be blank and default to zero when I believe it should just ignore such an entry. |
|
this looks a lot better! |
GUI only created once. Removed old wrapping system. Newlines after commas. Spaces after colons. Last colon and comma ignored so you can delete it without the formatter blocking you. Display the new data when you press write. Moved the parsing to its own function. Changed label to "edit contents". Sorted keys and nicer stringify. not instead of == nil nitpick. Taller GUI.
|
also sidenote, the code for the counter GUI also creates it every time on tinker and I just copied that behaviour. If it's better to create only once then that should be applied to the counter too. |
|
same for the math block |
Add GUI instance persistence for counters and math blocks
|
I know you're supposed to make each feature into its own pull request but it's so minor that I hope you'll let it slide. up to you guys how you handle it. |
|
it might actually be intentional to avoid loading a whole GUI instance for every block every time even when it's not going to be used. sounds like it would be a memory usage concern. |
Yeah I've just seen that now too and it's valid to just use the same approach there in this case. I still would've probably approached it differently, but that's okay.
Fair point. I don't know about the intentions of the original developers who worked on this. If it comes to having a single local memoryGui
...
function MemoryPanel:client_onCreate()
...
if not memoryGui then
memoryGui = sm.gui.createGuiFromLayout("$CONTENT_DATA/Gui/Layouts/MemoryPanelGui.layout", false, { backgroundAlpha = 0.5 })
-- Rest of the setup code
end
...
end
...I suppose you can ignore my earlier comment about moving the creation of the |
|
I'll do you one better, give me a moment |
|
never mind my idea didn't work, looks like your suggestion really is the best approach |
|
ok so your idea worked on the memory panel UI, but when I tried the exact same approach on the counter and math block, they just both stopped working |
|
I've double checked to make sure I did the replacements just right. the counter block throws no errors but just the button callbacks don't work. and the math block throws errors when you try to select a function. |
This reverts commit 67e3c54.
|
so I suppose I'll just leave the counter and math blocks alone |
JuneCarya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also test your changes in multiplayer with other people online?
I suspect some issues with the synchronisation of the server's data with all its clients.
|
alright I'll try to fix it all and try to get someone to test it tomorrow |
|
the errors occuring were just from data not beng synced |
|
I'm thinking a better way to do it would be to just sync the data once when the GUI is opened as like a request to the server. I'll try that tomorrow and test it with a friend. |
|
Yeah no the cached GUI in a global variable was breaking things again @JuneCarya. also according to |
|
tested in multiplayer and working |
|
there is an alternative approach I could take where the client asks the server for the data as the GUI opens but this would introduce latency |
|
currently it keeps all clients synced with the latest state of the memory panel |
|
iio: a little bit of latency sounds like an acceptable tradeoff for avoiding unneeded network spam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than the decision between less network usage and lower latency, LGTI
thank you for your contributions and your patience with the review process!
Connected clients ask the server for the data when opening the GUI
|
Yeah I think it's probably for the best, that should do it |
|
no something still feels off, I don't think |
|
I think that's a much neater way of handling it, give it a proper multiplayer test tomorrow |
0x57e11a
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after an mp test and @JuneCarya's review, should be ready to merge!
2025-11-15.13-47-14.mp4It works exactly as expected! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will be my final requested changes. After that I'll request one of the maintainers to check this and let them make the final call about implementing this feature.
I'm usually not involved in the decision making on what features are green lit and also don't want to take on that responsibility without some of the original authors getting involved.
Replaced usage of self.host with sm.isHost for host checks. Simplified parseData and enforced validation.
|
Dear maintainers, thank you for your consideration, I believe this to be a very useful feature which many people have been lacking for a while. Until this point the only way to enter large amounts of data into memory panels has been to use macros or blueprint editing which is either slow or difficult. There are a wide variety of applications that memory panels are used for like storing programs for computers and saving video and music data and working with memory panels has often been tedious. This feature adds a simple GUI not unlike the counter which makes viewing and editing the stored data of the memory panel trivial. I hope you see it's potential and will choose to officially add it to the modpack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TechnologicNick I'll be handing over the decision to you now.
Additional testing by people more familiar with the code base could make sure that everything is fine.
What could be done is rebasing this PR to clean up the commit history should this be merged into main @rubyswolf
@JuneCarya I can't figure how to do it. It just keeps saying that everything is already up to date and I don't see a pull requests settings tab at all like it says there should be online. |
|
Please help |
|
I was a bit busy the last few days and don't check in on github that often. I don't use github's desktop application, so I can't help you with that tool. The link above explains rebasing using CLI tools |



Added a GUI to the memory panel which allows you to view and edit the stored data as a comma separated list of key:value entries like "0:1,1:2"