Hi. Imagine. I open derma and see a DTextEntry. I write something and then I press enter. That what I wrote in the DTextEntry should save. How to do it?
Moved to the correct section.
Depends on how you wish to save it and what you wish to save.
If you want to save it and write it to a text file to be used later on read the following - file.Write. After doing so you would use file.Read to access that saved data.
I would like to see changed value in DTextEntry
But how do you want it to save in what way? You are not giving any description for anyone to do anything with at the moment. Go into more detail or look around on the gmod wiki. Saying 'I would like to see changed value in DTextEntry' does not make sense since it seems like this is the box you want to input to. Do you mean how do you save it each time you open the menu? Please explain what you are wanting.
Ok. Look. I want to make entity where located many SimpleTextOutlined. When I press E (on the entity) I want see derma where I can change DTextEntry to change SimpleTextOutlined (Text on enity)
local TextEntry= vgui.Create( "DTextEntry" )
TextEntry.OnEnter = function()
OtherPanel:SetText(TextEntry:SetTextColor
:GetValue())
end
But when I open Derma again I don't see that what I wrote
Why are you setting the value of the text entry to the value that is already in the text entry box it makes no sense?
Still don't understand what you want since it seems like English is not your first language but from what I think I understand I will just check what you want. If you wanted it so the value saves when you reopen the menu then you would have to store the value when it is set then when the menu opens you set the value. If you want it to display on the entity or menu you need some way of showing it either throught 2d3d or something in 2D like DLable.
If you want it so the value is stored across separate entities then you can set a NWString or store a variable on the entity which can be called where ever you wish to call the variable such as opening the menu or displaying on the entity its self.
Yes. You are quite right
Sorry, you need to Log In to post a reply to this thread.