Commit Graph
7779 Commits
Author SHA1 Message Date
ac-stef a6bd160a76 disable ktf indicator when minimap is open 2017-06-08 19:28:07 +02:00
ac-stef ef2b91c0ce more cubescript limits
the limits are hardcoded and require recompilation to change

* limit recursion depth
* limit loop iterations
* limit string lengths
* limit push/pop depth
* clean surplus whitespace from config files
* provide context for script errors

(limits accidental crashes, not intentionally malfunctioning code)
2017-06-08 19:00:04 +02:00
ac-stef 2a52dc0069 third option for flag score hud transparency
flagscorehudtransparency 0|1|2

    0: no transparency, icon set "flag gone"
    1: transparency, icon set "flag gone"
    2: transparency, classic icon set (default)

DOCREF flagscorehudtransparency
2017-06-08 00:39:24 +02:00
ac-stef 83d0199867 command cleanup
changed commands:

  strstr haystack needle

    now returns position of needle in haystack (counting from 1)
    or zero, if not found

  substr string start len

    now counts negative length from total length
    "substr text 1 -2" now returns the text without first and last char

  strreplace text search replace

    no longer restricted to 260 char stringlengths

removed commands:

  swapelements, strpos (can be scripted, if required)

DOCREF strstr substr
DOCREF swapelements strpos
2017-06-07 23:20:00 +02:00
ac-stef ffee440fa0 add early string replacement and alias lookup to cubescript
replace tokens starting with @ during scanning/sizing-up of []-blocks

  @word    look up word as in $word
  @(...)   evaluate braces
  @[...]   evaluate braces and look up result
  @"..."   parse quotes

in nested []-blocks, use multiple @ to determine time of replacement
(for example, @@@word is replaced when found inside three nested braces)

in regular $-lookup, $[...] now evaluates the braces before lookup
2017-06-07 18:16:06 +02:00
ac-stef 4d684cfc8e improve alias lookups
now i = 3; echo $(concatword arg $i) works like echo $arg3 :)
2017-06-06 21:41:25 +02:00
ac-stef 0e78c1e9dd fix empty menu footers
thx BrutalSystem
2017-06-06 19:19:57 +02:00
ac-stef dbcb040eeb menu code cleanup
* 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
2017-06-06 13:17:20 +02:00
ac-stef 7948212234 add radio buttons and simplify sliders
- 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
2017-06-06 13:17:20 +02:00
ac-stef c9ddadd525 per-slider option to wrap around
menuitemslider text min max val step display action wrap

DOCREF menuitemslider
2017-06-05 15:14:40 +02:00
ac-stef 1bf36ca2b3 option to turn off flag score hud transparency
flagscorehudtransparency 0|1

    default: 1

DOCREF flagscorehudtransparency
2017-06-05 01:06:35 +02:00
ac-stef d81071f200 provide HOME for all
...menus
2017-06-04 17:43:44 +02:00
ac-stef e57ece345d rewrite url connect protocol parser
to use existing url parser

valid examples:

  assaultcube://example.org
  assaultcube://example.org:28763
  assaultcube://example.org:28763/?password=secret
  assaultcube://example.org?password=secret
  assaultcube://example.org/?password=secret
  assaultcube://example.org/?port=28763
  assaultcube://example.org?password=secret&port=28763
  assaultcube://example.org?port=28763&password=secret
  assaultcube://11.22.33.44
  assaultcube://11.22.33.44/
  assaultcube://11.22.33.44:28763
  assaultcube://11.22.33.44:28763/?password=secret

* the slash after the host part (example.org) is optional
* the host part can also be an IP address
* password and port in the query part (after '?') have no specific order
2017-06-04 17:43:40 +02:00
ac-stef d5e00f9e89 optionally omit cleaning up vector when closing vector stream
allows reusing the vector

Makefile updates
2017-06-02 14:30:31 +02:00
ac-stef e5b99e6da4 xmap menus
getxmaplist <what>

    Returns a list of all regular xmaps in memory, or, if <what> is "bak"
    the details of a stored backup xmap. Each xmap is listed with nickname
    and description.

DOCREF getxmaplist
2017-05-31 19:59:17 +02:00
ac-stef 0bd18421f1 optionally not store inputcommand into command history
inputcommand <init> <command> <prompt> <nopersist>

    Opens a custom console buffer with custom prompt, initial buffer text
    and execution script (which gets the input buffer content in alias
    cmdbuf). If nopersist is not zero, the command will not be stored in
    console history.

DOCREF inputcommand
2017-05-31 15:37:08 +02:00
ac-stef a588761b5a add vantage point menu
also: added sanity checks for vantage points

  getvantagepoint

    returns string with coordinates of vantage point or empty string, if
    none is set

DOCREF getvantagepoint
2017-05-31 14:19:39 +02:00
ac-stef 460066f7da cleanup closestent
- make sure, nextclosestent works for pinned entities
- menu entries for nextclosestent
- highlight closest ent
- have closestenttype return the current value and not change the value if
  the argument is "-"
- recognise manually changed closestenttypes in the menu

DOCREF closestenttype
2017-05-31 12:15:32 +02:00
ac-stef 954fe7ee7f cleanup edithide
- replace by simple bitmask
- rewrite showedithide, setedithide and seteditshow in cubescript
- menu added for convenient use

setedithide and seteditshow no longer accept entity type numbers as
parameters - only entity type names

showedithide, setedithide and seteditshow are considered deprecated

  edithideentmask

    Integer variable containing a bitmask of hidden entity types.

DOCREF showedithide setedithide seteditshow edithideentmask
2017-05-31 03:00:38 +02:00
ac-stef a4cb82b25c point and click to select entities
pointatent 0|1

    enables (1) or disables (0) pointing at entities
    if an entity is poiinted at during disabling, it is pinned

  pointatentmaxangle a

    specifies the required precision for pointing at entities

DOCREF pointatent pointatentmaxangle
2017-05-31 01:56:18 +02:00
ac-stef cb2e20af98 optionally hide closest entity filename info
it gets cut off on 5:4 screens...

  hideeditslotinfo 0..2

    0: show info always
    1: only show "unassigned slot" if necessary
    2: never show info

DOCREF hideeditslotinfo
2017-05-30 10:43:55 +02:00
ac-stef 72e5b08463 add edit info panel
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
2017-05-30 10:43:55 +02:00
ac-stef a7b84e4338 new command format2
like format, but all parameters are treated as lists and are exploded first

  format2 <formatstring> arg1 arg2 arg3...

    substitutes %1..%9 with the arguments 1..9
    argument lists are exploded first

    /echo (format "_%1_%2_%3_%4_%5_" "A B C" D E F)
    prints: _A B C_D_E_F__

    /echo (format2 "_%1_%2_%3_%4_%5_" "A B C" D E F)
    prints: _A_B_C_D_E_

In addition, both format and format2 now allow access to more than nine
parameters. Parameter numbers of 10 and higher have to be prefixed with
an additional zero. For example "%010" accesses parameter number ten.

DOCREF format2 format
2017-05-29 18:00:37 +02:00
ac-stef c02c1277ec cleanup
declare "?" and "switch" deprecated: should not be used or documented

DOCREF ? switch
2017-05-29 15:47:12 +02:00
ac-stef 753474c401 menu updates
- separate settings menus for console and scoreboard
- some sorting
- "return" command removed

DOCREF return
2017-05-29 00:00:26 +02:00
ac-stef 5e20a2343b add animated inlined images for console text
Images are stored in packages/misc/igraph/*.png and loaded during game
start. Filenames consist of the image shorthand (mnemonic) and optional
frame times, separated by "_". Keep in mind, media file names may only
contain letters, digits and "_-.()".

All texts displayed in the game console are scanned for mnemonics prefixed
with ":". All found matches are replaced by the image.

The images are displayed as squares with width and height the same as the
regular font height. To create animations, put several square images side
by side into the file. For example, a 128x32 image is interpreted as four
frames. Frame duration is encoded in the filename, so, for example the file
"nop_1000_200_100.png" shows the first frame for 1000 milliseconds, the
second frame for 200 msec and the third (as the rest) for 100 msec.

Igraphs "1" to "9" are hardcoded and can be manually encoded in menu texts.
Use the new escape code "\i" plus the number of the image: "\i\1".."\i\9".
Other images can be used in menus as well, but the codes have to be fetched
by getigraph.

new commands:

  updateigraphs

    Checks for new files in packages/misc/igraph. Only necessary, if new
    files are added during the game - for example, by mod package download.

  getigraph <mnemonic>

    Returns an encoded string to display an image outside the console, or
    an empty string, if the mnemonic was not found.

new parameters:

  igraphsize 80..300 (default 120)

    scales the images (in percent)

  igraphsizehardcoded 80..160 (default 106)

    scales the hardcoded images "1".."9" (in percent)

  igraphanimate 0..1 (default 1)

    if 0, only the first frame of every image is displayed

  igraphdefaultframetime 5..2000 (default 200)

    used for images with multiple frames but no frame duration specified
    in the filename

  hideigraphs 0..1 (default 0)

    if 1, no new images will be shown in the console

DOCREF updateigraphs getigraph igraphsizehardcoded
DOCREF igraphsize igraphanimate igraphdefaultframetime hideigraphs
2017-05-28 23:29:06 +02:00
ac-stef 4e77b91c0e re-check line-of-sight depth readout from the graphics driver
- manually intersect line-of-sight with all map geometry
- shorten sight vector if necessary
2017-05-28 00:37:13 +02:00
ac-stef c97461a0f5 docs fixes and cleanup
- cleanup scoreboard menu code
- clientlog info messages for debug binaries only
- have debug binaries check for easy docs errors
- docinvalid now also checks for broken references
2017-05-24 20:11:11 +02:00
ac-stef b0dc65e50b add debug checks to verify proper calling threads for functions
for some functions, it matters...
2017-05-24 11:25:15 +02:00
ac-stef 969e7308be fix generic byteswap code
also, make use of builtins
2017-05-24 11:19:16 +02:00
ac-stef b49dd05411 add incremental mode for tiger hash
also clean up and fix some stuff: lilswap(unsigned long long int) mapped
to the 32-bit swap code...

added some runtime tests for the hash functions - now they will crash at
startup, if some test vectors fail (because big endian is still untested)
2017-05-24 11:18:18 +02:00
ac-stef 5cf4c8d61d rewrite ringbuf
to use own pointers for reading and writing

broken find() removed
2017-05-24 11:08:36 +02:00
ac-stef 8ece94d5bb allow menu checkboxes to change position
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
2017-05-24 02:09:17 +02:00
aurhatandac-stef 71a75a9dce Update keyboard menus 2017-05-24 02:09:09 +02:00
ac-stef dd82065177 fix killmessage menu
and add frag/gibmessage weapon name completion
2017-05-22 22:50:51 +02:00
ac-stef a97d69bc0e relocate string sort functions 2017-05-22 20:52:45 +02:00
ac-stef 1afd7515ab simplify masterserver type selection
Use a plain cubescript variable instead of a commandline switch.

mastertype
  0: classic direct TCP connection
  1: HTTP connection (via proxy) (default)

DOCREF mastertype "--mastertype="
2017-05-22 20:44:58 +02:00
ac-stef 2bc8936680 cleanup killmessages
* remove server-side custom killmessages (log files need to be uniform)
* clean up client-side custom killmessages
2017-05-22 20:19:15 +02:00
ac-stef 271d5b3929 always use a profile directory
If none is specified by commandline, "profile/" is used. This way,
downloaded files don't mix with the original install files.
2017-05-22 19:53:01 +02:00
ac-stef ad5a438b86 remove legacy mode for filtertext
was no longer in use
2017-05-22 19:50:31 +02:00
ac-stef d0b309320b really cleanup sound
- collect most sound infos in one table and use it to generate the menus
- no more sound category checks with ranges
- now only PAINx and FOOTSTEP* sounds use hardcoded index numbers

enumsounds <list of categories>

  Lists sound index numbers and short descriptions for all sounds of one
  or more categories. The argument should contain one or more of PAIN,
  OWNPAIN, WEAPON, PICKUP, MOVEMENT, BULLET, OTHER, VOICECOM, TEAM,
  PUBLIC, FFA, FLAGONLY. All sounds with at least one of the flags will
  be listed. Flag names prefixed with "!" will exclude all matching
  sound from the list.

  Example: /echo (enumsounds "VOICECOM !PUBLIC") will list all voicecom
  sounds that are for teams only.

DOCREF enumsounds
2017-05-22 17:30:51 +02:00
ac-stef 6e24e4af6c hide frag score hud for zero scores 2017-05-22 11:29:45 +02:00
ac-stef 788baf6299 cleanup sound 2017-05-22 11:29:41 +02:00
aurhat e126faef15 Cleanup 2017-05-21 22:08:04 +02:00
aurhat 8bc1a0121b Display description of references in menu footer 2017-05-21 21:43:33 +02:00
ac-stef 58ca08ec86 fix conc
thx BrutalSystem
2017-05-19 23:15:18 +02:00
ac-stef aa2e3876f9 fix menu footer size calculation
also: limit width of item descriptions to screen width & wrap around
2017-05-18 19:29:31 +02:00
ac-stef 2f99b368f0 allow mnemonics for execution context levels
scriptcontext and isolatecontext now allow plain text mnemonics for
context level arguments (one of CORE, CFG, PROMPT, MAPCFG, MDLCFG)

also:

- cleanup (some dead code and dead prototypes removed)
- some stuff renamed
- script errors now show context levels
- conc is no longer thread-safe (but slightly faster)

DOCREF scriptcontext isolatecontext
2017-05-18 16:19:01 +02:00
ac-stef ec2cdb4533 print filenames for errors in map and model config files 2017-05-17 14:13:45 +02:00
ac-stef 6bafdb0037 allow particle type names in md2emit and md3emit
md[2|3]emit <tag name> <particle type> <attrib1> <attrib2>

  particle type may now be numeric 0..19 or one of SPARK, SMOKE, ECLOSEST,
  BLOOD, DEMOTRACK, FIREBALL, SHOTLINE, BULLETHOLE, BLOODSTAIN, SCORCH,
  HUDMUZZLEFLASH, MUZZLEFLASH, ELIGHT, ESPAWN, EAMMO, EPICKUP, EMODEL,
  ECARROT, ELADDER, EFLAG

also: cleanup

DOCREF md2emit md3emit
2017-05-16 17:50:00 +02:00