I need something like:
Variable_Edit(atom/A in world, edit as text)
var/list/variables = A.vars
if(!variables.Find(edit)) return
var/change = input("Change [edit] on [A] to what?") as text
//A.[edit] = change
Disregarding everything other than text and num for now cause I wouldn't know how to go that far.
// Tested code. Is meant to be dumped into a random project and should still work. |
In response to GhostAnime
|
|
GhostAnime wrote:
My HTML-style create & edit system so you can search for the variable you want to edit. (</shameless_plug>) I'm sorry for stealing your thunder, but I was already working on this before you posted. Why not just look up an Admin demo which should have this command in already? In my case I prefer to have something I can paste in any BYOND project which would work the same regardless of other people's code. Taking care of /client/Topic and /client/Click should be all that is needed to make this functionality work in a(ny) project. |
In response to Sir Lazarus
|
|
Sir Lazarus wrote:
GhostAnime wrote: Meh, I don't really care about the spotlight, especially seeing that I made the original demo of this system 6 years ago. (Man, time flies by fast). I do like your system & style, nice and simple :) Though the S column is pretty vague. I assume that the column refers if the value is TRUE or FALSE? (Not too sure what S stands for though, is it string?, since IMO "B" would be more appropriate for the TRUE/FALSE as they are Boolean values) Why not just look up an Admin demo which should have this command in already? Hm, I should have stated demo/library in that case. For the edit system, that can definitely be a library by itself but when you branch out to some other fields (like where the user can specify what variables cannot be edited, or specific objects on the create list), it would (kind of) fall under the demo category based on the wording of this pinned post. But that is just semantics *shrug*. But my point is that the OP could have searched for an admin system and would have seen how the verb works and could have copied it in to their system. If appropriately designed, I do not see an admin system in the demo/library section differing from how one would expect it to work. The process and visual style in the way it works may differ but the intended effect should happen with very little to no tweaking in any project included. (Again, the keyword here is appropriately designed). |
In response to GhostAnime
|
|
I have a code like that. I think I used either nero's or your demo a while ago. I don't want an overall variable analysis and search. I want to be able to type in a variable, look at it and make changes.
|
In response to Mav472
|
|
If you want to see the variable list all in one go, refer back to Sir Lazarus' post above.
The difference between mine and his system is that he shows the variables immediately whereas my current version is initially hidden until you click the link above (ex: clicking A will show all vars that starts with A) or typing in a portion of the name to search for the variable (ex: gr[enter] => group, up[enter]=>group). [The next version displays it right away but I don't see myself releasing that version anytime soon] They both work the same, just different execution/way to go around it. It doesn't really matter to us which one you chose since it'll be a behind-the-scene work. In the end, I would recommend Sir Lazarus since his version appears to be more user friendly than mine. |
That's what i'm saying. I don't want a list of variables (variable analysis) I want a more simplified version of edit. "Which variable would you like to edit? "
|
In response to Mav472
|
|
Mav472 wrote:
That's what i'm saying. I don't want a list of variables (variable analysis) I want a more simplified version of edit. "Which variable would you like to edit? " ... So, uh, how do you want to do that exactly? Because that's what the search field in both mine & SL's does. In SL's system, above the Variable link, there is a field that states Filter On Variable. You click that, start typing in the variable of interest and the body will narrow down to variables with those names. (Ex: when you type 'ic', it'll immediate filter down to icon & icon_state) Then you click that variable name to edit. |
I don't want a list. Just a verb. Something like this Variable_Edit(atom/A in world, edit as text)
var/list/variables = A.vars if(!variables.Find(edit)) return var/change = input("Change [edit] on [A] to what?") as text //A.[edit] = change Where I can just type in a variable to change without a list or searching. |
So you would rather type out the whole variable name in an input to edit than have a dynamic searching field which can narrow down long variable names with a few characters?
... Whatever floats your boat. This snippet (small test done) will make you choose if a variable is a text or number if a number is entered. The variable you want to edit must be entered exactly. This means this is case sensitive and the value will either be text or numeric (the latter asks which form you want via alert but you can always comment out that line to make it numeric by default). mob/verb/Variable_Edit(atom/A in world, edit as text) Also, for the future, please put your code in the DM tags like <DM>[CODE]</DM> |
In response to GhostAnime
|
|
GhostAnime wrote:
Though the S column is pretty vague. I assume that the column refers if the value is TRUE or FALSE? (Not too sure what S stands for though, is it string?, since IMO "B" would be more appropriate for the TRUE/FALSE as they are Boolean values) The "S" column shows the result of issaved() on the variable. If "T" then the variable is saved in a savefile. If "F" then the variable is tmp or const. Sorting is possible by clicking a header. Filtering is possible through the use of the text fields. Filters are always a "contains". Hm, I should have stated demo/library in that case. For the edit system, that can definitely be a library by itself but when you branch out to some other fields (like where the user can specify what variables cannot be edited, or specific objects on the create list), it would (kind of) fall under the demo category based on the wording of this pinned post. But that is just semantics *shrug*. I think we're on the same page... My approach requires both /client/Click and /client/Topic to be modified, which is a no-no in my design model. Built-in functions should call developer-operated functions, not be overridden by anyone else. What may be interesting to develop is an event model which developers can use to patch into procs such as /client/Click. This would allow an ambiguous case like this one to work seamlessly, has the additional benefit that developers can use the hooks themselves, and may help us when people come asking for support on the forum. Thank you for that idea. I'll look into it. |
For example:
Edit Nero's Admin System
My HTML-style create & edit system so you can search for the variable you want to edit. (</shameless_plug>)