almost 3000 lines of "errors" contained one actual memleak, one actually
unused variable and three actual ambiguous code parts
from cppcheck website: "The goal is to detect only real errors in the
code (i.e. have zero false positives)." :)
thx for finding five problems in our code
menuitemmapload mapname action [hoveraction [desc]]
create menu entry for a map file
menudirlistsub action dots
adds subdirectory entries to a menu with a files list
has to come after the menudirlist command
<action> is the command to be executed, when the menu entry is chosen
if <dots> is 1, an entry ".." is added
enumfiles path [extension]
lists files in a directory
if extension is specified, only files of that extension are listed
if the extension is "dir", only directories are listed
DOCREF menuitemmapload menudirlistsub enumfiles
* fix some memory leaks
* rename stuff
* fix crash
Removed commands and variables:
chmenumdl (replaced by menumdl)
scorefont (replaced by "menufont score mono")
menuitemvar (better handled with fully dynamic menus)
Changed commands:
menufont menu font
Sets the font for a specific menu. If menu is "", the currently
initialised menu is used. Example: menufont score mono
menumdl menu mdl anim rotspeed scale
Assumes the function of the previous chmenumdl. If menu is "", the
currently initialised menu is used. Specifies, which model to render
and how. If only menu is specified, no model is rendered.
DOCREF chmenumdl scorefont menufont menumdl menuitemvar
- omit step size for sliders with value descriptions
- optionally auto-determine max value by list length
menuitemslider text min max value display action wrap
menuitemradio text min max value display action
text: menu item text
min: min value
max: max value (or optionally -1 and set by display string length)
value: initial value
display: list of value descriptions or value step size
action: executed on value changes (new value in arg1)
wrap: if 1, wrap slider around (radio buttons always wrap)
DOCREF menuitemslider menuitemradio
updateeditinfopanel is a cubescript hook to provide additional information
about the current edit situation, like, for example, the closest entity.
The returned text is rendered on the right side of the screen.
Default for updateeditinfopanel is explainclosestentity which provides
detailed info about the closest entity.
editinfopanelmillis <n>
update the edit info panel every n milliseconds
hideeditinfopanel 0|1
render (0) or hide (1) the edit info panel
DOCREF updateeditinfopanel editinfopanelmillis hideeditinfopanel
and: fix enumsounds, kill some CR, cleanup
menuitemcheckbox <text> <value> <action> <position>
Now takes an optional fourth parameter "position" in the range from 0
to 100, default 0, which moves the position of the checkbox over the
width of a text input or slider, with 100 being left and 0 being right.
DOCREF menuitemcheckbox
* fixes bug with text input fields with less than 15 chars allowed
* recalculates slider width for resolution and font changes (on menu open)
* new tab-like function for '\n' in menuitems: sync with slider width
(see example in menus_edit.cfg in this commit)
DOCREF menuitem
menusynctabstops 0|1
if enabled(1), tab positions in a menu are synchronised
default is off(0)
affects menu title, header and items but not footer or descriptions
DOCREF menusynctabstops
1. Added background to description of selected keyinput item.
2. Added warning to menu footer, when user tries to bind already bound key.
3. Cleanup, fixed background color in description of selected active
menu items, when "menuitem" is absent in the menu.
* removed convertcase
use toupper (concat A B C D ....) instead
* moved several COMMAND macros to their function bodies
* cleaned up screenshot extension handling
* prefix screenshot argument with "screenshot/" and add correct extension
Two new commands, menuitemeditkeyinput and menuitemspectkeyinput, both
work the same as menuitemkeyinput - only for edit and spect binds.
The new edit keys menu should also work fine as edit key help :)
menuitem[|edit|spect]keyinput text bindcmd
Menuitem, that displays "text" and all keys, that bind "bindcmd" - in
game-, edit- or spect mode.
DOCREF menuitemeditkeyinput menuitemspectkeyinput
Now, if the last line of a menu is a text input item, pressing enter in
that line will not only execute the assigned command, but also close the
menu.
With this, menus without the annoying "[OK]"-button can be created.
Also: emptied text input fields don't magically fill up again, when you
deselect them.
DOCREF menuitemtextinput
Drop support for maps outside packages/maps and for package config files.
(never been used in AC anyway)
also: generate all map related filenames with proper path separators
By specifying a title string in the second argument to chmenutexture,
a picture is rendered instead of a texture. The title string is
displayed instead of the texture resolution. The variable menupicturesize
holds a size modifier for pictures, similar to menutexturesize.
DOCREF chmenutexture menupicturesize
In second and next lines server description lost formatting, so also
colors, and it could be cut.
Now text in footer will be also divided by spaces, and not characters
(not applicable in case of long continuous strings).
menuselectionpersistent
Enables persistent selections for the currently displayed menu and also
restores a previously saved selection. Probably most efficient inside
"menuinit". The position is restored during execution of this command,
so the menu entry has to already exist and the alias with the last
position has to be read from saved.cfg. In autmatically created menus
it may be necessary to execute the command with a short delay (see
examples in this commit).
DOCREF menuselectionpersistent
Also: add '\a' to the list of escaped characters and remove storage of
unneeded "filename".
mitemaltfont <altfont> <text> <action> <hoveraction> <desc>
Displays a menu line with a text which may contain chars from an
alternate font.
altfont
Name of the alternate font.
text
Content of menu line. Chars from the alternate font have to be marked
with "\a". Alternate font chars have no width and are just rendered
above the following text. Use spaces to counter that.
action, hoveraction, desc
Same function as with other menu lines.
DOCREF menuitemaltfont
chmenutexture <menu name> <texture path>
Displays a texture on the right side of a menu.
menutexturesize <size factor>
Changes the size of textures displayed in menus. Mostly for testing
purposes.
DOCREF chmenutexture menutexturesize
Moves a menu away from the middle of the screen. Values of "100" represent
half the screen width and height.
menurenderoffset x-offset y-offset
DOCREF menurenderoffset
Keys 5, 6 and 7 (in combination with the scrollwheel) can be used to alter
the new entity attributes.
Pressing editmeta (LCTRL by default) speeds up the scrolling.
(Parts of the roll code are borrowed from Alejandro V. Garcia's commit
"Model rotations, experimental" from January 2013)
Note: coop edit is now broken between "next" and older clients, but I
don't want to bump the protocol just yet.
Not clearing the menu selection in a followup "newmenu" command does not
seem to have negative effects - and keeps the selection.
Initaction ("menuinit") is now executed before the selction focus is set
during menu->open. This avoids old hover commands to be executed before
the menu gets deleted during rebuild.
Now the command specified by menuinit is executed first, and then the
various menu item init commands (for example getting the value for
menuitemtextinput lines).
This may affect some menu init scripts - but I couldn't find any problems.
It only affects menus which use "menuinit" _and_ menu items with
initialisation.