Author |
Message |
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sun Jan 30, 2011 2:05 pm Post subject: <C> cmdlist |
|
|
|
|
Following the discussion in this topic, I made a simple ?cmdlist module.
It will list all the commands available to the player, for all the modules in the arena. The commands are sorted alphabetically. It lists commands that can only be sent privately separately. However, commands that can be sent both publicly and privately are only shown in the 'Public commands' section, it would be pretty spammy otherwise.
It needs to be loaded right after the chat module, in modules.conf.
Feel free to make improvements on this and post updates.
Source and windows binary included.
Possible improvements:
-Filter option (i.e. "?cmdlist set" would return all commands containing "set")
-Column formatting (sort commands and display them top to bottom, left to right, instead of left to right, top to bottom)
-Get the chat interface in POSTLOAD or on the first ?cmdlist called; this would allow us to load the cmdlist module earlier
-Variable number of columns / column width, perhaps even automatically adjust the column width depending on the longest command name
UPDATE 20/02/2011: Uploaded new version. Includes makefile. Compiles and runs properly both on Linux and Windows. _________________ (Insert a bunch of dead links here)
.dll and source
cmdlist.zip - 23.59 KB
File downloaded or viewed 198 time(s)
cmdlist.png - 66.86 KB
File downloaded or viewed 203 time(s)
Last edited by Samapico on Sun Feb 20, 2011 2:59 am, edited 1 time in total |
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Mon Jan 31, 2011 1:21 am Post subject: Re: <C> cmdlist |
|
|
|
|
Samapico wrote: | -Filter option (i.e. "?cmdlist set" would return all commands containing "set")
-Column formatting (sort commands and display them top to bottom, left to right, instead of left to right, top to bottom)
-Variable number of columns / column width, perhaps even automatically adjust the column width depending on the longest command name |
i would say the first two would be substantially important, but the third one can not be done without knowing the client's resolution
Samapico wrote: | -Get the chat interface in POSTLOAD or on the first ?cmdlist called; this would allow us to load the cmdlist module earlier
|
this isnt even really needed, but if you feel the need to:
Get the chat interface in POSTLOAD=winner
the other one is just silly _________________ SSC Distension Owner
SSCU Trench Wars Developer
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Mon Jan 31, 2011 6:52 am Post subject: |
|
|
|
|
The server does know the client's resolution, you know. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Mon Jan 31, 2011 8:09 am Post subject: |
|
|
|
|
By the way, these 'possible improvements' are stuff that I probably won't do myself (unless I specifically need it at some point), but you're all welcome to do it
|
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Mon Jan 31, 2011 1:23 pm Post subject: |
|
|
|
|
Dr Brain wrote: | The server does know the client's resolution, you know. |
lol i forgot about that
also, i rewrote this and compiled, and then it crashed when the first command got added, then i compiled your source file, same thing, then i used your included binary, same thing.
and yet you have a screenshot, so it must have worked at some point...
is there something missing?
|
|
Back to top |
|
|
Arnk Kilo Dylie Seasoned Helper
Age:37 Gender: Joined: Jul 14 2006 Posts: 108 Offline
|
Posted: Mon Jan 31, 2011 2:16 pm Post subject: |
|
|
|
|
Server doesn't know the text size the client is using though
Anyway...I was hoping that you wrote something that magically could replace hz's cmdlist module. While you're doing a clever hack, I figure cmdman needs to be redone anyway...grouping commands into sections is a must--such that one could filter out staff vs player commands, commands for each module or game, etc. That's already on the list of 1,000 desirable asss revamps that might happen in the next 10 years...ramble ramble
P.S. Would recommend not using POSTLOAD.
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Mon Jan 31, 2011 5:38 pm Post subject: |
|
|
|
|
Did you put cmdlist:cmdlist right after chat in modules.conf?
And it shouldn't be attached to any arena either.
As for splitting in sections...
if capman has a way to tell us if a capability is available for a normal player, we could get:
Player commands:
...
(if you have powers other than default)
Other/staff commands:
...
But splitting by modules is way trickier... Perhaps it could recognize a string in the helptext of a function (Module: ... Args: ... etc...) and categorize it as what's written at Module... If you don't write anything, or if the command doesn't have a helptext, it just puts it in a generic section.
So you could categorize your commands, but if you don't want to, you don't have to. But doing it automatically, as it is now, would be impossible
Either way, I think it's very useful, even as it is. When you forget how a particular command was spelled, or whatever.
|
|
Back to top |
|
|
Arnk Kilo Dylie Seasoned Helper
Age:37 Gender: Joined: Jul 14 2006 Posts: 108 Offline
|
Posted: Mon Jan 31, 2011 5:54 pm Post subject: |
|
|
|
|
I know, that's why I brought up that cmdman needs an overhaul anyway. Oh, and capman too...
Brainstorm things you need in new versions of those and it might happen.
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Mon Jan 31, 2011 6:59 pm Post subject: |
|
|
|
|
One way to do things would be:
1) Add a 'AddCommand' function that has another parameter for a 'category'
2) The default AddCommand would use "" as category
Unless there's really a way to know from which module the AddCommand was called from...
And to differentiate player commands from staff commands, the only way I can think of is some kind of:
GroupHasCapability(somegroup (i.e. "default"), somecapability (i.e. "cmd_stats")); function.
From what I see and understand in capman.c, it would be pretty easy.........
Actually:
return(cfg->GetStr(groupdef, somegroup, cap) != NULL);
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
|
Back to top |
|
|
Cheese Wow Cheese is so helpful!
Joined: Mar 18 2007 Posts: 1017 Offline
|
Posted: Sun Feb 20, 2011 10:25 am Post subject: |
|
|
|
|
recompiled from source with this fix, and it works 100% now
good job, this thing is awesome
also, since this is probably going to be used by everyone, variable column lengths and vertical alphabeticismness are going to be pretty much mandatory.
ill write it when i get some free time in about six months from now...
PS filter would be icing on the cake
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sun Feb 20, 2011 11:49 am Post subject: |
|
|
|
|
Cheese wrote: |
also, since this is probably going to be used by everyone, variable column lengths and vertical alphabeticismness are going to be pretty much mandatory.
ill write it when i get some free time in about six months from now...
PS filter would be icing on the cake | Yeah I know. I want all of these things too
|
|
Back to top |
|
|
Dr Brain Flip-flopping like a wind surfer
Age:38 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
|
Back to top |
|
|
JoWie Server Help Squatter
Gender: Joined: Feb 25 2004 Posts: 215 Offline
|
Posted: Tue Feb 22, 2011 6:31 am Post subject: |
|
|
|
|
- Align column left, right or center
- Custom characters for the borders (padding, configurable width for borders, custom junction chars, etc)
- Maximum width based on screen resolution
- Maximum width configurable with the command ?menuwidth (persistent)
- Multiple tables within a menu can be stretched to each others width
- Column less tables (text area) within a menu
- Custom seperators
- Toggle visibility of columns
- Calculates the best column width to use based on the data contained in each row (like html tables)
- word wraps column data without breaking lines
Requires cPickle
ChatMenu_test.py - 3.45 KB
File downloaded or viewed 293 time(s)
ChatMenu.py - 19.81 KB
File downloaded or viewed 305 time(s)
|
|
Back to top |
|
|
|