• Print

Author Topic: Idea for new UCL menu  (Read 13 times)

0 Members and 1 Guest are viewing this topic.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Idea for new UCL menu
« on: January 19, 2009, 07:21:57 pm »
Here's a quick idea I threw out for a possible new UCL config menu. Sorry for my terrible penmanship. :P

The top part is the group configuration. You start by choosing a group (or creating, removing) on the left, users in the group are shown on the right with the ability to add and remove from there too. In the middle is every possible access flag. There's a checkbox to enable/disable access to the specified permission, and the 'more' button.

The menu you get when you click the 'more' button for 'ulx ban' is shown on the bottom of the page. It starts by showing you the command format and then going into specific configs for each parameter. In the case of the first arg, you can specify that the group is allowed to target immune players with this command, or specify groups they can target. The second arg is a little more exciting in this case, where you can constrain the range of time this group is allowed to ban someone. The checkboxes show whether they are constrained to that number or not (how else do we allow infinity?).

Don't let this scare you from a programming aspect though, I've thought it through and I think it would be fairly simple to program. Specifically, if we go with the method I proposed earlier where we're specifying the args a command can take like this...
Code: Lua
  1. cmd = NewCommand( "ulx slap" )
  2. cmd:SetFunction( ulx.Slap )
  3. cmd:SetParam{ arg=1, type=PlayerArg }
  4. cmd:SetParam{ arg=2, optional, type=IntArg, max=100, min=0 }
  5. cmd:SetParam{ arg=3, optional, type=BoolArg }

It all becomes a simple matter of having the types (PlayerArg, IntArg, BoolArg, etc) take care of menu generation, config loading/saving/validation, etc. The menus would all be generated using the information we're already specifying in the code.

Thoughts? :)

Edit
Sorry about the image, my computer is showing it rotated perfectly, not sure why it's not showing right here...
« Last Edit: January 19, 2009, 07:23:29 pm by Megiddo »
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Idea for new UCL menu
« Reply #1 on: January 19, 2009, 07:48:05 pm »
I like it.

Re: Photo - Most photo apps can tell when a photo's been taken long-ways and adjust for that using the EXIF data.
Apparently, SMF doesn't :P
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline spbogie

  • Ulysses Team Member
  • Sr. Member
  • *****
  • Posts: 456
  • Karma: 41
Re: Idea for new UCL menu
« Reply #2 on: January 20, 2009, 07:42:59 am »
An interesting idea with the commands. I've personally been doing a lot of work with low level C and assembly with classes reacently, so to me the whole object oriented approach for a simple command seems a little overboard, but I suppose it may be easier for others to understand. I can also see some potential issues should the occasion ever arise where arguments could be of more than one type.

The menu idea is nice, but I'm not sure every command needs a "More" option. I suppose for specifying who they can target, but I think that's better suited being set per-group. At least a per-group default setting, and then special restrictions can be enabled per-command on those which it is desired.

Also, because I've seen it asked once or twice about SuperAdmin's level of power, I think a warning box that pops up when you try to add a user to SuperAdmin saying something along the lines of "WARNING: SuperAdmin users have full access to all commands. Do not grant SuperAdmin access to anyone whom you would not trust with direct access to the server console. Are you sure...?" (this would only apply to adding through the menu)

(No, I'm not dead, just distracted ;))
I have not failed. I've just found 10,000 ways that won't work. - Thomas A. Edison
I reject your reality and substitute my own. - Adam Savage

  • Print