Commit Graph
7157 Commits
Author SHA1 Message Date
ac-stef 045343a26d fix crosshairnames
damn akimbo special treatment...
2015-03-06 14:31:51 +01:00
ac-stef 0f8dbf69aa introduce temporary aliases
An alias, that was at least once used with the new "tempalias" will not be
written to saved.cfg.

So, now there are four ways to create aliases:

1) alias (or "=")
  General alias, who's value gets saved at game exit in saved.cfg, and
  restored at the next restart - unless the alias was created at a time,
  where persistidents was zero (usually during execution of the game's own
  config files during startup).

2) const
  Creates an alias, that can not be changed. Makes it harder for users
  to destroy their config.

3) push
  Reassigns an alias with a new value. After "pop", the old value is
  restored. Allows the use of "local" aliases in scripts. Also avoids
  name conflicts.

4) tempalias
  Like "alias", but the value will not be written to saved.cfg.

The commit also changes aliases, written by the engine itself, to "temp":
gametimestart, __getmaprevisions

DOCREF tempalias
2015-03-06 14:17:08 +01:00
ac-stef 32db3e5e88 new options for saved.cfg
Defaults to omitting variables from saved.cfg, that are still at default
value. By setting omitunchangeddefaults to zero, those variables get
written, but commented out. The variable "groupvariables" sets the number
of variables with similar names, that can be grouped on one line. Setting
it to zero will additionally write min, max and default values and a
short description of the variable to file.

In general, variables, that are still at default value, will not be
restored from saved.cfg, so when the default in the game is changed, all
clients will use that new default. This way, testers don't have to erase
their saved.cfg as often.

DOCREF omitunchangeddefaults groupvariables
2015-03-06 14:01:52 +01:00
ac-stef a013148305 save original aliases instead of local ones
If an alias has a local value assigned (by "push"), this change will write
the original value to saved.cfg instead of the last local value.

This has the additional effect, that aliases, that were created by "push",
will not be written to saved.cfg, since the original value was empty.
2015-03-06 13:46:13 +01:00
ac-stef d9b7e0e159 clean up saved.cfg
* combine all weapon attributes in a table
* sort variables and aliases
* group variables
* implement curname as SVAR
* implement cmdbuf as temporary alias
2015-02-23 20:17:43 +01:00
ac-stef 8153813c14 fix string escaping for SVARs
* avoid double richtext conversion for mspmsg
* fix minor memleak in pushident()
* always escape strings for the command buffer
2015-02-23 20:12:47 +01:00
ac-stef d585550315 automatic escaping for strings
* parsed words starting with " will handle richtext
* all strings in saved.cfg that need escaping are escaped
* new command "escape" to escape a string manually

DOCREF escape
2015-02-23 18:56:32 +01:00
ac-stef 1956f0acc0 clean up loadcrosshair
* use the same list of gun names for all occasions
* switched syntax, so that argument completion will work
* support old syntax, so old config files will work
* fix path handling by disallowing paths altogether ;)

DOCREF loadcrosshair
2015-02-23 18:55:58 +01:00
ac-stef 2231c06528 fix nesting of numargs 2015-02-23 18:52:34 +01:00
ac-stef 71ac04c129 only write variables with non-default values to saved.cfg 2015-02-23 18:52:34 +01:00
ac-stef f75f0c0af4 add optional pre-access function for SVARs
allows a SVAR to be assembled when needed

also:

* mapmsg is now a SVAR
* getmapmsg was removed (now: $mapmsg)
* new editsvar script to edit any SVAR in the console buffer
* nonfunctional menu removed

DOCREF mapmsg getmapmsg editsvar
2015-02-23 18:52:34 +01:00
ac-stef 02869f988a fix keyrepeat
don't disable keyrepeat when going straight from menus to saycommand
2015-02-23 18:52:34 +01:00
ac-stef 390c4870ef fix memory leaks in sortlist and swapelements 2015-02-23 18:52:34 +01:00
ac-stef ed3b193b85 fix return value for cubescript command "execute" 2015-02-23 18:52:34 +01:00
ac-stef ec13fd7005 nested alias lookup
best explained with an example:

one = two ; two = three ; three = four
echo $one
> two
echo $$one
> three
echo $$$one
> four
2015-02-23 18:52:34 +01:00
ac-stef 47f71f1288 allow symbolic arguments for some commands
* new command "listoptions" lists the argument options for several
  argument types like entities, weapons and teamnames
* "burstshots", "weapon", "magcontent", "magreserve", "fragmessage" and
  "gibmessage" now allow guns to be specified by name
* "addpunct" allows plaintext arguments like "brackets" and "quotes"
* the "team" command now understands numeric teams
* entity types can now be specified by type index number
* removed some lists from the config files (now provided by listoptions)
* added argument completion for several commands
* change nextprimary from integer to string variable

DOCREF listoptions burstshots weapon addpunct
DOCREF fragmessage gibmessage magcontent magreserve
DOCREF nextprimary
2015-02-23 18:52:04 +01:00
ac-stef e89b2eae86 new looplist command
* optionally works with several variables
* does not leak memory

DOCREF looplist
2015-02-23 18:50:14 +01:00
ac-stef 8d83d8b8ab change user data path for the dev version
also: one more directory level
2015-02-14 19:48:12 +01:00
Michaelandac-stef 8f91b9064b Move AC's home dir in "My Games" on Windows 2015-02-14 19:30:29 +01:00
aurhat 6b27825a52 Revert "sdl_ttf, utf8"
This reverts commit 33683a9471.
2015-02-14 16:12:45 +01:00
aurhat f640b23a95 Revert "test font"
This reverts commit f65b11525b.
2015-02-14 16:12:44 +01:00
aurhat 1b70e0b94d Remove obsolete utf8 code/dependencies
It reverts part of e232a3f3ac ,
also removes dependencies from all IDE.
2015-02-14 16:12:43 +01:00
ac-stef 4b75405829 remove some dead code
and some braind* concepts
2015-02-12 12:54:03 +01:00
ac-stef d4110288da undo TAB-completion with LSHIFT+ESC
New commandline key-combination LSHIFT-ESC.
Resets the commandline to the state before using TAB-completion.
Useful, if TAB-completion wasn't helpful.
2015-02-12 12:19:38 +01:00
ac-stef 3b9075049c omit commands with leading blanks from history
like "HISTCONTROL = ignorespace" in bash
2015-02-12 12:17:04 +01:00
aurhatandac-stef a284064e9f Complete backwards
Use LSHIFT to direct TAB-completion to browse backwards through the
available alternatives.

also: full cleanup of the commandcomplete()-code [by stef]

* fix crashing buffer overflow
* remove some ancient ludicrous code
* ignore more spaces
* browse command- and filename-alternatives in alphabetical order
* clean up nickcomplete
* more comments (sry)
2015-02-12 12:10:22 +01:00
ac-stef 78f2bac38d enable keyrepeat in menus
* also fix a memory leak
* fix mitem type TYPE_TEXTINPUT
* the name change from type to mitemtype is of cosmetic nature
2015-02-09 11:56:50 +01:00
aurhat befd22d2e8 Don't hide the sniper rifle scope if scoreboard is enabled
The fix also allows to turn on/off the scope during intermission (since
a few years the scope was blocked in intermission, because it was
immediately turned off by scoreboard).
2015-02-08 23:05:37 +01:00
ac-stef d7c2c8333a add mrproper target to fix enet build
Sometimes the enet build seems to get messed up and "make" won't work
anymore in ../enet. The mrproper target tries to clean up ../enet, but
if it doesn't work, it deletes ../enet/Makefile manually. This triggers
a configure run in ../enet with the next make invocation - which should
fix everything.
2015-02-08 17:46:11 +01:00
ac-stef 64f378154d add incremental crc calculation
re-using the enet code
2015-02-08 17:39:15 +01:00
ac-stef 84ae6f152e whitespace cleanup in enet sources
The codeblocks editor cleans up surplus whitespace with every save by
default. That's nice, as long as everyone uses it. Otherwise, changes in
whitespace will creep into most commits and make the diffs hard to read.
Therefore: one commit with _only_ whitespace changed.
2015-02-08 17:39:15 +01:00
ac-stef e369f3e415 move backup() 2015-02-08 17:39:15 +01:00
ac-stef 348f640507 new tool functions 2015-02-08 17:39:15 +01:00
ac-stef af70d5c069 add locking to addsleep() to support multithreading
Now other threads can also add commands to the queue without messing up
the vector.
2015-02-08 17:39:15 +01:00
ac-stef b76413ddc2 clean up stopwatch code
* SDL_GetTicks() returns uint
* there's no need to make a fuss about "starting" and "stopping" the clock
* instead of stopping the clock, we can now just get the elapsed time
2015-02-08 17:39:15 +01:00
ac-stef 685dbb8326 store old state of random generator to restore after a seed()
The light calculation requires the random generator to be seeded with a
constant - otherwise repeated light recalculations would make the lights
change.

This patch allows the random generator to go back to the state before the
static seed().
2015-02-08 17:39:14 +01:00
ac-stef 05a41b1c0a add endian swap routines for 64-bit integer values 2015-02-08 17:39:14 +01:00
ac-stef 44c15dcd13 remove unnecessarily stupid comment 2015-02-08 17:39:14 +01:00
ac-stef 7e7834af2c wrapper functions for threading and semaphores
allow the standalone linux server to use posix libraries instead of SDL
(using SDL can be forced by defining AC_FORCE_SDL_THREADS)
2015-02-08 17:39:14 +01:00
ac-stef 007632ed77 clean up logging
especially restrict the constant flushing to debug mode
2015-02-08 17:39:14 +01:00
ac-stef 71dc155d45 fix loopvjrev
apparently, no one used this macro since 2007
2015-02-08 17:39:14 +01:00
ac-stef 5d7017e6b6 removed huge unnecessary file
The file packages/models/playermodels/RVSF/07_Blue-Red.psd had a filesize
of over nine megabyte - and was of no use to the game. It made all recent
game packages 9MB bigger than they had to be. That's about the size of
all game textures combined...
If someone still needs the file, check it out from an older commit.
2015-02-08 17:39:14 +01:00
ac-stef 39cbee947d Merge branch 'master' into next 2015-02-08 16:17:04 +01:00
aurhat 87bb20e799 Fix sound bug on shallow water 2015-02-07 15:01:57 +01:00
aurhat 67049f5e73 In demo mode show info about different map rev only if map is loaded 2015-02-07 14:26:12 +01:00
ac-stef 400e7eb9a6 fix glitch in map editor that allowed to violate map borders
Also, provide a more detailed error message in case of client fatal due
 to bad map (with non-solid borders).
2015-01-29 15:09:54 +01:00
aurhat d5763d9f5b More accurate info, when player joins match with less than 60s to end 2015-01-24 22:41:37 +01:00
aurhat c31399a36a Add additional options to crosshairfx
0 - turn off all effects; 1 - turn on all effects;
2 - turn on color change/off size change for AR and > 3 shots in a row;
3 - turn off color change/on size change for AR and > 3 shots in a row.
It fixes https://github.com/assaultcube/AC/issues/72 .

DOCREF crosshairfx
2015-01-24 12:44:45 +01:00
aurhat 3470b49963 Fix spawn issues in bot modes
It fixes https://github.com/assaultcube/AC/issues/62 : "Respawning in bot
modes doesn't reset camera".
Also only 1 click will be needed to spawn, because it looks, that note in:
https://github.com/assaultcube/AC/commit/f9ec71cbab638189ea4fa3f664e2584605e2ba0e
isn't true now.
2015-01-24 12:21:51 +01:00
aurhat d86e1a9581 Allow only flying spectating in bot modes 2015-01-24 12:18:48 +01:00