Commit Graph
157 Commits
Author SHA1 Message Date
flowtron 75fe433613 retire newent7 2021-08-18 17:08:50 +02:00
flowtron 83bf139cc0 curated cubescript compatibility 2021-08-04 10:33:53 +02:00
flowtron 8a28e18056 poor man's decimal slider 2021-08-03 15:01:13 +02:00
flowtron b13fcaf3e3 merge grenadier/aurhat commits curated by BrutalSystem (issue #375) 2021-06-25 09:32:35 +02:00
BrutalSystemandGitHub a6a10268e8 fix pointatent
It was printing text on the console whenever  "editing setting" menu was opened and after closing and opening AC the config did not keep the "pointatent" configuration.
2021-06-20 10:54:47 -03:00
flowtron b043f27a18 add back dropped line 2021-06-20 11:45:22 +02:00
flowtron aaddacd3cb persistent edithideentmask and pointatent (issue #362) 2021-06-20 11:06:39 +02:00
BrutalSystemandGitHub 7796c5f946 Update menus_edit.cfg
fixed, I don't get any more errors generated in clientlog, my commit has also been fixed
2021-04-30 21:59:55 -03:00
drian e600ea09a3 Merge branch 'release_1.3' of https://github.com/assaultcube/AC into release_1.3 2021-04-30 06:02:03 +02:00
drian f080e16560 #286 Toggle for /pointatent missing in editing menu 2021-04-30 06:01:56 +02:00
BrutalSystemandGitHub 91b1fcd236 Update menus_edit.cfg
fix
2021-04-29 23:03:48 -03:00
drian 612d512ddd typo 2021-04-06 06:42:13 +02:00
drian 4cb6840f23 #243 menu back-navigation is not standardized 2021-04-06 06:41:38 +02:00
aurhat 9f537b0876 Fix unquoted semicolons
Thanks Robtics
2018-01-27 09:35:07 +01:00
ac-stef 59c3d1756d add option to grey out menu items
greyed out menu items are a) grey and b) can't be operated

  menuitemgreyedout 0|1

    menu items added after this command are greyed out (1) or not (0)

DOCREF menuitemgreyedout
2017-07-09 11:30:29 +02:00
ac-stef f33b9c0dba enable automapconfig whenever config slots are added 2017-06-16 19:20:21 +02:00
ac-stef 8235300d77 merge old and new entity copy/paste
- copyent and pasteent now also work with the menu list of copied ents
- pressing editmeta while using pasteent opens the menu
- new switch command (not unlike the old one)
- make expandselection and shrinkselection work with multiple selections

DOCREF switch copyent pasteent
2017-06-15 14:00:54 +02:00
ac-stef 0b2079660a fix clip entity menu and add entity copy/paste menu
newent7 type attr1 attr2 attr3 attr4 attr5 attr6 attr7

    Works like newent, but can set all seven attributes directly.
    Does not automatically put the camera yaw angle into mapmodel and flag
    entities.

fixed selectionwalk so that the first parameter can be ""

DOCREF newent7
2017-06-15 01:12:33 +02:00
ac-stef d7277c1aa4 fix permissions for some edit commands
- always allow read-only edittextureslot, editmapmodelslot and
  editmapsoundslot
- allow setvantagepoint when editing offline or spectating offline
- new var editing_sp: 1 during edit mode in singleplayer (offline)
- additional menus for read-only access to map config slots
- new bonus edit scripts: selectmiddle and unclipentclippedmodels

DOCREF edittextureslot editmapmodelslot editmapsoundslot setvantagepoint
DOCREF editing_sp
2017-06-14 16:33:58 +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 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 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 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 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
aurhatandac-stef 71a75a9dce Update keyboard menus 2017-05-24 02:09:09 +02:00
ac-stef abd37fe6d4 add command to rebuild mapmodel registry
While the mapmodel registry works fully automatically for all auto-
downloaded models, it does not check for manual changes to the filesystem.
To clear models from the list that have been deleted from the profile
directory and to add models that have been downloaded outside the game,
this new menu entry can be used.

mapmodelregistryclear deletes all loaded mapmodel attributes

loadallmapmodels checks the filesystem for mapmodels and loads them
(all trees below packages/models/mapmodels, in home, zips, mods, install)

Both together rebuild the whole mapmodel database.

DOCREF mapmodelregistryclear
2017-05-12 13:27:57 +02:00
ac-stef b33ad603d4 cleanup
c removed

DOCREF c
2017-05-12 01:33:55 +02:00
ac-stef b650fca2ca persistidents cleanup
Restore the old persistidents system from AC 1.0, since it's working as
intended - if used properly.

As a reminder:

  * aliases created by "const" and "tempalias" are never persistent
  * aliases created or altered by "alias" or "=" become persistent, if
    the persistidents flag is set during that operation
  * persistidents if false during the execution of almost all config files
    during game start - those files can create aliases with default values
    which will not be persistent (until changed later while the flag is
    set)
  * before saved.cfg is executed, the flag is set and stays set all
    throughout the game - which means, that all changes (from menus, for
    example) will change the altered alias to "persistent"
  * exceptions for map or model config files are unnecessary, since those
    run restricted and can't create aliases anyway
  * exceptions are necessary for "late run" config files like those in
    config/opt/

The new command "persistidents" may be used to manually set or clear the
flag. It also returns the current state of the flag. If used in a config
file, the flag is restored to its original value when the file ends
execution.

In short: only late-run config files (meaning: run after saved.cfg was
restored) may need to manually set/reset the flag. Use const and tempalias
where appropriate and clear persistidents before creating an alias with a
not-to-save default value that may be changed and made persistent later.

DOCREF persistidents
2017-05-05 15:50:59 +02:00
ac-stef 9739464381 unify menu slider width calculation
* 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
2017-04-24 19:51:40 +02:00
aurhat 4d2d326136 Cleanup 2017-02-18 22:40:07 +01:00
ac-stef c5065cddaa add batch map conversion tools and more editing scripts
convmap is a toolset to convert hundreds of maps mostly automatically
to map format 10. Old media paths from akimbo and from before AC 1.2 are
automatically converted to AC 1.2 and akimbo2 paths.

The additional editing scripts mostly help with further optimisation of
existing maps (mainly to reduce the number of clipped entities).

If convmap is loaded after mapeditscripts, one additional conversion
stage is unlocked.
2016-11-07 16:57:18 +01:00
ac-stef e12d25dc95 add todo list for entities
Add some commands to support an entity TODO list. Entity errors during
map load are automatically added to the list. The list is saved and
restored with xmaps. A keybind (no default key assigned) to scroll
through TODO entities was added.

The list is indented as a means for automated map check scripts to
return a list of entities to fix.

cleartodoentities [index]
  Clear list of TODO entities. The list is also deleted, when a new map
  is loaded.
  If an entity number is given as an argument, only entries for this
  entity are cleared.

addtodoentity index comment
  Add the entity #index to the TODO list. Add optional comment.

enumtodoentities
  Returns a list of TODO entities. Returns entity index number and comment
  for every entry.

DOCREF enumtodoentities addtodoentity cleartodoentities
2016-11-05 17:42:30 +01:00
ac-stef 88320bd095 add script and keybind to cycle through spawn points in edit mode
If the assigned key is pressed, the mousewheel can be used to cycle
through player spawn points, sorted by groups CLA, RVSF and FFA.

No default key is assigned.

gotonextplayerstart can be used, to manually jump to the next spawn.
2016-11-03 18:02:45 +01:00
ac-stef 71a12bfe82 allow custom mapmodels to depend on other custom mapmodels
By adding a "requires"-attribute to the mapmodel config file, a mapmodel
can trigger the map editor to include another model and have it loaded
during map load. This can be used to create model modifications which
use ressources of another model. For example, a new model can provide a
different skin for an existing model - and that attribute will make sure,
that the required original model is also loaded.

This mechanism does not work, if the attribute is changed after the map
is finished, because the map editor has to copy the dependency into the
map config file. After adding the attribute, the map has to be written at
least once (the dependencies are checked during savemap).

The point of dependency-attributes is to make sure the custom original
model is also loaded from a package server. Mods of official models do not
need to use the attribute, because the official model does not need to be
downloaded. The attribute is necessary, if one model on akimbo depends on
another model on akimbo.

The mapmodels that are required by other models have an additional
parameter "1" added to their mapmodel command in the config file - which
will preload the model during map load, even if no entity actually uses it.
The additional parameter is handled automatically.

The new command updatemapmodeldependencies triggers the dependency check
manually - which will make required models appear in the model list. This
is done automatically during savemap.

Changed commands:

  mapmodelslotusage

    now returns a single space, if the model slot is not used by any
    map entity, but is required by another model (with entities)

  mapmodel

    allows one more parameter - if "1", the model is preloaded, even if
    no entities use it

  mdlattribute requires <modelname>

    if used, specifies that the current model depends on parts of another
    custom model (which therefore also has to be downloaded)

    can only be used once per model config

    example:

      mdlattribute requires makke/signs/exit

        could be used in signs/loading-dock/md2.cfg to reuse
        makke/signs/exit/tris.md2

DOCREF mdlattribute mapmodel mapmodelslotusage
2016-10-16 21:54:22 +02:00
ac-stef a451a0fd61 show model usage info where models are used 2016-10-14 11:58:13 +02:00
ac-stef 0e425d2103 allow synonym for mapmodel distribution "autodownload"
"akimbo" says the same
2016-10-12 19:45:40 +02:00
ac-stef 5ba5d1b4b3 optionally show media origin in slot lists 2016-09-26 22:45:34 +02:00
ac-stef c66f846cf0 better selection handling for arch and slope placement
enlargearchslopeselections

  If the variable is set to 1, after placing an arch or a slope, the
  selection is enlarged, so that the arch or slope can be changed by
  vdelta increments (for example, to raise an arch in 1/4 cube increments).
  This is also the classic behaviour.
  If the variable is set to 0 (which is now default), the selection remains
  unchanged. This way, for example, the arch can be raised or lowered by
  regular cube increments.
  The arch menu allows changing the setting and also contains a script to
  enlarge the selections once.

pushselections

  New script to store the positions of all current selections. Can be used
  repeatedly. To restore the selections, type "popselections".

enlargevdeltaselections

  Enlarges all selections by one cube in x- and y- direction, to change a
  selection from the "cube area" to the "vdelta area".
  If an argument is given, it is used as increment value, so, for example
  "enlargevdeltaselections -1" undoes a previous enlargement.

DOCREF enlargearchslopeselections pushselections enlargevdeltaselections
2016-09-18 17:13:24 +02:00
ac-stef a291b74504 take measurements to create arch prefabs from existing maps
The arch menu now allows

 * editing all vertices instead of only half of them, for non-symmetrical
   arches
 * deleting saved custom arches
 * using custom arches for other widths than what they were created for
 * measuring an arch on a map and creating a prefab of it

Scripts:

av_measure

  "echo (av_measure)" prints the list of vdelta values of a selected arch.
  Only works as expected, if the selection is only 1 cube wide. To use the
  measurements to create a width 8 arch, select 8x1 cubes under the arch
  to copy and type "av 8 (av_measure)". Or use the menu.

av width-1 vdelta_list

  One of the oldest scripts of the game (and because of that, the first
  argument stayed "arch width minus one", for compatibility reasons).
  Creates a prefab arch of the desired width. If the list has exactly
  as many entries as required, all of them are used to create the prefab -
  this is the way the script has always worked.
  If there are too few or too many elements in the list, the script will
  try to take half the required values from the list and mirror the other
  half to create a symmetrical arch. This way, a list can be used for
  slightly wider or narrower archs. Or use the menu.
2016-09-18 00:22:27 +02:00
ac-stef 925645ecb3 new custom arch prefab editor
The menu lists all prefab arches and allows to edit them with sliders.
Arches can be saved and restored.

"archvertex" now returns the old value of the vertex, and if the vertex
argument is omitted, doesn't change it.

enumalias prefix

  Lists all persistent aliases that start with prefix. Returns a table
  with two entries per alias: 1) full name and 2) name without prefix

DOCREF archvertex enumalias
2016-09-17 01:01:40 +02:00
ac-stef fc3c77868f add hardcoded stairs command for coop
stairs xs ys

  Places stairs in all selections. xs and ys determine the step width
  in x- and y-direction.

DOCREF stairs
2016-09-16 14:06:27 +02:00
ac-stef c5904dc065 add stairs to edit menu 2016-09-16 14:06:26 +02:00
ac-stef cb630bde49 add per-map overrides to disable graphics features
The mapper has now the choice to disable several graphics features on
the client (for his map only, of course). The overrides are stored in
the map header.

mapoverride_nowaterreflect

  If "1", water reflection is disabled. Useful, when odd water colours
  are used to emulate other liquids that are not supposed to be that
  reflective.

mapoverride_limitwaveheight

  If "1", waveheight is capped at 0.1 max. Useful for small water
  areas (like puddles), where higher waves would look weird.

mapoverride_nostencilshadows

  If "1", stencil shadows are disabled. On clients, where stencil shadows
  are otherwise enabled, blob shadows are used instead. If shadows are
  disabled anyway, they stay disabled. Useful for dim maps, where hard
  shadows make no sense.


The player is free to ignore any of those overrides:

ignoreoverride_nowaterreflect

  If "1", mapoverride_nowaterreflect is ignored and regular client
  settings are used.

ignoreoverride_limitwaveheight

  If "1", mapoverride_limitwaveheight is ignored, and "waveheight" is
  used unchanged.

ignoreoverride_nostencilshadows

  If "1", mapoverride_nostencilshadows is ignored.


DOCREF mapoverride_nowaterreflect ignoreoverride_nowaterreflect
DOCREF mapoverride_limitwaveheight ignoreoverride_limitwaveheight
DOCREF mapoverride_nostencilshadows ignoreoverride_nostencilshadows
2016-09-04 17:44:22 +02:00