diff --git a/.gitignore b/.gitignore index 00ad69ef..34512f4a 100644 --- a/.gitignore +++ b/.gitignore @@ -56,6 +56,7 @@ ssqccore.txt # Ideally you would add # your project here as well +action/ AbsoluteZero/ base_pbr/ baseq2/ @@ -93,6 +94,9 @@ ship/ tf/ tf2/ tfc/ +dk/ +basedk/ +mainkp/ ts/ valve/ wastes/ diff --git a/Documentation/About.md b/Documentation/About.md new file mode 100644 index 00000000..7da77973 --- /dev/null +++ b/Documentation/About.md @@ -0,0 +1,57 @@ + +# About The Project {#about} + +The Nuclide project produces a freely available game-logic component and +development platform on top of [FTEQW](https://www.fteqw.org); which is a featureful QuakeWorld-based engine. + +**The general idea is that Nuclide takes care of ~90% of the code you shouldn't have to worry about.** + +It is targetted towards developers with a background/interest in id Technology. + +It comes with a simple example game (simply referred to as 'Base') and some test maps. There's also some other, third-party example projects. + +General feature overview: + +- The 'missing' SDK for engines like FTEQW +- Support for client-side predicted movement, weaponry and vehicles +- Documented APIs for everything you need to interface with the engine +- APIs and Frameworks for managing updates, mods, servers, and platform specific features +- Complete re-implementations of hundreds of entities, from GoldSrc/Source engine games +- Entity communication via traditional one-way triggers, or our Source Engine I/O compatible system +- Includes BotLib, a framework for multiplayer-AI that can receive game-specific overrides +- Includes VGUILib, a re-imagining of Valve's GUI library, which can also be used for in-game surface based interfaces +- Designed to be familar to developers coming from GoldSrc/Source +- VR/XR aware codebase +- All permissively licensed + + +# Frequently Asked Questions + +## 1. Why might I want to use it? {#why} + +You might be migrating from an engine that is no longer being licensed and don't want to learn a new engine and toolchain. + +You might want to develop a game using a lot of complex and well-tested objects +which might be tedious to implement on your own. + +You might want to run or make modifications for a game using Nuclide and need full +control over what you can do. + +## 2. How free is Nuclide? {#license} + +Everything in Nuclide is **free software**. The copyright terms for the game-logic are +very permitting. Nuclide *does not use the GPL* as a point of reference in terms of license, it instead uses a **ISC-like license**. This means you can use, copy, modify and +distribute the code and work resulting from it for any purpose. + +**Please read the very short 'LICENSE' document for details.** + +## 3. What are the alternatives? {#alternatives} + +Implementing systems such as prediction, complex map objects and entities on +your own, from scratch - or licensing another engine such as [Source](https://partner.steamgames.com/doc/sdk/uploading/distributing_source_engine) that ships with its own **Source SDK Base**. + +## 4. Any example projects? {#examples} + +- [The Wastes](https://store.steampowered.com/app/793670) is a commerical game built using Nuclide. +- [Rad-Therapy](https://www.github.com/eukara/freehl) is a clone of 'Half-Life: Deathmatch' on Nuclide. +- [Tactical Retreat](https://www.github.com/eukara/freecs) is a clone of 'Counter-Strike', for Rad-Therapy. diff --git a/Documentation/Decl.md b/Documentation/Decl.md deleted file mode 100644 index ee64654b..00000000 --- a/Documentation/Decl.md +++ /dev/null @@ -1,6 +0,0 @@ -# Defs/Declarations {#scripting} - -Explanation of declaration-based subsystems within Nuclide. - -These usually contain key/value pair type parameters (and more, depending on the type) -within the game. They help a great deal in managing complexity between reusable components. That way the game code can focus on everything that's not unique. diff --git a/Documentation/DoxygenLayout.xml b/Documentation/DoxygenLayout.xml new file mode 100644 index 00000000..268a5992 --- /dev/null +++ b/Documentation/DoxygenLayout.xml @@ -0,0 +1,238 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Documentation/Footer.html b/Documentation/Footer.html new file mode 100644 index 00000000..dd08fe30 --- /dev/null +++ b/Documentation/Footer.html @@ -0,0 +1 @@ +Nuclide is a project by [Vera Visions, L.L.C.](https://www.vera-visions.com/) diff --git a/Documentation/GettingStarted.md b/Documentation/GettingStarted.md new file mode 100644 index 00000000..9b69a818 --- /dev/null +++ b/Documentation/GettingStarted.md @@ -0,0 +1,12 @@ +# Getting started + +## How to get the latest version {#how} + +You clone the Nuclide git repository first. There's multiple places to get it, one such place may be GitHub: + +`git clone https://github.com/veravisions/nuclide` + +You can then update the git repository as you normally would. Using `git pull` for example. + +And then you can [get started on building the engine and the rest of the toolchain](Building.md). Alternatively, you can also move in the official FTEQW binaries into the Nuclide directory to get started without bootstrapping your own engine + QuakeC compiler. +C programming knowledge is not required to use Nuclide itself. diff --git a/Documentation/History.md b/Documentation/History.md index 7380234c..a547949b 100644 --- a/Documentation/History.md +++ b/Documentation/History.md @@ -29,7 +29,7 @@ A lot had been learned about prediction and taking full advantage of the custom networking available in **FTEQW**, but new features have also been added to the engine to take full advantage of what the content had to offer: -Features like interacting with [OpenAL's EAX extension](EFX.md), [model-events](VVM.md), support +Features like interacting with [OpenAL's EAX extension](@ref efx), [model-events](VVM.md), support for WAD3 decal parsing and countless QuakeC extensions were all added by either Spike (FTEQW Author) or eukara himself to make everything possible. diff --git a/Documentation/ReadMe.md b/Documentation/ReadMe.md index 45ed366f..4cd181c6 100644 --- a/Documentation/ReadMe.md +++ b/Documentation/ReadMe.md @@ -4,89 +4,23 @@ Welcome to the manual for **Nuclide**! -This is a game development kit (GDK) and development environment created by [Vera Visions, L.L.C.](https://www.vera-visions.com/). We want to share it with everyone to avoid duplicate effort and in the hopes that it is useful to someone else. +![](brick.png) This is a game development kit (GDK) and development environment for id Tech, using GPL QuakeWorld technology. We are sharing it in the hopes that it is useful! -### What this project is {#what} +[You can read more in-depth information, such as features here](About.md). -The Nuclide project produces a freely available game-logic component and -development platform on top of [FTEQW](https://www.fteqw.org); which is the engine we happen to use. +## Learning Resources -**The general idea is that Nuclide takes care of ~90% of the code you shouldn't have to worry about.** +![](hourglass.png) [Getting Started](GettingStarted.md) -The goal is to create a modern research base for new advancements, as well -as to have a stable base with a decent API for making games. +![](table.png) [Guide To Decl Files](@ref decl) -It is targetted towards developers with a background/interest in id Technology. +![](table_edit.png) [Creating Weapons](@ref NSWeapon) -It comes with a simple example game (simply referred to as 'Base') and some test maps. There's also some other, third-party example projects. +![](table_edit.png) [Creating Items](@ref NSItem) -General feature overview: +![](page_code.png) [Writing Game Rules](@ref NSGameRules) -- The 'missing' SDK for engines like FTEQW -- Support for client-side predicted movement, weaponry and vehicles -- Documented APIs for everything you need to interface with the engine -- APIs and Frameworks for managing updates, mods, servers, and platform specific features -- Complete re-implementations of hundreds of entities, from GoldSrc/Source engine games -- Entity communication via traditional one-way triggers, or our Source Engine I/O compatible system -- Includes BotLib, a framework for multiplayer-AI that can receive game-specific overrides -- Includes VGUILib, a re-imagining of Valve's GUI library, which can also be used for in-game surface based interfaces -- Designed to be familar to developers coming from GoldSrc/Source -- VR/XR aware codebase -- All permissively licensed -### 1. Why might I want to use it? {#why} +## Contributing -You might be migrating from an engine that is no longer being licensed and don't want to learn a new engine and toolchain. - -You might want to develop a game using a lot of complex and well-tested objects -which might be tedious to implement on your own. - -You might want to run or make modifications for a game using Nuclide and need full -control over what you can do. - -### 2. How free is Nuclide? {#license} - -Everything in Nuclide is **free software**. The copyright terms for the game-logic are -very permitting. Nuclide *does not use the GPL* as a point of reference in terms of license, it instead uses a **ISC-like license**. This means you can use, copy, modify and -distribute the code and work resulting from it for any purpose. - -**Please read the very short 'LICENSE' document for details.** - -### 3. What are the alternatives? {#alternatives} - -Implementing systems such as prediction, complex map objects and entities on -your own, from scratch - or licensing another engine such as [Source](https://partner.steamgames.com/doc/sdk/uploading/distributing_source_engine) that ships with its own **Source SDK Base**. - -### 4. Any example projects? {#examples} - -- [The Wastes](https://store.steampowered.com/app/793670) is a commerical game built using Nuclide. -- [FreeHL](https://www.github.com/eukara/freehl) is a free-software, clean-room clone of Half-Life: Deathmatch also built using Nuclide. -- [FreeCS](https://www.github.com/eukara/freecs) exists in the same vein as FreeHL, but targetting a recreation of Counter-Strike v1.5 (mod version) specifically. - -## Getting started {#prerequisites} - -First of all, you want to be sure this is what you want to get into. -If you do posess a basic knowledge of the following: - -- The C programming language -- Debugging a native application -- Makefiles -- Compiling your own binaries -- Concept of public and private APIs -- QuakeC - -Then you will have a good time. -We strive to keep the codebase portable and conform to open standards wherever possible. -This means that if you develop on Windows, you probably want to install something like WSL or even [Cygwin](https://www.cygwin.com/) to make this bearable. - -Please don't ask us how to use WSL or Cygwin. We do not provide support for either. We do not develop on Windows! Sorry. - -**This is a development kit and a development environment. This is not a game.** - -## Actually getting started {#how} - -You clone the Nuclide git repository first. There's multiple places to get it, one such place may be GitHub: - -`git clone https://github.com/veravisions/nuclide` - -And then you can [get started on building the engine and the rest of the toolchain](Building.md). Alternatively, you can also move in the official FTEQW binaries into the Nuclide directory to get started without bootstrapping your own engine + QuakeC compiler. \ No newline at end of file +![](bug.png) You can contribute by filing bugs [here](https://www.github.com/veravisions/nuclide). diff --git a/Documentation/footer.html b/Documentation/footer.html new file mode 100644 index 00000000..5880adbf --- /dev/null +++ b/Documentation/footer.html @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/Doxyfile b/Doxyfile index 49bb763f..dbfe97b0 100644 --- a/Doxyfile +++ b/Doxyfile @@ -244,7 +244,7 @@ SEPARATE_MEMBER_PAGES = NO # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. -TAB_SIZE = 8 +TAB_SIZE = 4 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: @@ -741,7 +741,7 @@ SHOW_USED_FILES = YES # (if specified). # The default value is: YES. -SHOW_FILES = YES +SHOW_FILES = NO # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the @@ -772,7 +772,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = Documentation/DoxygenLayout.xml # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -876,6 +876,8 @@ WARN_LOGFILE = INPUT = src/ \ Documentation/ReadMe.md \ + Documentation/About.md \ + Documentation/GettingStarted.md \ Documentation/Building.md \ Documentation/Dependencies.md \ Documentation/Launching.md \ @@ -1016,6 +1018,7 @@ EXAMPLE_RECURSIVE = NO IMAGE_PATH = Documentation/Materials/ \ Documentation/Images/ \ + base/resources.pk3dir/gfx/icon16/ # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -1230,7 +1233,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = Documentation/footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of diff --git a/Makefile b/Makefile index 0a600451..78ba94c0 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ # Nuclide Makefile # # Apr 2024 by Marco Cawthorne +# Last updated: 2024/10/12 # # set `GAME` when issuing make. E.g. `make GAME=wastes` @@ -14,6 +15,8 @@ GAME_EXT= GAME_BINARY=$(NAME)_$(GAME_ARCH)$(GAME_EXT) GAMEDS_BINARY=$(NAME)DS_$(GAME_ARCH)$(GAME_EXT) +ENGINE_URL=https://www.github.com/fte-team/fteqw + # FTE specific builds ENGINE_ARCH=amd64 ENGINE_CLBUILD=m-dbg @@ -56,6 +59,7 @@ help: all: game engine dedicated plugins game: fteqcc + -cp src/cvar_defaults.cfg "$(GAME)/zpak001.pk3dir/default_cvar.cfg" cd "$(GAME)/src/" && $(MAKE) QCC=$(QCC_DIR)/../../fteqcc client: fteqcc @@ -148,6 +152,10 @@ clean-engine: cd ThirdParty/fteqw/engine && $(MAKE) clean -rm $(NAME)_x64$(GAME_EXT) $(NAME)_x86$(GAME_EXT) $(NAME)DS_x64$(GAME_EXT) $(NAME)DS_x86$(GAME_EXT) fteqw fteqw-sv +clean-fteqw: + cd ThirdParty/fteqw/engine && $(MAKE) clean + -rm fteqw fteqw-sv + clean-tools: cd Tools/vmap && $(MAKE) clean cd Tools/vvmtool && $(MAKE) clean @@ -157,7 +165,7 @@ clean-tools: update: if [ -f ./.git/config ];then git pull;fi if [ -f $(GAME)/.git/config ];then cd $(GAME) && git pull;fi - if [ ! -d ThirdParty/fteqw ];then git clone https://www.github.com/fte-team/fteqw ThirdParty/fteqw;else cd ./ThirdParty/fteqw && git pull;fi + if [ ! -d ThirdParty/fteqw ];then git clone $(ENGINE_URL) ThirdParty/fteqw;else cd ./ThirdParty/fteqw && git pull;fi if [ ! -d Tools/vvmtool ];then git clone https://github.com/VeraVisions/vvmtool Tools/vvmtool;else cd ./Tools/vvmtool && git pull;fi if [ ! -d Tools/vmap ];then git clone https://github.com/VeraVisions/vmap Tools/vmap;else cd ./Tools/vmap && git pull;fi if [ ! -d Tools/worldspawn ];then git clone https://github.com/VeraVisions/worldspawn Tools/worldspawn;else cd ./Tools/worldspawn && git pull;fi diff --git a/README.md b/README.md index d71beae4..5ce05d51 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,8 @@ Run the engine in the root of this repository, after having issued `make progs G You can build your own offline version of the online manual by running `doxygen` in the root of this repository. The output will be under **Documentation/html/index.html**. +# Credits + +Silk Icons: https://github.com/markjames/famfamfam-silk-icons +Flag Icons: https://github.com/markjames/famfamfam-flag-icons +https://heyter.github.io/js-famfamfam-search/ \ No newline at end of file diff --git a/base/engine.h b/base/engine.h index 9bf4c5f7..d4b2745b 100644 --- a/base/engine.h +++ b/base/engine.h @@ -43,7 +43,7 @@ #define USEAREAGRID /* leave it on, improves performance */ #define AVAIL_DINPUT /* input for Windows */ #define AVAIL_FREETYPE /* for truetype font rendering */ -#define AVAIL_STBI /* avoid libpng/libjpeg dependancies */ +#undef AVAIL_STBI /* avoid libpng/libjpeg dependancies */ #define ENGINE_ROUTING /* engine-side, fast routing */ #ifndef LEGACY_GPU @@ -140,8 +140,8 @@ #undef HAVE_SPEEX /* .xz decompression */ #undef AVAIL_GZDEC /* .gz decompression */ #undef PACKAGE_DZIP /* .dzip special-case archive support */ -#undef AVAIL_PNGLIB /* .png image format support (read+screenshots) */ -#undef AVAIL_JPEGLIB /* .jpeg image format support (read+screenshots) */ +#define AVAIL_PNGLIB /* .png image format support (read+screenshots) */ +#define AVAIL_JPEGLIB /* .jpeg image format support (read+screenshots) */ #undef AVAIL_MP3_ACM /* .mp3 support (in windows). */ #undef IMAGEFMT_DDS #undef IMAGEFMT_PKM @@ -192,8 +192,8 @@ #undef IMAGEFMT_PSD #undef IMAGEFMT_XCF #undef IMAGEFMT_LMP -#undef IMAGEFMT_PNG -#undef IMAGEFMT_JPG +#define IMAGEFMT_PNG +#define IMAGEFMT_JPG #undef IMAGEFMT_GIF #undef IMAGEFMT_EXR #undef IPLOG diff --git a/base/resources.pk3dir/decls/def/player.def b/base/resources.pk3dir/decls/def/player.def index 90aa44a5..3c666d54 100644 --- a/base/resources.pk3dir/decls/def/player.def +++ b/base/resources.pk3dir/decls/def/player.def @@ -1,6 +1,7 @@ entityDef player { - "spawnclass" "NSClientPlayer" + "spawnclass" "NSClientPlayer" + "model" "models/player.vvm" } entityDef player_mp diff --git a/base/resources.pk3dir/default.cfg b/base/resources.pk3dir/default.cfg index e9557811..3553b1b1 100644 --- a/base/resources.pk3dir/default.cfg +++ b/base/resources.pk3dir/default.cfg @@ -1,5 +1,4 @@ -// Standard Game Bindings -// Feel free to modify them however you like +exec default_cvar.cfg // Clear all bindings... unbindall @@ -17,10 +16,16 @@ bind MWHEELUP "weapprev" bind MWHEELDOWN "weapnext" // Interact button -bind e "+use" +bind q "+leanleft" +bind e "+leanright" +bind f "+use" -// Flashlight button -bind f "impulse 100" +bind shift "+sprint" + +set pm_walkspeed "190" +set pm_runspeed "320" +set pm_stepheight "18" +set pm_airstepheight "18" // Misc interface buttons bind t "messagemode" diff --git a/base/resources.pk3dir/fonts/centerprint.font b/base/resources.pk3dir/fonts/centerprint.font new file mode 100644 index 00000000..34f2c508 --- /dev/null +++ b/base/resources.pk3dir/fonts/centerprint.font @@ -0,0 +1,2 @@ +path fonts/IBMPlexMono-Text.otf +size 16 \ No newline at end of file diff --git a/base/resources.pk3dir/gfx/flags16/CREDITS b/base/resources.pk3dir/gfx/flags16/CREDITS new file mode 100644 index 00000000..9bebbb70 --- /dev/null +++ b/base/resources.pk3dir/gfx/flags16/CREDITS @@ -0,0 +1,3 @@ +Flag Icons by Mark James +https://github.com/markjames/famfamfam-flag-icons +http://www.famfamfam.com/lab/icons/flags/ diff --git a/base/resources.pk3dir/gfx/flags16/ad.png b/base/resources.pk3dir/gfx/flags16/ad.png new file mode 100755 index 00000000..625ca84f Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ad.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ae.png b/base/resources.pk3dir/gfx/flags16/ae.png new file mode 100755 index 00000000..ef3a1ecf Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ae.png differ diff --git a/base/resources.pk3dir/gfx/flags16/af.png b/base/resources.pk3dir/gfx/flags16/af.png new file mode 100755 index 00000000..a4742e29 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/af.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ag.png b/base/resources.pk3dir/gfx/flags16/ag.png new file mode 100755 index 00000000..556d5504 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ag.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ai.png b/base/resources.pk3dir/gfx/flags16/ai.png new file mode 100755 index 00000000..74ed29d9 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ai.png differ diff --git a/base/resources.pk3dir/gfx/flags16/al.png b/base/resources.pk3dir/gfx/flags16/al.png new file mode 100755 index 00000000..92354cb6 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/al.png differ diff --git a/base/resources.pk3dir/gfx/flags16/am.png b/base/resources.pk3dir/gfx/flags16/am.png new file mode 100755 index 00000000..344a2a86 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/am.png differ diff --git a/base/resources.pk3dir/gfx/flags16/an.png b/base/resources.pk3dir/gfx/flags16/an.png new file mode 100755 index 00000000..633e4b89 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/an.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ao.png b/base/resources.pk3dir/gfx/flags16/ao.png new file mode 100644 index 00000000..bcbd1d6d Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ao.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ar.png b/base/resources.pk3dir/gfx/flags16/ar.png new file mode 100755 index 00000000..e5ef8f1f Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ar.png differ diff --git a/base/resources.pk3dir/gfx/flags16/as.png b/base/resources.pk3dir/gfx/flags16/as.png new file mode 100755 index 00000000..32f30e4c Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/as.png differ diff --git a/base/resources.pk3dir/gfx/flags16/at.png b/base/resources.pk3dir/gfx/flags16/at.png new file mode 100755 index 00000000..0f15f34f Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/at.png differ diff --git a/base/resources.pk3dir/gfx/flags16/au.png b/base/resources.pk3dir/gfx/flags16/au.png new file mode 100755 index 00000000..a01389a7 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/au.png differ diff --git a/base/resources.pk3dir/gfx/flags16/aw.png b/base/resources.pk3dir/gfx/flags16/aw.png new file mode 100755 index 00000000..a3579c2d Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/aw.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ax.png b/base/resources.pk3dir/gfx/flags16/ax.png new file mode 100755 index 00000000..1eea80a7 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ax.png differ diff --git a/base/resources.pk3dir/gfx/flags16/az.png b/base/resources.pk3dir/gfx/flags16/az.png new file mode 100755 index 00000000..4ee9fe5c Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/az.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ba.png b/base/resources.pk3dir/gfx/flags16/ba.png new file mode 100755 index 00000000..c7749924 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ba.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bb.png b/base/resources.pk3dir/gfx/flags16/bb.png new file mode 100755 index 00000000..0df19c71 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bb.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bd.png b/base/resources.pk3dir/gfx/flags16/bd.png new file mode 100755 index 00000000..076a8bf8 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bd.png differ diff --git a/base/resources.pk3dir/gfx/flags16/be.png b/base/resources.pk3dir/gfx/flags16/be.png new file mode 100755 index 00000000..d86ebc80 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/be.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bf.png b/base/resources.pk3dir/gfx/flags16/bf.png new file mode 100755 index 00000000..ab5ce8fe Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bf.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bg.png b/base/resources.pk3dir/gfx/flags16/bg.png new file mode 100755 index 00000000..0469f060 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bg.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bh.png b/base/resources.pk3dir/gfx/flags16/bh.png new file mode 100755 index 00000000..ea8ce687 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bh.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bi.png b/base/resources.pk3dir/gfx/flags16/bi.png new file mode 100755 index 00000000..5cc2e30c Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bi.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bj.png b/base/resources.pk3dir/gfx/flags16/bj.png new file mode 100755 index 00000000..1cc8b458 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bj.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bm.png b/base/resources.pk3dir/gfx/flags16/bm.png new file mode 100755 index 00000000..c0c7aead Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bm.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bn.png b/base/resources.pk3dir/gfx/flags16/bn.png new file mode 100755 index 00000000..8fb09849 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bn.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bo.png b/base/resources.pk3dir/gfx/flags16/bo.png new file mode 100755 index 00000000..ce7ba522 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bo.png differ diff --git a/base/resources.pk3dir/gfx/flags16/br.png b/base/resources.pk3dir/gfx/flags16/br.png new file mode 100755 index 00000000..9b1a5538 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/br.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bs.png b/base/resources.pk3dir/gfx/flags16/bs.png new file mode 100755 index 00000000..639fa6cf Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bs.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bt.png b/base/resources.pk3dir/gfx/flags16/bt.png new file mode 100755 index 00000000..1d512dff Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bt.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bv.png b/base/resources.pk3dir/gfx/flags16/bv.png new file mode 100755 index 00000000..160b6b5b Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bv.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bw.png b/base/resources.pk3dir/gfx/flags16/bw.png new file mode 100755 index 00000000..fcb10394 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bw.png differ diff --git a/base/resources.pk3dir/gfx/flags16/by.png b/base/resources.pk3dir/gfx/flags16/by.png new file mode 100755 index 00000000..504774ec Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/by.png differ diff --git a/base/resources.pk3dir/gfx/flags16/bz.png b/base/resources.pk3dir/gfx/flags16/bz.png new file mode 100755 index 00000000..be63ee1c Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/bz.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ca.png b/base/resources.pk3dir/gfx/flags16/ca.png new file mode 100755 index 00000000..1f204193 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ca.png differ diff --git a/base/resources.pk3dir/gfx/flags16/catalonia.png b/base/resources.pk3dir/gfx/flags16/catalonia.png new file mode 100644 index 00000000..5041e308 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/catalonia.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cc.png b/base/resources.pk3dir/gfx/flags16/cc.png new file mode 100755 index 00000000..aed3d3b4 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cc.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cd.png b/base/resources.pk3dir/gfx/flags16/cd.png new file mode 100644 index 00000000..5e489424 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cd.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cf.png b/base/resources.pk3dir/gfx/flags16/cf.png new file mode 100755 index 00000000..da687bdc Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cf.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cg.png b/base/resources.pk3dir/gfx/flags16/cg.png new file mode 100755 index 00000000..a859792e Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cg.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ch.png b/base/resources.pk3dir/gfx/flags16/ch.png new file mode 100755 index 00000000..242ec01a Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ch.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ci.png b/base/resources.pk3dir/gfx/flags16/ci.png new file mode 100755 index 00000000..3f2c62eb Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ci.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ck.png b/base/resources.pk3dir/gfx/flags16/ck.png new file mode 100755 index 00000000..746d3d6f Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ck.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cl.png b/base/resources.pk3dir/gfx/flags16/cl.png new file mode 100755 index 00000000..29c6d61b Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cl.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cm.png b/base/resources.pk3dir/gfx/flags16/cm.png new file mode 100755 index 00000000..f65c5bd5 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cm.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cn.png b/base/resources.pk3dir/gfx/flags16/cn.png new file mode 100755 index 00000000..89144146 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cn.png differ diff --git a/base/resources.pk3dir/gfx/flags16/co.png b/base/resources.pk3dir/gfx/flags16/co.png new file mode 100755 index 00000000..a118ff4a Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/co.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cr.png b/base/resources.pk3dir/gfx/flags16/cr.png new file mode 100755 index 00000000..c7a37317 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cr.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cs.png b/base/resources.pk3dir/gfx/flags16/cs.png new file mode 100755 index 00000000..8254790c Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cs.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cu.png b/base/resources.pk3dir/gfx/flags16/cu.png new file mode 100755 index 00000000..083f1d61 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cu.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cv.png b/base/resources.pk3dir/gfx/flags16/cv.png new file mode 100755 index 00000000..a63f7eaf Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cv.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cx.png b/base/resources.pk3dir/gfx/flags16/cx.png new file mode 100755 index 00000000..48e31adb Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cx.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cy.png b/base/resources.pk3dir/gfx/flags16/cy.png new file mode 100755 index 00000000..5b1ad6c0 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cy.png differ diff --git a/base/resources.pk3dir/gfx/flags16/cz.png b/base/resources.pk3dir/gfx/flags16/cz.png new file mode 100755 index 00000000..c8403dd2 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/cz.png differ diff --git a/base/resources.pk3dir/gfx/flags16/de.png b/base/resources.pk3dir/gfx/flags16/de.png new file mode 100755 index 00000000..ac4a9773 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/de.png differ diff --git a/base/resources.pk3dir/gfx/flags16/dj.png b/base/resources.pk3dir/gfx/flags16/dj.png new file mode 100755 index 00000000..582af364 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/dj.png differ diff --git a/base/resources.pk3dir/gfx/flags16/dk.png b/base/resources.pk3dir/gfx/flags16/dk.png new file mode 100755 index 00000000..e2993d3c Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/dk.png differ diff --git a/base/resources.pk3dir/gfx/flags16/dm.png b/base/resources.pk3dir/gfx/flags16/dm.png new file mode 100755 index 00000000..5fbffcba Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/dm.png differ diff --git a/base/resources.pk3dir/gfx/flags16/do.png b/base/resources.pk3dir/gfx/flags16/do.png new file mode 100755 index 00000000..5a04932d Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/do.png differ diff --git a/base/resources.pk3dir/gfx/flags16/dz.png b/base/resources.pk3dir/gfx/flags16/dz.png new file mode 100755 index 00000000..335c2391 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/dz.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ec.png b/base/resources.pk3dir/gfx/flags16/ec.png new file mode 100755 index 00000000..0caa0b1e Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ec.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ee.png b/base/resources.pk3dir/gfx/flags16/ee.png new file mode 100755 index 00000000..0c82efb7 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ee.png differ diff --git a/base/resources.pk3dir/gfx/flags16/eg.png b/base/resources.pk3dir/gfx/flags16/eg.png new file mode 100755 index 00000000..8a3f7a10 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/eg.png differ diff --git a/base/resources.pk3dir/gfx/flags16/eh.png b/base/resources.pk3dir/gfx/flags16/eh.png new file mode 100755 index 00000000..90a1195b Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/eh.png differ diff --git a/base/resources.pk3dir/gfx/flags16/england.png b/base/resources.pk3dir/gfx/flags16/england.png new file mode 100755 index 00000000..3a7311d5 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/england.png differ diff --git a/base/resources.pk3dir/gfx/flags16/er.png b/base/resources.pk3dir/gfx/flags16/er.png new file mode 100755 index 00000000..13065ae9 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/er.png differ diff --git a/base/resources.pk3dir/gfx/flags16/es.png b/base/resources.pk3dir/gfx/flags16/es.png new file mode 100755 index 00000000..c2de2d71 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/es.png differ diff --git a/base/resources.pk3dir/gfx/flags16/et.png b/base/resources.pk3dir/gfx/flags16/et.png new file mode 100755 index 00000000..2e893fa0 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/et.png differ diff --git a/base/resources.pk3dir/gfx/flags16/europeanunion.png b/base/resources.pk3dir/gfx/flags16/europeanunion.png new file mode 100644 index 00000000..d6d87115 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/europeanunion.png differ diff --git a/base/resources.pk3dir/gfx/flags16/fam.png b/base/resources.pk3dir/gfx/flags16/fam.png new file mode 100755 index 00000000..cf50c759 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/fam.png differ diff --git a/base/resources.pk3dir/gfx/flags16/fi.png b/base/resources.pk3dir/gfx/flags16/fi.png new file mode 100755 index 00000000..14ec091b Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/fi.png differ diff --git a/base/resources.pk3dir/gfx/flags16/fj.png b/base/resources.pk3dir/gfx/flags16/fj.png new file mode 100755 index 00000000..cee99889 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/fj.png differ diff --git a/base/resources.pk3dir/gfx/flags16/fk.png b/base/resources.pk3dir/gfx/flags16/fk.png new file mode 100755 index 00000000..ceaeb27d Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/fk.png differ diff --git a/base/resources.pk3dir/gfx/flags16/fm.png b/base/resources.pk3dir/gfx/flags16/fm.png new file mode 100755 index 00000000..066bb247 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/fm.png differ diff --git a/base/resources.pk3dir/gfx/flags16/fo.png b/base/resources.pk3dir/gfx/flags16/fo.png new file mode 100755 index 00000000..cbceb809 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/fo.png differ diff --git a/base/resources.pk3dir/gfx/flags16/fr.png b/base/resources.pk3dir/gfx/flags16/fr.png new file mode 100755 index 00000000..8332c4ec Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/fr.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ga.png b/base/resources.pk3dir/gfx/flags16/ga.png new file mode 100755 index 00000000..0e0d4343 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ga.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gb.png b/base/resources.pk3dir/gfx/flags16/gb.png new file mode 100644 index 00000000..ff701e19 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gb.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gd.png b/base/resources.pk3dir/gfx/flags16/gd.png new file mode 100755 index 00000000..9ab57f54 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gd.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ge.png b/base/resources.pk3dir/gfx/flags16/ge.png new file mode 100755 index 00000000..728d9707 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ge.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gf.png b/base/resources.pk3dir/gfx/flags16/gf.png new file mode 100755 index 00000000..8332c4ec Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gf.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gh.png b/base/resources.pk3dir/gfx/flags16/gh.png new file mode 100755 index 00000000..4e2f8965 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gh.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gi.png b/base/resources.pk3dir/gfx/flags16/gi.png new file mode 100755 index 00000000..e76797f6 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gi.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gl.png b/base/resources.pk3dir/gfx/flags16/gl.png new file mode 100755 index 00000000..ef12a73b Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gl.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gm.png b/base/resources.pk3dir/gfx/flags16/gm.png new file mode 100755 index 00000000..0720b667 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gm.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gn.png b/base/resources.pk3dir/gfx/flags16/gn.png new file mode 100755 index 00000000..ea660b01 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gn.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gp.png b/base/resources.pk3dir/gfx/flags16/gp.png new file mode 100755 index 00000000..dbb086d0 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gp.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gq.png b/base/resources.pk3dir/gfx/flags16/gq.png new file mode 100755 index 00000000..ebe20a28 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gq.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gr.png b/base/resources.pk3dir/gfx/flags16/gr.png new file mode 100755 index 00000000..8651ade7 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gr.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gs.png b/base/resources.pk3dir/gfx/flags16/gs.png new file mode 100755 index 00000000..7ef0bf59 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gs.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gt.png b/base/resources.pk3dir/gfx/flags16/gt.png new file mode 100755 index 00000000..c43a70d3 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gt.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gu.png b/base/resources.pk3dir/gfx/flags16/gu.png new file mode 100755 index 00000000..92f37c05 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gu.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gw.png b/base/resources.pk3dir/gfx/flags16/gw.png new file mode 100755 index 00000000..b37bcf06 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gw.png differ diff --git a/base/resources.pk3dir/gfx/flags16/gy.png b/base/resources.pk3dir/gfx/flags16/gy.png new file mode 100755 index 00000000..22cbe2f5 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/gy.png differ diff --git a/base/resources.pk3dir/gfx/flags16/hk.png b/base/resources.pk3dir/gfx/flags16/hk.png new file mode 100755 index 00000000..d5c380ca Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/hk.png differ diff --git a/base/resources.pk3dir/gfx/flags16/hm.png b/base/resources.pk3dir/gfx/flags16/hm.png new file mode 100755 index 00000000..a01389a7 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/hm.png differ diff --git a/base/resources.pk3dir/gfx/flags16/hn.png b/base/resources.pk3dir/gfx/flags16/hn.png new file mode 100755 index 00000000..96f83885 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/hn.png differ diff --git a/base/resources.pk3dir/gfx/flags16/hr.png b/base/resources.pk3dir/gfx/flags16/hr.png new file mode 100755 index 00000000..696b5154 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/hr.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ht.png b/base/resources.pk3dir/gfx/flags16/ht.png new file mode 100755 index 00000000..416052af Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ht.png differ diff --git a/base/resources.pk3dir/gfx/flags16/hu.png b/base/resources.pk3dir/gfx/flags16/hu.png new file mode 100755 index 00000000..7baafe44 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/hu.png differ diff --git a/base/resources.pk3dir/gfx/flags16/id.png b/base/resources.pk3dir/gfx/flags16/id.png new file mode 100755 index 00000000..c6bc0faf Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/id.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ie.png b/base/resources.pk3dir/gfx/flags16/ie.png new file mode 100755 index 00000000..26baa31e Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ie.png differ diff --git a/base/resources.pk3dir/gfx/flags16/il.png b/base/resources.pk3dir/gfx/flags16/il.png new file mode 100755 index 00000000..2ca772d0 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/il.png differ diff --git a/base/resources.pk3dir/gfx/flags16/in.png b/base/resources.pk3dir/gfx/flags16/in.png new file mode 100755 index 00000000..e4d7e81a Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/in.png differ diff --git a/base/resources.pk3dir/gfx/flags16/io.png b/base/resources.pk3dir/gfx/flags16/io.png new file mode 100755 index 00000000..3e74b6a3 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/io.png differ diff --git a/base/resources.pk3dir/gfx/flags16/iq.png b/base/resources.pk3dir/gfx/flags16/iq.png new file mode 100755 index 00000000..878a3514 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/iq.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ir.png b/base/resources.pk3dir/gfx/flags16/ir.png new file mode 100755 index 00000000..c5fd136a Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ir.png differ diff --git a/base/resources.pk3dir/gfx/flags16/is.png b/base/resources.pk3dir/gfx/flags16/is.png new file mode 100755 index 00000000..b8f6d0f0 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/is.png differ diff --git a/base/resources.pk3dir/gfx/flags16/it.png b/base/resources.pk3dir/gfx/flags16/it.png new file mode 100755 index 00000000..89692f74 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/it.png differ diff --git a/base/resources.pk3dir/gfx/flags16/jm.png b/base/resources.pk3dir/gfx/flags16/jm.png new file mode 100755 index 00000000..7be119e0 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/jm.png differ diff --git a/base/resources.pk3dir/gfx/flags16/jo.png b/base/resources.pk3dir/gfx/flags16/jo.png new file mode 100755 index 00000000..11bd4972 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/jo.png differ diff --git a/base/resources.pk3dir/gfx/flags16/jp.png b/base/resources.pk3dir/gfx/flags16/jp.png new file mode 100755 index 00000000..325fbad3 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/jp.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ke.png b/base/resources.pk3dir/gfx/flags16/ke.png new file mode 100755 index 00000000..51879adf Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ke.png differ diff --git a/base/resources.pk3dir/gfx/flags16/kg.png b/base/resources.pk3dir/gfx/flags16/kg.png new file mode 100755 index 00000000..0a818f67 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/kg.png differ diff --git a/base/resources.pk3dir/gfx/flags16/kh.png b/base/resources.pk3dir/gfx/flags16/kh.png new file mode 100755 index 00000000..30f6bb1b Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/kh.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ki.png b/base/resources.pk3dir/gfx/flags16/ki.png new file mode 100755 index 00000000..2dcce4b3 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ki.png differ diff --git a/base/resources.pk3dir/gfx/flags16/km.png b/base/resources.pk3dir/gfx/flags16/km.png new file mode 100755 index 00000000..812b2f56 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/km.png differ diff --git a/base/resources.pk3dir/gfx/flags16/kn.png b/base/resources.pk3dir/gfx/flags16/kn.png new file mode 100755 index 00000000..febd5b48 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/kn.png differ diff --git a/base/resources.pk3dir/gfx/flags16/kp.png b/base/resources.pk3dir/gfx/flags16/kp.png new file mode 100755 index 00000000..d3d509aa Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/kp.png differ diff --git a/base/resources.pk3dir/gfx/flags16/kr.png b/base/resources.pk3dir/gfx/flags16/kr.png new file mode 100755 index 00000000..9c0a78eb Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/kr.png differ diff --git a/base/resources.pk3dir/gfx/flags16/kw.png b/base/resources.pk3dir/gfx/flags16/kw.png new file mode 100755 index 00000000..96546da3 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/kw.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ky.png b/base/resources.pk3dir/gfx/flags16/ky.png new file mode 100755 index 00000000..15c5f8e4 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ky.png differ diff --git a/base/resources.pk3dir/gfx/flags16/kz.png b/base/resources.pk3dir/gfx/flags16/kz.png new file mode 100755 index 00000000..45a8c887 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/kz.png differ diff --git a/base/resources.pk3dir/gfx/flags16/la.png b/base/resources.pk3dir/gfx/flags16/la.png new file mode 100755 index 00000000..e28acd01 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/la.png differ diff --git a/base/resources.pk3dir/gfx/flags16/lb.png b/base/resources.pk3dir/gfx/flags16/lb.png new file mode 100755 index 00000000..d0d452bf Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/lb.png differ diff --git a/base/resources.pk3dir/gfx/flags16/lc.png b/base/resources.pk3dir/gfx/flags16/lc.png new file mode 100644 index 00000000..a47d0655 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/lc.png differ diff --git a/base/resources.pk3dir/gfx/flags16/li.png b/base/resources.pk3dir/gfx/flags16/li.png new file mode 100755 index 00000000..6469909c Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/li.png differ diff --git a/base/resources.pk3dir/gfx/flags16/lk.png b/base/resources.pk3dir/gfx/flags16/lk.png new file mode 100755 index 00000000..088aad6d Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/lk.png differ diff --git a/base/resources.pk3dir/gfx/flags16/lr.png b/base/resources.pk3dir/gfx/flags16/lr.png new file mode 100755 index 00000000..89a5bc7e Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/lr.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ls.png b/base/resources.pk3dir/gfx/flags16/ls.png new file mode 100755 index 00000000..33fdef10 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ls.png differ diff --git a/base/resources.pk3dir/gfx/flags16/lt.png b/base/resources.pk3dir/gfx/flags16/lt.png new file mode 100755 index 00000000..c8ef0da0 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/lt.png differ diff --git a/base/resources.pk3dir/gfx/flags16/lu.png b/base/resources.pk3dir/gfx/flags16/lu.png new file mode 100755 index 00000000..4cabba98 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/lu.png differ diff --git a/base/resources.pk3dir/gfx/flags16/lv.png b/base/resources.pk3dir/gfx/flags16/lv.png new file mode 100755 index 00000000..49b69981 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/lv.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ly.png b/base/resources.pk3dir/gfx/flags16/ly.png new file mode 100755 index 00000000..b163a9f8 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ly.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ma.png b/base/resources.pk3dir/gfx/flags16/ma.png new file mode 100755 index 00000000..f3867702 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ma.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mc.png b/base/resources.pk3dir/gfx/flags16/mc.png new file mode 100755 index 00000000..1aa830f1 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mc.png differ diff --git a/base/resources.pk3dir/gfx/flags16/md.png b/base/resources.pk3dir/gfx/flags16/md.png new file mode 100755 index 00000000..4e92c189 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/md.png differ diff --git a/base/resources.pk3dir/gfx/flags16/me.png b/base/resources.pk3dir/gfx/flags16/me.png new file mode 100644 index 00000000..ac725355 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/me.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mg.png b/base/resources.pk3dir/gfx/flags16/mg.png new file mode 100755 index 00000000..d2715b3d Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mg.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mh.png b/base/resources.pk3dir/gfx/flags16/mh.png new file mode 100755 index 00000000..fb523a8c Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mh.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mk.png b/base/resources.pk3dir/gfx/flags16/mk.png new file mode 100755 index 00000000..db173aaf Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mk.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ml.png b/base/resources.pk3dir/gfx/flags16/ml.png new file mode 100755 index 00000000..2cec8ba4 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ml.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mm.png b/base/resources.pk3dir/gfx/flags16/mm.png new file mode 100755 index 00000000..f464f67f Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mm.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mn.png b/base/resources.pk3dir/gfx/flags16/mn.png new file mode 100755 index 00000000..9396355d Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mn.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mo.png b/base/resources.pk3dir/gfx/flags16/mo.png new file mode 100755 index 00000000..deb801dd Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mo.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mp.png b/base/resources.pk3dir/gfx/flags16/mp.png new file mode 100755 index 00000000..298d588b Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mp.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mq.png b/base/resources.pk3dir/gfx/flags16/mq.png new file mode 100755 index 00000000..010143b3 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mq.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mr.png b/base/resources.pk3dir/gfx/flags16/mr.png new file mode 100755 index 00000000..319546b1 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mr.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ms.png b/base/resources.pk3dir/gfx/flags16/ms.png new file mode 100755 index 00000000..d4cbb433 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ms.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mt.png b/base/resources.pk3dir/gfx/flags16/mt.png new file mode 100755 index 00000000..00af9487 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mt.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mu.png b/base/resources.pk3dir/gfx/flags16/mu.png new file mode 100755 index 00000000..b7fdce1b Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mu.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mv.png b/base/resources.pk3dir/gfx/flags16/mv.png new file mode 100755 index 00000000..5073d9ec Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mv.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mw.png b/base/resources.pk3dir/gfx/flags16/mw.png new file mode 100755 index 00000000..13886e9f Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mw.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mx.png b/base/resources.pk3dir/gfx/flags16/mx.png new file mode 100755 index 00000000..5bc58ab3 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mx.png differ diff --git a/base/resources.pk3dir/gfx/flags16/my.png b/base/resources.pk3dir/gfx/flags16/my.png new file mode 100755 index 00000000..9034cbab Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/my.png differ diff --git a/base/resources.pk3dir/gfx/flags16/mz.png b/base/resources.pk3dir/gfx/flags16/mz.png new file mode 100755 index 00000000..76405e06 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/mz.png differ diff --git a/base/resources.pk3dir/gfx/flags16/na.png b/base/resources.pk3dir/gfx/flags16/na.png new file mode 100755 index 00000000..63358c67 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/na.png differ diff --git a/base/resources.pk3dir/gfx/flags16/nc.png b/base/resources.pk3dir/gfx/flags16/nc.png new file mode 100755 index 00000000..2cad2837 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/nc.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ne.png b/base/resources.pk3dir/gfx/flags16/ne.png new file mode 100755 index 00000000..d85f424f Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ne.png differ diff --git a/base/resources.pk3dir/gfx/flags16/nf.png b/base/resources.pk3dir/gfx/flags16/nf.png new file mode 100755 index 00000000..f9bcdda1 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/nf.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ng.png b/base/resources.pk3dir/gfx/flags16/ng.png new file mode 100755 index 00000000..3eea2e02 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ng.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ni.png b/base/resources.pk3dir/gfx/flags16/ni.png new file mode 100755 index 00000000..3969aaaa Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ni.png differ diff --git a/base/resources.pk3dir/gfx/flags16/nl.png b/base/resources.pk3dir/gfx/flags16/nl.png new file mode 100755 index 00000000..fe44791e Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/nl.png differ diff --git a/base/resources.pk3dir/gfx/flags16/no.png b/base/resources.pk3dir/gfx/flags16/no.png new file mode 100755 index 00000000..160b6b5b Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/no.png differ diff --git a/base/resources.pk3dir/gfx/flags16/np.png b/base/resources.pk3dir/gfx/flags16/np.png new file mode 100755 index 00000000..aeb058b7 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/np.png differ diff --git a/base/resources.pk3dir/gfx/flags16/nr.png b/base/resources.pk3dir/gfx/flags16/nr.png new file mode 100755 index 00000000..705fc337 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/nr.png differ diff --git a/base/resources.pk3dir/gfx/flags16/nu.png b/base/resources.pk3dir/gfx/flags16/nu.png new file mode 100755 index 00000000..c3ce4aed Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/nu.png differ diff --git a/base/resources.pk3dir/gfx/flags16/nz.png b/base/resources.pk3dir/gfx/flags16/nz.png new file mode 100755 index 00000000..10d6306d Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/nz.png differ diff --git a/base/resources.pk3dir/gfx/flags16/om.png b/base/resources.pk3dir/gfx/flags16/om.png new file mode 100755 index 00000000..2ffba7e8 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/om.png differ diff --git a/base/resources.pk3dir/gfx/flags16/pa.png b/base/resources.pk3dir/gfx/flags16/pa.png new file mode 100755 index 00000000..9b2ee9a7 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/pa.png differ diff --git a/base/resources.pk3dir/gfx/flags16/pe.png b/base/resources.pk3dir/gfx/flags16/pe.png new file mode 100755 index 00000000..62a04977 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/pe.png differ diff --git a/base/resources.pk3dir/gfx/flags16/pf.png b/base/resources.pk3dir/gfx/flags16/pf.png new file mode 100755 index 00000000..771a0f65 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/pf.png differ diff --git a/base/resources.pk3dir/gfx/flags16/pg.png b/base/resources.pk3dir/gfx/flags16/pg.png new file mode 100755 index 00000000..10d62334 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/pg.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ph.png b/base/resources.pk3dir/gfx/flags16/ph.png new file mode 100755 index 00000000..b89e1593 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ph.png differ diff --git a/base/resources.pk3dir/gfx/flags16/pk.png b/base/resources.pk3dir/gfx/flags16/pk.png new file mode 100755 index 00000000..e9df70ca Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/pk.png differ diff --git a/base/resources.pk3dir/gfx/flags16/pl.png b/base/resources.pk3dir/gfx/flags16/pl.png new file mode 100755 index 00000000..d413d010 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/pl.png differ diff --git a/base/resources.pk3dir/gfx/flags16/pm.png b/base/resources.pk3dir/gfx/flags16/pm.png new file mode 100755 index 00000000..ba91d2c7 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/pm.png differ diff --git a/base/resources.pk3dir/gfx/flags16/pn.png b/base/resources.pk3dir/gfx/flags16/pn.png new file mode 100755 index 00000000..aa9344f5 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/pn.png differ diff --git a/base/resources.pk3dir/gfx/flags16/pr.png b/base/resources.pk3dir/gfx/flags16/pr.png new file mode 100755 index 00000000..82d9130d Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/pr.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ps.png b/base/resources.pk3dir/gfx/flags16/ps.png new file mode 100755 index 00000000..f5f54776 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ps.png differ diff --git a/base/resources.pk3dir/gfx/flags16/pt.png b/base/resources.pk3dir/gfx/flags16/pt.png new file mode 100755 index 00000000..ece79801 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/pt.png differ diff --git a/base/resources.pk3dir/gfx/flags16/pw.png b/base/resources.pk3dir/gfx/flags16/pw.png new file mode 100755 index 00000000..6178b254 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/pw.png differ diff --git a/base/resources.pk3dir/gfx/flags16/py.png b/base/resources.pk3dir/gfx/flags16/py.png new file mode 100755 index 00000000..cb8723c0 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/py.png differ diff --git a/base/resources.pk3dir/gfx/flags16/qa.png b/base/resources.pk3dir/gfx/flags16/qa.png new file mode 100755 index 00000000..ed4c621f Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/qa.png differ diff --git a/base/resources.pk3dir/gfx/flags16/re.png b/base/resources.pk3dir/gfx/flags16/re.png new file mode 100755 index 00000000..8332c4ec Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/re.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ro.png b/base/resources.pk3dir/gfx/flags16/ro.png new file mode 100755 index 00000000..57e74a65 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ro.png differ diff --git a/base/resources.pk3dir/gfx/flags16/rs.png b/base/resources.pk3dir/gfx/flags16/rs.png new file mode 100644 index 00000000..9439a5b6 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/rs.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ru.png b/base/resources.pk3dir/gfx/flags16/ru.png new file mode 100755 index 00000000..47da4214 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ru.png differ diff --git a/base/resources.pk3dir/gfx/flags16/rw.png b/base/resources.pk3dir/gfx/flags16/rw.png new file mode 100755 index 00000000..53564917 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/rw.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sa.png b/base/resources.pk3dir/gfx/flags16/sa.png new file mode 100755 index 00000000..b4641c7e Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sa.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sb.png b/base/resources.pk3dir/gfx/flags16/sb.png new file mode 100755 index 00000000..a9937ccf Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sb.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sc.png b/base/resources.pk3dir/gfx/flags16/sc.png new file mode 100755 index 00000000..39ee3718 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sc.png differ diff --git a/base/resources.pk3dir/gfx/flags16/scotland.png b/base/resources.pk3dir/gfx/flags16/scotland.png new file mode 100755 index 00000000..a0e57b41 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/scotland.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sd.png b/base/resources.pk3dir/gfx/flags16/sd.png new file mode 100755 index 00000000..eaab69eb Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sd.png differ diff --git a/base/resources.pk3dir/gfx/flags16/se.png b/base/resources.pk3dir/gfx/flags16/se.png new file mode 100755 index 00000000..1994653d Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/se.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sg.png b/base/resources.pk3dir/gfx/flags16/sg.png new file mode 100755 index 00000000..dd34d612 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sg.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sh.png b/base/resources.pk3dir/gfx/flags16/sh.png new file mode 100755 index 00000000..4b1d2a29 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sh.png differ diff --git a/base/resources.pk3dir/gfx/flags16/si.png b/base/resources.pk3dir/gfx/flags16/si.png new file mode 100755 index 00000000..bb1476ff Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/si.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sj.png b/base/resources.pk3dir/gfx/flags16/sj.png new file mode 100755 index 00000000..160b6b5b Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sj.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sk.png b/base/resources.pk3dir/gfx/flags16/sk.png new file mode 100755 index 00000000..7ccbc827 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sk.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sl.png b/base/resources.pk3dir/gfx/flags16/sl.png new file mode 100755 index 00000000..12d812d2 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sl.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sm.png b/base/resources.pk3dir/gfx/flags16/sm.png new file mode 100755 index 00000000..3df2fdcf Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sm.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sn.png b/base/resources.pk3dir/gfx/flags16/sn.png new file mode 100755 index 00000000..eabb71db Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sn.png differ diff --git a/base/resources.pk3dir/gfx/flags16/so.png b/base/resources.pk3dir/gfx/flags16/so.png new file mode 100755 index 00000000..4a1ea4b2 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/so.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sr.png b/base/resources.pk3dir/gfx/flags16/sr.png new file mode 100755 index 00000000..5eff9271 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sr.png differ diff --git a/base/resources.pk3dir/gfx/flags16/st.png b/base/resources.pk3dir/gfx/flags16/st.png new file mode 100755 index 00000000..2978557b Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/st.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sv.png b/base/resources.pk3dir/gfx/flags16/sv.png new file mode 100755 index 00000000..24987990 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sv.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sy.png b/base/resources.pk3dir/gfx/flags16/sy.png new file mode 100755 index 00000000..f5ce30dc Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sy.png differ diff --git a/base/resources.pk3dir/gfx/flags16/sz.png b/base/resources.pk3dir/gfx/flags16/sz.png new file mode 100755 index 00000000..914ee861 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/sz.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tc.png b/base/resources.pk3dir/gfx/flags16/tc.png new file mode 100755 index 00000000..8fc1156b Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tc.png differ diff --git a/base/resources.pk3dir/gfx/flags16/td.png b/base/resources.pk3dir/gfx/flags16/td.png new file mode 100755 index 00000000..667f21fd Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/td.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tf.png b/base/resources.pk3dir/gfx/flags16/tf.png new file mode 100755 index 00000000..80529a43 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tf.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tg.png b/base/resources.pk3dir/gfx/flags16/tg.png new file mode 100755 index 00000000..3aa00ad4 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tg.png differ diff --git a/base/resources.pk3dir/gfx/flags16/th.png b/base/resources.pk3dir/gfx/flags16/th.png new file mode 100755 index 00000000..dd8ba917 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/th.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tj.png b/base/resources.pk3dir/gfx/flags16/tj.png new file mode 100755 index 00000000..617bf645 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tj.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tk.png b/base/resources.pk3dir/gfx/flags16/tk.png new file mode 100755 index 00000000..67b8c8cb Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tk.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tl.png b/base/resources.pk3dir/gfx/flags16/tl.png new file mode 100755 index 00000000..77da181e Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tl.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tm.png b/base/resources.pk3dir/gfx/flags16/tm.png new file mode 100755 index 00000000..828020ec Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tm.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tn.png b/base/resources.pk3dir/gfx/flags16/tn.png new file mode 100755 index 00000000..183cdd3d Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tn.png differ diff --git a/base/resources.pk3dir/gfx/flags16/to.png b/base/resources.pk3dir/gfx/flags16/to.png new file mode 100755 index 00000000..f89b8ba7 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/to.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tr.png b/base/resources.pk3dir/gfx/flags16/tr.png new file mode 100755 index 00000000..be32f77e Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tr.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tt.png b/base/resources.pk3dir/gfx/flags16/tt.png new file mode 100755 index 00000000..2a11c1e2 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tt.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tv.png b/base/resources.pk3dir/gfx/flags16/tv.png new file mode 100755 index 00000000..28274c5f Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tv.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tw.png b/base/resources.pk3dir/gfx/flags16/tw.png new file mode 100755 index 00000000..f31c654c Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tw.png differ diff --git a/base/resources.pk3dir/gfx/flags16/tz.png b/base/resources.pk3dir/gfx/flags16/tz.png new file mode 100755 index 00000000..c00ff796 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/tz.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ua.png b/base/resources.pk3dir/gfx/flags16/ua.png new file mode 100755 index 00000000..09563a21 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ua.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ug.png b/base/resources.pk3dir/gfx/flags16/ug.png new file mode 100755 index 00000000..33f4affa Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ug.png differ diff --git a/base/resources.pk3dir/gfx/flags16/um.png b/base/resources.pk3dir/gfx/flags16/um.png new file mode 100755 index 00000000..c1dd9654 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/um.png differ diff --git a/base/resources.pk3dir/gfx/flags16/us.png b/base/resources.pk3dir/gfx/flags16/us.png new file mode 100755 index 00000000..10f451fe Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/us.png differ diff --git a/base/resources.pk3dir/gfx/flags16/uy.png b/base/resources.pk3dir/gfx/flags16/uy.png new file mode 100755 index 00000000..31d948a0 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/uy.png differ diff --git a/base/resources.pk3dir/gfx/flags16/uz.png b/base/resources.pk3dir/gfx/flags16/uz.png new file mode 100755 index 00000000..fef5dc17 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/uz.png differ diff --git a/base/resources.pk3dir/gfx/flags16/va.png b/base/resources.pk3dir/gfx/flags16/va.png new file mode 100755 index 00000000..b31eaf22 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/va.png differ diff --git a/base/resources.pk3dir/gfx/flags16/vc.png b/base/resources.pk3dir/gfx/flags16/vc.png new file mode 100755 index 00000000..8fa17b06 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/vc.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ve.png b/base/resources.pk3dir/gfx/flags16/ve.png new file mode 100755 index 00000000..00c90f9a Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ve.png differ diff --git a/base/resources.pk3dir/gfx/flags16/vg.png b/base/resources.pk3dir/gfx/flags16/vg.png new file mode 100755 index 00000000..41569079 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/vg.png differ diff --git a/base/resources.pk3dir/gfx/flags16/vi.png b/base/resources.pk3dir/gfx/flags16/vi.png new file mode 100755 index 00000000..ed26915a Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/vi.png differ diff --git a/base/resources.pk3dir/gfx/flags16/vn.png b/base/resources.pk3dir/gfx/flags16/vn.png new file mode 100755 index 00000000..ec7cd48a Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/vn.png differ diff --git a/base/resources.pk3dir/gfx/flags16/vu.png b/base/resources.pk3dir/gfx/flags16/vu.png new file mode 100755 index 00000000..b3397bc6 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/vu.png differ diff --git a/base/resources.pk3dir/gfx/flags16/wales.png b/base/resources.pk3dir/gfx/flags16/wales.png new file mode 100755 index 00000000..e0d7cee1 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/wales.png differ diff --git a/base/resources.pk3dir/gfx/flags16/wf.png b/base/resources.pk3dir/gfx/flags16/wf.png new file mode 100755 index 00000000..9f955873 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/wf.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ws.png b/base/resources.pk3dir/gfx/flags16/ws.png new file mode 100755 index 00000000..c1695080 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ws.png differ diff --git a/base/resources.pk3dir/gfx/flags16/ye.png b/base/resources.pk3dir/gfx/flags16/ye.png new file mode 100755 index 00000000..468dfad0 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/ye.png differ diff --git a/base/resources.pk3dir/gfx/flags16/yt.png b/base/resources.pk3dir/gfx/flags16/yt.png new file mode 100755 index 00000000..c298f378 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/yt.png differ diff --git a/base/resources.pk3dir/gfx/flags16/za.png b/base/resources.pk3dir/gfx/flags16/za.png new file mode 100755 index 00000000..57c58e21 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/za.png differ diff --git a/base/resources.pk3dir/gfx/flags16/zm.png b/base/resources.pk3dir/gfx/flags16/zm.png new file mode 100755 index 00000000..c25b07be Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/zm.png differ diff --git a/base/resources.pk3dir/gfx/flags16/zw.png b/base/resources.pk3dir/gfx/flags16/zw.png new file mode 100755 index 00000000..53c97259 Binary files /dev/null and b/base/resources.pk3dir/gfx/flags16/zw.png differ diff --git a/base/resources.pk3dir/gfx/icon16/CREDITS b/base/resources.pk3dir/gfx/icon16/CREDITS new file mode 100644 index 00000000..cd3339f9 --- /dev/null +++ b/base/resources.pk3dir/gfx/icon16/CREDITS @@ -0,0 +1,3 @@ +Silk Icons by Mark James +https://github.com/markjames/famfamfam-silk-icons +http://www.famfamfam.com/lab/icons/silk/ diff --git a/base/resources.pk3dir/gfx/icon16/accept.png b/base/resources.pk3dir/gfx/icon16/accept.png new file mode 100644 index 00000000..89c8129a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/accept.png differ diff --git a/base/resources.pk3dir/gfx/icon16/add.png b/base/resources.pk3dir/gfx/icon16/add.png new file mode 100644 index 00000000..6332fefe Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/anchor.png b/base/resources.pk3dir/gfx/icon16/anchor.png new file mode 100644 index 00000000..9b3422c6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/anchor.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application.png b/base/resources.pk3dir/gfx/icon16/application.png new file mode 100644 index 00000000..1dee9e36 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_add.png b/base/resources.pk3dir/gfx/icon16/application_add.png new file mode 100644 index 00000000..2e945076 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_cascade.png b/base/resources.pk3dir/gfx/icon16/application_cascade.png new file mode 100644 index 00000000..da5c622e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_cascade.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_delete.png b/base/resources.pk3dir/gfx/icon16/application_delete.png new file mode 100644 index 00000000..0a335acf Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_double.png b/base/resources.pk3dir/gfx/icon16/application_double.png new file mode 100644 index 00000000..647592f2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_double.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_edit.png b/base/resources.pk3dir/gfx/icon16/application_edit.png new file mode 100644 index 00000000..fb2efb87 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_error.png b/base/resources.pk3dir/gfx/icon16/application_error.png new file mode 100644 index 00000000..b35fa571 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_form.png b/base/resources.pk3dir/gfx/icon16/application_form.png new file mode 100644 index 00000000..807b862c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_form.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_form_add.png b/base/resources.pk3dir/gfx/icon16/application_form_add.png new file mode 100644 index 00000000..28c2175e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_form_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_form_delete.png b/base/resources.pk3dir/gfx/icon16/application_form_delete.png new file mode 100644 index 00000000..cd305ec8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_form_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_form_edit.png b/base/resources.pk3dir/gfx/icon16/application_form_edit.png new file mode 100644 index 00000000..af486c94 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_form_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_form_magnify.png b/base/resources.pk3dir/gfx/icon16/application_form_magnify.png new file mode 100644 index 00000000..7b7fbd17 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_form_magnify.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_get.png b/base/resources.pk3dir/gfx/icon16/application_get.png new file mode 100644 index 00000000..28e41ea2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_get.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_go.png b/base/resources.pk3dir/gfx/icon16/application_go.png new file mode 100644 index 00000000..5cc2b0dd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_home.png b/base/resources.pk3dir/gfx/icon16/application_home.png new file mode 100644 index 00000000..b60d0c85 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_home.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_key.png b/base/resources.pk3dir/gfx/icon16/application_key.png new file mode 100644 index 00000000..998d65c6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_lightning.png b/base/resources.pk3dir/gfx/icon16/application_lightning.png new file mode 100644 index 00000000..7e91545c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_lightning.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_link.png b/base/resources.pk3dir/gfx/icon16/application_link.png new file mode 100644 index 00000000..f8fbb3ed Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_osx.png b/base/resources.pk3dir/gfx/icon16/application_osx.png new file mode 100644 index 00000000..9f022ece Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_osx.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_osx_terminal.png b/base/resources.pk3dir/gfx/icon16/application_osx_terminal.png new file mode 100644 index 00000000..b3d8ce01 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_osx_terminal.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_put.png b/base/resources.pk3dir/gfx/icon16/application_put.png new file mode 100644 index 00000000..c30cf598 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_put.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_side_boxes.png b/base/resources.pk3dir/gfx/icon16/application_side_boxes.png new file mode 100644 index 00000000..efbf3c4f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_side_boxes.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_side_contract.png b/base/resources.pk3dir/gfx/icon16/application_side_contract.png new file mode 100644 index 00000000..3585f94d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_side_contract.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_side_expand.png b/base/resources.pk3dir/gfx/icon16/application_side_expand.png new file mode 100644 index 00000000..030cf7c3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_side_expand.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_side_list.png b/base/resources.pk3dir/gfx/icon16/application_side_list.png new file mode 100644 index 00000000..248eaf1a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_side_list.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_side_tree.png b/base/resources.pk3dir/gfx/icon16/application_side_tree.png new file mode 100644 index 00000000..f04a52b3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_side_tree.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_split.png b/base/resources.pk3dir/gfx/icon16/application_split.png new file mode 100644 index 00000000..a91c78a5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_split.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_tile_horizontal.png b/base/resources.pk3dir/gfx/icon16/application_tile_horizontal.png new file mode 100644 index 00000000..8a1191c3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_tile_horizontal.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_tile_vertical.png b/base/resources.pk3dir/gfx/icon16/application_tile_vertical.png new file mode 100644 index 00000000..1d40383d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_tile_vertical.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_view_columns.png b/base/resources.pk3dir/gfx/icon16/application_view_columns.png new file mode 100644 index 00000000..dc2e9d5f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_view_columns.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_view_detail.png b/base/resources.pk3dir/gfx/icon16/application_view_detail.png new file mode 100644 index 00000000..aba044bb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_view_detail.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_view_gallery.png b/base/resources.pk3dir/gfx/icon16/application_view_gallery.png new file mode 100644 index 00000000..851950db Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_view_gallery.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_view_icons.png b/base/resources.pk3dir/gfx/icon16/application_view_icons.png new file mode 100644 index 00000000..6a93cdaa Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_view_icons.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_view_list.png b/base/resources.pk3dir/gfx/icon16/application_view_list.png new file mode 100644 index 00000000..acc30b85 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_view_list.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_view_tile.png b/base/resources.pk3dir/gfx/icon16/application_view_tile.png new file mode 100644 index 00000000..3bc0bd32 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_view_tile.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_xp.png b/base/resources.pk3dir/gfx/icon16/application_xp.png new file mode 100644 index 00000000..d22860a3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_xp.png differ diff --git a/base/resources.pk3dir/gfx/icon16/application_xp_terminal.png b/base/resources.pk3dir/gfx/icon16/application_xp_terminal.png new file mode 100644 index 00000000..c28dd638 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/application_xp_terminal.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_branch.png b/base/resources.pk3dir/gfx/icon16/arrow_branch.png new file mode 100644 index 00000000..7542db1d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_branch.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_divide.png b/base/resources.pk3dir/gfx/icon16/arrow_divide.png new file mode 100644 index 00000000..61a7b1d9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_divide.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_down.png b/base/resources.pk3dir/gfx/icon16/arrow_down.png new file mode 100644 index 00000000..2c4e2793 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_down.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_in.png b/base/resources.pk3dir/gfx/icon16/arrow_in.png new file mode 100644 index 00000000..745c6513 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_in.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_inout.png b/base/resources.pk3dir/gfx/icon16/arrow_inout.png new file mode 100644 index 00000000..1b763672 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_inout.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_join.png b/base/resources.pk3dir/gfx/icon16/arrow_join.png new file mode 100644 index 00000000..a128413d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_join.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_left.png b/base/resources.pk3dir/gfx/icon16/arrow_left.png new file mode 100644 index 00000000..5dc69678 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_left.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_merge.png b/base/resources.pk3dir/gfx/icon16/arrow_merge.png new file mode 100644 index 00000000..7502dbb3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_merge.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_out.png b/base/resources.pk3dir/gfx/icon16/arrow_out.png new file mode 100644 index 00000000..2e9bc42b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_out.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_redo.png b/base/resources.pk3dir/gfx/icon16/arrow_redo.png new file mode 100644 index 00000000..fdc394c7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_redo.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_refresh.png b/base/resources.pk3dir/gfx/icon16/arrow_refresh.png new file mode 100644 index 00000000..0de26566 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_refresh.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_refresh_small.png b/base/resources.pk3dir/gfx/icon16/arrow_refresh_small.png new file mode 100644 index 00000000..d3087dfc Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_refresh_small.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_right.png b/base/resources.pk3dir/gfx/icon16/arrow_right.png new file mode 100644 index 00000000..b1a18192 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_right.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_rotate_anticlockwise.png b/base/resources.pk3dir/gfx/icon16/arrow_rotate_anticlockwise.png new file mode 100644 index 00000000..46c75aa8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_rotate_anticlockwise.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_rotate_clockwise.png b/base/resources.pk3dir/gfx/icon16/arrow_rotate_clockwise.png new file mode 100644 index 00000000..aa65210e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_rotate_clockwise.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_switch.png b/base/resources.pk3dir/gfx/icon16/arrow_switch.png new file mode 100644 index 00000000..258c16c6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_switch.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_turn_left.png b/base/resources.pk3dir/gfx/icon16/arrow_turn_left.png new file mode 100644 index 00000000..a3d6c9e3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_turn_left.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_turn_right.png b/base/resources.pk3dir/gfx/icon16/arrow_turn_right.png new file mode 100644 index 00000000..629f20d6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_turn_right.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_undo.png b/base/resources.pk3dir/gfx/icon16/arrow_undo.png new file mode 100644 index 00000000..6972c5e5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_undo.png differ diff --git a/base/resources.pk3dir/gfx/icon16/arrow_up.png b/base/resources.pk3dir/gfx/icon16/arrow_up.png new file mode 100644 index 00000000..1ebb1932 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/arrow_up.png differ diff --git a/base/resources.pk3dir/gfx/icon16/asterisk_orange.png b/base/resources.pk3dir/gfx/icon16/asterisk_orange.png new file mode 100644 index 00000000..1ebebde5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/asterisk_orange.png differ diff --git a/base/resources.pk3dir/gfx/icon16/asterisk_yellow.png b/base/resources.pk3dir/gfx/icon16/asterisk_yellow.png new file mode 100644 index 00000000..bab7cc9b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/asterisk_yellow.png differ diff --git a/base/resources.pk3dir/gfx/icon16/attach.png b/base/resources.pk3dir/gfx/icon16/attach.png new file mode 100644 index 00000000..ea897cc9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/attach.png differ diff --git a/base/resources.pk3dir/gfx/icon16/award_star_add.png b/base/resources.pk3dir/gfx/icon16/award_star_add.png new file mode 100644 index 00000000..9c4be9be Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/award_star_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/award_star_bronze_1.png b/base/resources.pk3dir/gfx/icon16/award_star_bronze_1.png new file mode 100644 index 00000000..658c7117 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/award_star_bronze_1.png differ diff --git a/base/resources.pk3dir/gfx/icon16/award_star_bronze_2.png b/base/resources.pk3dir/gfx/icon16/award_star_bronze_2.png new file mode 100644 index 00000000..e47babd7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/award_star_bronze_2.png differ diff --git a/base/resources.pk3dir/gfx/icon16/award_star_bronze_3.png b/base/resources.pk3dir/gfx/icon16/award_star_bronze_3.png new file mode 100644 index 00000000..396e4b3a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/award_star_bronze_3.png differ diff --git a/base/resources.pk3dir/gfx/icon16/award_star_delete.png b/base/resources.pk3dir/gfx/icon16/award_star_delete.png new file mode 100644 index 00000000..4721b152 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/award_star_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/award_star_gold_1.png b/base/resources.pk3dir/gfx/icon16/award_star_gold_1.png new file mode 100644 index 00000000..97a22b72 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/award_star_gold_1.png differ diff --git a/base/resources.pk3dir/gfx/icon16/award_star_gold_2.png b/base/resources.pk3dir/gfx/icon16/award_star_gold_2.png new file mode 100644 index 00000000..0eaa5717 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/award_star_gold_2.png differ diff --git a/base/resources.pk3dir/gfx/icon16/award_star_gold_3.png b/base/resources.pk3dir/gfx/icon16/award_star_gold_3.png new file mode 100644 index 00000000..124c9914 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/award_star_gold_3.png differ diff --git a/base/resources.pk3dir/gfx/icon16/award_star_silver_1.png b/base/resources.pk3dir/gfx/icon16/award_star_silver_1.png new file mode 100644 index 00000000..028a5462 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/award_star_silver_1.png differ diff --git a/base/resources.pk3dir/gfx/icon16/award_star_silver_2.png b/base/resources.pk3dir/gfx/icon16/award_star_silver_2.png new file mode 100644 index 00000000..e487c3a1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/award_star_silver_2.png differ diff --git a/base/resources.pk3dir/gfx/icon16/award_star_silver_3.png b/base/resources.pk3dir/gfx/icon16/award_star_silver_3.png new file mode 100644 index 00000000..1d72d472 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/award_star_silver_3.png differ diff --git a/base/resources.pk3dir/gfx/icon16/basket.png b/base/resources.pk3dir/gfx/icon16/basket.png new file mode 100644 index 00000000..b0686d78 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/basket.png differ diff --git a/base/resources.pk3dir/gfx/icon16/basket_add.png b/base/resources.pk3dir/gfx/icon16/basket_add.png new file mode 100644 index 00000000..35543682 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/basket_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/basket_delete.png b/base/resources.pk3dir/gfx/icon16/basket_delete.png new file mode 100644 index 00000000..1349974f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/basket_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/basket_edit.png b/base/resources.pk3dir/gfx/icon16/basket_edit.png new file mode 100644 index 00000000..8138bbdf Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/basket_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/basket_error.png b/base/resources.pk3dir/gfx/icon16/basket_error.png new file mode 100644 index 00000000..3978b292 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/basket_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/basket_go.png b/base/resources.pk3dir/gfx/icon16/basket_go.png new file mode 100644 index 00000000..ed8b9a57 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/basket_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/basket_put.png b/base/resources.pk3dir/gfx/icon16/basket_put.png new file mode 100644 index 00000000..be62faaa Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/basket_put.png differ diff --git a/base/resources.pk3dir/gfx/icon16/basket_remove.png b/base/resources.pk3dir/gfx/icon16/basket_remove.png new file mode 100644 index 00000000..04dd7fd3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/basket_remove.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bell.png b/base/resources.pk3dir/gfx/icon16/bell.png new file mode 100644 index 00000000..6e0015df Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bell.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bell_add.png b/base/resources.pk3dir/gfx/icon16/bell_add.png new file mode 100644 index 00000000..7db01d62 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bell_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bell_delete.png b/base/resources.pk3dir/gfx/icon16/bell_delete.png new file mode 100644 index 00000000..23907bbb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bell_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bell_error.png b/base/resources.pk3dir/gfx/icon16/bell_error.png new file mode 100644 index 00000000..a0ddc002 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bell_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bell_go.png b/base/resources.pk3dir/gfx/icon16/bell_go.png new file mode 100644 index 00000000..b89bb343 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bell_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bell_link.png b/base/resources.pk3dir/gfx/icon16/bell_link.png new file mode 100644 index 00000000..b8c64af1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bell_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bin.png b/base/resources.pk3dir/gfx/icon16/bin.png new file mode 100644 index 00000000..ebad933c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bin.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bin_closed.png b/base/resources.pk3dir/gfx/icon16/bin_closed.png new file mode 100644 index 00000000..afe22ba9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bin_closed.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bin_empty.png b/base/resources.pk3dir/gfx/icon16/bin_empty.png new file mode 100644 index 00000000..375b8bf6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bin_empty.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bomb.png b/base/resources.pk3dir/gfx/icon16/bomb.png new file mode 100644 index 00000000..1be37974 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bomb.png differ diff --git a/base/resources.pk3dir/gfx/icon16/book.png b/base/resources.pk3dir/gfx/icon16/book.png new file mode 100644 index 00000000..b0f4dd79 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/book.png differ diff --git a/base/resources.pk3dir/gfx/icon16/book_add.png b/base/resources.pk3dir/gfx/icon16/book_add.png new file mode 100644 index 00000000..e2f08472 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/book_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/book_addresses.png b/base/resources.pk3dir/gfx/icon16/book_addresses.png new file mode 100644 index 00000000..b73419ba Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/book_addresses.png differ diff --git a/base/resources.pk3dir/gfx/icon16/book_delete.png b/base/resources.pk3dir/gfx/icon16/book_delete.png new file mode 100644 index 00000000..d9a6340d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/book_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/book_edit.png b/base/resources.pk3dir/gfx/icon16/book_edit.png new file mode 100644 index 00000000..6e756cc8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/book_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/book_error.png b/base/resources.pk3dir/gfx/icon16/book_error.png new file mode 100644 index 00000000..f3fbed0d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/book_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/book_go.png b/base/resources.pk3dir/gfx/icon16/book_go.png new file mode 100644 index 00000000..cd4e1964 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/book_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/book_key.png b/base/resources.pk3dir/gfx/icon16/book_key.png new file mode 100644 index 00000000..d8e23ec9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/book_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/book_link.png b/base/resources.pk3dir/gfx/icon16/book_link.png new file mode 100644 index 00000000..dd0820e8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/book_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/book_next.png b/base/resources.pk3dir/gfx/icon16/book_next.png new file mode 100644 index 00000000..ff2ea1ab Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/book_next.png differ diff --git a/base/resources.pk3dir/gfx/icon16/book_open.png b/base/resources.pk3dir/gfx/icon16/book_open.png new file mode 100644 index 00000000..7d863f94 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/book_open.png differ diff --git a/base/resources.pk3dir/gfx/icon16/book_previous.png b/base/resources.pk3dir/gfx/icon16/book_previous.png new file mode 100644 index 00000000..2e53c698 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/book_previous.png differ diff --git a/base/resources.pk3dir/gfx/icon16/box.png b/base/resources.pk3dir/gfx/icon16/box.png new file mode 100644 index 00000000..8443c23e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/box.png differ diff --git a/base/resources.pk3dir/gfx/icon16/brick.png b/base/resources.pk3dir/gfx/icon16/brick.png new file mode 100644 index 00000000..7851cf34 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/brick.png differ diff --git a/base/resources.pk3dir/gfx/icon16/brick_add.png b/base/resources.pk3dir/gfx/icon16/brick_add.png new file mode 100644 index 00000000..fac186bf Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/brick_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/brick_delete.png b/base/resources.pk3dir/gfx/icon16/brick_delete.png new file mode 100644 index 00000000..3a8c3734 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/brick_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/brick_edit.png b/base/resources.pk3dir/gfx/icon16/brick_edit.png new file mode 100644 index 00000000..eb06df3b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/brick_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/brick_error.png b/base/resources.pk3dir/gfx/icon16/brick_error.png new file mode 100644 index 00000000..18ab01eb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/brick_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/brick_go.png b/base/resources.pk3dir/gfx/icon16/brick_go.png new file mode 100644 index 00000000..fe0d3356 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/brick_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/brick_link.png b/base/resources.pk3dir/gfx/icon16/brick_link.png new file mode 100644 index 00000000..9ebf013a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/brick_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bricks.png b/base/resources.pk3dir/gfx/icon16/bricks.png new file mode 100644 index 00000000..0905f933 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bricks.png differ diff --git a/base/resources.pk3dir/gfx/icon16/briefcase.png b/base/resources.pk3dir/gfx/icon16/briefcase.png new file mode 100644 index 00000000..05c56491 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/briefcase.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bug.png b/base/resources.pk3dir/gfx/icon16/bug.png new file mode 100644 index 00000000..2d5fb90e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bug.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bug_add.png b/base/resources.pk3dir/gfx/icon16/bug_add.png new file mode 100644 index 00000000..ced78174 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bug_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bug_delete.png b/base/resources.pk3dir/gfx/icon16/bug_delete.png new file mode 100644 index 00000000..e81d7571 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bug_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bug_edit.png b/base/resources.pk3dir/gfx/icon16/bug_edit.png new file mode 100644 index 00000000..e5c7dc05 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bug_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bug_error.png b/base/resources.pk3dir/gfx/icon16/bug_error.png new file mode 100644 index 00000000..c4e8c280 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bug_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bug_go.png b/base/resources.pk3dir/gfx/icon16/bug_go.png new file mode 100644 index 00000000..4e4ae99d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bug_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bug_link.png b/base/resources.pk3dir/gfx/icon16/bug_link.png new file mode 100644 index 00000000..30e25aba Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bug_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/building.png b/base/resources.pk3dir/gfx/icon16/building.png new file mode 100644 index 00000000..11a017cf Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/building.png differ diff --git a/base/resources.pk3dir/gfx/icon16/building_add.png b/base/resources.pk3dir/gfx/icon16/building_add.png new file mode 100644 index 00000000..d88e2b9a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/building_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/building_delete.png b/base/resources.pk3dir/gfx/icon16/building_delete.png new file mode 100644 index 00000000..db6455d2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/building_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/building_edit.png b/base/resources.pk3dir/gfx/icon16/building_edit.png new file mode 100644 index 00000000..646db36b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/building_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/building_error.png b/base/resources.pk3dir/gfx/icon16/building_error.png new file mode 100644 index 00000000..a342eefc Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/building_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/building_go.png b/base/resources.pk3dir/gfx/icon16/building_go.png new file mode 100644 index 00000000..cdcbcb38 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/building_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/building_key.png b/base/resources.pk3dir/gfx/icon16/building_key.png new file mode 100644 index 00000000..8b79e30e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/building_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/building_link.png b/base/resources.pk3dir/gfx/icon16/building_link.png new file mode 100644 index 00000000..a340629a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/building_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_add.png b/base/resources.pk3dir/gfx/icon16/bullet_add.png new file mode 100644 index 00000000..41ff8335 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_arrow_bottom.png b/base/resources.pk3dir/gfx/icon16/bullet_arrow_bottom.png new file mode 100644 index 00000000..1a28d825 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_arrow_bottom.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_arrow_down.png b/base/resources.pk3dir/gfx/icon16/bullet_arrow_down.png new file mode 100644 index 00000000..9b23c06d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_arrow_down.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_arrow_top.png b/base/resources.pk3dir/gfx/icon16/bullet_arrow_top.png new file mode 100644 index 00000000..0ce86d2b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_arrow_top.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_arrow_up.png b/base/resources.pk3dir/gfx/icon16/bullet_arrow_up.png new file mode 100644 index 00000000..24df0f42 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_arrow_up.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_black.png b/base/resources.pk3dir/gfx/icon16/bullet_black.png new file mode 100644 index 00000000..57619706 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_black.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_blue.png b/base/resources.pk3dir/gfx/icon16/bullet_blue.png new file mode 100644 index 00000000..a7651ec8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_delete.png b/base/resources.pk3dir/gfx/icon16/bullet_delete.png new file mode 100644 index 00000000..bd6271b2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_disk.png b/base/resources.pk3dir/gfx/icon16/bullet_disk.png new file mode 100644 index 00000000..209c6a78 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_disk.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_error.png b/base/resources.pk3dir/gfx/icon16/bullet_error.png new file mode 100644 index 00000000..bca2b491 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_feed.png b/base/resources.pk3dir/gfx/icon16/bullet_feed.png new file mode 100644 index 00000000..1a0e0f18 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_feed.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_go.png b/base/resources.pk3dir/gfx/icon16/bullet_go.png new file mode 100644 index 00000000..bc4faa70 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_green.png b/base/resources.pk3dir/gfx/icon16/bullet_green.png new file mode 100644 index 00000000..058ad261 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_green.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_key.png b/base/resources.pk3dir/gfx/icon16/bullet_key.png new file mode 100644 index 00000000..3d37f2ea Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_orange.png b/base/resources.pk3dir/gfx/icon16/bullet_orange.png new file mode 100644 index 00000000..fa63024e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_orange.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_picture.png b/base/resources.pk3dir/gfx/icon16/bullet_picture.png new file mode 100644 index 00000000..386cb302 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_picture.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_pink.png b/base/resources.pk3dir/gfx/icon16/bullet_pink.png new file mode 100644 index 00000000..0c9f73e3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_pink.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_purple.png b/base/resources.pk3dir/gfx/icon16/bullet_purple.png new file mode 100644 index 00000000..52ba5036 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_purple.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_red.png b/base/resources.pk3dir/gfx/icon16/bullet_red.png new file mode 100644 index 00000000..0cd80311 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_red.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_star.png b/base/resources.pk3dir/gfx/icon16/bullet_star.png new file mode 100644 index 00000000..fab774a3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_star.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_toggle_minus.png b/base/resources.pk3dir/gfx/icon16/bullet_toggle_minus.png new file mode 100644 index 00000000..b47ce55f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_toggle_minus.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_toggle_plus.png b/base/resources.pk3dir/gfx/icon16/bullet_toggle_plus.png new file mode 100644 index 00000000..9ab4a896 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_toggle_plus.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_white.png b/base/resources.pk3dir/gfx/icon16/bullet_white.png new file mode 100644 index 00000000..a9af8d44 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_white.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_wrench.png b/base/resources.pk3dir/gfx/icon16/bullet_wrench.png new file mode 100644 index 00000000..67817e6e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_wrench.png differ diff --git a/base/resources.pk3dir/gfx/icon16/bullet_yellow.png b/base/resources.pk3dir/gfx/icon16/bullet_yellow.png new file mode 100644 index 00000000..6469cea7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/bullet_yellow.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cake.png b/base/resources.pk3dir/gfx/icon16/cake.png new file mode 100644 index 00000000..4ef151ae Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cake.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calculator.png b/base/resources.pk3dir/gfx/icon16/calculator.png new file mode 100644 index 00000000..701a60a5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calculator.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calculator_add.png b/base/resources.pk3dir/gfx/icon16/calculator_add.png new file mode 100644 index 00000000..fd377bde Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calculator_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calculator_delete.png b/base/resources.pk3dir/gfx/icon16/calculator_delete.png new file mode 100644 index 00000000..ac96170e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calculator_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calculator_edit.png b/base/resources.pk3dir/gfx/icon16/calculator_edit.png new file mode 100644 index 00000000..63b06b98 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calculator_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calculator_error.png b/base/resources.pk3dir/gfx/icon16/calculator_error.png new file mode 100644 index 00000000..0bc4288a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calculator_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calculator_link.png b/base/resources.pk3dir/gfx/icon16/calculator_link.png new file mode 100644 index 00000000..a2a8fe69 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calculator_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calendar.png b/base/resources.pk3dir/gfx/icon16/calendar.png new file mode 100644 index 00000000..65891385 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calendar.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calendar_add.png b/base/resources.pk3dir/gfx/icon16/calendar_add.png new file mode 100644 index 00000000..17679db6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calendar_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calendar_delete.png b/base/resources.pk3dir/gfx/icon16/calendar_delete.png new file mode 100644 index 00000000..69a3b10a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calendar_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calendar_edit.png b/base/resources.pk3dir/gfx/icon16/calendar_edit.png new file mode 100644 index 00000000..d1d2d6e6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calendar_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calendar_link.png b/base/resources.pk3dir/gfx/icon16/calendar_link.png new file mode 100644 index 00000000..6b106b94 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calendar_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calendar_view_day.png b/base/resources.pk3dir/gfx/icon16/calendar_view_day.png new file mode 100644 index 00000000..9740f76e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calendar_view_day.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calendar_view_month.png b/base/resources.pk3dir/gfx/icon16/calendar_view_month.png new file mode 100644 index 00000000..6cff76c1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calendar_view_month.png differ diff --git a/base/resources.pk3dir/gfx/icon16/calendar_view_week.png b/base/resources.pk3dir/gfx/icon16/calendar_view_week.png new file mode 100644 index 00000000..8fe695f5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/calendar_view_week.png differ diff --git a/base/resources.pk3dir/gfx/icon16/camera.png b/base/resources.pk3dir/gfx/icon16/camera.png new file mode 100644 index 00000000..8536d1a7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/camera.png differ diff --git a/base/resources.pk3dir/gfx/icon16/camera_add.png b/base/resources.pk3dir/gfx/icon16/camera_add.png new file mode 100644 index 00000000..08b5da98 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/camera_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/camera_delete.png b/base/resources.pk3dir/gfx/icon16/camera_delete.png new file mode 100644 index 00000000..3846d74c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/camera_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/camera_edit.png b/base/resources.pk3dir/gfx/icon16/camera_edit.png new file mode 100644 index 00000000..b5015b10 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/camera_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/camera_error.png b/base/resources.pk3dir/gfx/icon16/camera_error.png new file mode 100644 index 00000000..3c1bc95c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/camera_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/camera_go.png b/base/resources.pk3dir/gfx/icon16/camera_go.png new file mode 100644 index 00000000..94ce2b25 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/camera_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/camera_link.png b/base/resources.pk3dir/gfx/icon16/camera_link.png new file mode 100644 index 00000000..d2ac9f93 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/camera_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/camera_small.png b/base/resources.pk3dir/gfx/icon16/camera_small.png new file mode 100644 index 00000000..454b0b01 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/camera_small.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cancel.png b/base/resources.pk3dir/gfx/icon16/cancel.png new file mode 100644 index 00000000..c149c2bc Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cancel.png differ diff --git a/base/resources.pk3dir/gfx/icon16/car.png b/base/resources.pk3dir/gfx/icon16/car.png new file mode 100644 index 00000000..4f3a770f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/car.png differ diff --git a/base/resources.pk3dir/gfx/icon16/car_add.png b/base/resources.pk3dir/gfx/icon16/car_add.png new file mode 100644 index 00000000..1215a51a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/car_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/car_delete.png b/base/resources.pk3dir/gfx/icon16/car_delete.png new file mode 100644 index 00000000..2803b567 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/car_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cart.png b/base/resources.pk3dir/gfx/icon16/cart.png new file mode 100644 index 00000000..1baf7b9f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cart.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cart_add.png b/base/resources.pk3dir/gfx/icon16/cart_add.png new file mode 100644 index 00000000..45c29000 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cart_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cart_delete.png b/base/resources.pk3dir/gfx/icon16/cart_delete.png new file mode 100644 index 00000000..ac5bce5c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cart_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cart_edit.png b/base/resources.pk3dir/gfx/icon16/cart_edit.png new file mode 100644 index 00000000..b94ff88e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cart_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cart_error.png b/base/resources.pk3dir/gfx/icon16/cart_error.png new file mode 100644 index 00000000..144c8353 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cart_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cart_go.png b/base/resources.pk3dir/gfx/icon16/cart_go.png new file mode 100644 index 00000000..20ee0584 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cart_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cart_put.png b/base/resources.pk3dir/gfx/icon16/cart_put.png new file mode 100644 index 00000000..3aec353e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cart_put.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cart_remove.png b/base/resources.pk3dir/gfx/icon16/cart_remove.png new file mode 100644 index 00000000..360217b5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cart_remove.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cd.png b/base/resources.pk3dir/gfx/icon16/cd.png new file mode 100644 index 00000000..ef432235 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cd.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cd_add.png b/base/resources.pk3dir/gfx/icon16/cd_add.png new file mode 100644 index 00000000..b0254eff Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cd_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cd_burn.png b/base/resources.pk3dir/gfx/icon16/cd_burn.png new file mode 100644 index 00000000..157cb0ba Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cd_burn.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cd_delete.png b/base/resources.pk3dir/gfx/icon16/cd_delete.png new file mode 100644 index 00000000..7d7b3d52 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cd_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cd_edit.png b/base/resources.pk3dir/gfx/icon16/cd_edit.png new file mode 100644 index 00000000..b0dc194b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cd_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cd_eject.png b/base/resources.pk3dir/gfx/icon16/cd_eject.png new file mode 100644 index 00000000..762932f6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cd_eject.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cd_go.png b/base/resources.pk3dir/gfx/icon16/cd_go.png new file mode 100644 index 00000000..13e04991 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cd_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_bar.png b/base/resources.pk3dir/gfx/icon16/chart_bar.png new file mode 100644 index 00000000..9051fbc6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_bar.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_bar_add.png b/base/resources.pk3dir/gfx/icon16/chart_bar_add.png new file mode 100644 index 00000000..d283e846 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_bar_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_bar_delete.png b/base/resources.pk3dir/gfx/icon16/chart_bar_delete.png new file mode 100644 index 00000000..259f6868 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_bar_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_bar_edit.png b/base/resources.pk3dir/gfx/icon16/chart_bar_edit.png new file mode 100644 index 00000000..df64d97e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_bar_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_bar_error.png b/base/resources.pk3dir/gfx/icon16/chart_bar_error.png new file mode 100644 index 00000000..bdacea5e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_bar_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_bar_link.png b/base/resources.pk3dir/gfx/icon16/chart_bar_link.png new file mode 100644 index 00000000..bf18aed4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_bar_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_curve.png b/base/resources.pk3dir/gfx/icon16/chart_curve.png new file mode 100644 index 00000000..01e933a6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_curve.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_curve_add.png b/base/resources.pk3dir/gfx/icon16/chart_curve_add.png new file mode 100644 index 00000000..f9e20504 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_curve_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_curve_delete.png b/base/resources.pk3dir/gfx/icon16/chart_curve_delete.png new file mode 100644 index 00000000..b411391c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_curve_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_curve_edit.png b/base/resources.pk3dir/gfx/icon16/chart_curve_edit.png new file mode 100644 index 00000000..bd07673b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_curve_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_curve_error.png b/base/resources.pk3dir/gfx/icon16/chart_curve_error.png new file mode 100644 index 00000000..906dd038 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_curve_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_curve_go.png b/base/resources.pk3dir/gfx/icon16/chart_curve_go.png new file mode 100644 index 00000000..ac9eda51 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_curve_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_curve_link.png b/base/resources.pk3dir/gfx/icon16/chart_curve_link.png new file mode 100644 index 00000000..144eafe0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_curve_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_line.png b/base/resources.pk3dir/gfx/icon16/chart_line.png new file mode 100644 index 00000000..85020f32 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_line.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_line_add.png b/base/resources.pk3dir/gfx/icon16/chart_line_add.png new file mode 100644 index 00000000..5571a5eb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_line_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_line_delete.png b/base/resources.pk3dir/gfx/icon16/chart_line_delete.png new file mode 100644 index 00000000..5b0aa901 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_line_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_line_edit.png b/base/resources.pk3dir/gfx/icon16/chart_line_edit.png new file mode 100644 index 00000000..9cf66073 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_line_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_line_error.png b/base/resources.pk3dir/gfx/icon16/chart_line_error.png new file mode 100644 index 00000000..ff23c03a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_line_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_line_link.png b/base/resources.pk3dir/gfx/icon16/chart_line_link.png new file mode 100644 index 00000000..f3727d22 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_line_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_organisation.png b/base/resources.pk3dir/gfx/icon16/chart_organisation.png new file mode 100644 index 00000000..c32d25c1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_organisation.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_organisation_add.png b/base/resources.pk3dir/gfx/icon16/chart_organisation_add.png new file mode 100644 index 00000000..f0dba4ac Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_organisation_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_organisation_delete.png b/base/resources.pk3dir/gfx/icon16/chart_organisation_delete.png new file mode 100644 index 00000000..7dc8dcac Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_organisation_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_pie.png b/base/resources.pk3dir/gfx/icon16/chart_pie.png new file mode 100644 index 00000000..fe00fa05 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_pie.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_pie_add.png b/base/resources.pk3dir/gfx/icon16/chart_pie_add.png new file mode 100644 index 00000000..bf0822ee Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_pie_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_pie_delete.png b/base/resources.pk3dir/gfx/icon16/chart_pie_delete.png new file mode 100644 index 00000000..5ab9efd5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_pie_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_pie_edit.png b/base/resources.pk3dir/gfx/icon16/chart_pie_edit.png new file mode 100644 index 00000000..3debc12d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_pie_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_pie_error.png b/base/resources.pk3dir/gfx/icon16/chart_pie_error.png new file mode 100644 index 00000000..7344174f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_pie_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/chart_pie_link.png b/base/resources.pk3dir/gfx/icon16/chart_pie_link.png new file mode 100644 index 00000000..c072f8e0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/chart_pie_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/clock.png b/base/resources.pk3dir/gfx/icon16/clock.png new file mode 100644 index 00000000..e2672c20 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/clock.png differ diff --git a/base/resources.pk3dir/gfx/icon16/clock_add.png b/base/resources.pk3dir/gfx/icon16/clock_add.png new file mode 100644 index 00000000..598b839b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/clock_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/clock_delete.png b/base/resources.pk3dir/gfx/icon16/clock_delete.png new file mode 100644 index 00000000..8bf9efe4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/clock_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/clock_edit.png b/base/resources.pk3dir/gfx/icon16/clock_edit.png new file mode 100644 index 00000000..7d357188 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/clock_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/clock_error.png b/base/resources.pk3dir/gfx/icon16/clock_error.png new file mode 100644 index 00000000..a7c461ba Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/clock_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/clock_go.png b/base/resources.pk3dir/gfx/icon16/clock_go.png new file mode 100644 index 00000000..a1a24d3f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/clock_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/clock_link.png b/base/resources.pk3dir/gfx/icon16/clock_link.png new file mode 100644 index 00000000..481cf04c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/clock_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/clock_pause.png b/base/resources.pk3dir/gfx/icon16/clock_pause.png new file mode 100644 index 00000000..ba747258 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/clock_pause.png differ diff --git a/base/resources.pk3dir/gfx/icon16/clock_play.png b/base/resources.pk3dir/gfx/icon16/clock_play.png new file mode 100644 index 00000000..fb4ebc85 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/clock_play.png differ diff --git a/base/resources.pk3dir/gfx/icon16/clock_red.png b/base/resources.pk3dir/gfx/icon16/clock_red.png new file mode 100644 index 00000000..2842cc33 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/clock_red.png differ diff --git a/base/resources.pk3dir/gfx/icon16/clock_stop.png b/base/resources.pk3dir/gfx/icon16/clock_stop.png new file mode 100644 index 00000000..6fe8a6f9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/clock_stop.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cog.png b/base/resources.pk3dir/gfx/icon16/cog.png new file mode 100644 index 00000000..67de2c6c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cog.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cog_add.png b/base/resources.pk3dir/gfx/icon16/cog_add.png new file mode 100644 index 00000000..04f22bad Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cog_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cog_delete.png b/base/resources.pk3dir/gfx/icon16/cog_delete.png new file mode 100644 index 00000000..8ce71c47 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cog_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cog_edit.png b/base/resources.pk3dir/gfx/icon16/cog_edit.png new file mode 100644 index 00000000..47b75a45 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cog_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cog_error.png b/base/resources.pk3dir/gfx/icon16/cog_error.png new file mode 100644 index 00000000..47667430 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cog_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cog_go.png b/base/resources.pk3dir/gfx/icon16/cog_go.png new file mode 100644 index 00000000..3262767c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cog_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/coins.png b/base/resources.pk3dir/gfx/icon16/coins.png new file mode 100644 index 00000000..0ca9074d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/coins.png differ diff --git a/base/resources.pk3dir/gfx/icon16/coins_add.png b/base/resources.pk3dir/gfx/icon16/coins_add.png new file mode 100644 index 00000000..cdff5d3d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/coins_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/coins_delete.png b/base/resources.pk3dir/gfx/icon16/coins_delete.png new file mode 100644 index 00000000..18e0c0fd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/coins_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/color_swatch.png b/base/resources.pk3dir/gfx/icon16/color_swatch.png new file mode 100644 index 00000000..6e6e8521 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/color_swatch.png differ diff --git a/base/resources.pk3dir/gfx/icon16/color_wheel.png b/base/resources.pk3dir/gfx/icon16/color_wheel.png new file mode 100644 index 00000000..809fb00e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/color_wheel.png differ diff --git a/base/resources.pk3dir/gfx/icon16/comment.png b/base/resources.pk3dir/gfx/icon16/comment.png new file mode 100644 index 00000000..7bc9233e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/comment.png differ diff --git a/base/resources.pk3dir/gfx/icon16/comment_add.png b/base/resources.pk3dir/gfx/icon16/comment_add.png new file mode 100644 index 00000000..75e78ded Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/comment_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/comment_delete.png b/base/resources.pk3dir/gfx/icon16/comment_delete.png new file mode 100644 index 00000000..643fdbe8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/comment_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/comment_edit.png b/base/resources.pk3dir/gfx/icon16/comment_edit.png new file mode 100644 index 00000000..73db110d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/comment_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/comments.png b/base/resources.pk3dir/gfx/icon16/comments.png new file mode 100644 index 00000000..39433cf7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/comments.png differ diff --git a/base/resources.pk3dir/gfx/icon16/comments_add.png b/base/resources.pk3dir/gfx/icon16/comments_add.png new file mode 100644 index 00000000..b3256344 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/comments_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/comments_delete.png b/base/resources.pk3dir/gfx/icon16/comments_delete.png new file mode 100644 index 00000000..6df7376d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/comments_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/compress.png b/base/resources.pk3dir/gfx/icon16/compress.png new file mode 100644 index 00000000..8606ff0f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/compress.png differ diff --git a/base/resources.pk3dir/gfx/icon16/computer.png b/base/resources.pk3dir/gfx/icon16/computer.png new file mode 100644 index 00000000..9bc37dce Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/computer.png differ diff --git a/base/resources.pk3dir/gfx/icon16/computer_add.png b/base/resources.pk3dir/gfx/icon16/computer_add.png new file mode 100644 index 00000000..db604ee3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/computer_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/computer_delete.png b/base/resources.pk3dir/gfx/icon16/computer_delete.png new file mode 100644 index 00000000..5e9b2683 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/computer_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/computer_edit.png b/base/resources.pk3dir/gfx/icon16/computer_edit.png new file mode 100644 index 00000000..34c72fe5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/computer_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/computer_error.png b/base/resources.pk3dir/gfx/icon16/computer_error.png new file mode 100644 index 00000000..b2c3ed57 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/computer_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/computer_go.png b/base/resources.pk3dir/gfx/icon16/computer_go.png new file mode 100644 index 00000000..0b26144d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/computer_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/computer_key.png b/base/resources.pk3dir/gfx/icon16/computer_key.png new file mode 100644 index 00000000..eca54301 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/computer_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/computer_link.png b/base/resources.pk3dir/gfx/icon16/computer_link.png new file mode 100644 index 00000000..3859db21 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/computer_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/connect.png b/base/resources.pk3dir/gfx/icon16/connect.png new file mode 100644 index 00000000..024138eb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/connect.png differ diff --git a/base/resources.pk3dir/gfx/icon16/contrast.png b/base/resources.pk3dir/gfx/icon16/contrast.png new file mode 100644 index 00000000..adcc0046 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/contrast.png differ diff --git a/base/resources.pk3dir/gfx/icon16/contrast_decrease.png b/base/resources.pk3dir/gfx/icon16/contrast_decrease.png new file mode 100644 index 00000000..0155bf5c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/contrast_decrease.png differ diff --git a/base/resources.pk3dir/gfx/icon16/contrast_high.png b/base/resources.pk3dir/gfx/icon16/contrast_high.png new file mode 100644 index 00000000..d87c8cbb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/contrast_high.png differ diff --git a/base/resources.pk3dir/gfx/icon16/contrast_increase.png b/base/resources.pk3dir/gfx/icon16/contrast_increase.png new file mode 100644 index 00000000..a3e7f520 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/contrast_increase.png differ diff --git a/base/resources.pk3dir/gfx/icon16/contrast_low.png b/base/resources.pk3dir/gfx/icon16/contrast_low.png new file mode 100644 index 00000000..dc9f4b10 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/contrast_low.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_eject.png b/base/resources.pk3dir/gfx/icon16/control_eject.png new file mode 100644 index 00000000..924d817b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_eject.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_eject_blue.png b/base/resources.pk3dir/gfx/icon16/control_eject_blue.png new file mode 100644 index 00000000..2bd49638 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_eject_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_end.png b/base/resources.pk3dir/gfx/icon16/control_end.png new file mode 100644 index 00000000..036e04dc Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_end.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_end_blue.png b/base/resources.pk3dir/gfx/icon16/control_end_blue.png new file mode 100644 index 00000000..72079357 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_end_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_equalizer.png b/base/resources.pk3dir/gfx/icon16/control_equalizer.png new file mode 100644 index 00000000..46060872 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_equalizer.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_equalizer_blue.png b/base/resources.pk3dir/gfx/icon16/control_equalizer_blue.png new file mode 100644 index 00000000..1b2e6a37 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_equalizer_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_fastforward.png b/base/resources.pk3dir/gfx/icon16/control_fastforward.png new file mode 100644 index 00000000..31f7fd3a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_fastforward.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_fastforward_blue.png b/base/resources.pk3dir/gfx/icon16/control_fastforward_blue.png new file mode 100644 index 00000000..4a2f9d4e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_fastforward_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_pause.png b/base/resources.pk3dir/gfx/icon16/control_pause.png new file mode 100644 index 00000000..2d9ce9c4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_pause.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_pause_blue.png b/base/resources.pk3dir/gfx/icon16/control_pause_blue.png new file mode 100644 index 00000000..ec61099b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_pause_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_play.png b/base/resources.pk3dir/gfx/icon16/control_play.png new file mode 100644 index 00000000..0846555d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_play.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_play_blue.png b/base/resources.pk3dir/gfx/icon16/control_play_blue.png new file mode 100644 index 00000000..f8c8ec68 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_play_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_repeat.png b/base/resources.pk3dir/gfx/icon16/control_repeat.png new file mode 100644 index 00000000..1c4f57a1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_repeat.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_repeat_blue.png b/base/resources.pk3dir/gfx/icon16/control_repeat_blue.png new file mode 100644 index 00000000..406ec333 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_repeat_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_rewind.png b/base/resources.pk3dir/gfx/icon16/control_rewind.png new file mode 100644 index 00000000..c0294477 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_rewind.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_rewind_blue.png b/base/resources.pk3dir/gfx/icon16/control_rewind_blue.png new file mode 100644 index 00000000..15d1584b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_rewind_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_start.png b/base/resources.pk3dir/gfx/icon16/control_start.png new file mode 100644 index 00000000..7dd1c07f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_start.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_start_blue.png b/base/resources.pk3dir/gfx/icon16/control_start_blue.png new file mode 100644 index 00000000..6f11fcb0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_start_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_stop.png b/base/resources.pk3dir/gfx/icon16/control_stop.png new file mode 100644 index 00000000..893bb60e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_stop.png differ diff --git a/base/resources.pk3dir/gfx/icon16/control_stop_blue.png b/base/resources.pk3dir/gfx/icon16/control_stop_blue.png new file mode 100644 index 00000000..e6f75d23 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/control_stop_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/controller.png b/base/resources.pk3dir/gfx/icon16/controller.png new file mode 100644 index 00000000..5cf76ed0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/controller.png differ diff --git a/base/resources.pk3dir/gfx/icon16/controller_add.png b/base/resources.pk3dir/gfx/icon16/controller_add.png new file mode 100644 index 00000000..efecb387 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/controller_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/controller_delete.png b/base/resources.pk3dir/gfx/icon16/controller_delete.png new file mode 100644 index 00000000..3d83bc7b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/controller_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/controller_error.png b/base/resources.pk3dir/gfx/icon16/controller_error.png new file mode 100644 index 00000000..7f17c0cb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/controller_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/creditcards.png b/base/resources.pk3dir/gfx/icon16/creditcards.png new file mode 100644 index 00000000..4eae583e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/creditcards.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cross.png b/base/resources.pk3dir/gfx/icon16/cross.png new file mode 100644 index 00000000..1514d51a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cross.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cross_mono.png b/base/resources.pk3dir/gfx/icon16/cross_mono.png new file mode 100644 index 00000000..5385a662 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cross_mono.png differ diff --git a/base/resources.pk3dir/gfx/icon16/css.png b/base/resources.pk3dir/gfx/icon16/css.png new file mode 100644 index 00000000..23f31018 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/css.png differ diff --git a/base/resources.pk3dir/gfx/icon16/css_add.png b/base/resources.pk3dir/gfx/icon16/css_add.png new file mode 100644 index 00000000..e8ea10fc Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/css_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/css_delete.png b/base/resources.pk3dir/gfx/icon16/css_delete.png new file mode 100644 index 00000000..326aba44 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/css_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/css_go.png b/base/resources.pk3dir/gfx/icon16/css_go.png new file mode 100644 index 00000000..6cdf38c3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/css_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/css_valid.png b/base/resources.pk3dir/gfx/icon16/css_valid.png new file mode 100644 index 00000000..4c72ca5a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/css_valid.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cup.png b/base/resources.pk3dir/gfx/icon16/cup.png new file mode 100644 index 00000000..b7bfcd15 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cup.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cup_add.png b/base/resources.pk3dir/gfx/icon16/cup_add.png new file mode 100644 index 00000000..4ecaece2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cup_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cup_delete.png b/base/resources.pk3dir/gfx/icon16/cup_delete.png new file mode 100644 index 00000000..59a6d9c6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cup_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cup_edit.png b/base/resources.pk3dir/gfx/icon16/cup_edit.png new file mode 100644 index 00000000..0b8f1e1e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cup_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cup_error.png b/base/resources.pk3dir/gfx/icon16/cup_error.png new file mode 100644 index 00000000..68798748 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cup_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cup_go.png b/base/resources.pk3dir/gfx/icon16/cup_go.png new file mode 100644 index 00000000..9527efbe Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cup_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cup_key.png b/base/resources.pk3dir/gfx/icon16/cup_key.png new file mode 100644 index 00000000..7ae160ce Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cup_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cup_link.png b/base/resources.pk3dir/gfx/icon16/cup_link.png new file mode 100644 index 00000000..41d1ace1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cup_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cursor.png b/base/resources.pk3dir/gfx/icon16/cursor.png new file mode 100644 index 00000000..532f532d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cursor.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cut.png b/base/resources.pk3dir/gfx/icon16/cut.png new file mode 100644 index 00000000..f215d6f6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cut.png differ diff --git a/base/resources.pk3dir/gfx/icon16/cut_red.png b/base/resources.pk3dir/gfx/icon16/cut_red.png new file mode 100644 index 00000000..85bb2f0f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/cut_red.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database.png b/base/resources.pk3dir/gfx/icon16/database.png new file mode 100644 index 00000000..3d09261a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_add.png b/base/resources.pk3dir/gfx/icon16/database_add.png new file mode 100644 index 00000000..802bd6cd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_connect.png b/base/resources.pk3dir/gfx/icon16/database_connect.png new file mode 100644 index 00000000..3a111977 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_connect.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_delete.png b/base/resources.pk3dir/gfx/icon16/database_delete.png new file mode 100644 index 00000000..cce652e8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_edit.png b/base/resources.pk3dir/gfx/icon16/database_edit.png new file mode 100644 index 00000000..e501b668 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_error.png b/base/resources.pk3dir/gfx/icon16/database_error.png new file mode 100644 index 00000000..578221aa Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_gear.png b/base/resources.pk3dir/gfx/icon16/database_gear.png new file mode 100644 index 00000000..7c0ab2b4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_gear.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_go.png b/base/resources.pk3dir/gfx/icon16/database_go.png new file mode 100644 index 00000000..61a8556c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_key.png b/base/resources.pk3dir/gfx/icon16/database_key.png new file mode 100644 index 00000000..33341476 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_lightning.png b/base/resources.pk3dir/gfx/icon16/database_lightning.png new file mode 100644 index 00000000..d9eefc22 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_lightning.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_link.png b/base/resources.pk3dir/gfx/icon16/database_link.png new file mode 100644 index 00000000..4c8204af Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_refresh.png b/base/resources.pk3dir/gfx/icon16/database_refresh.png new file mode 100644 index 00000000..ff803be1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_refresh.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_save.png b/base/resources.pk3dir/gfx/icon16/database_save.png new file mode 100644 index 00000000..44c06ddd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_save.png differ diff --git a/base/resources.pk3dir/gfx/icon16/database_table.png b/base/resources.pk3dir/gfx/icon16/database_table.png new file mode 100644 index 00000000..693709cb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/database_table.png differ diff --git a/base/resources.pk3dir/gfx/icon16/date.png b/base/resources.pk3dir/gfx/icon16/date.png new file mode 100644 index 00000000..783c8335 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/date.png differ diff --git a/base/resources.pk3dir/gfx/icon16/date_add.png b/base/resources.pk3dir/gfx/icon16/date_add.png new file mode 100644 index 00000000..6a7ae025 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/date_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/date_delete.png b/base/resources.pk3dir/gfx/icon16/date_delete.png new file mode 100644 index 00000000..969a6b72 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/date_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/date_edit.png b/base/resources.pk3dir/gfx/icon16/date_edit.png new file mode 100644 index 00000000..e6810650 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/date_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/date_error.png b/base/resources.pk3dir/gfx/icon16/date_error.png new file mode 100644 index 00000000..442cd97d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/date_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/date_go.png b/base/resources.pk3dir/gfx/icon16/date_go.png new file mode 100644 index 00000000..52dd9f3a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/date_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/date_link.png b/base/resources.pk3dir/gfx/icon16/date_link.png new file mode 100644 index 00000000..9f0aada7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/date_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/date_magnify.png b/base/resources.pk3dir/gfx/icon16/date_magnify.png new file mode 100644 index 00000000..cd05f190 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/date_magnify.png differ diff --git a/base/resources.pk3dir/gfx/icon16/date_next.png b/base/resources.pk3dir/gfx/icon16/date_next.png new file mode 100644 index 00000000..48d740ab Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/date_next.png differ diff --git a/base/resources.pk3dir/gfx/icon16/date_previous.png b/base/resources.pk3dir/gfx/icon16/date_previous.png new file mode 100644 index 00000000..e117a837 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/date_previous.png differ diff --git a/base/resources.pk3dir/gfx/icon16/delete.png b/base/resources.pk3dir/gfx/icon16/delete.png new file mode 100644 index 00000000..08f24936 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/disconnect.png b/base/resources.pk3dir/gfx/icon16/disconnect.png new file mode 100644 index 00000000..b335cb11 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/disconnect.png differ diff --git a/base/resources.pk3dir/gfx/icon16/disk.png b/base/resources.pk3dir/gfx/icon16/disk.png new file mode 100644 index 00000000..99d532e8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/disk.png differ diff --git a/base/resources.pk3dir/gfx/icon16/disk_multiple.png b/base/resources.pk3dir/gfx/icon16/disk_multiple.png new file mode 100644 index 00000000..fc5a52f5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/disk_multiple.png differ diff --git a/base/resources.pk3dir/gfx/icon16/door.png b/base/resources.pk3dir/gfx/icon16/door.png new file mode 100644 index 00000000..369fc46e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/door.png differ diff --git a/base/resources.pk3dir/gfx/icon16/door_in.png b/base/resources.pk3dir/gfx/icon16/door_in.png new file mode 100644 index 00000000..41676a0a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/door_in.png differ diff --git a/base/resources.pk3dir/gfx/icon16/door_open.png b/base/resources.pk3dir/gfx/icon16/door_open.png new file mode 100644 index 00000000..64bab57d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/door_open.png differ diff --git a/base/resources.pk3dir/gfx/icon16/door_out.png b/base/resources.pk3dir/gfx/icon16/door_out.png new file mode 100644 index 00000000..2541d2bc Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/door_out.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drink.png b/base/resources.pk3dir/gfx/icon16/drink.png new file mode 100644 index 00000000..d98359c2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drink.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drink_empty.png b/base/resources.pk3dir/gfx/icon16/drink_empty.png new file mode 100644 index 00000000..a40211ed Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drink_empty.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive.png b/base/resources.pk3dir/gfx/icon16/drive.png new file mode 100644 index 00000000..37b7c9b2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_add.png b/base/resources.pk3dir/gfx/icon16/drive_add.png new file mode 100644 index 00000000..29a35d5a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_burn.png b/base/resources.pk3dir/gfx/icon16/drive_burn.png new file mode 100644 index 00000000..80fd79f9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_burn.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_cd.png b/base/resources.pk3dir/gfx/icon16/drive_cd.png new file mode 100644 index 00000000..1850b701 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_cd.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_cd_empty.png b/base/resources.pk3dir/gfx/icon16/drive_cd_empty.png new file mode 100644 index 00000000..8df38d9e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_cd_empty.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_delete.png b/base/resources.pk3dir/gfx/icon16/drive_delete.png new file mode 100644 index 00000000..e6eb1866 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_disk.png b/base/resources.pk3dir/gfx/icon16/drive_disk.png new file mode 100644 index 00000000..5a51e819 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_disk.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_edit.png b/base/resources.pk3dir/gfx/icon16/drive_edit.png new file mode 100644 index 00000000..7923fada Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_error.png b/base/resources.pk3dir/gfx/icon16/drive_error.png new file mode 100644 index 00000000..309f6396 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_go.png b/base/resources.pk3dir/gfx/icon16/drive_go.png new file mode 100644 index 00000000..fc53379e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_key.png b/base/resources.pk3dir/gfx/icon16/drive_key.png new file mode 100644 index 00000000..d0b3c673 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_link.png b/base/resources.pk3dir/gfx/icon16/drive_link.png new file mode 100644 index 00000000..8679c4b5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_magnify.png b/base/resources.pk3dir/gfx/icon16/drive_magnify.png new file mode 100644 index 00000000..0f0f4446 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_magnify.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_network.png b/base/resources.pk3dir/gfx/icon16/drive_network.png new file mode 100644 index 00000000..63d2d5d5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_network.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_rename.png b/base/resources.pk3dir/gfx/icon16/drive_rename.png new file mode 100644 index 00000000..2a9f38b4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_rename.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_user.png b/base/resources.pk3dir/gfx/icon16/drive_user.png new file mode 100644 index 00000000..0b4751ce Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_user.png differ diff --git a/base/resources.pk3dir/gfx/icon16/drive_web.png b/base/resources.pk3dir/gfx/icon16/drive_web.png new file mode 100644 index 00000000..8850a835 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/drive_web.png differ diff --git a/base/resources.pk3dir/gfx/icon16/dvd.png b/base/resources.pk3dir/gfx/icon16/dvd.png new file mode 100644 index 00000000..9d94de5d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/dvd.png differ diff --git a/base/resources.pk3dir/gfx/icon16/dvd_add.png b/base/resources.pk3dir/gfx/icon16/dvd_add.png new file mode 100644 index 00000000..517d1121 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/dvd_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/dvd_delete.png b/base/resources.pk3dir/gfx/icon16/dvd_delete.png new file mode 100644 index 00000000..87bed221 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/dvd_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/dvd_edit.png b/base/resources.pk3dir/gfx/icon16/dvd_edit.png new file mode 100644 index 00000000..d6330aa9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/dvd_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/dvd_error.png b/base/resources.pk3dir/gfx/icon16/dvd_error.png new file mode 100644 index 00000000..8f6d4bee Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/dvd_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/dvd_go.png b/base/resources.pk3dir/gfx/icon16/dvd_go.png new file mode 100644 index 00000000..ef6959f7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/dvd_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/dvd_key.png b/base/resources.pk3dir/gfx/icon16/dvd_key.png new file mode 100644 index 00000000..da9307f6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/dvd_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/dvd_link.png b/base/resources.pk3dir/gfx/icon16/dvd_link.png new file mode 100644 index 00000000..caad7263 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/dvd_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/email.png b/base/resources.pk3dir/gfx/icon16/email.png new file mode 100644 index 00000000..7348aed7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/email.png differ diff --git a/base/resources.pk3dir/gfx/icon16/email_add.png b/base/resources.pk3dir/gfx/icon16/email_add.png new file mode 100644 index 00000000..6c933681 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/email_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/email_attach.png b/base/resources.pk3dir/gfx/icon16/email_attach.png new file mode 100644 index 00000000..1f994851 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/email_attach.png differ diff --git a/base/resources.pk3dir/gfx/icon16/email_delete.png b/base/resources.pk3dir/gfx/icon16/email_delete.png new file mode 100644 index 00000000..a9932b1a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/email_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/email_edit.png b/base/resources.pk3dir/gfx/icon16/email_edit.png new file mode 100644 index 00000000..244f04ae Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/email_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/email_error.png b/base/resources.pk3dir/gfx/icon16/email_error.png new file mode 100644 index 00000000..8bdd3304 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/email_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/email_go.png b/base/resources.pk3dir/gfx/icon16/email_go.png new file mode 100644 index 00000000..4a6c5d39 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/email_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/email_link.png b/base/resources.pk3dir/gfx/icon16/email_link.png new file mode 100644 index 00000000..2c49f78a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/email_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/email_open.png b/base/resources.pk3dir/gfx/icon16/email_open.png new file mode 100644 index 00000000..7b6f9813 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/email_open.png differ diff --git a/base/resources.pk3dir/gfx/icon16/email_open_image.png b/base/resources.pk3dir/gfx/icon16/email_open_image.png new file mode 100644 index 00000000..e588e2fb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/email_open_image.png differ diff --git a/base/resources.pk3dir/gfx/icon16/emoticon_evilgrin.png b/base/resources.pk3dir/gfx/icon16/emoticon_evilgrin.png new file mode 100644 index 00000000..817bd509 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/emoticon_evilgrin.png differ diff --git a/base/resources.pk3dir/gfx/icon16/emoticon_grin.png b/base/resources.pk3dir/gfx/icon16/emoticon_grin.png new file mode 100644 index 00000000..fc60c5e1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/emoticon_grin.png differ diff --git a/base/resources.pk3dir/gfx/icon16/emoticon_happy.png b/base/resources.pk3dir/gfx/icon16/emoticon_happy.png new file mode 100644 index 00000000..6b7336e1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/emoticon_happy.png differ diff --git a/base/resources.pk3dir/gfx/icon16/emoticon_smile.png b/base/resources.pk3dir/gfx/icon16/emoticon_smile.png new file mode 100644 index 00000000..ade43185 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/emoticon_smile.png differ diff --git a/base/resources.pk3dir/gfx/icon16/emoticon_surprised.png b/base/resources.pk3dir/gfx/icon16/emoticon_surprised.png new file mode 100644 index 00000000..4520cfc5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/emoticon_surprised.png differ diff --git a/base/resources.pk3dir/gfx/icon16/emoticon_tongue.png b/base/resources.pk3dir/gfx/icon16/emoticon_tongue.png new file mode 100644 index 00000000..ecafd2ff Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/emoticon_tongue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/emoticon_unhappy.png b/base/resources.pk3dir/gfx/icon16/emoticon_unhappy.png new file mode 100644 index 00000000..fd5d030e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/emoticon_unhappy.png differ diff --git a/base/resources.pk3dir/gfx/icon16/emoticon_waii.png b/base/resources.pk3dir/gfx/icon16/emoticon_waii.png new file mode 100644 index 00000000..458f9361 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/emoticon_waii.png differ diff --git a/base/resources.pk3dir/gfx/icon16/emoticon_wink.png b/base/resources.pk3dir/gfx/icon16/emoticon_wink.png new file mode 100644 index 00000000..a631949b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/emoticon_wink.png differ diff --git a/base/resources.pk3dir/gfx/icon16/error.png b/base/resources.pk3dir/gfx/icon16/error.png new file mode 100644 index 00000000..628cf2da Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/error_add.png b/base/resources.pk3dir/gfx/icon16/error_add.png new file mode 100644 index 00000000..4c974840 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/error_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/error_delete.png b/base/resources.pk3dir/gfx/icon16/error_delete.png new file mode 100644 index 00000000..7f78bcc8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/error_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/error_go.png b/base/resources.pk3dir/gfx/icon16/error_go.png new file mode 100644 index 00000000..caa1838d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/error_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/exclamation.png b/base/resources.pk3dir/gfx/icon16/exclamation.png new file mode 100644 index 00000000..c37bd062 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/exclamation.png differ diff --git a/base/resources.pk3dir/gfx/icon16/eye.png b/base/resources.pk3dir/gfx/icon16/eye.png new file mode 100644 index 00000000..564a1a97 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/eye.png differ diff --git a/base/resources.pk3dir/gfx/icon16/feed.png b/base/resources.pk3dir/gfx/icon16/feed.png new file mode 100644 index 00000000..315c4f4f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/feed.png differ diff --git a/base/resources.pk3dir/gfx/icon16/feed_add.png b/base/resources.pk3dir/gfx/icon16/feed_add.png new file mode 100644 index 00000000..e77d46e8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/feed_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/feed_delete.png b/base/resources.pk3dir/gfx/icon16/feed_delete.png new file mode 100644 index 00000000..5e332b4c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/feed_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/feed_disk.png b/base/resources.pk3dir/gfx/icon16/feed_disk.png new file mode 100644 index 00000000..a158c998 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/feed_disk.png differ diff --git a/base/resources.pk3dir/gfx/icon16/feed_edit.png b/base/resources.pk3dir/gfx/icon16/feed_edit.png new file mode 100644 index 00000000..f1fde7a9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/feed_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/feed_error.png b/base/resources.pk3dir/gfx/icon16/feed_error.png new file mode 100644 index 00000000..c0a801c7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/feed_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/feed_go.png b/base/resources.pk3dir/gfx/icon16/feed_go.png new file mode 100644 index 00000000..f2eed1ec Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/feed_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/feed_key.png b/base/resources.pk3dir/gfx/icon16/feed_key.png new file mode 100644 index 00000000..156bfa97 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/feed_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/feed_link.png b/base/resources.pk3dir/gfx/icon16/feed_link.png new file mode 100644 index 00000000..c45a5345 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/feed_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/feed_magnify.png b/base/resources.pk3dir/gfx/icon16/feed_magnify.png new file mode 100644 index 00000000..3023695d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/feed_magnify.png differ diff --git a/base/resources.pk3dir/gfx/icon16/female.png b/base/resources.pk3dir/gfx/icon16/female.png new file mode 100644 index 00000000..f92958e6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/female.png differ diff --git a/base/resources.pk3dir/gfx/icon16/film.png b/base/resources.pk3dir/gfx/icon16/film.png new file mode 100644 index 00000000..b0ce7bb1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/film.png differ diff --git a/base/resources.pk3dir/gfx/icon16/film_add.png b/base/resources.pk3dir/gfx/icon16/film_add.png new file mode 100644 index 00000000..40d681fe Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/film_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/film_delete.png b/base/resources.pk3dir/gfx/icon16/film_delete.png new file mode 100644 index 00000000..23a2508c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/film_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/film_edit.png b/base/resources.pk3dir/gfx/icon16/film_edit.png new file mode 100644 index 00000000..af66b73f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/film_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/film_error.png b/base/resources.pk3dir/gfx/icon16/film_error.png new file mode 100644 index 00000000..88f3d69b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/film_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/film_go.png b/base/resources.pk3dir/gfx/icon16/film_go.png new file mode 100644 index 00000000..dd0168ea Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/film_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/film_key.png b/base/resources.pk3dir/gfx/icon16/film_key.png new file mode 100644 index 00000000..58921624 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/film_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/film_link.png b/base/resources.pk3dir/gfx/icon16/film_link.png new file mode 100644 index 00000000..0f24e86e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/film_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/film_save.png b/base/resources.pk3dir/gfx/icon16/film_save.png new file mode 100644 index 00000000..bc8c0d35 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/film_save.png differ diff --git a/base/resources.pk3dir/gfx/icon16/find.png b/base/resources.pk3dir/gfx/icon16/find.png new file mode 100644 index 00000000..15474796 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/find.png differ diff --git a/base/resources.pk3dir/gfx/icon16/flag_blue.png b/base/resources.pk3dir/gfx/icon16/flag_blue.png new file mode 100644 index 00000000..003924f5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/flag_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/flag_green.png b/base/resources.pk3dir/gfx/icon16/flag_green.png new file mode 100644 index 00000000..e4bc611f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/flag_green.png differ diff --git a/base/resources.pk3dir/gfx/icon16/flag_orange.png b/base/resources.pk3dir/gfx/icon16/flag_orange.png new file mode 100644 index 00000000..e6320242 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/flag_orange.png differ diff --git a/base/resources.pk3dir/gfx/icon16/flag_pink.png b/base/resources.pk3dir/gfx/icon16/flag_pink.png new file mode 100644 index 00000000..5f15e526 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/flag_pink.png differ diff --git a/base/resources.pk3dir/gfx/icon16/flag_purple.png b/base/resources.pk3dir/gfx/icon16/flag_purple.png new file mode 100644 index 00000000..d0698664 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/flag_purple.png differ diff --git a/base/resources.pk3dir/gfx/icon16/flag_red.png b/base/resources.pk3dir/gfx/icon16/flag_red.png new file mode 100644 index 00000000..e8a602da Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/flag_red.png differ diff --git a/base/resources.pk3dir/gfx/icon16/flag_yellow.png b/base/resources.pk3dir/gfx/icon16/flag_yellow.png new file mode 100644 index 00000000..14c89a54 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/flag_yellow.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder.png b/base/resources.pk3dir/gfx/icon16/folder.png new file mode 100644 index 00000000..784e8fa4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_add.png b/base/resources.pk3dir/gfx/icon16/folder_add.png new file mode 100644 index 00000000..529fe8fe Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_bell.png b/base/resources.pk3dir/gfx/icon16/folder_bell.png new file mode 100644 index 00000000..d04dd7f5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_bell.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_brick.png b/base/resources.pk3dir/gfx/icon16/folder_brick.png new file mode 100644 index 00000000..5dea9769 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_brick.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_bug.png b/base/resources.pk3dir/gfx/icon16/folder_bug.png new file mode 100644 index 00000000..4f791b68 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_bug.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_camera.png b/base/resources.pk3dir/gfx/icon16/folder_camera.png new file mode 100644 index 00000000..c9519416 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_camera.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_database.png b/base/resources.pk3dir/gfx/icon16/folder_database.png new file mode 100644 index 00000000..5193e2ef Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_database.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_delete.png b/base/resources.pk3dir/gfx/icon16/folder_delete.png new file mode 100644 index 00000000..112b0163 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_edit.png b/base/resources.pk3dir/gfx/icon16/folder_edit.png new file mode 100644 index 00000000..ad669cc7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_error.png b/base/resources.pk3dir/gfx/icon16/folder_error.png new file mode 100644 index 00000000..1af88095 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_explore.png b/base/resources.pk3dir/gfx/icon16/folder_explore.png new file mode 100644 index 00000000..0ba93918 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_explore.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_feed.png b/base/resources.pk3dir/gfx/icon16/folder_feed.png new file mode 100644 index 00000000..d06ee51e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_feed.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_find.png b/base/resources.pk3dir/gfx/icon16/folder_find.png new file mode 100644 index 00000000..c64e2ee6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_find.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_go.png b/base/resources.pk3dir/gfx/icon16/folder_go.png new file mode 100644 index 00000000..34a736f7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_heart.png b/base/resources.pk3dir/gfx/icon16/folder_heart.png new file mode 100644 index 00000000..56d7da1d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_heart.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_image.png b/base/resources.pk3dir/gfx/icon16/folder_image.png new file mode 100644 index 00000000..d5df75bb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_image.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_key.png b/base/resources.pk3dir/gfx/icon16/folder_key.png new file mode 100644 index 00000000..fb9b4c2b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_lightbulb.png b/base/resources.pk3dir/gfx/icon16/folder_lightbulb.png new file mode 100644 index 00000000..f367a511 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_lightbulb.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_link.png b/base/resources.pk3dir/gfx/icon16/folder_link.png new file mode 100644 index 00000000..b9b75f6c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_magnify.png b/base/resources.pk3dir/gfx/icon16/folder_magnify.png new file mode 100644 index 00000000..0a3e7985 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_magnify.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_page.png b/base/resources.pk3dir/gfx/icon16/folder_page.png new file mode 100644 index 00000000..1ef6e114 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_page.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_page_white.png b/base/resources.pk3dir/gfx/icon16/folder_page_white.png new file mode 100644 index 00000000..14d6b618 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_page_white.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_palette.png b/base/resources.pk3dir/gfx/icon16/folder_palette.png new file mode 100644 index 00000000..ba12fe8a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_palette.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_picture.png b/base/resources.pk3dir/gfx/icon16/folder_picture.png new file mode 100644 index 00000000..052b3363 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_picture.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_star.png b/base/resources.pk3dir/gfx/icon16/folder_star.png new file mode 100644 index 00000000..448e46fd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_star.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_table.png b/base/resources.pk3dir/gfx/icon16/folder_table.png new file mode 100644 index 00000000..473cee35 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_table.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_user.png b/base/resources.pk3dir/gfx/icon16/folder_user.png new file mode 100644 index 00000000..f021c3e1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_user.png differ diff --git a/base/resources.pk3dir/gfx/icon16/folder_wrench.png b/base/resources.pk3dir/gfx/icon16/folder_wrench.png new file mode 100644 index 00000000..ea3404e0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/folder_wrench.png differ diff --git a/base/resources.pk3dir/gfx/icon16/font.png b/base/resources.pk3dir/gfx/icon16/font.png new file mode 100644 index 00000000..b7960db9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/font.png differ diff --git a/base/resources.pk3dir/gfx/icon16/font_add.png b/base/resources.pk3dir/gfx/icon16/font_add.png new file mode 100644 index 00000000..b709ebae Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/font_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/font_delete.png b/base/resources.pk3dir/gfx/icon16/font_delete.png new file mode 100644 index 00000000..1d6124d6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/font_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/font_go.png b/base/resources.pk3dir/gfx/icon16/font_go.png new file mode 100644 index 00000000..75eba80d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/font_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/group.png b/base/resources.pk3dir/gfx/icon16/group.png new file mode 100644 index 00000000..7fb4e1f1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/group.png differ diff --git a/base/resources.pk3dir/gfx/icon16/group_add.png b/base/resources.pk3dir/gfx/icon16/group_add.png new file mode 100644 index 00000000..06c5350c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/group_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/group_delete.png b/base/resources.pk3dir/gfx/icon16/group_delete.png new file mode 100644 index 00000000..4489ca23 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/group_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/group_edit.png b/base/resources.pk3dir/gfx/icon16/group_edit.png new file mode 100644 index 00000000..c88b945b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/group_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/group_error.png b/base/resources.pk3dir/gfx/icon16/group_error.png new file mode 100644 index 00000000..7364a13c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/group_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/group_gear.png b/base/resources.pk3dir/gfx/icon16/group_gear.png new file mode 100644 index 00000000..2544f2e6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/group_gear.png differ diff --git a/base/resources.pk3dir/gfx/icon16/group_go.png b/base/resources.pk3dir/gfx/icon16/group_go.png new file mode 100644 index 00000000..1f523330 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/group_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/group_key.png b/base/resources.pk3dir/gfx/icon16/group_key.png new file mode 100644 index 00000000..257f111c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/group_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/group_link.png b/base/resources.pk3dir/gfx/icon16/group_link.png new file mode 100644 index 00000000..c77ed881 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/group_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/heart.png b/base/resources.pk3dir/gfx/icon16/heart.png new file mode 100644 index 00000000..d9ee53e5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/heart.png differ diff --git a/base/resources.pk3dir/gfx/icon16/heart_add.png b/base/resources.pk3dir/gfx/icon16/heart_add.png new file mode 100644 index 00000000..d4195ff8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/heart_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/heart_delete.png b/base/resources.pk3dir/gfx/icon16/heart_delete.png new file mode 100644 index 00000000..ce523e34 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/heart_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/help.png b/base/resources.pk3dir/gfx/icon16/help.png new file mode 100644 index 00000000..5c870176 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/help.png differ diff --git a/base/resources.pk3dir/gfx/icon16/hourglass.png b/base/resources.pk3dir/gfx/icon16/hourglass.png new file mode 100644 index 00000000..57b03ce7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/hourglass.png differ diff --git a/base/resources.pk3dir/gfx/icon16/hourglass_add.png b/base/resources.pk3dir/gfx/icon16/hourglass_add.png new file mode 100644 index 00000000..170dfff1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/hourglass_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/hourglass_delete.png b/base/resources.pk3dir/gfx/icon16/hourglass_delete.png new file mode 100644 index 00000000..4b1337be Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/hourglass_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/hourglass_go.png b/base/resources.pk3dir/gfx/icon16/hourglass_go.png new file mode 100644 index 00000000..b2d3a98b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/hourglass_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/hourglass_link.png b/base/resources.pk3dir/gfx/icon16/hourglass_link.png new file mode 100644 index 00000000..ecc59b0a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/hourglass_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/house.png b/base/resources.pk3dir/gfx/icon16/house.png new file mode 100644 index 00000000..fed62219 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/house.png differ diff --git a/base/resources.pk3dir/gfx/icon16/house_go.png b/base/resources.pk3dir/gfx/icon16/house_go.png new file mode 100644 index 00000000..5457dbd3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/house_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/house_link.png b/base/resources.pk3dir/gfx/icon16/house_link.png new file mode 100644 index 00000000..be2c2719 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/house_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/html.png b/base/resources.pk3dir/gfx/icon16/html.png new file mode 100644 index 00000000..55d1072e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/html.png differ diff --git a/base/resources.pk3dir/gfx/icon16/html_add.png b/base/resources.pk3dir/gfx/icon16/html_add.png new file mode 100644 index 00000000..f1c08b7d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/html_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/html_delete.png b/base/resources.pk3dir/gfx/icon16/html_delete.png new file mode 100644 index 00000000..1bd28489 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/html_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/html_go.png b/base/resources.pk3dir/gfx/icon16/html_go.png new file mode 100644 index 00000000..a95cede1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/html_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/html_valid.png b/base/resources.pk3dir/gfx/icon16/html_valid.png new file mode 100644 index 00000000..71cec924 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/html_valid.png differ diff --git a/base/resources.pk3dir/gfx/icon16/image.png b/base/resources.pk3dir/gfx/icon16/image.png new file mode 100644 index 00000000..fc3c393c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/image.png differ diff --git a/base/resources.pk3dir/gfx/icon16/image_add.png b/base/resources.pk3dir/gfx/icon16/image_add.png new file mode 100644 index 00000000..fc5d6139 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/image_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/image_delete.png b/base/resources.pk3dir/gfx/icon16/image_delete.png new file mode 100644 index 00000000..c260e1d9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/image_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/image_edit.png b/base/resources.pk3dir/gfx/icon16/image_edit.png new file mode 100644 index 00000000..0aa4cc65 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/image_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/image_link.png b/base/resources.pk3dir/gfx/icon16/image_link.png new file mode 100644 index 00000000..4bdb3541 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/image_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/images.png b/base/resources.pk3dir/gfx/icon16/images.png new file mode 100644 index 00000000..184860d1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/images.png differ diff --git a/base/resources.pk3dir/gfx/icon16/information.png b/base/resources.pk3dir/gfx/icon16/information.png new file mode 100644 index 00000000..12cd1aef Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/information.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ipod.png b/base/resources.pk3dir/gfx/icon16/ipod.png new file mode 100644 index 00000000..3f768da5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ipod.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ipod_cast.png b/base/resources.pk3dir/gfx/icon16/ipod_cast.png new file mode 100644 index 00000000..6f6d3406 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ipod_cast.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ipod_cast_add.png b/base/resources.pk3dir/gfx/icon16/ipod_cast_add.png new file mode 100644 index 00000000..c3257f5f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ipod_cast_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ipod_cast_delete.png b/base/resources.pk3dir/gfx/icon16/ipod_cast_delete.png new file mode 100644 index 00000000..377ab695 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ipod_cast_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ipod_sound.png b/base/resources.pk3dir/gfx/icon16/ipod_sound.png new file mode 100644 index 00000000..fef6e8ba Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ipod_sound.png differ diff --git a/base/resources.pk3dir/gfx/icon16/joystick.png b/base/resources.pk3dir/gfx/icon16/joystick.png new file mode 100644 index 00000000..62168f56 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/joystick.png differ diff --git a/base/resources.pk3dir/gfx/icon16/joystick_add.png b/base/resources.pk3dir/gfx/icon16/joystick_add.png new file mode 100644 index 00000000..77e71077 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/joystick_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/joystick_delete.png b/base/resources.pk3dir/gfx/icon16/joystick_delete.png new file mode 100644 index 00000000..5d44b592 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/joystick_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/joystick_error.png b/base/resources.pk3dir/gfx/icon16/joystick_error.png new file mode 100644 index 00000000..b32149e2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/joystick_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/key.png b/base/resources.pk3dir/gfx/icon16/key.png new file mode 100644 index 00000000..4ec1a928 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/key_add.png b/base/resources.pk3dir/gfx/icon16/key_add.png new file mode 100644 index 00000000..d4074039 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/key_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/key_delete.png b/base/resources.pk3dir/gfx/icon16/key_delete.png new file mode 100644 index 00000000..00dec80d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/key_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/key_go.png b/base/resources.pk3dir/gfx/icon16/key_go.png new file mode 100644 index 00000000..30b0dc31 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/key_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/keyboard.png b/base/resources.pk3dir/gfx/icon16/keyboard.png new file mode 100644 index 00000000..898d402d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/keyboard.png differ diff --git a/base/resources.pk3dir/gfx/icon16/keyboard_add.png b/base/resources.pk3dir/gfx/icon16/keyboard_add.png new file mode 100644 index 00000000..26938dd0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/keyboard_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/keyboard_delete.png b/base/resources.pk3dir/gfx/icon16/keyboard_delete.png new file mode 100644 index 00000000..1786ed5b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/keyboard_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/keyboard_magnify.png b/base/resources.pk3dir/gfx/icon16/keyboard_magnify.png new file mode 100644 index 00000000..928fc17b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/keyboard_magnify.png differ diff --git a/base/resources.pk3dir/gfx/icon16/layers.png b/base/resources.pk3dir/gfx/icon16/layers.png new file mode 100644 index 00000000..00818f63 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/layers.png differ diff --git a/base/resources.pk3dir/gfx/icon16/layout.png b/base/resources.pk3dir/gfx/icon16/layout.png new file mode 100644 index 00000000..ea086b04 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/layout.png differ diff --git a/base/resources.pk3dir/gfx/icon16/layout_add.png b/base/resources.pk3dir/gfx/icon16/layout_add.png new file mode 100644 index 00000000..62037221 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/layout_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/layout_content.png b/base/resources.pk3dir/gfx/icon16/layout_content.png new file mode 100644 index 00000000..b4aaad9a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/layout_content.png differ diff --git a/base/resources.pk3dir/gfx/icon16/layout_delete.png b/base/resources.pk3dir/gfx/icon16/layout_delete.png new file mode 100644 index 00000000..4bd45f13 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/layout_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/layout_edit.png b/base/resources.pk3dir/gfx/icon16/layout_edit.png new file mode 100644 index 00000000..ab3100b5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/layout_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/layout_error.png b/base/resources.pk3dir/gfx/icon16/layout_error.png new file mode 100644 index 00000000..5b5acea9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/layout_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/layout_header.png b/base/resources.pk3dir/gfx/icon16/layout_header.png new file mode 100644 index 00000000..c6ea7f23 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/layout_header.png differ diff --git a/base/resources.pk3dir/gfx/icon16/layout_link.png b/base/resources.pk3dir/gfx/icon16/layout_link.png new file mode 100644 index 00000000..3445d420 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/layout_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/layout_sidebar.png b/base/resources.pk3dir/gfx/icon16/layout_sidebar.png new file mode 100644 index 00000000..3be27bb9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/layout_sidebar.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lightbulb.png b/base/resources.pk3dir/gfx/icon16/lightbulb.png new file mode 100644 index 00000000..3d6db4db Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lightbulb.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lightbulb_add.png b/base/resources.pk3dir/gfx/icon16/lightbulb_add.png new file mode 100644 index 00000000..3a026f45 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lightbulb_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lightbulb_delete.png b/base/resources.pk3dir/gfx/icon16/lightbulb_delete.png new file mode 100644 index 00000000..4e8a6149 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lightbulb_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lightbulb_off.png b/base/resources.pk3dir/gfx/icon16/lightbulb_off.png new file mode 100644 index 00000000..468e1f37 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lightbulb_off.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lightning.png b/base/resources.pk3dir/gfx/icon16/lightning.png new file mode 100644 index 00000000..9680afd1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lightning.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lightning_add.png b/base/resources.pk3dir/gfx/icon16/lightning_add.png new file mode 100644 index 00000000..dac3c905 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lightning_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lightning_delete.png b/base/resources.pk3dir/gfx/icon16/lightning_delete.png new file mode 100644 index 00000000..dfe27705 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lightning_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lightning_go.png b/base/resources.pk3dir/gfx/icon16/lightning_go.png new file mode 100644 index 00000000..29039e6a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lightning_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/link.png b/base/resources.pk3dir/gfx/icon16/link.png new file mode 100644 index 00000000..25eacb7c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/link_add.png b/base/resources.pk3dir/gfx/icon16/link_add.png new file mode 100644 index 00000000..00be352c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/link_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/link_break.png b/base/resources.pk3dir/gfx/icon16/link_break.png new file mode 100644 index 00000000..52357530 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/link_break.png differ diff --git a/base/resources.pk3dir/gfx/icon16/link_delete.png b/base/resources.pk3dir/gfx/icon16/link_delete.png new file mode 100644 index 00000000..f66e2974 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/link_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/link_edit.png b/base/resources.pk3dir/gfx/icon16/link_edit.png new file mode 100644 index 00000000..5b3aed09 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/link_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/link_error.png b/base/resources.pk3dir/gfx/icon16/link_error.png new file mode 100644 index 00000000..ab694b1a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/link_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/link_go.png b/base/resources.pk3dir/gfx/icon16/link_go.png new file mode 100644 index 00000000..ae8cae80 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/link_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lock.png b/base/resources.pk3dir/gfx/icon16/lock.png new file mode 100644 index 00000000..2ebc4f6f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lock.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lock_add.png b/base/resources.pk3dir/gfx/icon16/lock_add.png new file mode 100644 index 00000000..a7b566b1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lock_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lock_break.png b/base/resources.pk3dir/gfx/icon16/lock_break.png new file mode 100644 index 00000000..13578ab5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lock_break.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lock_delete.png b/base/resources.pk3dir/gfx/icon16/lock_delete.png new file mode 100644 index 00000000..ecb50a93 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lock_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lock_edit.png b/base/resources.pk3dir/gfx/icon16/lock_edit.png new file mode 100644 index 00000000..116aa5b7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lock_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lock_go.png b/base/resources.pk3dir/gfx/icon16/lock_go.png new file mode 100644 index 00000000..8c7c89b2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lock_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lock_open.png b/base/resources.pk3dir/gfx/icon16/lock_open.png new file mode 100644 index 00000000..a471765f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lock_open.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lorry.png b/base/resources.pk3dir/gfx/icon16/lorry.png new file mode 100644 index 00000000..8f95f5a5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lorry.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lorry_add.png b/base/resources.pk3dir/gfx/icon16/lorry_add.png new file mode 100644 index 00000000..a2c51249 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lorry_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lorry_delete.png b/base/resources.pk3dir/gfx/icon16/lorry_delete.png new file mode 100644 index 00000000..66217f52 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lorry_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lorry_error.png b/base/resources.pk3dir/gfx/icon16/lorry_error.png new file mode 100644 index 00000000..3619ead9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lorry_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lorry_flatbed.png b/base/resources.pk3dir/gfx/icon16/lorry_flatbed.png new file mode 100644 index 00000000..8b20f550 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lorry_flatbed.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lorry_go.png b/base/resources.pk3dir/gfx/icon16/lorry_go.png new file mode 100644 index 00000000..1c296a6a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lorry_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/lorry_link.png b/base/resources.pk3dir/gfx/icon16/lorry_link.png new file mode 100644 index 00000000..5e6663e5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/lorry_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/magnifier.png b/base/resources.pk3dir/gfx/icon16/magnifier.png new file mode 100644 index 00000000..cf3d97f7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/magnifier.png differ diff --git a/base/resources.pk3dir/gfx/icon16/magnifier_zoom_in.png b/base/resources.pk3dir/gfx/icon16/magnifier_zoom_in.png new file mode 100644 index 00000000..af4fe074 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/magnifier_zoom_in.png differ diff --git a/base/resources.pk3dir/gfx/icon16/magnifier_zoom_out.png b/base/resources.pk3dir/gfx/icon16/magnifier_zoom_out.png new file mode 100644 index 00000000..81f28199 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/magnifier_zoom_out.png differ diff --git a/base/resources.pk3dir/gfx/icon16/male.png b/base/resources.pk3dir/gfx/icon16/male.png new file mode 100644 index 00000000..25d6ea91 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/male.png differ diff --git a/base/resources.pk3dir/gfx/icon16/map.png b/base/resources.pk3dir/gfx/icon16/map.png new file mode 100644 index 00000000..f90ef25e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/map.png differ diff --git a/base/resources.pk3dir/gfx/icon16/map_add.png b/base/resources.pk3dir/gfx/icon16/map_add.png new file mode 100644 index 00000000..2b72da06 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/map_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/map_delete.png b/base/resources.pk3dir/gfx/icon16/map_delete.png new file mode 100644 index 00000000..e74402f9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/map_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/map_edit.png b/base/resources.pk3dir/gfx/icon16/map_edit.png new file mode 100644 index 00000000..93d4d7e5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/map_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/map_go.png b/base/resources.pk3dir/gfx/icon16/map_go.png new file mode 100644 index 00000000..11eab26d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/map_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/map_magnify.png b/base/resources.pk3dir/gfx/icon16/map_magnify.png new file mode 100644 index 00000000..7184c9dd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/map_magnify.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_bronze_1.png b/base/resources.pk3dir/gfx/icon16/medal_bronze_1.png new file mode 100644 index 00000000..5f8a6d65 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_bronze_1.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_bronze_2.png b/base/resources.pk3dir/gfx/icon16/medal_bronze_2.png new file mode 100644 index 00000000..623d68c5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_bronze_2.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_bronze_3.png b/base/resources.pk3dir/gfx/icon16/medal_bronze_3.png new file mode 100644 index 00000000..ed3f43eb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_bronze_3.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_bronze_add.png b/base/resources.pk3dir/gfx/icon16/medal_bronze_add.png new file mode 100644 index 00000000..8487b2c1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_bronze_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_bronze_delete.png b/base/resources.pk3dir/gfx/icon16/medal_bronze_delete.png new file mode 100644 index 00000000..d32aed72 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_bronze_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_gold_1.png b/base/resources.pk3dir/gfx/icon16/medal_gold_1.png new file mode 100644 index 00000000..87584dc9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_gold_1.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_gold_2.png b/base/resources.pk3dir/gfx/icon16/medal_gold_2.png new file mode 100644 index 00000000..fa3a15dd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_gold_2.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_gold_3.png b/base/resources.pk3dir/gfx/icon16/medal_gold_3.png new file mode 100644 index 00000000..ef1b08b9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_gold_3.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_gold_add.png b/base/resources.pk3dir/gfx/icon16/medal_gold_add.png new file mode 100644 index 00000000..dcade0d8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_gold_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_gold_delete.png b/base/resources.pk3dir/gfx/icon16/medal_gold_delete.png new file mode 100644 index 00000000..84b06d5b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_gold_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_silver_1.png b/base/resources.pk3dir/gfx/icon16/medal_silver_1.png new file mode 100644 index 00000000..75a64da3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_silver_1.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_silver_2.png b/base/resources.pk3dir/gfx/icon16/medal_silver_2.png new file mode 100644 index 00000000..2e0fe75c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_silver_2.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_silver_3.png b/base/resources.pk3dir/gfx/icon16/medal_silver_3.png new file mode 100644 index 00000000..e385b546 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_silver_3.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_silver_add.png b/base/resources.pk3dir/gfx/icon16/medal_silver_add.png new file mode 100644 index 00000000..b0633fa0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_silver_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/medal_silver_delete.png b/base/resources.pk3dir/gfx/icon16/medal_silver_delete.png new file mode 100644 index 00000000..06cab467 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/medal_silver_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/money.png b/base/resources.pk3dir/gfx/icon16/money.png new file mode 100644 index 00000000..42c52d05 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/money.png differ diff --git a/base/resources.pk3dir/gfx/icon16/money_add.png b/base/resources.pk3dir/gfx/icon16/money_add.png new file mode 100644 index 00000000..588fa9d0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/money_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/money_delete.png b/base/resources.pk3dir/gfx/icon16/money_delete.png new file mode 100644 index 00000000..eae2c524 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/money_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/money_dollar.png b/base/resources.pk3dir/gfx/icon16/money_dollar.png new file mode 100644 index 00000000..59af1638 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/money_dollar.png differ diff --git a/base/resources.pk3dir/gfx/icon16/money_euro.png b/base/resources.pk3dir/gfx/icon16/money_euro.png new file mode 100644 index 00000000..b322ba92 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/money_euro.png differ diff --git a/base/resources.pk3dir/gfx/icon16/money_pound.png b/base/resources.pk3dir/gfx/icon16/money_pound.png new file mode 100644 index 00000000..b7113646 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/money_pound.png differ diff --git a/base/resources.pk3dir/gfx/icon16/money_yen.png b/base/resources.pk3dir/gfx/icon16/money_yen.png new file mode 100644 index 00000000..228a6778 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/money_yen.png differ diff --git a/base/resources.pk3dir/gfx/icon16/monitor.png b/base/resources.pk3dir/gfx/icon16/monitor.png new file mode 100644 index 00000000..d040bd02 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/monitor.png differ diff --git a/base/resources.pk3dir/gfx/icon16/monitor_add.png b/base/resources.pk3dir/gfx/icon16/monitor_add.png new file mode 100644 index 00000000..a8180664 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/monitor_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/monitor_delete.png b/base/resources.pk3dir/gfx/icon16/monitor_delete.png new file mode 100644 index 00000000..37332563 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/monitor_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/monitor_edit.png b/base/resources.pk3dir/gfx/icon16/monitor_edit.png new file mode 100644 index 00000000..f772c562 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/monitor_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/monitor_error.png b/base/resources.pk3dir/gfx/icon16/monitor_error.png new file mode 100644 index 00000000..270c5018 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/monitor_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/monitor_go.png b/base/resources.pk3dir/gfx/icon16/monitor_go.png new file mode 100644 index 00000000..8af3eda9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/monitor_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/monitor_lightning.png b/base/resources.pk3dir/gfx/icon16/monitor_lightning.png new file mode 100644 index 00000000..06e53a9d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/monitor_lightning.png differ diff --git a/base/resources.pk3dir/gfx/icon16/monitor_link.png b/base/resources.pk3dir/gfx/icon16/monitor_link.png new file mode 100644 index 00000000..a014b025 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/monitor_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/mouse.png b/base/resources.pk3dir/gfx/icon16/mouse.png new file mode 100644 index 00000000..63a92fa9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/mouse.png differ diff --git a/base/resources.pk3dir/gfx/icon16/mouse_add.png b/base/resources.pk3dir/gfx/icon16/mouse_add.png new file mode 100644 index 00000000..65bcab52 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/mouse_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/mouse_delete.png b/base/resources.pk3dir/gfx/icon16/mouse_delete.png new file mode 100644 index 00000000..72865668 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/mouse_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/mouse_error.png b/base/resources.pk3dir/gfx/icon16/mouse_error.png new file mode 100644 index 00000000..bcc15623 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/mouse_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/music.png b/base/resources.pk3dir/gfx/icon16/music.png new file mode 100644 index 00000000..a8b3ede3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/music.png differ diff --git a/base/resources.pk3dir/gfx/icon16/new.png b/base/resources.pk3dir/gfx/icon16/new.png new file mode 100644 index 00000000..6a9bf037 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/new.png differ diff --git a/base/resources.pk3dir/gfx/icon16/newspaper.png b/base/resources.pk3dir/gfx/icon16/newspaper.png new file mode 100644 index 00000000..6a2ecce1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/newspaper.png differ diff --git a/base/resources.pk3dir/gfx/icon16/newspaper_add.png b/base/resources.pk3dir/gfx/icon16/newspaper_add.png new file mode 100644 index 00000000..8140e8c1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/newspaper_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/newspaper_delete.png b/base/resources.pk3dir/gfx/icon16/newspaper_delete.png new file mode 100644 index 00000000..bde96ce1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/newspaper_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/newspaper_go.png b/base/resources.pk3dir/gfx/icon16/newspaper_go.png new file mode 100644 index 00000000..fd614287 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/newspaper_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/newspaper_link.png b/base/resources.pk3dir/gfx/icon16/newspaper_link.png new file mode 100644 index 00000000..99e57cba Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/newspaper_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/note.png b/base/resources.pk3dir/gfx/icon16/note.png new file mode 100644 index 00000000..244e6ca0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/note.png differ diff --git a/base/resources.pk3dir/gfx/icon16/note_add.png b/base/resources.pk3dir/gfx/icon16/note_add.png new file mode 100644 index 00000000..abdad91e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/note_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/note_delete.png b/base/resources.pk3dir/gfx/icon16/note_delete.png new file mode 100644 index 00000000..8a1f0ff5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/note_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/note_edit.png b/base/resources.pk3dir/gfx/icon16/note_edit.png new file mode 100644 index 00000000..291bfc76 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/note_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/note_error.png b/base/resources.pk3dir/gfx/icon16/note_error.png new file mode 100644 index 00000000..896dadfd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/note_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/note_go.png b/base/resources.pk3dir/gfx/icon16/note_go.png new file mode 100644 index 00000000..49e54fd8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/note_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/package.png b/base/resources.pk3dir/gfx/icon16/package.png new file mode 100644 index 00000000..da3c2a2d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/package.png differ diff --git a/base/resources.pk3dir/gfx/icon16/package_add.png b/base/resources.pk3dir/gfx/icon16/package_add.png new file mode 100644 index 00000000..9c8a9da4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/package_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/package_delete.png b/base/resources.pk3dir/gfx/icon16/package_delete.png new file mode 100644 index 00000000..86f7fbc2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/package_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/package_go.png b/base/resources.pk3dir/gfx/icon16/package_go.png new file mode 100644 index 00000000..aace63ad Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/package_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/package_green.png b/base/resources.pk3dir/gfx/icon16/package_green.png new file mode 100644 index 00000000..25b28bb6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/package_green.png differ diff --git a/base/resources.pk3dir/gfx/icon16/package_link.png b/base/resources.pk3dir/gfx/icon16/package_link.png new file mode 100644 index 00000000..48e7ab55 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/package_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page.png b/base/resources.pk3dir/gfx/icon16/page.png new file mode 100644 index 00000000..03ddd799 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_add.png b/base/resources.pk3dir/gfx/icon16/page_add.png new file mode 100644 index 00000000..d5bfa071 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_attach.png b/base/resources.pk3dir/gfx/icon16/page_attach.png new file mode 100644 index 00000000..89ee2da0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_attach.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_code.png b/base/resources.pk3dir/gfx/icon16/page_code.png new file mode 100644 index 00000000..f7ea9041 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_code.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_copy.png b/base/resources.pk3dir/gfx/icon16/page_copy.png new file mode 100644 index 00000000..195dc6d6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_copy.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_delete.png b/base/resources.pk3dir/gfx/icon16/page_delete.png new file mode 100644 index 00000000..3141467c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_edit.png b/base/resources.pk3dir/gfx/icon16/page_edit.png new file mode 100644 index 00000000..046811ed Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_error.png b/base/resources.pk3dir/gfx/icon16/page_error.png new file mode 100644 index 00000000..f07f449a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_excel.png b/base/resources.pk3dir/gfx/icon16/page_excel.png new file mode 100644 index 00000000..eb6158eb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_excel.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_find.png b/base/resources.pk3dir/gfx/icon16/page_find.png new file mode 100644 index 00000000..2f193889 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_find.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_gear.png b/base/resources.pk3dir/gfx/icon16/page_gear.png new file mode 100644 index 00000000..8e83281c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_gear.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_go.png b/base/resources.pk3dir/gfx/icon16/page_go.png new file mode 100644 index 00000000..80fe1ed0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_green.png b/base/resources.pk3dir/gfx/icon16/page_green.png new file mode 100644 index 00000000..de8e003f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_green.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_key.png b/base/resources.pk3dir/gfx/icon16/page_key.png new file mode 100644 index 00000000..d6626cb0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_lightning.png b/base/resources.pk3dir/gfx/icon16/page_lightning.png new file mode 100644 index 00000000..7e568703 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_lightning.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_link.png b/base/resources.pk3dir/gfx/icon16/page_link.png new file mode 100644 index 00000000..312eab09 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_paintbrush.png b/base/resources.pk3dir/gfx/icon16/page_paintbrush.png new file mode 100644 index 00000000..246a2f0b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_paintbrush.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_paste.png b/base/resources.pk3dir/gfx/icon16/page_paste.png new file mode 100644 index 00000000..968f073f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_paste.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_red.png b/base/resources.pk3dir/gfx/icon16/page_red.png new file mode 100644 index 00000000..0b18247d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_red.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_refresh.png b/base/resources.pk3dir/gfx/icon16/page_refresh.png new file mode 100644 index 00000000..cf347c7d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_refresh.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_save.png b/base/resources.pk3dir/gfx/icon16/page_save.png new file mode 100644 index 00000000..caea546a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_save.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white.png b/base/resources.pk3dir/gfx/icon16/page_white.png new file mode 100644 index 00000000..8b8b1ca0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_acrobat.png b/base/resources.pk3dir/gfx/icon16/page_white_acrobat.png new file mode 100644 index 00000000..8f8095e4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_acrobat.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_actionscript.png b/base/resources.pk3dir/gfx/icon16/page_white_actionscript.png new file mode 100644 index 00000000..159b2407 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_actionscript.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_add.png b/base/resources.pk3dir/gfx/icon16/page_white_add.png new file mode 100644 index 00000000..aa23dde3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_c.png b/base/resources.pk3dir/gfx/icon16/page_white_c.png new file mode 100644 index 00000000..34a05ccc Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_c.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_camera.png b/base/resources.pk3dir/gfx/icon16/page_white_camera.png new file mode 100644 index 00000000..f501a593 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_camera.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_cd.png b/base/resources.pk3dir/gfx/icon16/page_white_cd.png new file mode 100644 index 00000000..848bdaf3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_cd.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_code.png b/base/resources.pk3dir/gfx/icon16/page_white_code.png new file mode 100644 index 00000000..0c76bd12 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_code.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_code_red.png b/base/resources.pk3dir/gfx/icon16/page_white_code_red.png new file mode 100644 index 00000000..87a69145 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_code_red.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_coldfusion.png b/base/resources.pk3dir/gfx/icon16/page_white_coldfusion.png new file mode 100644 index 00000000..c66011fb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_coldfusion.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_compressed.png b/base/resources.pk3dir/gfx/icon16/page_white_compressed.png new file mode 100644 index 00000000..2b6b1007 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_compressed.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_copy.png b/base/resources.pk3dir/gfx/icon16/page_white_copy.png new file mode 100644 index 00000000..a9f31a27 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_copy.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_cplusplus.png b/base/resources.pk3dir/gfx/icon16/page_white_cplusplus.png new file mode 100644 index 00000000..a87cf847 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_cplusplus.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_csharp.png b/base/resources.pk3dir/gfx/icon16/page_white_csharp.png new file mode 100644 index 00000000..ffb8fc93 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_csharp.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_cup.png b/base/resources.pk3dir/gfx/icon16/page_white_cup.png new file mode 100644 index 00000000..0a7d6f4a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_cup.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_database.png b/base/resources.pk3dir/gfx/icon16/page_white_database.png new file mode 100644 index 00000000..bddba1f9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_database.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_delete.png b/base/resources.pk3dir/gfx/icon16/page_white_delete.png new file mode 100644 index 00000000..af1ecaf2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_dvd.png b/base/resources.pk3dir/gfx/icon16/page_white_dvd.png new file mode 100644 index 00000000..4cc537af Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_dvd.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_edit.png b/base/resources.pk3dir/gfx/icon16/page_white_edit.png new file mode 100644 index 00000000..b93e7760 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_error.png b/base/resources.pk3dir/gfx/icon16/page_white_error.png new file mode 100644 index 00000000..9fc5a0a1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_excel.png b/base/resources.pk3dir/gfx/icon16/page_white_excel.png new file mode 100644 index 00000000..b977d7e5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_excel.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_find.png b/base/resources.pk3dir/gfx/icon16/page_white_find.png new file mode 100644 index 00000000..58184363 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_find.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_flash.png b/base/resources.pk3dir/gfx/icon16/page_white_flash.png new file mode 100644 index 00000000..5769120b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_flash.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_freehand.png b/base/resources.pk3dir/gfx/icon16/page_white_freehand.png new file mode 100644 index 00000000..8d719df5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_freehand.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_gear.png b/base/resources.pk3dir/gfx/icon16/page_white_gear.png new file mode 100644 index 00000000..106f5aa3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_gear.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_get.png b/base/resources.pk3dir/gfx/icon16/page_white_get.png new file mode 100644 index 00000000..e4a1ecba Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_get.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_go.png b/base/resources.pk3dir/gfx/icon16/page_white_go.png new file mode 100644 index 00000000..7e62a924 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_h.png b/base/resources.pk3dir/gfx/icon16/page_white_h.png new file mode 100644 index 00000000..e902abb0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_h.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_horizontal.png b/base/resources.pk3dir/gfx/icon16/page_white_horizontal.png new file mode 100644 index 00000000..1d2d0a49 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_horizontal.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_key.png b/base/resources.pk3dir/gfx/icon16/page_white_key.png new file mode 100644 index 00000000..d6164845 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_lightning.png b/base/resources.pk3dir/gfx/icon16/page_white_lightning.png new file mode 100644 index 00000000..7215d1e8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_lightning.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_link.png b/base/resources.pk3dir/gfx/icon16/page_white_link.png new file mode 100644 index 00000000..bf7bd1c9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_magnify.png b/base/resources.pk3dir/gfx/icon16/page_white_magnify.png new file mode 100644 index 00000000..f6b74cc4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_magnify.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_medal.png b/base/resources.pk3dir/gfx/icon16/page_white_medal.png new file mode 100644 index 00000000..d3fffb6d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_medal.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_office.png b/base/resources.pk3dir/gfx/icon16/page_white_office.png new file mode 100644 index 00000000..a65bcb3e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_office.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_paint.png b/base/resources.pk3dir/gfx/icon16/page_white_paint.png new file mode 100644 index 00000000..23a37b89 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_paint.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_paintbrush.png b/base/resources.pk3dir/gfx/icon16/page_white_paintbrush.png new file mode 100644 index 00000000..f907e44b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_paintbrush.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_paste.png b/base/resources.pk3dir/gfx/icon16/page_white_paste.png new file mode 100644 index 00000000..5b2cbb3f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_paste.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_php.png b/base/resources.pk3dir/gfx/icon16/page_white_php.png new file mode 100644 index 00000000..7868a259 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_php.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_picture.png b/base/resources.pk3dir/gfx/icon16/page_white_picture.png new file mode 100644 index 00000000..134b6693 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_picture.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_powerpoint.png b/base/resources.pk3dir/gfx/icon16/page_white_powerpoint.png new file mode 100644 index 00000000..c4eff038 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_powerpoint.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_put.png b/base/resources.pk3dir/gfx/icon16/page_white_put.png new file mode 100644 index 00000000..884ffd6f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_put.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_ruby.png b/base/resources.pk3dir/gfx/icon16/page_white_ruby.png new file mode 100644 index 00000000..f59b7c43 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_ruby.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_stack.png b/base/resources.pk3dir/gfx/icon16/page_white_stack.png new file mode 100644 index 00000000..44084add Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_stack.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_star.png b/base/resources.pk3dir/gfx/icon16/page_white_star.png new file mode 100644 index 00000000..3a1441c9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_star.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_swoosh.png b/base/resources.pk3dir/gfx/icon16/page_white_swoosh.png new file mode 100644 index 00000000..e7708292 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_swoosh.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_text.png b/base/resources.pk3dir/gfx/icon16/page_white_text.png new file mode 100644 index 00000000..813f712f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_text.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_text_width.png b/base/resources.pk3dir/gfx/icon16/page_white_text_width.png new file mode 100644 index 00000000..d9cf1325 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_text_width.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_tux.png b/base/resources.pk3dir/gfx/icon16/page_white_tux.png new file mode 100644 index 00000000..52699bfe Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_tux.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_vector.png b/base/resources.pk3dir/gfx/icon16/page_white_vector.png new file mode 100644 index 00000000..4a05955b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_vector.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_visualstudio.png b/base/resources.pk3dir/gfx/icon16/page_white_visualstudio.png new file mode 100644 index 00000000..a0a433df Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_visualstudio.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_width.png b/base/resources.pk3dir/gfx/icon16/page_white_width.png new file mode 100644 index 00000000..1eb88094 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_width.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_word.png b/base/resources.pk3dir/gfx/icon16/page_white_word.png new file mode 100644 index 00000000..ae8ecbf4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_word.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_world.png b/base/resources.pk3dir/gfx/icon16/page_white_world.png new file mode 100644 index 00000000..6ed2490e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_world.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_wrench.png b/base/resources.pk3dir/gfx/icon16/page_white_wrench.png new file mode 100644 index 00000000..fecadd08 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_wrench.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_white_zip.png b/base/resources.pk3dir/gfx/icon16/page_white_zip.png new file mode 100644 index 00000000..fd4bbccd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_white_zip.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_word.png b/base/resources.pk3dir/gfx/icon16/page_word.png new file mode 100644 index 00000000..834cdfaf Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_word.png differ diff --git a/base/resources.pk3dir/gfx/icon16/page_world.png b/base/resources.pk3dir/gfx/icon16/page_world.png new file mode 100644 index 00000000..b8895dde Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/page_world.png differ diff --git a/base/resources.pk3dir/gfx/icon16/paintbrush.png b/base/resources.pk3dir/gfx/icon16/paintbrush.png new file mode 100644 index 00000000..a3ecf877 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/paintbrush.png differ diff --git a/base/resources.pk3dir/gfx/icon16/paintcan.png b/base/resources.pk3dir/gfx/icon16/paintcan.png new file mode 100644 index 00000000..f82a8865 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/paintcan.png differ diff --git a/base/resources.pk3dir/gfx/icon16/palette.png b/base/resources.pk3dir/gfx/icon16/palette.png new file mode 100644 index 00000000..73c5b3f2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/palette.png differ diff --git a/base/resources.pk3dir/gfx/icon16/paste_plain.png b/base/resources.pk3dir/gfx/icon16/paste_plain.png new file mode 100644 index 00000000..c0490eb7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/paste_plain.png differ diff --git a/base/resources.pk3dir/gfx/icon16/paste_word.png b/base/resources.pk3dir/gfx/icon16/paste_word.png new file mode 100644 index 00000000..f6b87f82 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/paste_word.png differ diff --git a/base/resources.pk3dir/gfx/icon16/pencil.png b/base/resources.pk3dir/gfx/icon16/pencil.png new file mode 100644 index 00000000..0bfecd50 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/pencil.png differ diff --git a/base/resources.pk3dir/gfx/icon16/pencil_add.png b/base/resources.pk3dir/gfx/icon16/pencil_add.png new file mode 100644 index 00000000..902bbe61 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/pencil_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/pencil_delete.png b/base/resources.pk3dir/gfx/icon16/pencil_delete.png new file mode 100644 index 00000000..d8944e6e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/pencil_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/pencil_go.png b/base/resources.pk3dir/gfx/icon16/pencil_go.png new file mode 100644 index 00000000..937bded9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/pencil_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/phone.png b/base/resources.pk3dir/gfx/icon16/phone.png new file mode 100644 index 00000000..c39f162f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/phone.png differ diff --git a/base/resources.pk3dir/gfx/icon16/phone_add.png b/base/resources.pk3dir/gfx/icon16/phone_add.png new file mode 100644 index 00000000..d3555e02 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/phone_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/phone_delete.png b/base/resources.pk3dir/gfx/icon16/phone_delete.png new file mode 100644 index 00000000..bbe4f8ab Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/phone_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/phone_sound.png b/base/resources.pk3dir/gfx/icon16/phone_sound.png new file mode 100644 index 00000000..7fdf1c58 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/phone_sound.png differ diff --git a/base/resources.pk3dir/gfx/icon16/photo.png b/base/resources.pk3dir/gfx/icon16/photo.png new file mode 100644 index 00000000..6c2aaaaa Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/photo.png differ diff --git a/base/resources.pk3dir/gfx/icon16/photo_add.png b/base/resources.pk3dir/gfx/icon16/photo_add.png new file mode 100644 index 00000000..63cc355c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/photo_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/photo_delete.png b/base/resources.pk3dir/gfx/icon16/photo_delete.png new file mode 100644 index 00000000..18b67df4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/photo_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/photo_link.png b/base/resources.pk3dir/gfx/icon16/photo_link.png new file mode 100644 index 00000000..e6bb35fb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/photo_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/photos.png b/base/resources.pk3dir/gfx/icon16/photos.png new file mode 100644 index 00000000..8836fe6c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/photos.png differ diff --git a/base/resources.pk3dir/gfx/icon16/picture.png b/base/resources.pk3dir/gfx/icon16/picture.png new file mode 100644 index 00000000..4a158fef Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/picture.png differ diff --git a/base/resources.pk3dir/gfx/icon16/picture_add.png b/base/resources.pk3dir/gfx/icon16/picture_add.png new file mode 100644 index 00000000..d6d3f856 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/picture_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/picture_delete.png b/base/resources.pk3dir/gfx/icon16/picture_delete.png new file mode 100644 index 00000000..cca9f535 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/picture_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/picture_edit.png b/base/resources.pk3dir/gfx/icon16/picture_edit.png new file mode 100644 index 00000000..9a70c349 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/picture_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/picture_empty.png b/base/resources.pk3dir/gfx/icon16/picture_empty.png new file mode 100644 index 00000000..abd2b9bb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/picture_empty.png differ diff --git a/base/resources.pk3dir/gfx/icon16/picture_error.png b/base/resources.pk3dir/gfx/icon16/picture_error.png new file mode 100644 index 00000000..d41d90d6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/picture_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/picture_go.png b/base/resources.pk3dir/gfx/icon16/picture_go.png new file mode 100644 index 00000000..27c63c5a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/picture_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/picture_key.png b/base/resources.pk3dir/gfx/icon16/picture_key.png new file mode 100644 index 00000000..667086c0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/picture_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/picture_link.png b/base/resources.pk3dir/gfx/icon16/picture_link.png new file mode 100644 index 00000000..42dca744 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/picture_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/picture_save.png b/base/resources.pk3dir/gfx/icon16/picture_save.png new file mode 100644 index 00000000..777fb5d2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/picture_save.png differ diff --git a/base/resources.pk3dir/gfx/icon16/pictures.png b/base/resources.pk3dir/gfx/icon16/pictures.png new file mode 100644 index 00000000..d9591c13 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/pictures.png differ diff --git a/base/resources.pk3dir/gfx/icon16/pilcrow.png b/base/resources.pk3dir/gfx/icon16/pilcrow.png new file mode 100644 index 00000000..95704fba Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/pilcrow.png differ diff --git a/base/resources.pk3dir/gfx/icon16/pill.png b/base/resources.pk3dir/gfx/icon16/pill.png new file mode 100644 index 00000000..f2bdef6b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/pill.png differ diff --git a/base/resources.pk3dir/gfx/icon16/pill_add.png b/base/resources.pk3dir/gfx/icon16/pill_add.png new file mode 100644 index 00000000..ac9c2df6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/pill_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/pill_delete.png b/base/resources.pk3dir/gfx/icon16/pill_delete.png new file mode 100644 index 00000000..c61592e8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/pill_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/pill_go.png b/base/resources.pk3dir/gfx/icon16/pill_go.png new file mode 100644 index 00000000..e5c07d41 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/pill_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/plugin.png b/base/resources.pk3dir/gfx/icon16/plugin.png new file mode 100644 index 00000000..6187b15a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/plugin.png differ diff --git a/base/resources.pk3dir/gfx/icon16/plugin_add.png b/base/resources.pk3dir/gfx/icon16/plugin_add.png new file mode 100644 index 00000000..ae43690e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/plugin_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/plugin_delete.png b/base/resources.pk3dir/gfx/icon16/plugin_delete.png new file mode 100644 index 00000000..d9c3376d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/plugin_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/plugin_disabled.png b/base/resources.pk3dir/gfx/icon16/plugin_disabled.png new file mode 100644 index 00000000..f4f6be59 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/plugin_disabled.png differ diff --git a/base/resources.pk3dir/gfx/icon16/plugin_edit.png b/base/resources.pk3dir/gfx/icon16/plugin_edit.png new file mode 100644 index 00000000..b6cb0ecf Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/plugin_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/plugin_error.png b/base/resources.pk3dir/gfx/icon16/plugin_error.png new file mode 100644 index 00000000..cff65d7f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/plugin_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/plugin_go.png b/base/resources.pk3dir/gfx/icon16/plugin_go.png new file mode 100644 index 00000000..41da9913 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/plugin_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/plugin_link.png b/base/resources.pk3dir/gfx/icon16/plugin_link.png new file mode 100644 index 00000000..445c1886 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/plugin_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/printer.png b/base/resources.pk3dir/gfx/icon16/printer.png new file mode 100644 index 00000000..a350d187 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/printer.png differ diff --git a/base/resources.pk3dir/gfx/icon16/printer_add.png b/base/resources.pk3dir/gfx/icon16/printer_add.png new file mode 100644 index 00000000..d228d058 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/printer_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/printer_delete.png b/base/resources.pk3dir/gfx/icon16/printer_delete.png new file mode 100644 index 00000000..1d8605f2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/printer_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/printer_empty.png b/base/resources.pk3dir/gfx/icon16/printer_empty.png new file mode 100644 index 00000000..94e8c161 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/printer_empty.png differ diff --git a/base/resources.pk3dir/gfx/icon16/printer_error.png b/base/resources.pk3dir/gfx/icon16/printer_error.png new file mode 100644 index 00000000..279ebb0e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/printer_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/rainbow.png b/base/resources.pk3dir/gfx/icon16/rainbow.png new file mode 100644 index 00000000..5ede989a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/rainbow.png differ diff --git a/base/resources.pk3dir/gfx/icon16/report.png b/base/resources.pk3dir/gfx/icon16/report.png new file mode 100644 index 00000000..779ad58e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/report.png differ diff --git a/base/resources.pk3dir/gfx/icon16/report_add.png b/base/resources.pk3dir/gfx/icon16/report_add.png new file mode 100644 index 00000000..d5eac9bc Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/report_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/report_delete.png b/base/resources.pk3dir/gfx/icon16/report_delete.png new file mode 100644 index 00000000..dcce0b64 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/report_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/report_disk.png b/base/resources.pk3dir/gfx/icon16/report_disk.png new file mode 100644 index 00000000..1c856cd6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/report_disk.png differ diff --git a/base/resources.pk3dir/gfx/icon16/report_edit.png b/base/resources.pk3dir/gfx/icon16/report_edit.png new file mode 100644 index 00000000..c61a6d84 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/report_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/report_go.png b/base/resources.pk3dir/gfx/icon16/report_go.png new file mode 100644 index 00000000..f35a9793 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/report_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/report_key.png b/base/resources.pk3dir/gfx/icon16/report_key.png new file mode 100644 index 00000000..90b758e8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/report_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/report_link.png b/base/resources.pk3dir/gfx/icon16/report_link.png new file mode 100644 index 00000000..23f2611e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/report_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/report_magnify.png b/base/resources.pk3dir/gfx/icon16/report_magnify.png new file mode 100644 index 00000000..aeaa8895 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/report_magnify.png differ diff --git a/base/resources.pk3dir/gfx/icon16/report_picture.png b/base/resources.pk3dir/gfx/icon16/report_picture.png new file mode 100644 index 00000000..3a9a7e5e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/report_picture.png differ diff --git a/base/resources.pk3dir/gfx/icon16/report_user.png b/base/resources.pk3dir/gfx/icon16/report_user.png new file mode 100644 index 00000000..7766edd7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/report_user.png differ diff --git a/base/resources.pk3dir/gfx/icon16/report_word.png b/base/resources.pk3dir/gfx/icon16/report_word.png new file mode 100644 index 00000000..99513424 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/report_word.png differ diff --git a/base/resources.pk3dir/gfx/icon16/resultset_first.png b/base/resources.pk3dir/gfx/icon16/resultset_first.png new file mode 100644 index 00000000..b03eaf8b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/resultset_first.png differ diff --git a/base/resources.pk3dir/gfx/icon16/resultset_last.png b/base/resources.pk3dir/gfx/icon16/resultset_last.png new file mode 100644 index 00000000..8ec89478 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/resultset_last.png differ diff --git a/base/resources.pk3dir/gfx/icon16/resultset_next.png b/base/resources.pk3dir/gfx/icon16/resultset_next.png new file mode 100644 index 00000000..e252606d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/resultset_next.png differ diff --git a/base/resources.pk3dir/gfx/icon16/resultset_previous.png b/base/resources.pk3dir/gfx/icon16/resultset_previous.png new file mode 100644 index 00000000..18f9cc10 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/resultset_previous.png differ diff --git a/base/resources.pk3dir/gfx/icon16/rosette.png b/base/resources.pk3dir/gfx/icon16/rosette.png new file mode 100644 index 00000000..f233bc77 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/rosette.png differ diff --git a/base/resources.pk3dir/gfx/icon16/rss.png b/base/resources.pk3dir/gfx/icon16/rss.png new file mode 100644 index 00000000..1dc6ff30 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/rss.png differ diff --git a/base/resources.pk3dir/gfx/icon16/rss_add.png b/base/resources.pk3dir/gfx/icon16/rss_add.png new file mode 100644 index 00000000..b590beb7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/rss_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/rss_delete.png b/base/resources.pk3dir/gfx/icon16/rss_delete.png new file mode 100644 index 00000000..9deb738d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/rss_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/rss_go.png b/base/resources.pk3dir/gfx/icon16/rss_go.png new file mode 100644 index 00000000..43a86bff Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/rss_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/rss_valid.png b/base/resources.pk3dir/gfx/icon16/rss_valid.png new file mode 100644 index 00000000..a6d0b0e8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/rss_valid.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ruby.png b/base/resources.pk3dir/gfx/icon16/ruby.png new file mode 100644 index 00000000..f763a168 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ruby.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ruby_add.png b/base/resources.pk3dir/gfx/icon16/ruby_add.png new file mode 100644 index 00000000..a2cd648f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ruby_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ruby_delete.png b/base/resources.pk3dir/gfx/icon16/ruby_delete.png new file mode 100644 index 00000000..30022630 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ruby_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ruby_gear.png b/base/resources.pk3dir/gfx/icon16/ruby_gear.png new file mode 100644 index 00000000..4a10590b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ruby_gear.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ruby_get.png b/base/resources.pk3dir/gfx/icon16/ruby_get.png new file mode 100644 index 00000000..f5203c7e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ruby_get.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ruby_go.png b/base/resources.pk3dir/gfx/icon16/ruby_go.png new file mode 100644 index 00000000..d8d276e3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ruby_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ruby_key.png b/base/resources.pk3dir/gfx/icon16/ruby_key.png new file mode 100644 index 00000000..451cfebe Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ruby_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ruby_link.png b/base/resources.pk3dir/gfx/icon16/ruby_link.png new file mode 100644 index 00000000..bf4be526 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ruby_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/ruby_put.png b/base/resources.pk3dir/gfx/icon16/ruby_put.png new file mode 100644 index 00000000..e026323c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/ruby_put.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script.png b/base/resources.pk3dir/gfx/icon16/script.png new file mode 100644 index 00000000..0f9ed4d4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_add.png b/base/resources.pk3dir/gfx/icon16/script_add.png new file mode 100644 index 00000000..d650552d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_code.png b/base/resources.pk3dir/gfx/icon16/script_code.png new file mode 100644 index 00000000..63fe6cef Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_code.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_code_red.png b/base/resources.pk3dir/gfx/icon16/script_code_red.png new file mode 100644 index 00000000..8fcf0f09 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_code_red.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_delete.png b/base/resources.pk3dir/gfx/icon16/script_delete.png new file mode 100644 index 00000000..e6500ced Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_edit.png b/base/resources.pk3dir/gfx/icon16/script_edit.png new file mode 100644 index 00000000..b4d31ce2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_error.png b/base/resources.pk3dir/gfx/icon16/script_error.png new file mode 100644 index 00000000..04919548 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_gear.png b/base/resources.pk3dir/gfx/icon16/script_gear.png new file mode 100644 index 00000000..56fcf84a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_gear.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_go.png b/base/resources.pk3dir/gfx/icon16/script_go.png new file mode 100644 index 00000000..8e154e23 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_key.png b/base/resources.pk3dir/gfx/icon16/script_key.png new file mode 100644 index 00000000..49bb24d7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_lightning.png b/base/resources.pk3dir/gfx/icon16/script_lightning.png new file mode 100644 index 00000000..b3fa18ce Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_lightning.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_link.png b/base/resources.pk3dir/gfx/icon16/script_link.png new file mode 100644 index 00000000..bdeb9852 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_palette.png b/base/resources.pk3dir/gfx/icon16/script_palette.png new file mode 100644 index 00000000..6d46962d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_palette.png differ diff --git a/base/resources.pk3dir/gfx/icon16/script_save.png b/base/resources.pk3dir/gfx/icon16/script_save.png new file mode 100644 index 00000000..36216d82 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/script_save.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server.png b/base/resources.pk3dir/gfx/icon16/server.png new file mode 100644 index 00000000..720a237c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_add.png b/base/resources.pk3dir/gfx/icon16/server_add.png new file mode 100644 index 00000000..3f10a3a9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_chart.png b/base/resources.pk3dir/gfx/icon16/server_chart.png new file mode 100644 index 00000000..1128d3f3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_chart.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_compressed.png b/base/resources.pk3dir/gfx/icon16/server_compressed.png new file mode 100644 index 00000000..bf49fad9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_compressed.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_connect.png b/base/resources.pk3dir/gfx/icon16/server_connect.png new file mode 100644 index 00000000..49b26914 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_connect.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_database.png b/base/resources.pk3dir/gfx/icon16/server_database.png new file mode 100644 index 00000000..b24e826c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_database.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_delete.png b/base/resources.pk3dir/gfx/icon16/server_delete.png new file mode 100644 index 00000000..61e740fe Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_edit.png b/base/resources.pk3dir/gfx/icon16/server_edit.png new file mode 100644 index 00000000..dc762537 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_error.png b/base/resources.pk3dir/gfx/icon16/server_error.png new file mode 100644 index 00000000..f6402563 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_go.png b/base/resources.pk3dir/gfx/icon16/server_go.png new file mode 100644 index 00000000..540c8e26 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_key.png b/base/resources.pk3dir/gfx/icon16/server_key.png new file mode 100644 index 00000000..ecd51742 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_lightning.png b/base/resources.pk3dir/gfx/icon16/server_lightning.png new file mode 100644 index 00000000..b0f4e46c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_lightning.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_link.png b/base/resources.pk3dir/gfx/icon16/server_link.png new file mode 100644 index 00000000..e8821dfd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/server_uncompressed.png b/base/resources.pk3dir/gfx/icon16/server_uncompressed.png new file mode 100644 index 00000000..86e8325b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/server_uncompressed.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shading.png b/base/resources.pk3dir/gfx/icon16/shading.png new file mode 100644 index 00000000..09275f9c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shading.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_align_bottom.png b/base/resources.pk3dir/gfx/icon16/shape_align_bottom.png new file mode 100644 index 00000000..55d26940 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_align_bottom.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_align_center.png b/base/resources.pk3dir/gfx/icon16/shape_align_center.png new file mode 100644 index 00000000..efe9a98e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_align_center.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_align_left.png b/base/resources.pk3dir/gfx/icon16/shape_align_left.png new file mode 100644 index 00000000..aaedc41b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_align_left.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_align_middle.png b/base/resources.pk3dir/gfx/icon16/shape_align_middle.png new file mode 100644 index 00000000..d350dd88 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_align_middle.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_align_right.png b/base/resources.pk3dir/gfx/icon16/shape_align_right.png new file mode 100644 index 00000000..ff556b6a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_align_right.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_align_top.png b/base/resources.pk3dir/gfx/icon16/shape_align_top.png new file mode 100644 index 00000000..1181b43f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_align_top.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_flip_horizontal.png b/base/resources.pk3dir/gfx/icon16/shape_flip_horizontal.png new file mode 100644 index 00000000..8667c81f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_flip_horizontal.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_flip_vertical.png b/base/resources.pk3dir/gfx/icon16/shape_flip_vertical.png new file mode 100644 index 00000000..0bd66d19 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_flip_vertical.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_group.png b/base/resources.pk3dir/gfx/icon16/shape_group.png new file mode 100644 index 00000000..bb2ff516 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_group.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_handles.png b/base/resources.pk3dir/gfx/icon16/shape_handles.png new file mode 100644 index 00000000..ce27fe3a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_handles.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_move_back.png b/base/resources.pk3dir/gfx/icon16/shape_move_back.png new file mode 100644 index 00000000..a216ffd3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_move_back.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_move_backwards.png b/base/resources.pk3dir/gfx/icon16/shape_move_backwards.png new file mode 100644 index 00000000..ee3f9b27 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_move_backwards.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_move_forwards.png b/base/resources.pk3dir/gfx/icon16/shape_move_forwards.png new file mode 100644 index 00000000..cfe44932 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_move_forwards.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_move_front.png b/base/resources.pk3dir/gfx/icon16/shape_move_front.png new file mode 100644 index 00000000..b4a4e3b7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_move_front.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_rotate_anticlockwise.png b/base/resources.pk3dir/gfx/icon16/shape_rotate_anticlockwise.png new file mode 100644 index 00000000..07a30206 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_rotate_anticlockwise.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_rotate_clockwise.png b/base/resources.pk3dir/gfx/icon16/shape_rotate_clockwise.png new file mode 100644 index 00000000..b99db7d7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_rotate_clockwise.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_square.png b/base/resources.pk3dir/gfx/icon16/shape_square.png new file mode 100644 index 00000000..33af0460 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_square.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_square_add.png b/base/resources.pk3dir/gfx/icon16/shape_square_add.png new file mode 100644 index 00000000..31edfce5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_square_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_square_delete.png b/base/resources.pk3dir/gfx/icon16/shape_square_delete.png new file mode 100644 index 00000000..ede912de Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_square_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_square_edit.png b/base/resources.pk3dir/gfx/icon16/shape_square_edit.png new file mode 100644 index 00000000..d28dc6b1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_square_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_square_error.png b/base/resources.pk3dir/gfx/icon16/shape_square_error.png new file mode 100644 index 00000000..0d0dcfa9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_square_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_square_go.png b/base/resources.pk3dir/gfx/icon16/shape_square_go.png new file mode 100644 index 00000000..5a2ad901 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_square_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_square_key.png b/base/resources.pk3dir/gfx/icon16/shape_square_key.png new file mode 100644 index 00000000..c34b982a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_square_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_square_link.png b/base/resources.pk3dir/gfx/icon16/shape_square_link.png new file mode 100644 index 00000000..b885fcc6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_square_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shape_ungroup.png b/base/resources.pk3dir/gfx/icon16/shape_ungroup.png new file mode 100644 index 00000000..3a6f369a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shape_ungroup.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shield.png b/base/resources.pk3dir/gfx/icon16/shield.png new file mode 100644 index 00000000..3cb4e257 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shield.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shield_add.png b/base/resources.pk3dir/gfx/icon16/shield_add.png new file mode 100644 index 00000000..e20a1b4a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shield_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shield_delete.png b/base/resources.pk3dir/gfx/icon16/shield_delete.png new file mode 100644 index 00000000..22823a70 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shield_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/shield_go.png b/base/resources.pk3dir/gfx/icon16/shield_go.png new file mode 100644 index 00000000..e9bd8522 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/shield_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sitemap.png b/base/resources.pk3dir/gfx/icon16/sitemap.png new file mode 100644 index 00000000..ca779f32 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sitemap.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sitemap_color.png b/base/resources.pk3dir/gfx/icon16/sitemap_color.png new file mode 100644 index 00000000..c64582bc Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sitemap_color.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sound.png b/base/resources.pk3dir/gfx/icon16/sound.png new file mode 100644 index 00000000..6056d234 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sound.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sound_add.png b/base/resources.pk3dir/gfx/icon16/sound_add.png new file mode 100644 index 00000000..965c503c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sound_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sound_delete.png b/base/resources.pk3dir/gfx/icon16/sound_delete.png new file mode 100644 index 00000000..ab9577aa Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sound_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sound_low.png b/base/resources.pk3dir/gfx/icon16/sound_low.png new file mode 100644 index 00000000..4d918633 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sound_low.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sound_mute.png b/base/resources.pk3dir/gfx/icon16/sound_mute.png new file mode 100644 index 00000000..b652d2a7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sound_mute.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sound_none.png b/base/resources.pk3dir/gfx/icon16/sound_none.png new file mode 100644 index 00000000..b497ebd5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sound_none.png differ diff --git a/base/resources.pk3dir/gfx/icon16/spellcheck.png b/base/resources.pk3dir/gfx/icon16/spellcheck.png new file mode 100644 index 00000000..ebc632d9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/spellcheck.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sport_8ball.png b/base/resources.pk3dir/gfx/icon16/sport_8ball.png new file mode 100644 index 00000000..4f627b76 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sport_8ball.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sport_basketball.png b/base/resources.pk3dir/gfx/icon16/sport_basketball.png new file mode 100644 index 00000000..f7a000b9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sport_basketball.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sport_football.png b/base/resources.pk3dir/gfx/icon16/sport_football.png new file mode 100644 index 00000000..199f0f7f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sport_football.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sport_golf.png b/base/resources.pk3dir/gfx/icon16/sport_golf.png new file mode 100644 index 00000000..e21fa44c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sport_golf.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sport_raquet.png b/base/resources.pk3dir/gfx/icon16/sport_raquet.png new file mode 100644 index 00000000..f5e0f0c2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sport_raquet.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sport_shuttlecock.png b/base/resources.pk3dir/gfx/icon16/sport_shuttlecock.png new file mode 100644 index 00000000..917287fa Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sport_shuttlecock.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sport_soccer.png b/base/resources.pk3dir/gfx/icon16/sport_soccer.png new file mode 100644 index 00000000..3eb1828b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sport_soccer.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sport_tennis.png b/base/resources.pk3dir/gfx/icon16/sport_tennis.png new file mode 100644 index 00000000..e88a6efa Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sport_tennis.png differ diff --git a/base/resources.pk3dir/gfx/icon16/star.png b/base/resources.pk3dir/gfx/icon16/star.png new file mode 100644 index 00000000..b88c8578 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/star.png differ diff --git a/base/resources.pk3dir/gfx/icon16/status_away.png b/base/resources.pk3dir/gfx/icon16/status_away.png new file mode 100644 index 00000000..70bcbcca Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/status_away.png differ diff --git a/base/resources.pk3dir/gfx/icon16/status_busy.png b/base/resources.pk3dir/gfx/icon16/status_busy.png new file mode 100644 index 00000000..987c806f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/status_busy.png differ diff --git a/base/resources.pk3dir/gfx/icon16/status_offline.png b/base/resources.pk3dir/gfx/icon16/status_offline.png new file mode 100644 index 00000000..a88261a6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/status_offline.png differ diff --git a/base/resources.pk3dir/gfx/icon16/status_online.png b/base/resources.pk3dir/gfx/icon16/status_online.png new file mode 100644 index 00000000..947bd4b6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/status_online.png differ diff --git a/base/resources.pk3dir/gfx/icon16/stop.png b/base/resources.pk3dir/gfx/icon16/stop.png new file mode 100644 index 00000000..0cfd5859 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/stop.png differ diff --git a/base/resources.pk3dir/gfx/icon16/style.png b/base/resources.pk3dir/gfx/icon16/style.png new file mode 100644 index 00000000..81e41de7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/style.png differ diff --git a/base/resources.pk3dir/gfx/icon16/style_add.png b/base/resources.pk3dir/gfx/icon16/style_add.png new file mode 100644 index 00000000..e0369c6b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/style_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/style_delete.png b/base/resources.pk3dir/gfx/icon16/style_delete.png new file mode 100644 index 00000000..640f187e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/style_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/style_edit.png b/base/resources.pk3dir/gfx/icon16/style_edit.png new file mode 100644 index 00000000..25bb5b67 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/style_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/style_go.png b/base/resources.pk3dir/gfx/icon16/style_go.png new file mode 100644 index 00000000..25d6181a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/style_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/sum.png b/base/resources.pk3dir/gfx/icon16/sum.png new file mode 100644 index 00000000..fd7b32e4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/sum.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tab.png b/base/resources.pk3dir/gfx/icon16/tab.png new file mode 100644 index 00000000..3d8207fd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tab.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tab_add.png b/base/resources.pk3dir/gfx/icon16/tab_add.png new file mode 100644 index 00000000..d3b99364 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tab_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tab_delete.png b/base/resources.pk3dir/gfx/icon16/tab_delete.png new file mode 100644 index 00000000..100da2f1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tab_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tab_edit.png b/base/resources.pk3dir/gfx/icon16/tab_edit.png new file mode 100644 index 00000000..4c09c0fd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tab_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tab_go.png b/base/resources.pk3dir/gfx/icon16/tab_go.png new file mode 100644 index 00000000..844ce04b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tab_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table.png b/base/resources.pk3dir/gfx/icon16/table.png new file mode 100644 index 00000000..abcd9368 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_add.png b/base/resources.pk3dir/gfx/icon16/table_add.png new file mode 100644 index 00000000..2a3e5c4d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_delete.png b/base/resources.pk3dir/gfx/icon16/table_delete.png new file mode 100644 index 00000000..b85916d9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_edit.png b/base/resources.pk3dir/gfx/icon16/table_edit.png new file mode 100644 index 00000000..bfcb0249 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_error.png b/base/resources.pk3dir/gfx/icon16/table_error.png new file mode 100644 index 00000000..589e92b5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_gear.png b/base/resources.pk3dir/gfx/icon16/table_gear.png new file mode 100644 index 00000000..cfc2702a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_gear.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_go.png b/base/resources.pk3dir/gfx/icon16/table_go.png new file mode 100644 index 00000000..0528dfa2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_key.png b/base/resources.pk3dir/gfx/icon16/table_key.png new file mode 100644 index 00000000..34e23e24 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_lightning.png b/base/resources.pk3dir/gfx/icon16/table_lightning.png new file mode 100644 index 00000000..612612b5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_lightning.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_link.png b/base/resources.pk3dir/gfx/icon16/table_link.png new file mode 100644 index 00000000..decac8a6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_multiple.png b/base/resources.pk3dir/gfx/icon16/table_multiple.png new file mode 100644 index 00000000..d76448e3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_multiple.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_refresh.png b/base/resources.pk3dir/gfx/icon16/table_refresh.png new file mode 100644 index 00000000..ab92010c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_refresh.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_relationship.png b/base/resources.pk3dir/gfx/icon16/table_relationship.png new file mode 100644 index 00000000..28b8505c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_relationship.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_row_delete.png b/base/resources.pk3dir/gfx/icon16/table_row_delete.png new file mode 100644 index 00000000..54c69691 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_row_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_row_insert.png b/base/resources.pk3dir/gfx/icon16/table_row_insert.png new file mode 100644 index 00000000..ff5925ef Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_row_insert.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_save.png b/base/resources.pk3dir/gfx/icon16/table_save.png new file mode 100644 index 00000000..25b74d18 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_save.png differ diff --git a/base/resources.pk3dir/gfx/icon16/table_sort.png b/base/resources.pk3dir/gfx/icon16/table_sort.png new file mode 100644 index 00000000..ed6785a6 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/table_sort.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tag.png b/base/resources.pk3dir/gfx/icon16/tag.png new file mode 100644 index 00000000..e093032a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tag.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tag_blue.png b/base/resources.pk3dir/gfx/icon16/tag_blue.png new file mode 100644 index 00000000..9757fc6e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tag_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tag_blue_add.png b/base/resources.pk3dir/gfx/icon16/tag_blue_add.png new file mode 100644 index 00000000..f135248f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tag_blue_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tag_blue_delete.png b/base/resources.pk3dir/gfx/icon16/tag_blue_delete.png new file mode 100644 index 00000000..9fbae672 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tag_blue_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tag_blue_edit.png b/base/resources.pk3dir/gfx/icon16/tag_blue_edit.png new file mode 100644 index 00000000..2a9f6266 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tag_blue_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tag_green.png b/base/resources.pk3dir/gfx/icon16/tag_green.png new file mode 100644 index 00000000..83ec984b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tag_green.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tag_orange.png b/base/resources.pk3dir/gfx/icon16/tag_orange.png new file mode 100644 index 00000000..454a59f3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tag_orange.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tag_pink.png b/base/resources.pk3dir/gfx/icon16/tag_pink.png new file mode 100644 index 00000000..76e2296c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tag_pink.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tag_purple.png b/base/resources.pk3dir/gfx/icon16/tag_purple.png new file mode 100644 index 00000000..ebaf0e87 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tag_purple.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tag_red.png b/base/resources.pk3dir/gfx/icon16/tag_red.png new file mode 100644 index 00000000..6ebb37d2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tag_red.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tag_yellow.png b/base/resources.pk3dir/gfx/icon16/tag_yellow.png new file mode 100644 index 00000000..83d12924 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tag_yellow.png differ diff --git a/base/resources.pk3dir/gfx/icon16/telephone.png b/base/resources.pk3dir/gfx/icon16/telephone.png new file mode 100644 index 00000000..cecc436f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/telephone.png differ diff --git a/base/resources.pk3dir/gfx/icon16/telephone_add.png b/base/resources.pk3dir/gfx/icon16/telephone_add.png new file mode 100644 index 00000000..5591cfc4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/telephone_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/telephone_delete.png b/base/resources.pk3dir/gfx/icon16/telephone_delete.png new file mode 100644 index 00000000..0013268e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/telephone_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/telephone_edit.png b/base/resources.pk3dir/gfx/icon16/telephone_edit.png new file mode 100644 index 00000000..bcf6d7ec Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/telephone_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/telephone_error.png b/base/resources.pk3dir/gfx/icon16/telephone_error.png new file mode 100644 index 00000000..d3ec3a11 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/telephone_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/telephone_go.png b/base/resources.pk3dir/gfx/icon16/telephone_go.png new file mode 100644 index 00000000..395c8fbf Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/telephone_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/telephone_key.png b/base/resources.pk3dir/gfx/icon16/telephone_key.png new file mode 100644 index 00000000..cef5dec4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/telephone_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/telephone_link.png b/base/resources.pk3dir/gfx/icon16/telephone_link.png new file mode 100644 index 00000000..ef1ee5dd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/telephone_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/television.png b/base/resources.pk3dir/gfx/icon16/television.png new file mode 100644 index 00000000..1738a4f1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/television.png differ diff --git a/base/resources.pk3dir/gfx/icon16/television_add.png b/base/resources.pk3dir/gfx/icon16/television_add.png new file mode 100644 index 00000000..2baaad99 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/television_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/television_delete.png b/base/resources.pk3dir/gfx/icon16/television_delete.png new file mode 100644 index 00000000..b9a58602 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/television_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_align_center.png b/base/resources.pk3dir/gfx/icon16/text_align_center.png new file mode 100644 index 00000000..57beb381 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_align_center.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_align_justify.png b/base/resources.pk3dir/gfx/icon16/text_align_justify.png new file mode 100644 index 00000000..2fbdd692 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_align_justify.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_align_left.png b/base/resources.pk3dir/gfx/icon16/text_align_left.png new file mode 100644 index 00000000..6c8fcc11 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_align_left.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_align_right.png b/base/resources.pk3dir/gfx/icon16/text_align_right.png new file mode 100644 index 00000000..a1502571 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_align_right.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_allcaps.png b/base/resources.pk3dir/gfx/icon16/text_allcaps.png new file mode 100644 index 00000000..280fd442 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_allcaps.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_bold.png b/base/resources.pk3dir/gfx/icon16/text_bold.png new file mode 100644 index 00000000..889ae80e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_bold.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_columns.png b/base/resources.pk3dir/gfx/icon16/text_columns.png new file mode 100644 index 00000000..97b2e035 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_columns.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_dropcaps.png b/base/resources.pk3dir/gfx/icon16/text_dropcaps.png new file mode 100644 index 00000000..dd65786a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_dropcaps.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_heading_1.png b/base/resources.pk3dir/gfx/icon16/text_heading_1.png new file mode 100644 index 00000000..9c122e91 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_heading_1.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_heading_2.png b/base/resources.pk3dir/gfx/icon16/text_heading_2.png new file mode 100644 index 00000000..fbd87657 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_heading_2.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_heading_3.png b/base/resources.pk3dir/gfx/icon16/text_heading_3.png new file mode 100644 index 00000000..c7836cf0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_heading_3.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_heading_4.png b/base/resources.pk3dir/gfx/icon16/text_heading_4.png new file mode 100644 index 00000000..4e929eaf Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_heading_4.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_heading_5.png b/base/resources.pk3dir/gfx/icon16/text_heading_5.png new file mode 100644 index 00000000..30cabebf Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_heading_5.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_heading_6.png b/base/resources.pk3dir/gfx/icon16/text_heading_6.png new file mode 100644 index 00000000..058170a2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_heading_6.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_horizontalrule.png b/base/resources.pk3dir/gfx/icon16/text_horizontalrule.png new file mode 100644 index 00000000..8dd1da1c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_horizontalrule.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_indent.png b/base/resources.pk3dir/gfx/icon16/text_indent.png new file mode 100644 index 00000000..93645323 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_indent.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_indent_remove.png b/base/resources.pk3dir/gfx/icon16/text_indent_remove.png new file mode 100644 index 00000000..1651b074 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_indent_remove.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_italic.png b/base/resources.pk3dir/gfx/icon16/text_italic.png new file mode 100644 index 00000000..8482ac8c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_italic.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_kerning.png b/base/resources.pk3dir/gfx/icon16/text_kerning.png new file mode 100644 index 00000000..377def64 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_kerning.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_letter_omega.png b/base/resources.pk3dir/gfx/icon16/text_letter_omega.png new file mode 100644 index 00000000..5075ec6b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_letter_omega.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_letterspacing.png b/base/resources.pk3dir/gfx/icon16/text_letterspacing.png new file mode 100644 index 00000000..41390f54 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_letterspacing.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_linespacing.png b/base/resources.pk3dir/gfx/icon16/text_linespacing.png new file mode 100644 index 00000000..1a91cbdd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_linespacing.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_list_bullets.png b/base/resources.pk3dir/gfx/icon16/text_list_bullets.png new file mode 100644 index 00000000..4a8672bd Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_list_bullets.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_list_numbers.png b/base/resources.pk3dir/gfx/icon16/text_list_numbers.png new file mode 100644 index 00000000..33b0b8df Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_list_numbers.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_lowercase.png b/base/resources.pk3dir/gfx/icon16/text_lowercase.png new file mode 100644 index 00000000..382a102e Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_lowercase.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_padding_bottom.png b/base/resources.pk3dir/gfx/icon16/text_padding_bottom.png new file mode 100644 index 00000000..4880c43a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_padding_bottom.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_padding_left.png b/base/resources.pk3dir/gfx/icon16/text_padding_left.png new file mode 100644 index 00000000..b55482ee Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_padding_left.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_padding_right.png b/base/resources.pk3dir/gfx/icon16/text_padding_right.png new file mode 100644 index 00000000..106edae5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_padding_right.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_padding_top.png b/base/resources.pk3dir/gfx/icon16/text_padding_top.png new file mode 100644 index 00000000..c5c45b2d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_padding_top.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_replace.png b/base/resources.pk3dir/gfx/icon16/text_replace.png new file mode 100644 index 00000000..877f82fe Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_replace.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_signature.png b/base/resources.pk3dir/gfx/icon16/text_signature.png new file mode 100644 index 00000000..c72fd808 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_signature.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_smallcaps.png b/base/resources.pk3dir/gfx/icon16/text_smallcaps.png new file mode 100644 index 00000000..5b98a6e1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_smallcaps.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_strikethrough.png b/base/resources.pk3dir/gfx/icon16/text_strikethrough.png new file mode 100644 index 00000000..612058a7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_strikethrough.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_subscript.png b/base/resources.pk3dir/gfx/icon16/text_subscript.png new file mode 100644 index 00000000..1a2b0101 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_subscript.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_superscript.png b/base/resources.pk3dir/gfx/icon16/text_superscript.png new file mode 100644 index 00000000..2fb2a7c7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_superscript.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_underline.png b/base/resources.pk3dir/gfx/icon16/text_underline.png new file mode 100644 index 00000000..90d0df28 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_underline.png differ diff --git a/base/resources.pk3dir/gfx/icon16/text_uppercase.png b/base/resources.pk3dir/gfx/icon16/text_uppercase.png new file mode 100644 index 00000000..8dcc2dbb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/text_uppercase.png differ diff --git a/base/resources.pk3dir/gfx/icon16/textfield.png b/base/resources.pk3dir/gfx/icon16/textfield.png new file mode 100644 index 00000000..d37e7304 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/textfield.png differ diff --git a/base/resources.pk3dir/gfx/icon16/textfield_add.png b/base/resources.pk3dir/gfx/icon16/textfield_add.png new file mode 100644 index 00000000..204de723 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/textfield_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/textfield_delete.png b/base/resources.pk3dir/gfx/icon16/textfield_delete.png new file mode 100644 index 00000000..c7bd58b2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/textfield_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/textfield_key.png b/base/resources.pk3dir/gfx/icon16/textfield_key.png new file mode 100644 index 00000000..a9d5e4f8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/textfield_key.png differ diff --git a/base/resources.pk3dir/gfx/icon16/textfield_rename.png b/base/resources.pk3dir/gfx/icon16/textfield_rename.png new file mode 100644 index 00000000..4e3688ed Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/textfield_rename.png differ diff --git a/base/resources.pk3dir/gfx/icon16/thumb_down.png b/base/resources.pk3dir/gfx/icon16/thumb_down.png new file mode 100644 index 00000000..3c832d4c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/thumb_down.png differ diff --git a/base/resources.pk3dir/gfx/icon16/thumb_up.png b/base/resources.pk3dir/gfx/icon16/thumb_up.png new file mode 100644 index 00000000..2bd16ccf Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/thumb_up.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tick.png b/base/resources.pk3dir/gfx/icon16/tick.png new file mode 100644 index 00000000..a9925a06 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tick.png differ diff --git a/base/resources.pk3dir/gfx/icon16/time.png b/base/resources.pk3dir/gfx/icon16/time.png new file mode 100644 index 00000000..911da3f1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/time.png differ diff --git a/base/resources.pk3dir/gfx/icon16/time_add.png b/base/resources.pk3dir/gfx/icon16/time_add.png new file mode 100644 index 00000000..dcc45cb2 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/time_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/time_delete.png b/base/resources.pk3dir/gfx/icon16/time_delete.png new file mode 100644 index 00000000..5bf8313c Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/time_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/time_go.png b/base/resources.pk3dir/gfx/icon16/time_go.png new file mode 100644 index 00000000..d451ee06 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/time_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/timeline_marker.png b/base/resources.pk3dir/gfx/icon16/timeline_marker.png new file mode 100644 index 00000000..a3fbddf8 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/timeline_marker.png differ diff --git a/base/resources.pk3dir/gfx/icon16/transmit.png b/base/resources.pk3dir/gfx/icon16/transmit.png new file mode 100644 index 00000000..f54bf736 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/transmit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/transmit_add.png b/base/resources.pk3dir/gfx/icon16/transmit_add.png new file mode 100644 index 00000000..b7fd4e68 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/transmit_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/transmit_blue.png b/base/resources.pk3dir/gfx/icon16/transmit_blue.png new file mode 100644 index 00000000..7b1142fc Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/transmit_blue.png differ diff --git a/base/resources.pk3dir/gfx/icon16/transmit_delete.png b/base/resources.pk3dir/gfx/icon16/transmit_delete.png new file mode 100644 index 00000000..3d72be2a Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/transmit_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/transmit_edit.png b/base/resources.pk3dir/gfx/icon16/transmit_edit.png new file mode 100644 index 00000000..eb9a3dd5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/transmit_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/transmit_error.png b/base/resources.pk3dir/gfx/icon16/transmit_error.png new file mode 100644 index 00000000..fd1d4499 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/transmit_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/transmit_go.png b/base/resources.pk3dir/gfx/icon16/transmit_go.png new file mode 100644 index 00000000..10137e55 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/transmit_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/tux.png b/base/resources.pk3dir/gfx/icon16/tux.png new file mode 100644 index 00000000..bbefe2ec Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/tux.png differ diff --git a/base/resources.pk3dir/gfx/icon16/user.png b/base/resources.pk3dir/gfx/icon16/user.png new file mode 100644 index 00000000..79f35ccb Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/user.png differ diff --git a/base/resources.pk3dir/gfx/icon16/user_add.png b/base/resources.pk3dir/gfx/icon16/user_add.png new file mode 100644 index 00000000..deae99bc Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/user_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/user_comment.png b/base/resources.pk3dir/gfx/icon16/user_comment.png new file mode 100644 index 00000000..e54ebeba Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/user_comment.png differ diff --git a/base/resources.pk3dir/gfx/icon16/user_delete.png b/base/resources.pk3dir/gfx/icon16/user_delete.png new file mode 100644 index 00000000..acbb5630 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/user_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/user_edit.png b/base/resources.pk3dir/gfx/icon16/user_edit.png new file mode 100644 index 00000000..c1974cda Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/user_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/user_female.png b/base/resources.pk3dir/gfx/icon16/user_female.png new file mode 100644 index 00000000..7c71de03 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/user_female.png differ diff --git a/base/resources.pk3dir/gfx/icon16/user_go.png b/base/resources.pk3dir/gfx/icon16/user_go.png new file mode 100644 index 00000000..0468cf08 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/user_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/user_gray.png b/base/resources.pk3dir/gfx/icon16/user_gray.png new file mode 100644 index 00000000..8fd539e9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/user_gray.png differ diff --git a/base/resources.pk3dir/gfx/icon16/user_green.png b/base/resources.pk3dir/gfx/icon16/user_green.png new file mode 100644 index 00000000..30383c2d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/user_green.png differ diff --git a/base/resources.pk3dir/gfx/icon16/user_orange.png b/base/resources.pk3dir/gfx/icon16/user_orange.png new file mode 100644 index 00000000..b818127d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/user_orange.png differ diff --git a/base/resources.pk3dir/gfx/icon16/user_red.png b/base/resources.pk3dir/gfx/icon16/user_red.png new file mode 100644 index 00000000..c6f66e8b Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/user_red.png differ diff --git a/base/resources.pk3dir/gfx/icon16/user_suit.png b/base/resources.pk3dir/gfx/icon16/user_suit.png new file mode 100644 index 00000000..b3454e15 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/user_suit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/vcard.png b/base/resources.pk3dir/gfx/icon16/vcard.png new file mode 100644 index 00000000..c02f315d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/vcard.png differ diff --git a/base/resources.pk3dir/gfx/icon16/vcard_add.png b/base/resources.pk3dir/gfx/icon16/vcard_add.png new file mode 100644 index 00000000..2a684538 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/vcard_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/vcard_delete.png b/base/resources.pk3dir/gfx/icon16/vcard_delete.png new file mode 100644 index 00000000..b194b971 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/vcard_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/vcard_edit.png b/base/resources.pk3dir/gfx/icon16/vcard_edit.png new file mode 100644 index 00000000..ab0f6e73 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/vcard_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/vector.png b/base/resources.pk3dir/gfx/icon16/vector.png new file mode 100644 index 00000000..a1291c2d Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/vector.png differ diff --git a/base/resources.pk3dir/gfx/icon16/vector_add.png b/base/resources.pk3dir/gfx/icon16/vector_add.png new file mode 100644 index 00000000..988770f4 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/vector_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/vector_delete.png b/base/resources.pk3dir/gfx/icon16/vector_delete.png new file mode 100644 index 00000000..ca139e0f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/vector_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/wand.png b/base/resources.pk3dir/gfx/icon16/wand.png new file mode 100644 index 00000000..44ccbf81 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/wand.png differ diff --git a/base/resources.pk3dir/gfx/icon16/weather_clouds.png b/base/resources.pk3dir/gfx/icon16/weather_clouds.png new file mode 100644 index 00000000..3f73eaa1 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/weather_clouds.png differ diff --git a/base/resources.pk3dir/gfx/icon16/weather_cloudy.png b/base/resources.pk3dir/gfx/icon16/weather_cloudy.png new file mode 100644 index 00000000..5856e1d0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/weather_cloudy.png differ diff --git a/base/resources.pk3dir/gfx/icon16/weather_lightning.png b/base/resources.pk3dir/gfx/icon16/weather_lightning.png new file mode 100644 index 00000000..1d42b367 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/weather_lightning.png differ diff --git a/base/resources.pk3dir/gfx/icon16/weather_rain.png b/base/resources.pk3dir/gfx/icon16/weather_rain.png new file mode 100644 index 00000000..cb3d54d0 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/weather_rain.png differ diff --git a/base/resources.pk3dir/gfx/icon16/weather_snow.png b/base/resources.pk3dir/gfx/icon16/weather_snow.png new file mode 100644 index 00000000..45bbdf19 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/weather_snow.png differ diff --git a/base/resources.pk3dir/gfx/icon16/weather_sun.png b/base/resources.pk3dir/gfx/icon16/weather_sun.png new file mode 100644 index 00000000..0156c266 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/weather_sun.png differ diff --git a/base/resources.pk3dir/gfx/icon16/webcam.png b/base/resources.pk3dir/gfx/icon16/webcam.png new file mode 100644 index 00000000..af71c306 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/webcam.png differ diff --git a/base/resources.pk3dir/gfx/icon16/webcam_add.png b/base/resources.pk3dir/gfx/icon16/webcam_add.png new file mode 100644 index 00000000..f02fcfa9 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/webcam_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/webcam_delete.png b/base/resources.pk3dir/gfx/icon16/webcam_delete.png new file mode 100644 index 00000000..bd6277f5 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/webcam_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/webcam_error.png b/base/resources.pk3dir/gfx/icon16/webcam_error.png new file mode 100644 index 00000000..2faa7067 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/webcam_error.png differ diff --git a/base/resources.pk3dir/gfx/icon16/world.png b/base/resources.pk3dir/gfx/icon16/world.png new file mode 100644 index 00000000..68f21d30 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/world.png differ diff --git a/base/resources.pk3dir/gfx/icon16/world_add.png b/base/resources.pk3dir/gfx/icon16/world_add.png new file mode 100644 index 00000000..6d0d7f74 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/world_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/world_delete.png b/base/resources.pk3dir/gfx/icon16/world_delete.png new file mode 100644 index 00000000..ffcd1156 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/world_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/world_edit.png b/base/resources.pk3dir/gfx/icon16/world_edit.png new file mode 100644 index 00000000..00794d40 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/world_edit.png differ diff --git a/base/resources.pk3dir/gfx/icon16/world_go.png b/base/resources.pk3dir/gfx/icon16/world_go.png new file mode 100644 index 00000000..aee9c97f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/world_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/world_link.png b/base/resources.pk3dir/gfx/icon16/world_link.png new file mode 100644 index 00000000..b8edc126 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/world_link.png differ diff --git a/base/resources.pk3dir/gfx/icon16/wrench.png b/base/resources.pk3dir/gfx/icon16/wrench.png new file mode 100644 index 00000000..5c8213fe Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/wrench.png differ diff --git a/base/resources.pk3dir/gfx/icon16/wrench_orange.png b/base/resources.pk3dir/gfx/icon16/wrench_orange.png new file mode 100644 index 00000000..565a9330 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/wrench_orange.png differ diff --git a/base/resources.pk3dir/gfx/icon16/xhtml.png b/base/resources.pk3dir/gfx/icon16/xhtml.png new file mode 100644 index 00000000..da5dbf20 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/xhtml.png differ diff --git a/base/resources.pk3dir/gfx/icon16/xhtml_add.png b/base/resources.pk3dir/gfx/icon16/xhtml_add.png new file mode 100644 index 00000000..bbaf784f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/xhtml_add.png differ diff --git a/base/resources.pk3dir/gfx/icon16/xhtml_delete.png b/base/resources.pk3dir/gfx/icon16/xhtml_delete.png new file mode 100644 index 00000000..157b5201 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/xhtml_delete.png differ diff --git a/base/resources.pk3dir/gfx/icon16/xhtml_go.png b/base/resources.pk3dir/gfx/icon16/xhtml_go.png new file mode 100644 index 00000000..43cf8144 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/xhtml_go.png differ diff --git a/base/resources.pk3dir/gfx/icon16/xhtml_valid.png b/base/resources.pk3dir/gfx/icon16/xhtml_valid.png new file mode 100644 index 00000000..d2e1cfbe Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/xhtml_valid.png differ diff --git a/base/resources.pk3dir/gfx/icon16/zoom.png b/base/resources.pk3dir/gfx/icon16/zoom.png new file mode 100644 index 00000000..908612e3 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/zoom.png differ diff --git a/base/resources.pk3dir/gfx/icon16/zoom_in.png b/base/resources.pk3dir/gfx/icon16/zoom_in.png new file mode 100644 index 00000000..cdf0a52f Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/zoom_in.png differ diff --git a/base/resources.pk3dir/gfx/icon16/zoom_out.png b/base/resources.pk3dir/gfx/icon16/zoom_out.png new file mode 100644 index 00000000..07bf98a7 Binary files /dev/null and b/base/resources.pk3dir/gfx/icon16/zoom_out.png differ diff --git a/base/resources.pk3dir/models/weapons/v_bat/sluggerskin.mat b/base/resources.pk3dir/models/weapons/v_bat/sluggerskin.mat index 04365ac4..216e5f11 100644 --- a/base/resources.pk3dir/models/weapons/v_bat/sluggerskin.mat +++ b/base/resources.pk3dir/models/weapons/v_bat/sluggerskin.mat @@ -2,10 +2,10 @@ { if $programs program vertexlit - diffusemap "models/weapons/slugger/sluggerskin.tga" + diffusemap "models/weapons/v_bat/sluggerskin.tga" else { - map "models/weapons/slugger/sluggerskin.tga" + map "models/weapons/v_bat/sluggerskin.tga" rgbGen lightingDiffuse } endif diff --git a/base/resources.pk3dir/models/weapons/v_bat/sluggerskin_bloody.mat b/base/resources.pk3dir/models/weapons/v_bat/sluggerskin_bloody.mat index 46c64e8e..3e5c688d 100644 --- a/base/resources.pk3dir/models/weapons/v_bat/sluggerskin_bloody.mat +++ b/base/resources.pk3dir/models/weapons/v_bat/sluggerskin_bloody.mat @@ -2,10 +2,10 @@ { if $programs program vertexlit - diffusemap "models/weapons/slugger/sluggerskin_bloody.tga" + diffusemap "models/weapons/v_bat/sluggerskin_bloody.tga" else { - map "models/weapons/slugger/sluggerskin_bloody.tga" + map "models/weapons/v_bat/sluggerskin_bloody.tga" rgbGen lightingDiffuse } endif diff --git a/base/resources.pk3dir/models/weapons/v_frag/grenskin_1.mat b/base/resources.pk3dir/models/weapons/v_frag/grenskin_1.mat index 350bf41a..554d3980 100644 --- a/base/resources.pk3dir/models/weapons/v_frag/grenskin_1.mat +++ b/base/resources.pk3dir/models/weapons/v_frag/grenskin_1.mat @@ -2,10 +2,10 @@ { if $programs program vertexlit - diffusemap "models/weapons/frag/grenskin_1.tga" + diffusemap "models/weapons/v_frag/grenskin_1.tga" else { - map "models/weapons/frag/grenskin_1.tga" + map "models/weapons/v_frag/grenskin_1.tga" rgbGen lightingDiffuse } endif diff --git a/base/resources.pk3dir/models/weapons/v_frag/grenskin_2.mat b/base/resources.pk3dir/models/weapons/v_frag/grenskin_2.mat index 2ac49394..2a65944f 100644 --- a/base/resources.pk3dir/models/weapons/v_frag/grenskin_2.mat +++ b/base/resources.pk3dir/models/weapons/v_frag/grenskin_2.mat @@ -2,10 +2,10 @@ { if $programs program vertexlit - diffusemap "models/weapons/frag/grenskin_2.tga" + diffusemap "models/weapons/v_frag/grenskin_2.tga" else { - map "models/weapons/frag/grenskin_2.tga" + map "models/weapons/v_frag/grenskin_2.tga" rgbGen lightingDiffuse } endif diff --git a/base/resources.pk3dir/models/weapons/v_pistol/coltskin_1.mat b/base/resources.pk3dir/models/weapons/v_pistol/coltskin_1.mat index 76d5d911..870d7d09 100644 --- a/base/resources.pk3dir/models/weapons/v_pistol/coltskin_1.mat +++ b/base/resources.pk3dir/models/weapons/v_pistol/coltskin_1.mat @@ -2,11 +2,11 @@ { if $programs program vertexlit - diffusemap "models/weapons/enforcer/coltskin_1.tga" - normalmap "models/weapons/enforcer/coltskin_1_n.tga" + diffusemap "models/weapons/v_pistol/coltskin_1.tga" + normalmap "models/weapons/v_pistol/coltskin_1_n.tga" else { - map "models/weapons/enforcer/coltskin_1.tga" + map "models/weapons/v_pistol/coltskin_1.tga" rgbGen lightingDiffuse } endif diff --git a/base/resources.pk3dir/models/weapons/v_pistol/coltskin_2.mat b/base/resources.pk3dir/models/weapons/v_pistol/coltskin_2.mat index f05296a5..072cfaba 100644 --- a/base/resources.pk3dir/models/weapons/v_pistol/coltskin_2.mat +++ b/base/resources.pk3dir/models/weapons/v_pistol/coltskin_2.mat @@ -2,11 +2,11 @@ { if $programs program vertexlit - diffusemap "models/weapons/enforcer/coltskin_2.tga" - normalmap "models/weapons/enforcer/coltskin_2_n.tga" + diffusemap "models/weapons/v_pistol/coltskin_2.tga" + normalmap "models/weapons/v_pistol/coltskin_2_n.tga" else { - map "models/weapons/enforcer/coltskin_2.tga" + map "models/weapons/v_pistol/coltskin_2.tga" rgbGen lightingDiffuse } endif diff --git a/base/resources.pk3dir/models/weapons/w_bat/world_slugger.mat b/base/resources.pk3dir/models/weapons/w_bat/world_slugger.mat index 35ab2eeb..b6470e86 100644 --- a/base/resources.pk3dir/models/weapons/w_bat/world_slugger.mat +++ b/base/resources.pk3dir/models/weapons/w_bat/world_slugger.mat @@ -2,10 +2,10 @@ { if $programs program vertexlit - diffusemap "models/items/slugger/world_sluggerskin.tga" + diffusemap "models/weapons/w_bat/world_sluggerskin.tga" else { - map "models/items/slugger/world_sluggerskin.tga" + map "models/weapons/w_bat/world_sluggerskin.tga" rgbGen lightingDiffuse } endif diff --git a/base/resources.pk3dir/models/weapons/w_frag/world_frag.mat b/base/resources.pk3dir/models/weapons/w_frag/world_frag.mat index b80532d7..7e573e13 100644 --- a/base/resources.pk3dir/models/weapons/w_frag/world_frag.mat +++ b/base/resources.pk3dir/models/weapons/w_frag/world_frag.mat @@ -2,10 +2,10 @@ { if $programs program vertexlit - diffusemap "models/items/frag/world_frag.tga" + diffusemap "models/weapons/w_frag/world_frag.tga" else { - map "models/items/frag/world_frag.tga" + map "models/weapons/w_frag/world_frag.tga" rgbGen lightingDiffuse } endif diff --git a/base/resources.pk3dir/models/weapons/w_pistol/world_enforcer.mat b/base/resources.pk3dir/models/weapons/w_pistol/world_enforcer.mat index 16396b56..7086a42e 100644 --- a/base/resources.pk3dir/models/weapons/w_pistol/world_enforcer.mat +++ b/base/resources.pk3dir/models/weapons/w_pistol/world_enforcer.mat @@ -2,10 +2,10 @@ { if $programs program vertexlit - diffusemap "models/items/enforcer/world_enforcerskin.tga" + diffusemap "models/weapons/w_pistol/world_enforcerskin.tga" else { - map "models/items/enforcer/world_enforcerskin.tga" + map "models/weapons/w_pistol/world_enforcerskin.tga" rgbGen lightingDiffuse } endif diff --git a/base/resources.pk3dir/particles/fx_spark.cfg b/base/resources.pk3dir/particles/fx_spark.cfg index 9b0400c4..e1877317 100644 --- a/base/resources.pk3dir/particles/fx_spark.cfg +++ b/base/resources.pk3dir/particles/fx_spark.cfg @@ -15,14 +15,3 @@ r_part main veladd 200 gravity 600 } - -r_part +main -{ - lighttime 1 - lightradius 64 - lightradiusfade 300 - lightrgb 1.0 0.5 0.4 - lightrgbfade 0.36 0.19 0.19 - count 0 0 1 - model "sprites/muzzleflash.spr" framestart=0 framecount=2 framerate=20 additive scalemin=0.1 scalemax=0.5 -} diff --git a/base/resources.pk3dir/particles/impact_default.cfg b/base/resources.pk3dir/particles/impact_default.cfg index e5257dab..db67a2f2 100644 --- a/base/resources.pk3dir/particles/impact_default.cfg +++ b/base/resources.pk3dir/particles/impact_default.cfg @@ -37,14 +37,6 @@ r_part +main gravity 600 } -// unused ricochet sprite, reactivated -r_part +main -{ - count 0 0 1 - orgadd 8 - model "sprites/richo2.spr" framestart=0 framecount=15 framerate=20 additive scalemin=0.25 scalemax=0.55 alpha=0.65 -} - // emitter for our bullet hole dust r_part +main { diff --git a/base/resources.pk3dir/scripts/bots.txt b/base/resources.pk3dir/scripts/bots.txt new file mode 100644 index 00000000..76930cde --- /dev/null +++ b/base/resources.pk3dir/scripts/bots.txt @@ -0,0 +1,25 @@ +{ + name Marco +} +{ + name Ash +} +{ + name Gethyn +} +{ + name Megan +} +{ + name Max +} +{ + name John + funname Pilsnerd +} +{ + name Jonny +} +{ + name Marten +} diff --git a/base/resources.pk3dir/scripts/propdata.txt b/base/resources.pk3dir/scripts/propdata.txt index eb00778d..c7f70052 100644 --- a/base/resources.pk3dir/scripts/propdata.txt +++ b/base/resources.pk3dir/scripts/propdata.txt @@ -1,76 +1,4 @@ "PropData.txt" { - "gs_material_glass" - { - "breakable_model" "gibs_glass" - } - "gs_material_wood" - { - "breakable_model" "gibs_wood" - } - "gs_material_metal" - { - "breakable_model" "gibs_metalplate" - } - "gs_material_flesh" - { - "breakable_model" "gibs_flesh" - } - "gs_material_cinderblock" - { - "breakable_model" "gibs_cinder" - } - "gs_material_tile" - { - "breakable_model" "gibs_ceiling" - } - "gs_material_computer" - { - "breakable_model" "gibs_computer" - } - "gs_material_unbreakableglass" - { - "breakable_model" "gibs_glass" - } - "gs_material_rocks" - { - "breakable_model" "gibs_rock" - } - - - "BreakableModels" - { - "gibs_glass" - { - "models/glassgibs.mdl" "5.0" - } - "gibs_wood" - { - "models/woodgibs.mdl" "5.0" - } - "gibs_metalplate" - { - "models/metalplategibs.mdl" "5.0" - } - "gibs_flesh" - { - "models/fleshgibs.mdl" "5.0" - } - "gibs_ceiling" - { - "models/ceilinggibs.mdl" "5.0" - } - "gibs_computer" - { - "models/computergibs.mdl" "5.0" - } - "gibs_rock" - { - "models/rockgibs.mdl" "5.0" - } - "gibs_cinder" - { - "models/cindergibs.mdl" "5.0" - } - } + } diff --git a/base/resources.pk3dir/scripts/surfaceproperties.txt b/base/resources.pk3dir/scripts/surfaceproperties.txt index 8f8aa32c..4cecfe93 100644 --- a/base/resources.pk3dir/scripts/surfaceproperties.txt +++ b/base/resources.pk3dir/scripts/surfaceproperties.txt @@ -5,171 +5,3 @@ default stepleft "step_default.left" stepright "step_default.right" } - -gs_material_glass -{ - gamematerial Y - fx_bulletimpact "fx_impact.glass" - bulletimpact "sfx_impact.glass" - stepleft "step_glass.left" - stepright "step_glass.right" -} - -gs_material_wood -{ - gamematerial W - fx_bulletimpact "fx_impact.wood" - bulletimpact "sfx_impact.wood" - stepleft "step_wood.left" - stepright "step_wood.right" -} - -gs_material_metal -{ - gamematerial M - fx_bulletimpact "fx_impact.metal" - bulletimpact "sfx_impact.metal" - stepleft "step_metal.left" - stepright "step_metal.right" -} - -gs_material_flesh -{ - gamematerial F - fx_bulletimpact "fx_impact.flesh" - bulletimpact "sfx_impact.flesh" - stepleft "step_flesh.left" - stepright "step_flesh.right" -} - -gs_material_cinderblock -{ - fx_bulletimpact "fx_impact.concrete" - bulletimpact "sfx_impact.concrete" - stepleft "step_default.left" - stepright "step_default.right" -} - -gs_material_tile -{ - gamematerial T - fx_bulletimpact "fx_impact.tile" - bulletimpact "sfx_impact.tile" - stepleft "step_tile.left" - stepright "step_tile.right" -} - -gs_material_computer -{ - gamematerial P - fx_bulletimpact "fx_impact.computer" - bulletimpact "sfx_impact.computer" - stepleft "step_computer.left" - stepright "step_computer.right" -} - -gs_material_unbreakableglass -{ - fx_bulletimpact "fx_impact.glass" - bulletimpact "sfx_impact.glass" - stepleft "step_glass.left" - stepright "step_glass.right" -} - -gs_material_rock -{ - fx_bulletimpact "fx_impact.rock" - bulletimpact "sfx_impact.rock" - stepleft "step_default.left" - stepright "step_default.right" -} - -gs_material_flesh -{ - gamematerial F - fx_bulletimpact "fx_impact.flesh" - bulletimpact "sfx_impact.flesh" - stepleft "step_flesh.left" - stepright "step_flesh.right" -} - -gs_material_concrete -{ - gamematerial C - fx_bulletimpact "fx_impact.concrete" - bulletimpact "sfx_impact.concrete" - stepleft "step_concrete.left" - stepright "step_concrete.right" -} - -gs_material_dirt -{ - gamematerial D - fx_bulletimpact "fx_impact.dirt" - bulletimpact "sfx_impact.dirt" - stepleft "step_dirt.left" - stepright "step_dirt.right" -} - -gs_material_grate -{ - gamematerial G - fx_bulletimpact "fx_impact.grate" - bulletimpact "sfx_impact.grate" - stepleft "step_grate.left" - stepright "step_grate.right" -} - -gs_material_alien -{ - gamematerial H - fx_bulletimpact "fx_impact.alien" - bulletimpact "sfx_impact.alien" - stepleft "step_alien.left" - stepright "step_alien.right" -} - -gs_material_snow -{ - gamematerial K - fx_bulletimpact "fx_impact.snow" - bulletimpact "sfx_impact.snow" - stepleft "step_snow.left" - stepright "step_snow.right" -} - -gs_material_sand -{ - gamematerial N - fx_bulletimpact "fx_impact.sand" - bulletimpact "sfx_impact.sand" - stepleft "step_sand.left" - stepright "step_sand.right" -} - -gs_material_foliage -{ - gamematerial O - fx_bulletimpact "fx_impact.foliage" - bulletimpact "sfx_impact.foliage" - stepleft "step_slosh.left" - stepright "step_slosh.right" -} - -gs_material_slosh -{ - gamematerial S - fx_bulletimpact "fx_impact.slosh" - bulletimpact "sfx_impact.slosh" - stepleft "step_slosh.left" - stepright "step_slosh.right" -} - -gs_material_vent -{ - gamematerial V - fx_bulletimpact "fx_impact.snow" - bulletimpact "sfx_impact.snow" - stepleft "step_vent.left" - stepright "step_vent.right" -} \ No newline at end of file diff --git a/base/resources.pk3dir/scripts/ui_style.txt b/base/resources.pk3dir/scripts/ui_style.txt index f3d5b9ce..efd01e72 100644 --- a/base/resources.pk3dir/scripts/ui_style.txt +++ b/base/resources.pk3dir/scripts/ui_style.txt @@ -1,3 +1,4 @@ COLOR=28 40 56 FG_COLOR=255 255 255 ALPHA=255 +ROUNDED=1 diff --git a/base/resources.pk3dir/textures/ui/avatar_missing.mat b/base/resources.pk3dir/textures/ui/avatar_missing.mat deleted file mode 100644 index 388a78b2..00000000 --- a/base/resources.pk3dir/textures/ui/avatar_missing.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/avatar_missing.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/cancel.mat b/base/resources.pk3dir/textures/ui/icons/cancel.mat deleted file mode 100644 index 79c647cc..00000000 --- a/base/resources.pk3dir/textures/ui/icons/cancel.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/cancel.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/cancel.tga b/base/resources.pk3dir/textures/ui/icons/cancel.tga deleted file mode 100644 index 303912ba..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/cancel.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/cd.mat b/base/resources.pk3dir/textures/ui/icons/cd.mat deleted file mode 100644 index 53d08bfc..00000000 --- a/base/resources.pk3dir/textures/ui/icons/cd.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/cd.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/cd.tga b/base/resources.pk3dir/textures/ui/icons/cd.tga deleted file mode 100644 index 8d6e67cd..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/cd.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/console.mat b/base/resources.pk3dir/textures/ui/icons/console.mat deleted file mode 100644 index 975ec2bd..00000000 --- a/base/resources.pk3dir/textures/ui/icons/console.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/console.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/console.tga b/base/resources.pk3dir/textures/ui/icons/console.tga deleted file mode 100644 index af30a675..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/console.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/desktop.mat b/base/resources.pk3dir/textures/ui/icons/desktop.mat deleted file mode 100644 index 7367dc92..00000000 --- a/base/resources.pk3dir/textures/ui/icons/desktop.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/desktop.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/desktop.tga b/base/resources.pk3dir/textures/ui/icons/desktop.tga deleted file mode 100644 index a73503aa..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/desktop.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/disconnect.mat b/base/resources.pk3dir/textures/ui/icons/disconnect.mat deleted file mode 100644 index b544eb2f..00000000 --- a/base/resources.pk3dir/textures/ui/icons/disconnect.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/disconnect.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/disconnect.tga b/base/resources.pk3dir/textures/ui/icons/disconnect.tga deleted file mode 100644 index 7674e5e5..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/disconnect.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/encrypted.mat b/base/resources.pk3dir/textures/ui/icons/encrypted.mat deleted file mode 100644 index f84cfb2e..00000000 --- a/base/resources.pk3dir/textures/ui/icons/encrypted.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/encrypted.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/encrypted.tga b/base/resources.pk3dir/textures/ui/icons/encrypted.tga deleted file mode 100644 index e3973aab..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/encrypted.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/exec.mat b/base/resources.pk3dir/textures/ui/icons/exec.mat deleted file mode 100644 index 09d74c94..00000000 --- a/base/resources.pk3dir/textures/ui/icons/exec.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/exec.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/exec.tga b/base/resources.pk3dir/textures/ui/icons/exec.tga deleted file mode 100644 index a14049d7..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/exec.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/exit.mat b/base/resources.pk3dir/textures/ui/icons/exit.mat deleted file mode 100644 index 25e845d6..00000000 --- a/base/resources.pk3dir/textures/ui/icons/exit.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/exit.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/exit.tga b/base/resources.pk3dir/textures/ui/icons/exit.tga deleted file mode 100644 index 37f4d9e5..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/exit.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/folder.mat b/base/resources.pk3dir/textures/ui/icons/folder.mat deleted file mode 100644 index a65c42a9..00000000 --- a/base/resources.pk3dir/textures/ui/icons/folder.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/folder.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/folder.tga b/base/resources.pk3dir/textures/ui/icons/folder.tga deleted file mode 100644 index c8936750..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/folder.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/gear.mat b/base/resources.pk3dir/textures/ui/icons/gear.mat deleted file mode 100644 index 2072587e..00000000 --- a/base/resources.pk3dir/textures/ui/icons/gear.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/gear.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/gear.tga b/base/resources.pk3dir/textures/ui/icons/gear.tga deleted file mode 100644 index b4e96dd1..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/gear.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/hdd.mat b/base/resources.pk3dir/textures/ui/icons/hdd.mat deleted file mode 100644 index 8d41b784..00000000 --- a/base/resources.pk3dir/textures/ui/icons/hdd.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/hdd.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/hdd.tga b/base/resources.pk3dir/textures/ui/icons/hdd.tga deleted file mode 100644 index 1e5d9a00..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/hdd.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/help-open.mat b/base/resources.pk3dir/textures/ui/icons/help-open.mat deleted file mode 100644 index 8b2d8a0c..00000000 --- a/base/resources.pk3dir/textures/ui/icons/help-open.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/help-open.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/help-open.tga b/base/resources.pk3dir/textures/ui/icons/help-open.tga deleted file mode 100644 index 98238ab2..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/help-open.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/help.mat b/base/resources.pk3dir/textures/ui/icons/help.mat deleted file mode 100644 index 3983c686..00000000 --- a/base/resources.pk3dir/textures/ui/icons/help.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/help.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/help.tga b/base/resources.pk3dir/textures/ui/icons/help.tga deleted file mode 100644 index 99c35383..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/help.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/important.mat b/base/resources.pk3dir/textures/ui/icons/important.mat deleted file mode 100644 index 54237aec..00000000 --- a/base/resources.pk3dir/textures/ui/icons/important.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/important.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/important.tga b/base/resources.pk3dir/textures/ui/icons/important.tga deleted file mode 100644 index f618e1e0..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/important.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/music.mat b/base/resources.pk3dir/textures/ui/icons/music.mat deleted file mode 100644 index 4853cd89..00000000 --- a/base/resources.pk3dir/textures/ui/icons/music.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/music.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/music.tga b/base/resources.pk3dir/textures/ui/icons/music.tga deleted file mode 100644 index 45933bef..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/music.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/refresh.mat b/base/resources.pk3dir/textures/ui/icons/refresh.mat deleted file mode 100644 index af3e0a06..00000000 --- a/base/resources.pk3dir/textures/ui/icons/refresh.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/refresh.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/refresh.tga b/base/resources.pk3dir/textures/ui/icons/refresh.tga deleted file mode 100644 index 1c7fa07d..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/refresh.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/save.mat b/base/resources.pk3dir/textures/ui/icons/save.mat deleted file mode 100644 index 1dbbbd38..00000000 --- a/base/resources.pk3dir/textures/ui/icons/save.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/save.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/save.tga b/base/resources.pk3dir/textures/ui/icons/save.tga deleted file mode 100644 index 3a63b485..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/save.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/server-new.mat b/base/resources.pk3dir/textures/ui/icons/server-new.mat deleted file mode 100644 index 0e52dd86..00000000 --- a/base/resources.pk3dir/textures/ui/icons/server-new.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/server-new.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/server-new.tga b/base/resources.pk3dir/textures/ui/icons/server-new.tga deleted file mode 100644 index 6023bf77..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/server-new.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/servers.mat b/base/resources.pk3dir/textures/ui/icons/servers.mat deleted file mode 100644 index be5f99fd..00000000 --- a/base/resources.pk3dir/textures/ui/icons/servers.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/servers.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/servers.tga b/base/resources.pk3dir/textures/ui/icons/servers.tga deleted file mode 100644 index dc70f484..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/servers.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/shred.mat b/base/resources.pk3dir/textures/ui/icons/shred.mat deleted file mode 100644 index d5d0c37a..00000000 --- a/base/resources.pk3dir/textures/ui/icons/shred.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/shred.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/shred.tga b/base/resources.pk3dir/textures/ui/icons/shred.tga deleted file mode 100644 index 66aa7552..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/shred.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/socket.mat b/base/resources.pk3dir/textures/ui/icons/socket.mat deleted file mode 100644 index 787d263e..00000000 --- a/base/resources.pk3dir/textures/ui/icons/socket.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/socket.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/socket.tga b/base/resources.pk3dir/textures/ui/icons/socket.tga deleted file mode 100644 index 49077058..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/socket.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/track-full.mat b/base/resources.pk3dir/textures/ui/icons/track-full.mat deleted file mode 100644 index c09dfb11..00000000 --- a/base/resources.pk3dir/textures/ui/icons/track-full.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/track-full.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/track-full.tga b/base/resources.pk3dir/textures/ui/icons/track-full.tga deleted file mode 100644 index c41ad75d..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/track-full.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/icons/trash.mat b/base/resources.pk3dir/textures/ui/icons/trash.mat deleted file mode 100644 index 107ee823..00000000 --- a/base/resources.pk3dir/textures/ui/icons/trash.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/icons/trash.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/icons/trash.tga b/base/resources.pk3dir/textures/ui/icons/trash.tga deleted file mode 100644 index 90232043..00000000 Binary files a/base/resources.pk3dir/textures/ui/icons/trash.tga and /dev/null differ diff --git a/base/resources.pk3dir/textures/ui/m_bottom.mat b/base/resources.pk3dir/textures/ui/m_bottom.mat deleted file mode 100644 index 684b2af1..00000000 --- a/base/resources.pk3dir/textures/ui/m_bottom.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_bottom.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_bottomleft.mat b/base/resources.pk3dir/textures/ui/m_bottomleft.mat deleted file mode 100644 index 3e2ab814..00000000 --- a/base/resources.pk3dir/textures/ui/m_bottomleft.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_bottomleft.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_bottomright.mat b/base/resources.pk3dir/textures/ui/m_bottomright.mat deleted file mode 100644 index a5ec44ee..00000000 --- a/base/resources.pk3dir/textures/ui/m_bottomright.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_bottomright.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_left.mat b/base/resources.pk3dir/textures/ui/m_left.mat deleted file mode 100644 index c4e4cdab..00000000 --- a/base/resources.pk3dir/textures/ui/m_left.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_left.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_linebottom.mat b/base/resources.pk3dir/textures/ui/m_linebottom.mat deleted file mode 100644 index de094343..00000000 --- a/base/resources.pk3dir/textures/ui/m_linebottom.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_linebottom.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_linebottomleft.mat b/base/resources.pk3dir/textures/ui/m_linebottomleft.mat deleted file mode 100644 index 7a4dc403..00000000 --- a/base/resources.pk3dir/textures/ui/m_linebottomleft.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_linebottomleft.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_linebottomright.mat b/base/resources.pk3dir/textures/ui/m_linebottomright.mat deleted file mode 100644 index d152923d..00000000 --- a/base/resources.pk3dir/textures/ui/m_linebottomright.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_linebottomright.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_lineleft.mat b/base/resources.pk3dir/textures/ui/m_lineleft.mat deleted file mode 100644 index 6fc7da2e..00000000 --- a/base/resources.pk3dir/textures/ui/m_lineleft.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_lineleft.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_linemid.mat b/base/resources.pk3dir/textures/ui/m_linemid.mat deleted file mode 100644 index b98f68f0..00000000 --- a/base/resources.pk3dir/textures/ui/m_linemid.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_linemid.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_lineright.mat b/base/resources.pk3dir/textures/ui/m_lineright.mat deleted file mode 100644 index ed43bb53..00000000 --- a/base/resources.pk3dir/textures/ui/m_lineright.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_lineright.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_linetop.mat b/base/resources.pk3dir/textures/ui/m_linetop.mat deleted file mode 100644 index 2c6ebcaf..00000000 --- a/base/resources.pk3dir/textures/ui/m_linetop.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_linetop.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_linetopleft.mat b/base/resources.pk3dir/textures/ui/m_linetopleft.mat deleted file mode 100644 index 409993d6..00000000 --- a/base/resources.pk3dir/textures/ui/m_linetopleft.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_linetopleft.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_linetopright.mat b/base/resources.pk3dir/textures/ui/m_linetopright.mat deleted file mode 100644 index 03a042c0..00000000 --- a/base/resources.pk3dir/textures/ui/m_linetopright.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_linetopright.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_mid.mat b/base/resources.pk3dir/textures/ui/m_mid.mat deleted file mode 100644 index ad647df9..00000000 --- a/base/resources.pk3dir/textures/ui/m_mid.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_mid.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_right.mat b/base/resources.pk3dir/textures/ui/m_right.mat deleted file mode 100644 index 60ac7d95..00000000 --- a/base/resources.pk3dir/textures/ui/m_right.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_right.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_top.mat b/base/resources.pk3dir/textures/ui/m_top.mat deleted file mode 100644 index 318ceb31..00000000 --- a/base/resources.pk3dir/textures/ui/m_top.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_top.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_topleft.mat b/base/resources.pk3dir/textures/ui/m_topleft.mat deleted file mode 100644 index b892a3a1..00000000 --- a/base/resources.pk3dir/textures/ui/m_topleft.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_topleft.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/m_topright.mat b/base/resources.pk3dir/textures/ui/m_topright.mat deleted file mode 100644 index 66ed1d59..00000000 --- a/base/resources.pk3dir/textures/ui/m_topright.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/m_topright.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/steam/icon_checked.mat b/base/resources.pk3dir/textures/ui/steam/icon_checked.mat deleted file mode 100644 index 28c0f111..00000000 --- a/base/resources.pk3dir/textures/ui/steam/icon_checked.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/steam/icon_checked.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/steam/icon_close.mat b/base/resources.pk3dir/textures/ui/steam/icon_close.mat deleted file mode 100644 index 0bc018c4..00000000 --- a/base/resources.pk3dir/textures/ui/steam/icon_close.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/steam/icon_close.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/steam/icon_down.mat b/base/resources.pk3dir/textures/ui/steam/icon_down.mat deleted file mode 100644 index 6c26d055..00000000 --- a/base/resources.pk3dir/textures/ui/steam/icon_down.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/steam/icon_down.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/steam/icon_emptybox.mat b/base/resources.pk3dir/textures/ui/steam/icon_emptybox.mat deleted file mode 100644 index 2fea5ae9..00000000 --- a/base/resources.pk3dir/textures/ui/steam/icon_emptybox.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/steam/icon_emptybox.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/steam/icon_radiosel.mat b/base/resources.pk3dir/textures/ui/steam/icon_radiosel.mat deleted file mode 100644 index 1dbea4e5..00000000 --- a/base/resources.pk3dir/textures/ui/steam/icon_radiosel.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/steam/icon_radiosel.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/steam/icon_radiounsel.mat b/base/resources.pk3dir/textures/ui/steam/icon_radiounsel.mat deleted file mode 100644 index 1458b1e8..00000000 --- a/base/resources.pk3dir/textures/ui/steam/icon_radiounsel.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/steam/icon_radiounsel.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/steam/icon_resizer.mat b/base/resources.pk3dir/textures/ui/steam/icon_resizer.mat deleted file mode 100644 index 39a214b8..00000000 --- a/base/resources.pk3dir/textures/ui/steam/icon_resizer.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/steam/icon_resizer.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/steam/icon_up.mat b/base/resources.pk3dir/textures/ui/steam/icon_up.mat deleted file mode 100644 index 3a39aff6..00000000 --- a/base/resources.pk3dir/textures/ui/steam/icon_up.mat +++ /dev/null @@ -1,9 +0,0 @@ -// Vera Visions Material -{ - diffusemap "textures/ui/steam/icon_up.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/voice_off.mat b/base/resources.pk3dir/textures/ui/voice_off.mat deleted file mode 100644 index 29655cf3..00000000 --- a/base/resources.pk3dir/textures/ui/voice_off.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/voice_off.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/resources.pk3dir/textures/ui/voice_on.mat b/base/resources.pk3dir/textures/ui/voice_on.mat deleted file mode 100644 index 00c47da0..00000000 --- a/base/resources.pk3dir/textures/ui/voice_on.mat +++ /dev/null @@ -1,12 +0,0 @@ -// Vera Visions Material -{ - noPicMip - noMipmaps - - diffusemap "textures/ui/voice_on.tga" - { - program sprite - map $diffusemap - blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA - } -} diff --git a/base/src/Makefile b/base/src/Makefile index c29bd0ae..6fd48572 100644 --- a/base/src/Makefile +++ b/base/src/Makefile @@ -4,3 +4,4 @@ all: cd client && $(MAKE) cd server && $(MAKE) cd menu && $(MAKE) + cd rules && $(MAKE) diff --git a/base/src/client/Makefile b/base/src/client/Makefile index 2fe44a45..24c4e84a 100644 --- a/base/src/client/Makefile +++ b/base/src/client/Makefile @@ -2,3 +2,4 @@ QCC=fteqcc all: $(QCC) progs.src + $(QCC) hud.qc diff --git a/base/src/client/hud.qc b/base/src/client/hud.qc new file mode 100644 index 00000000..6e08af56 --- /dev/null +++ b/base/src/client/hud.qc @@ -0,0 +1,56 @@ +#pragma PROGS_DAT "../../progs.pk3dir/hud.dat" + +#include "../../../src/client/api.h" + +const float baseIconSize = 32.0; +const float baseIconPadding = 16.0; + +font_s FONT_HUD; +var string g_ammoPic; + +void +HUD_Init(void) +{ + font.Load("fonts/font16.font", FONT_HUD); + g_ammoPic = 0; +} + +void +HUD_Draw(vector hud_mins, vector hud_size) +{ + vector hudSize = hud_size; + vector iconPos = hud_mins + (hudSize / 2); + iconPos[1] = (hudSize[1] - baseIconSize) - baseIconPadding; + + string healthValue = ftos(player.GetHealth()); + string armorValue = ftos(player.GetArmor()); + string ammoValue = ftos(weapon.GetAmmo1()); + + /* ammo */ + if (weapon.AmmoRequired() == true) { + draw.RText([hudSize[0] - baseIconPadding - baseIconSize - baseIconPadding, iconPos[1]], ammoValue, FONT_HUD); + } + + if (g_ammoPic != "") { + draw.Pic([hudSize[0] - baseIconPadding - baseIconSize, iconPos[1]], g_ammoPic, [baseIconSize, baseIconSize], [1,1,1], 1.0f); + } + + /* health, armor icons */ + draw.RText(iconPos + [-((baseIconSize/2) + (baseIconPadding/2)) - baseIconPadding, 0], healthValue, FONT_HUD); + draw.Pic(iconPos + [-((baseIconSize/2) + (baseIconPadding/2)), 0], "gfx/hud/health", [baseIconSize, baseIconSize], [1,1,1], 1.0f); + + draw.Text(iconPos + [(baseIconSize/2) + (baseIconPadding/2) + baseIconSize + baseIconPadding, 0], armorValue, FONT_HUD); + draw.Pic(iconPos + [(baseIconSize/2) + (baseIconPadding/2), 0], "gfx/hud/armor", [baseIconSize, baseIconSize], [1,1,1], 1.0f); +} + +void +HUD_DrawSpectator(vector hud_mins, vector hud_size) +{ + +} + +void +HUD_WeaponSwitched(string weaponName) +{ + g_ammoPic = entityDef.GetString(weaponName, "ammoIcon"); +} diff --git a/base/src/client/main.qc b/base/src/client/main.qc index a1c2f057..62c8e4de 100644 --- a/base/src/client/main.qc +++ b/base/src/client/main.qc @@ -127,45 +127,6 @@ ClientGame_EventParse(float fHeader) return (1); } -const float baseIconSize = 32.0; -const float baseIconPadding = 16.0; - -void -HUD_Init(void) -{ -} - -void -HUD_Draw(void) -{ - NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer; - vector hudSize = g_view.GetHUDCanvasSize(); - vector iconPos = g_view.GetHUDCanvasPos() + (hudSize / 2); - iconPos[1] = (hudSize[1] - baseIconSize) - baseIconPadding; - - string healthValue = ftos(pl.health); - string armorValue = ftos(pl.armor); - - /* health, armor icons */ - Font_DrawRText(iconPos + [-((baseIconSize/2) + (baseIconPadding/2)) - baseIconPadding, 0], healthValue, FONT_16); - drawpic(iconPos + [-((baseIconSize/2) + (baseIconPadding/2)), 0], "gfx/hud/health", [baseIconSize, baseIconSize], [1,1,1], 1.0f); - Font_DrawText(iconPos + [(baseIconSize/2) + (baseIconPadding/2) + baseIconSize + baseIconPadding, 0], armorValue, FONT_16); - drawpic(iconPos + [(baseIconSize/2) + (baseIconPadding/2), 0], "gfx/hud/armor", [baseIconSize, baseIconSize], [1,1,1], 1.0f); - - /* little point in not drawing these, even if you don't have a suit */ - if (pl.m_activeWeapon) { - pl.m_activeWeapon.UpdateGUI(); - } - - Textmenu_Draw(); -} - -void -HUD_DrawSpectator(void) -{ - -} - void ClientGame_Init(float apilevel, string enginename, float engineversion) { diff --git a/base/src/progs.src b/base/src/progs.src index e7760ac7..9801e913 100644 --- a/base/src/progs.src +++ b/base/src/progs.src @@ -1,3 +1,5 @@ #pragma sourcefile client/progs.src #pragma sourcefile server/progs.src #pragma sourcefile menu/progs.src +#pragma sourcefile rules/deathmatch.qc +#pragma sourcefile rules/singleplayer.qc diff --git a/base/src/rules/Makefile b/base/src/rules/Makefile new file mode 100644 index 00000000..3e33c696 --- /dev/null +++ b/base/src/rules/Makefile @@ -0,0 +1,6 @@ +QCC=fteqcc + +all: + mkdir -pv ../../progs.pk3dir/progs/ + $(QCC) deathmatch.qc + $(QCC) singleplayer.qc diff --git a/base/src/rules/deathmatch.qc b/base/src/rules/deathmatch.qc new file mode 100644 index 00000000..e49b674e --- /dev/null +++ b/base/src/rules/deathmatch.qc @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024 Marco Cawthorne + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma PROGS_DAT "../../progs.pk3dir/progs/deathmatch.dat" + +#include "../../../src/server/api.h" + +void +CodeCallback_StartGameType(void) +{ + motd.LoadDefault(); +} + +void +CodeCallback_PlayerSpawn(void) +{ + ents.ChangeToClass(self, "player_mp"); + game.TeleportToSpawn(self); +} + +void +CodeCallback_PlayerDisconnect(void) +{ + +} + +bool +CodeCallback_PlayerRequestRespawn(void) +{ + CodeCallback_PlayerSpawn(); + return (true); +} + +void +CodeCallback_PlayerDamage(entity inflictor, entity attacker) +{ + +} + +void +CodeCallback_PlayerKilled(entity inflictor, entity attacker, string weapon) +{ + combat.Obituary(self.netname, attacker.netname, weapon, ""); + + /* death-counter */ + self.deaths++; + + /* update score-counter */ + if (ents.isPlayer(attacker)) { + if (self == attacker) { + attacker.frags--; + } else { + attacker.frags++; + } + } +} diff --git a/base/src/rules/singleplayer.qc b/base/src/rules/singleplayer.qc new file mode 100644 index 00000000..ebd07731 --- /dev/null +++ b/base/src/rules/singleplayer.qc @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2024 Marco Cawthorne + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#pragma PROGS_DAT "../../progs.pk3dir/progs/singleplayer.dat" + +#include "../../../src/server/api.h" + +void +CodeCallback_StartGameType(void) +{ +} + +void +CodeCallback_PlayerSpawn(void) +{ + ents.ChangeToClass(self, "player"); + game.TeleportToSpawn(self); +} + +bool +CodeCallback_PlayerRequestRespawn(void) +{ + localcmd("load quick\n"); + return (true); +} + + +bool +CodeCallback_ImpulseCommand(float impulseNum) +{ + switch (impulseNum) { + case 100: + ents.Input(self, "UseItem", "item_suit", self); + break; + case 101: + ents.Input(self, "SetHealth", "100", self); + ents.Input(self, "SetArmor", "100", self); + ents.Input(self, "GiveItem", "item_suit", self); + ents.Input(self, "GiveItem", "weapon_357", self); + ents.Input(self, "GiveItem", "weapon_9mmAR", self); + ents.Input(self, "GiveItem", "weapon_9mmhandgun", self); + ents.Input(self, "GiveItem", "weapon_crossbow", self); + ents.Input(self, "GiveItem", "weapon_crowbar", self); + ents.Input(self, "GiveItem", "weapon_egon", self); + ents.Input(self, "GiveItem", "weapon_gauss", self); + ents.Input(self, "GiveItem", "weapon_handgrenade", self); + ents.Input(self, "GiveItem", "weapon_hornetgun", self); + ents.Input(self, "GiveItem", "weapon_rpg", self); + ents.Input(self, "GiveItem", "weapon_satchel", self); + ents.Input(self, "GiveItem", "weapon_shotgun", self); + ents.Input(self, "GiveItem", "weapon_snark", self); + ents.Input(self, "GiveItem", "weapon_tripmine", self); + ents.Input(self, "GiveAmmo", "ammo_9mm 255", self); + ents.Input(self, "GiveAmmo", "ammo_357 255", self); + ents.Input(self, "GiveAmmo", "ammo_buckshot 255", self); + ents.Input(self, "GiveAmmo", "ammo_bolt 255", self); + ents.Input(self, "GiveAmmo", "ammo_rocket 255", self); + ents.Input(self, "GiveAmmo", "ammo_uranium 255", self); + ents.Input(self, "GiveAmmo", "ammo_handgrenade 255", self); + ents.Input(self, "GiveAmmo", "ammo_satchel 255", self); + ents.Input(self, "GiveAmmo", "ammo_tripmine 255", self); + ents.Input(self, "GiveAmmo", "ammo_snark 255", self); + ents.Input(self, "GiveAmmo", "ammo_hornet 255", self); + ents.Input(self, "GiveAmmo", "ammo_m203_grenade 255", self); + break; + default: + return (false); + } + + return (true); +} diff --git a/base/src/server/main.qc b/base/src/server/main.qc index edbb2712..a8606274 100644 --- a/base/src/server/main.qc +++ b/base/src/server/main.qc @@ -7,5 +7,9 @@ Game_Worldspawn(void) void Game_InitRules(void) { - g_grMode = NSGameRules::InitFromProgs("maps/mp/gametypes/dm.dat"); + if (cvar("sv_playerslots") == 1 || cvar("coop") == 1) { + g_grMode = NSGameRules::InitFromProgs("progs/singleplayer.dat"); + } else { + g_grMode = NSGameRules::InitFromProgs("progs/deathmatch.dat"); + } } diff --git a/base/test_maps.pk3dir/maps/test/func_chargers.bak b/base/test_maps.pk3dir/maps/test/func_chargers.bak deleted file mode 100644 index 5517d080..00000000 --- a/base/test_maps.pk3dir/maps/test/func_chargers.bak +++ /dev/null @@ -1,137 +0,0 @@ - -// entity 0 -{ -"classname" "worldspawn" -// brush 0 -{ -( 248 192 -64 ) ( 248 -192 -64 ) ( -264 192 -64 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 256 192 8 ) ( -256 192 8 ) ( 256 192 0 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 256 192 8 ) ( 256 192 0 ) ( 256 -192 8 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 -128 ) ( 256 -192 -128 ) ( -256 192 -128 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 0 ) ( -256 -192 8 ) ( 256 -192 0 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 0 ) ( -256 192 0 ) ( -256 -192 8 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -} -// brush 1 -{ -( 248 192 192 ) ( 248 -192 192 ) ( -264 192 192 ) measure/ceiling [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 -0.5 0.5 0 0 0 -( 256 192 264 ) ( -256 192 264 ) ( 256 192 256 ) measure/ceiling [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 -0.5 0.5 0 0 0 -( 256 192 264 ) ( 256 192 256 ) ( 256 -192 264 ) measure/ceiling [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 -0.5 0.5 0 0 0 -( -256 -192 128 ) ( 256 -192 128 ) ( -256 192 128 ) measure/ceiling [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 -0.5 0.5 0 0 0 -( -256 -192 256 ) ( -256 -192 264 ) ( 256 -192 256 ) measure/ceiling [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 -0.5 0.5 0 0 0 -( -256 -192 256 ) ( -256 192 256 ) ( -256 -192 264 ) measure/ceiling [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 -0.5 0.5 0 0 0 -} -// brush 2 -{ -( 192 192 328 ) ( -320 192 328 ) ( 192 192 320 ) measure/wall128gr [ 1 0 0 -128 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 192 72 ) ( -256 192 64 ) ( -256 -192 72 ) measure/wall128gr [ 0 1 0 -128 ] [ -0 -0 -1 -128 ] -0 0.5 0.5 0 0 0 -( -768 -192 -64 ) ( -256 -192 -64 ) ( -768 192 -64 ) measure/wall128gr [ 1 0 0 -128 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -320 -192 320 ) ( -320 -192 328 ) ( 192 -192 320 ) measure/wall128gr [ 1 0 0 -128 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -320 -192 320 ) ( -320 192 320 ) ( -320 -192 328 ) measure/wall128gr [ 0 1 0 -128 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -64 -24 64 ) ( -64 64 64 ) ( 64 -24 64 ) common/caulk [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -} -// brush 3 -{ -( 768 192 328 ) ( 256 192 328 ) ( 768 192 320 ) measure/wall128gr [ 1 0 0 -128 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 320 192 72 ) ( 320 192 64 ) ( 320 -192 72 ) measure/wall128gr [ 0 1 0 -128 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -192 -192 -64 ) ( 320 -192 -64 ) ( -192 192 -64 ) measure/wall128gr [ 1 0 0 -128 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 256 -192 320 ) ( 256 -192 328 ) ( 768 -192 320 ) measure/wall128gr [ 1 0 0 -128 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 256 -192 320 ) ( 256 192 320 ) ( 256 -192 328 ) measure/wall128gr [ 0 1 0 -128 ] [ -0 -0 -1 -128 ] -0 0.5 0.5 0 0 0 -( -64 -24 64 ) ( -64 64 64 ) ( 64 -24 64 ) common/caulk [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -} -// brush 4 -{ -( 192 -192 328 ) ( -320 -192 328 ) ( 192 -192 320 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 -128 ] -0 0.5 0.5 0 0 0 -( 320 96 72 ) ( 320 96 64 ) ( 320 -288 72 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -768 -576 -64 ) ( -256 -576 -64 ) ( -768 -192 -64 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 272 -256 320 ) ( 272 -256 328 ) ( 784 -256 320 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -320 -576 320 ) ( -320 -192 320 ) ( -320 -576 328 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -64 -24 64 ) ( -64 64 64 ) ( 64 -24 64 ) common/caulk [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -} -// brush 5 -{ -( 192 256 328 ) ( -320 256 328 ) ( 192 256 320 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 320 544 72 ) ( 320 544 64 ) ( 320 160 72 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -768 -128 -64 ) ( -256 -128 -64 ) ( -768 256 -64 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 272 192 320 ) ( 272 192 328 ) ( 784 192 320 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 -128 ] -0 0.5 0.5 0 0 0 -( -320 -128 320 ) ( -320 256 320 ) ( -320 -128 328 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -64 -24 64 ) ( -64 64 64 ) ( 64 -24 64 ) common/caulk [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -} -// brush 6 -{ -( 192 192 456 ) ( -320 192 456 ) ( 192 192 448 ) measure/wall64a [ 1 0 0 128 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 192 200 ) ( -256 192 192 ) ( -256 -192 200 ) measure/wall64a [ 0 1 0 128 ] [ -0 -0 -1 128 ] -0 0.5 0.5 0 0 0 -( -768 -192 64 ) ( -256 -192 64 ) ( -768 192 64 ) measure/wall64a [ 1 0 0 128 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -320 -192 448 ) ( -320 -192 456 ) ( 192 -192 448 ) measure/wall64a [ 1 0 0 128 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -320 -192 448 ) ( -320 192 448 ) ( -320 -192 456 ) measure/wall64a [ 0 1 0 128 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -64 -24 192 ) ( -64 64 192 ) ( 64 -24 192 ) measure/wall64a [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -} -// brush 7 -{ -( 768 192 456 ) ( 256 192 456 ) ( 768 192 448 ) measure/wall64a [ 1 0 0 128 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 320 192 200 ) ( 320 192 192 ) ( 320 -192 200 ) measure/wall64a [ 0 1 0 128 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -192 -192 64 ) ( 320 -192 64 ) ( -192 192 64 ) measure/wall64a [ 1 0 0 128 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 256 -192 448 ) ( 256 -192 456 ) ( 768 -192 448 ) measure/wall64a [ 1 0 0 128 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 256 -192 448 ) ( 256 192 448 ) ( 256 -192 456 ) measure/wall64a [ 0 1 0 128 ] [ -0 -0 -1 128 ] -0 0.5 0.5 0 0 0 -( -64 -24 192 ) ( -64 64 192 ) ( 64 -24 192 ) measure/wall64a [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -} -// brush 8 -{ -( 192 -192 456 ) ( -320 -192 456 ) ( 192 -192 448 ) measure/wall64a [ 1 0 0 0 ] [ -0 -0 -1 128 ] -0 0.5 0.5 0 0 0 -( 320 96 200 ) ( 320 96 192 ) ( 320 -288 200 ) measure/wall64a [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -768 -576 64 ) ( -256 -576 64 ) ( -768 -192 64 ) measure/wall64a [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 272 -256 448 ) ( 272 -256 456 ) ( 784 -256 448 ) measure/wall64a [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -320 -576 448 ) ( -320 -192 448 ) ( -320 -576 456 ) measure/wall64a [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -64 -24 192 ) ( -64 64 192 ) ( 64 -24 192 ) measure/wall64a [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -} -// brush 9 -{ -( 192 256 456 ) ( -320 256 456 ) ( 192 256 448 ) measure/wall64a [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 320 544 200 ) ( 320 544 192 ) ( 320 160 200 ) measure/wall64a [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -768 -128 64 ) ( -256 -128 64 ) ( -768 256 64 ) measure/wall64a [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 272 192 448 ) ( 272 192 456 ) ( 784 192 448 ) measure/wall64a [ 1 0 0 0 ] [ -0 -0 -1 128 ] -0 0.5 0.5 0 0 0 -( -320 -128 448 ) ( -320 256 448 ) ( -320 -128 456 ) measure/wall64a [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -64 -24 192 ) ( -64 64 192 ) ( 64 -24 192 ) measure/wall64a [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -} -} -// entity 1 -{ -"classname" "info_player_start" -"origin" "0.000000 0.000000 -24.000000" -} -// entity 2 -{ -"classname" "info_player_deathmatch" -"origin" "0.000000 0.000000 -24.000000" -} -// entity 3 -{ -"classname" "light" -"origin" "0.000000 0.000000 96.000000" -"light" "500" -} -// entity 4 -{ -"classname" "func_healthcharger" -// brush 0 -{ -( 240 136 32 ) ( 240 72 32 ) ( 224 136 32 ) measure/wall64a [ 0 1 0 64 ] [ 1 0 0 0 ] -0 0.5 0.5 0 0 0 -( 256 120 16 ) ( 240 120 16 ) ( 256 120 0 ) measure/wall64a [ -1 0 0 0 ] [ 0 0 -1 0 ] -0 0.5 0.5 0 0 0 -( 256 136 16 ) ( 256 136 0 ) ( 256 72 16 ) measure/wall64a [ 0 1 0 64 ] [ 0 0 -1 0 ] -0 0.5 0.5 0 0 0 -( 240 72 -32 ) ( 256 72 -32 ) ( 240 136 -32 ) measure/wall64a [ 0 1 0 64 ] [ -1 0 0 0 ] -0 0.5 0.5 0 0 0 -( 240 72 0 ) ( 240 72 16 ) ( 256 72 0 ) measure/wall64a [ 1 0 0 0 ] [ 0 0 -1 0 ] -0 0.5 0.5 0 0 0 -( 240 72 -32 ) ( 240 136 -32 ) ( 240 72 -16 ) measure/healthcharge [ 0 -1 0 112 ] [ -0 0 -1 64 ] -0 0.5 0.5 0 0 0 -} -} -// entity 5 -{ -"classname" "func_recharge" -// brush 0 -{ -( 240 -56 32 ) ( 240 -120 32 ) ( 224 -56 32 ) measure/wall64a [ 0 1 0 64 ] [ 1 0 0 0 ] -0 0.5 0.5 0 0 0 -( 256 -72 16 ) ( 240 -72 16 ) ( 256 -72 0 ) measure/wall64a [ -1 0 0 0 ] [ 0 0 -1 0 ] -0 0.5 0.5 0 0 0 -( 256 -56 16 ) ( 256 -56 0 ) ( 256 -120 16 ) measure/wall64a [ 0 1 0 64 ] [ 0 0 -1 0 ] -0 0.5 0.5 0 0 0 -( 240 -120 -32 ) ( 256 -120 -32 ) ( 240 -56 -32 ) measure/wall64a [ 0 1 0 64 ] [ -1 0 0 0 ] -0 0.5 0.5 0 0 0 -( 240 -120 0 ) ( 240 -120 16 ) ( 256 -120 0 ) measure/wall64a [ 1 0 0 0 ] [ 0 0 -1 0 ] -0 0.5 0.5 0 0 0 -( 240 -120 -32 ) ( 240 -56 -32 ) ( 240 -120 -16 ) measure/recharge [ 0 -1 0 112 ] [ -0 0 -1 64 ] -0 0.5 0.5 0 0 0 -} -} diff --git a/base/test_maps.pk3dir/maps/test/func_chargers.prt b/base/test_maps.pk3dir/maps/test/func_chargers.prt deleted file mode 100644 index 4d2fec3c..00000000 --- a/base/test_maps.pk3dir/maps/test/func_chargers.prt +++ /dev/null @@ -1,40 +0,0 @@ -PRT1 -8 -12 -24 -4 0 4 0 (0 0 0 ) (0 0 128 ) (0 192 128 ) (0 192 0 ) -4 0 2 0 (0 0 128 ) (0 0 0 ) (256 0 0 ) (256 0 128 ) -4 0 1 0 (256 0 0 ) (0 0 0 ) (0 192 0 ) (256 192 0 ) -4 1 5 0 (0 0 -64 ) (0 0 0 ) (0 192 0 ) (0 192 -64 ) -4 1 3 0 (0 0 0 ) (0 0 -64 ) (256 0 -64 ) (256 0 0 ) -4 2 6 0 (0 0 128 ) (0 0 0 ) (0 -192 0 ) (0 -192 128 ) -4 2 3 0 (0 -192 0 ) (0 0 0 ) (256 0 0 ) (256 -192 0 ) -4 3 7 0 (0 -192 -64 ) (0 -192 0 ) (0 0 0 ) (0 0 -64 ) -4 4 6 0 (-256 0 0 ) (0 0 0 ) (0 0 128 ) (-256 0 128 ) -4 4 5 0 (0 0 0 ) (-256 0 0 ) (-256 192 0 ) (0 192 0 ) -4 5 7 0 (-256 0 -64 ) (0 0 -64 ) (0 0 0 ) (-256 0 0 ) -4 6 7 0 (-256 0 0 ) (0 0 0 ) (0 -192 0 ) (-256 -192 0 ) -4 0 (256 0 128 ) (256 0 0 ) (256 192 0 ) (256 192 128 ) -4 0 (256 192 128 ) (256 192 0 ) (0 192 0 ) (0 192 128 ) -4 0 (0 0 128 ) (256 0 128 ) (256 192 128 ) (0 192 128 ) -4 1 (256 0 -64 ) (0 0 -64 ) (0 192 -64 ) (256 192 -64 ) -4 1 (256 192 -64 ) (0 192 -64 ) (0 192 0 ) (256 192 0 ) -4 1 (256 0 0 ) (256 0 -64 ) (256 192 -64 ) (256 192 0 ) -4 2 (256 -192 128 ) (256 -192 0 ) (256 0 0 ) (256 0 128 ) -4 2 (0 -192 128 ) (0 -192 0 ) (256 -192 0 ) (256 -192 128 ) -4 2 (0 -192 128 ) (256 -192 128 ) (256 0 128 ) (0 0 128 ) -4 3 (256 -192 -64 ) (0 -192 -64 ) (0 0 -64 ) (256 0 -64 ) -4 3 (256 -192 0 ) (0 -192 0 ) (0 -192 -64 ) (256 -192 -64 ) -4 3 (256 0 0 ) (256 -192 0 ) (256 -192 -64 ) (256 0 -64 ) -4 4 (-256 192 128 ) (-256 192 0 ) (-256 0 0 ) (-256 0 128 ) -4 4 (-256 192 128 ) (0 192 128 ) (0 192 0 ) (-256 192 0 ) -4 4 (0 192 128 ) (-256 192 128 ) (-256 0 128 ) (0 0 128 ) -4 5 (0 0 -64 ) (-256 0 -64 ) (-256 192 -64 ) (0 192 -64 ) -4 5 (-256 192 -64 ) (-256 192 0 ) (0 192 0 ) (0 192 -64 ) -4 5 (-256 192 0 ) (-256 192 -64 ) (-256 0 -64 ) (-256 0 0 ) -4 6 (-256 0 128 ) (-256 0 0 ) (-256 -192 0 ) (-256 -192 128 ) -4 6 (-256 -192 0 ) (0 -192 0 ) (0 -192 128 ) (-256 -192 128 ) -4 6 (0 0 128 ) (-256 0 128 ) (-256 -192 128 ) (0 -192 128 ) -4 7 (0 -192 -64 ) (-256 -192 -64 ) (-256 0 -64 ) (0 0 -64 ) -4 7 (0 -192 -64 ) (0 -192 0 ) (-256 -192 0 ) (-256 -192 -64 ) -4 7 (-256 0 -64 ) (-256 -192 -64 ) (-256 -192 0 ) (-256 0 0 ) diff --git a/base/test_maps.pk3dir/maps/test/func_chargers.srf b/base/test_maps.pk3dir/maps/test/func_chargers.srf deleted file mode 100644 index 4e196d8c..00000000 --- a/base/test_maps.pk3dir/maps/test/func_chargers.srf +++ /dev/null @@ -1,164 +0,0 @@ -default -{ - castShadows 1 - receiveShadows 1 - sampleSize 16 - longestCurve 0.000000 -} - -0 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - lightmapAxis ( 0.000000 -1.000000 0.000000 ) -} - -1 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - lightmapAxis ( 0.000000 1.000000 0.000000 ) -} - -2 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - lightmapAxis ( -1.000000 0.000000 0.000000 ) -} - -3 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - lightmapAxis ( 1.000000 0.000000 0.000000 ) -} - -4 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall128gr - lightmapAxis ( 0.000000 -1.000000 0.000000 ) -} - -5 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall128gr - lightmapAxis ( 0.000000 1.000000 0.000000 ) -} - -6 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall128gr - lightmapAxis ( -1.000000 0.000000 0.000000 ) -} - -7 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall128gr - lightmapAxis ( 1.000000 0.000000 0.000000 ) -} - -8 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/ceiling - lightmapAxis ( 0.000000 0.000000 -1.000000 ) -} - -9 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/floor - lightmapAxis ( 0.000000 0.000000 1.000000 ) -} - -10 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/healthcharge - entity 4 - castShadows 0 - lightmapAxis ( -1.000000 0.000000 0.000000 ) -} - -11 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - entity 4 - castShadows 0 - lightmapAxis ( 1.000000 0.000000 0.000000 ) -} - -12 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - entity 4 - castShadows 0 - lightmapAxis ( 0.000000 -1.000000 0.000000 ) -} - -13 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - entity 4 - castShadows 0 - lightmapAxis ( 0.000000 1.000000 0.000000 ) -} - -14 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - entity 4 - castShadows 0 - lightmapAxis ( 0.000000 0.000000 -1.000000 ) -} - -15 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - entity 4 - castShadows 0 - lightmapAxis ( 0.000000 0.000000 1.000000 ) -} - -16 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/recharge - entity 5 - castShadows 0 - lightmapAxis ( -1.000000 0.000000 0.000000 ) -} - -17 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - entity 5 - castShadows 0 - lightmapAxis ( 1.000000 0.000000 0.000000 ) -} - -18 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - entity 5 - castShadows 0 - lightmapAxis ( 0.000000 -1.000000 0.000000 ) -} - -19 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - entity 5 - castShadows 0 - lightmapAxis ( 0.000000 1.000000 0.000000 ) -} - -20 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - entity 5 - castShadows 0 - lightmapAxis ( 0.000000 0.000000 -1.000000 ) -} - -21 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall64a - entity 5 - castShadows 0 - lightmapAxis ( 0.000000 0.000000 1.000000 ) -} - diff --git a/base/test_maps.pk3dir/maps/test/mapscript.bak b/base/test_maps.pk3dir/maps/test/mapscript.bak deleted file mode 100644 index 4de79d6a..00000000 --- a/base/test_maps.pk3dir/maps/test/mapscript.bak +++ /dev/null @@ -1,115 +0,0 @@ - -// entity 0 -{ -"classname" "worldspawn" -"sun_pos" "44.5842 325.561 0" -"lf_pos" "315.416 145.561 0" -// brush 0 -{ -( 512 512 0 ) ( 512 -512 0 ) ( -512 512 0 ) next/bunker3 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.25 0.25 0 0 0 -( 512 512 0 ) ( -512 512 0 ) ( 512 512 -128 ) next/bunker3 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( 512 512 0 ) ( 512 512 -128 ) ( 512 -512 0 ) next/bunker3 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( -512 -512 -128 ) ( 512 -512 -128 ) ( -512 512 -128 ) next/bunker3 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.25 0.25 0 0 0 -( -512 -512 -128 ) ( -512 -512 0 ) ( 512 -512 -128 ) next/bunker3 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( -512 -512 -128 ) ( -512 512 -128 ) ( -512 -512 0 ) next/bunker3 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -} -// brush 1 -{ -( -512 640 256 ) ( -512 -640 256 ) ( -640 640 256 ) skies/smudge [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -512 640 128 ) ( -640 640 128 ) ( -512 640 0 ) skies/smudge [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -512 640 128 ) ( -512 640 0 ) ( -512 -640 128 ) skies/smudge [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -640 -640 0 ) ( -512 -640 0 ) ( -640 640 0 ) skies/smudge [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -640 -640 0 ) ( -640 -640 128 ) ( -512 -640 0 ) skies/smudge [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -640 -640 0 ) ( -640 640 0 ) ( -640 -640 128 ) skies/smudge [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -} -// brush 2 -{ -( 640 640 256 ) ( 640 512 256 ) ( -512 640 256 ) skies/smudge [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 640 640 256 ) ( -512 640 256 ) ( 640 640 0 ) skies/smudge [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 640 640 256 ) ( 640 640 0 ) ( 640 512 256 ) skies/smudge [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -512 512 0 ) ( 640 512 0 ) ( -512 640 0 ) skies/smudge [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -512 512 0 ) ( -512 512 256 ) ( 640 512 0 ) skies/smudge [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -512 512 0 ) ( -512 640 0 ) ( -512 512 256 ) skies/smudge [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -} -// brush 3 -{ -( 640 512 256 ) ( 640 -640 256 ) ( 512 512 256 ) skies/smudge [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 640 512 256 ) ( 512 512 256 ) ( 640 512 0 ) skies/smudge [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 640 512 256 ) ( 640 512 0 ) ( 640 -640 256 ) skies/smudge [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 512 -640 0 ) ( 640 -640 0 ) ( 512 512 0 ) skies/smudge [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 512 -640 0 ) ( 512 -640 256 ) ( 640 -640 0 ) skies/smudge [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 512 -640 0 ) ( 512 512 0 ) ( 512 -640 256 ) skies/smudge [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -} -// brush 4 -{ -( 512 -512 256 ) ( 512 -640 256 ) ( -512 -512 256 ) skies/smudge [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 512 -512 256 ) ( -512 -512 256 ) ( 512 -512 0 ) skies/smudge [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 512 -512 256 ) ( 512 -512 0 ) ( 512 -640 256 ) skies/smudge [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -512 -640 0 ) ( 512 -640 0 ) ( -512 -512 0 ) skies/smudge [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -512 -640 0 ) ( -512 -640 256 ) ( 512 -640 0 ) skies/smudge [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -512 -640 0 ) ( -512 -512 0 ) ( -512 -640 256 ) skies/smudge [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -} -// brush 5 -{ -( 512 512 384 ) ( 512 -512 384 ) ( -512 512 384 ) skies/smudge [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 512 512 512 ) ( -512 512 512 ) ( 512 512 256 ) skies/smudge [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 512 512 512 ) ( 512 512 256 ) ( 512 -512 512 ) skies/smudge [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -512 -512 256 ) ( 512 -512 256 ) ( -512 512 256 ) skies/smudge [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -512 -512 256 ) ( -512 -512 512 ) ( 512 -512 256 ) skies/smudge [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -512 -512 256 ) ( -512 512 256 ) ( -512 -512 512 ) skies/smudge [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -} -// brush 6 -{ -( -128 192 64 ) ( -128 64 64 ) ( -256 192 64 ) next/bunker8 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.25 0.25 0 0 0 -( -128 192 64 ) ( -256 192 64 ) ( -128 192 -64 ) next/bunker8 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( -192 256 124 ) ( -192 256 -4 ) ( -192 128 124 ) next/bunker8 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( -256 128 0 ) ( -128 128 0 ) ( -256 256 0 ) next/bunker8 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.25 0.25 0 0 0 -( -256 128 0 ) ( -256 128 128 ) ( -128 128 0 ) next/bunker8 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( -256 128 0 ) ( -256 256 0 ) ( -256 128 128 ) next/bunker8 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -} -// brush 7 -{ -( 384 320 128 ) ( 384 192 128 ) ( 256 320 128 ) next/bunker8 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.25 0.25 0 0 0 -( 384 320 64 ) ( 256 320 64 ) ( 384 320 -64 ) next/bunker8 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( 320 384 124 ) ( 320 384 -4 ) ( 320 256 124 ) next/bunker8 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( 256 256 0 ) ( 384 256 0 ) ( 256 384 0 ) next/bunker8 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.25 0.25 0 0 0 -( 256 256 0 ) ( 256 256 128 ) ( 384 256 0 ) next/bunker8 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( 256 256 0 ) ( 256 384 0 ) ( 256 256 128 ) next/bunker8 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -} -// brush 8 -{ -( 320 -192 128 ) ( 320 -320 128 ) ( 192 -192 128 ) next/bunker8 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.25 0.25 0 0 0 -( 320 -192 64 ) ( 192 -192 64 ) ( 320 -192 -64 ) next/bunker8 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( 256 -128 124 ) ( 256 -128 -4 ) ( 256 -256 124 ) next/bunker8 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( 192 -256 0 ) ( 320 -256 0 ) ( 192 -128 0 ) next/bunker8 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.25 0.25 0 0 0 -( 192 -256 0 ) ( 192 -256 128 ) ( 320 -256 0 ) next/bunker8 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( 192 -256 0 ) ( 192 -128 0 ) ( 192 -256 128 ) next/bunker8 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -} -// brush 9 -{ -( -128 -256 64 ) ( -128 -384 64 ) ( -256 -256 64 ) next/bunker8 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.25 0.25 0 0 0 -( -128 -256 64 ) ( -256 -256 64 ) ( -128 -256 -64 ) next/bunker8 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( -192 -192 124 ) ( -192 -192 -4 ) ( -192 -320 124 ) next/bunker8 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( -256 -320 0 ) ( -128 -320 0 ) ( -256 -192 0 ) next/bunker8 [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.25 0.25 0 0 0 -( -256 -320 0 ) ( -256 -320 128 ) ( -128 -320 0 ) next/bunker8 [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -( -256 -320 0 ) ( -256 -192 0 ) ( -256 -320 128 ) next/bunker8 [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.25 0.25 0 0 0 -} -} -// entity 1 -{ -"classname" "light_environment" -"origin" "0 0 192" -"color" "0.996 0.941 0.835" -"ambientcolor" "0.678 0.816 0.949" -"intensity" "250" -"sunangle" "-44.616" -"pitch" "-145.86" -"filterradius" "1" -"sunspreadangle" "0" -"samples" "16" -} -// entity 2 -{ -"classname" "point_message" -"origin" "0 0 64" -} diff --git a/base/test_maps.pk3dir/maps/test/mapscript.prt b/base/test_maps.pk3dir/maps/test/mapscript.prt deleted file mode 100644 index dc202336..00000000 --- a/base/test_maps.pk3dir/maps/test/mapscript.prt +++ /dev/null @@ -1,121 +0,0 @@ -PRT1 -20 -51 -66 -4 0 6 0 (320 0 0 ) (512 0 0 ) (512 0 128 ) (320 0 128 ) -4 0 5 0 (512 0 128 ) (512 0 256 ) (320 0 256 ) (320 0 128 ) -4 0 2 0 (320 512 128 ) (320 512 0 ) (320 320 0 ) (320 320 128 ) -4 0 3 0 (320 256 0 ) (320 0 0 ) (320 0 128 ) (320 256 128 ) -4 0 1 0 (320 512 256 ) (320 512 128 ) (320 0 128 ) (320 0 256 ) -4 1 5 0 (320 0 128 ) (320 0 256 ) (256 0 256 ) (256 0 128 ) -4 1 2 0 (256 320 128 ) (256 512 128 ) (320 512 128 ) (320 320 128 ) -4 1 3 0 (256 0 128 ) (256 256 128 ) (320 256 128 ) (320 0 128 ) -4 1 4 0 (256 512 256 ) (256 512 128 ) (256 0 128 ) (256 0 256 ) -4 2 4 0 (256 512 128 ) (256 512 0 ) (256 320 0 ) (256 320 128 ) -4 3 6 0 (256 0 0 ) (320 0 0 ) (320 0 128 ) (256 0 128 ) -4 3 4 0 (256 256 0 ) (256 0 0 ) (256 0 128 ) (256 256 128 ) -4 4 11 0 (0 512 64 ) (0 512 0 ) (0 128 0 ) (0 128 64 ) -4 4 10 0 (0 128 256 ) (0 512 256 ) (0 512 64 ) (0 128 64 ) -4 4 14 0 (0 0 0 ) (0 0 256 ) (0 128 256 ) (0 128 0 ) -4 4 6 0 (192 0 0 ) (256 0 0 ) (256 0 128 ) (192 0 128 ) -4 4 8 0 (0 0 128 ) (0 0 0 ) (192 0 0 ) (192 0 128 ) -4 4 5 0 (0 0 256 ) (0 0 128 ) (256 0 128 ) (256 0 256 ) -4 5 15 0 (0 -256 256 ) (0 0 256 ) (0 0 128 ) (0 -256 128 ) -4 5 9 0 (512 -256 128 ) (512 -256 256 ) (0 -256 256 ) (0 -256 128 ) -4 5 7 0 (512 -256 128 ) (256 -256 128 ) (256 -192 128 ) (512 -192 128 ) -4 5 6 0 (192 -192 128 ) (192 0 128 ) (512 0 128 ) (512 -192 128 ) -4 5 8 0 (192 -256 128 ) (0 -256 128 ) (0 0 128 ) (192 0 128 ) -4 6 7 0 (256 -192 0 ) (512 -192 0 ) (512 -192 128 ) (256 -192 128 ) -4 6 8 0 (192 0 0 ) (192 -192 0 ) (192 -192 128 ) (192 0 128 ) -4 7 9 0 (256 -256 0 ) (512 -256 0 ) (512 -256 128 ) (256 -256 128 ) -4 8 16 0 (0 0 64 ) (0 0 0 ) (0 -256 0 ) (0 -256 64 ) -4 8 15 0 (0 0 128 ) (0 0 64 ) (0 -256 64 ) (0 -256 128 ) -4 8 9 0 (0 -256 0 ) (192 -256 0 ) (192 -256 128 ) (0 -256 128 ) -4 9 19 0 (0 -512 256 ) (0 -320 256 ) (0 -320 0 ) (0 -512 0 ) -4 9 17 0 (0 -256 64 ) (0 -256 0 ) (0 -320 0 ) (0 -320 64 ) -4 9 15 0 (0 -320 256 ) (0 -256 256 ) (0 -256 64 ) (0 -320 64 ) -4 10 12 0 (-256 192 64 ) (-256 512 64 ) (-192 512 64 ) (-192 192 64 ) -4 10 11 0 (0 128 64 ) (-192 128 64 ) (-192 512 64 ) (0 512 64 ) -4 10 13 0 (-256 512 256 ) (-256 512 64 ) (-256 128 64 ) (-256 128 256 ) -4 10 14 0 (0 128 64 ) (0 128 256 ) (-256 128 256 ) (-256 128 64 ) -4 11 12 0 (-192 192 64 ) (-192 512 64 ) (-192 512 0 ) (-192 192 0 ) -4 11 14 0 (-192 128 0 ) (0 128 0 ) (0 128 64 ) (-192 128 64 ) -4 12 13 0 (-256 512 64 ) (-256 512 0 ) (-256 192 0 ) (-256 192 64 ) -4 13 14 0 (-512 128 256 ) (-512 128 0 ) (-256 128 0 ) (-256 128 256 ) -4 14 16 0 (-256 0 0 ) (0 0 0 ) (0 0 64 ) (-256 0 64 ) -4 14 18 0 (-512 0 0 ) (-256 0 0 ) (-256 0 64 ) (-512 0 64 ) -4 14 15 0 (0 0 64 ) (0 0 256 ) (-512 0 256 ) (-512 0 64 ) -4 15 19 0 (-512 -320 256 ) (-512 -320 64 ) (0 -320 64 ) (0 -320 256 ) -4 15 17 0 (0 -320 64 ) (-192 -320 64 ) (-192 -256 64 ) (0 -256 64 ) -4 15 16 0 (-256 -256 64 ) (-256 0 64 ) (0 0 64 ) (0 -256 64 ) -4 15 18 0 (-256 -320 64 ) (-512 -320 64 ) (-512 0 64 ) (-256 0 64 ) -4 16 17 0 (-192 -256 0 ) (0 -256 0 ) (0 -256 64 ) (-192 -256 64 ) -4 16 18 0 (-256 0 0 ) (-256 -256 0 ) (-256 -256 64 ) (-256 0 64 ) -4 17 19 0 (-192 -320 0 ) (0 -320 0 ) (0 -320 64 ) (-192 -320 64 ) -4 18 19 0 (-512 -320 64 ) (-512 -320 0 ) (-256 -320 0 ) (-256 -320 64 ) -4 0 (320 320 0 ) (320 256 0 ) (320 256 128 ) (320 320 128 ) -4 0 (512 0 256 ) (512 0 0 ) (512 512 0 ) (512 512 256 ) -4 0 (320 512 256 ) (512 512 256 ) (512 512 0 ) (320 512 0 ) -4 0 (512 0 0 ) (320 0 0 ) (320 512 0 ) (512 512 0 ) -4 0 (512 512 256 ) (320 512 256 ) (320 0 256 ) (512 0 256 ) -4 1 (256 256 128 ) (256 320 128 ) (320 320 128 ) (320 256 128 ) -4 1 (320 512 256 ) (256 512 256 ) (256 0 256 ) (320 0 256 ) -4 1 (256 512 128 ) (256 512 256 ) (320 512 256 ) (320 512 128 ) -4 2 (256 320 0 ) (256 512 0 ) (320 512 0 ) (320 320 0 ) -4 2 (256 512 128 ) (320 512 128 ) (320 512 0 ) (256 512 0 ) -4 2 (320 320 0 ) (320 320 128 ) (256 320 128 ) (256 320 0 ) -4 3 (256 256 0 ) (256 256 128 ) (320 256 128 ) (320 256 0 ) -4 3 (320 0 0 ) (256 0 0 ) (256 256 0 ) (320 256 0 ) -4 4 (256 320 128 ) (256 256 128 ) (256 256 0 ) (256 320 0 ) -4 4 (0 512 256 ) (256 512 256 ) (256 512 0 ) (0 512 0 ) -4 4 (256 0 0 ) (0 0 0 ) (0 512 0 ) (256 512 0 ) -4 4 (256 512 256 ) (0 512 256 ) (0 0 256 ) (256 0 256 ) -4 5 (256 -256 128 ) (192 -256 128 ) (192 -192 128 ) (256 -192 128 ) -4 5 (512 -256 256 ) (512 0 256 ) (0 0 256 ) (0 -256 256 ) -4 5 (512 0 128 ) (512 0 256 ) (512 -256 256 ) (512 -256 128 ) -4 6 (192 -192 128 ) (192 -192 0 ) (256 -192 0 ) (256 -192 128 ) -4 6 (192 0 0 ) (512 0 0 ) (512 -192 0 ) (192 -192 0 ) -4 6 (512 0 128 ) (512 -192 128 ) (512 -192 0 ) (512 0 0 ) -4 7 (512 -192 128 ) (512 -256 128 ) (512 -256 0 ) (512 -192 0 ) -4 7 (512 -192 0 ) (512 -256 0 ) (256 -256 0 ) (256 -192 0 ) -4 7 (256 -192 128 ) (256 -192 0 ) (256 -256 0 ) (256 -256 128 ) -4 8 (192 -192 128 ) (192 -256 128 ) (192 -256 0 ) (192 -192 0 ) -4 8 (0 -256 0 ) (0 0 0 ) (192 0 0 ) (192 -256 0 ) -4 9 (512 -512 256 ) (512 -256 256 ) (0 -256 256 ) (0 -512 256 ) -4 9 (0 -512 0 ) (0 -256 0 ) (512 -256 0 ) (512 -512 0 ) -4 9 (512 -256 256 ) (512 -512 256 ) (512 -512 0 ) (512 -256 0 ) -4 9 (192 -256 128 ) (256 -256 128 ) (256 -256 0 ) (192 -256 0 ) -4 9 (0 -512 0 ) (512 -512 0 ) (512 -512 256 ) (0 -512 256 ) -4 10 (-192 128 64 ) (-256 128 64 ) (-256 192 64 ) (-192 192 64 ) -4 10 (-256 128 256 ) (0 128 256 ) (0 512 256 ) (-256 512 256 ) -4 10 (-256 512 64 ) (-256 512 256 ) (0 512 256 ) (0 512 64 ) -4 11 (-192 128 0 ) (-192 128 64 ) (-192 192 64 ) (-192 192 0 ) -4 11 (-192 512 64 ) (0 512 64 ) (0 512 0 ) (-192 512 0 ) -4 11 (-192 512 0 ) (0 512 0 ) (0 128 0 ) (-192 128 0 ) -4 12 (-256 512 0 ) (-192 512 0 ) (-192 192 0 ) (-256 192 0 ) -4 12 (-256 512 64 ) (-192 512 64 ) (-192 512 0 ) (-256 512 0 ) -4 12 (-192 192 0 ) (-192 192 64 ) (-256 192 64 ) (-256 192 0 ) -4 13 (-256 192 64 ) (-256 128 64 ) (-256 128 0 ) (-256 192 0 ) -4 13 (-256 512 256 ) (-256 512 0 ) (-512 512 0 ) (-512 512 256 ) -4 13 (-512 512 0 ) (-512 128 0 ) (-512 128 256 ) (-512 512 256 ) -4 13 (-512 128 0 ) (-512 512 0 ) (-256 512 0 ) (-256 128 0 ) -4 13 (-256 128 256 ) (-256 512 256 ) (-512 512 256 ) (-512 128 256 ) -4 14 (-256 128 64 ) (-192 128 64 ) (-192 128 0 ) (-256 128 0 ) -4 14 (-512 128 0 ) (-512 0 0 ) (-512 0 256 ) (-512 128 256 ) -4 14 (0 0 0 ) (-512 0 0 ) (-512 128 0 ) (0 128 0 ) -4 14 (0 128 256 ) (-512 128 256 ) (-512 0 256 ) (0 0 256 ) -4 15 (-192 -320 64 ) (-256 -320 64 ) (-256 -256 64 ) (-192 -256 64 ) -4 15 (-512 -320 256 ) (0 -320 256 ) (0 0 256 ) (-512 0 256 ) -4 15 (-512 -320 64 ) (-512 -320 256 ) (-512 0 256 ) (-512 0 64 ) -4 16 (-256 -256 64 ) (-256 -256 0 ) (-192 -256 0 ) (-192 -256 64 ) -4 16 (-256 0 0 ) (0 0 0 ) (0 -256 0 ) (-256 -256 0 ) -4 17 (0 -256 0 ) (0 -320 0 ) (-192 -320 0 ) (-192 -256 0 ) -4 17 (-192 -256 64 ) (-192 -256 0 ) (-192 -320 0 ) (-192 -320 64 ) -4 18 (-256 -256 64 ) (-256 -320 64 ) (-256 -320 0 ) (-256 -256 0 ) -4 18 (-512 0 0 ) (-512 -320 0 ) (-512 -320 64 ) (-512 0 64 ) -4 18 (-512 0 0 ) (-256 0 0 ) (-256 -320 0 ) (-512 -320 0 ) -4 19 (-512 -320 256 ) (-512 -512 256 ) (0 -512 256 ) (0 -320 256 ) -4 19 (0 -320 0 ) (0 -512 0 ) (-512 -512 0 ) (-512 -320 0 ) -4 19 (-512 -320 0 ) (-512 -512 0 ) (-512 -512 256 ) (-512 -320 256 ) -4 19 (-256 -320 64 ) (-192 -320 64 ) (-192 -320 0 ) (-256 -320 0 ) -4 19 (-512 -512 256 ) (-512 -512 0 ) (0 -512 0 ) (0 -512 256 ) diff --git a/base/test_maps.pk3dir/maps/test/mapscript.mapC b/base/test_maps.pk3dir/maps/test/mapscript.qc similarity index 78% rename from base/test_maps.pk3dir/maps/test/mapscript.mapC rename to base/test_maps.pk3dir/maps/test/mapscript.qc index 7258cc89..c2404b78 100644 --- a/base/test_maps.pk3dir/maps/test/mapscript.mapC +++ b/base/test_maps.pk3dir/maps/test/mapscript.qc @@ -1,6 +1,6 @@ #pragma PROGS_DAT "mapscript.dat" -#include "../../../src/server/mapC.src" +#include "../../../src/server/api.h" void main() { @@ -11,4 +11,9 @@ void main() radio = spawnClass("info_player_deathmatch", [0, 0, 128]); radio.angles = [0, random(-180, 180), 0]; radio.targetname = "MPSpawn"; +} + +void CSEv_TriggerTarget_s(string toTrigger) +{ + } \ No newline at end of file diff --git a/base/test_maps.pk3dir/maps/test/mapscript.srf b/base/test_maps.pk3dir/maps/test/mapscript.srf deleted file mode 100644 index 29f60cd1..00000000 --- a/base/test_maps.pk3dir/maps/test/mapscript.srf +++ /dev/null @@ -1,164 +0,0 @@ -default -{ - castShadows 1 - receiveShadows 1 - sampleSize 16 - longestCurve 0.000000 -} - -0 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( -1.000000 0.000000 0.000000 ) -} - -1 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 1.000000 0.000000 0.000000 ) -} - -2 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 0.000000 -1.000000 0.000000 ) -} - -3 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 0.000000 1.000000 0.000000 ) -} - -4 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 0.000000 0.000000 1.000000 ) -} - -5 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( -1.000000 0.000000 0.000000 ) -} - -6 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 1.000000 0.000000 0.000000 ) -} - -7 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 0.000000 -1.000000 0.000000 ) -} - -8 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 0.000000 1.000000 0.000000 ) -} - -9 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 0.000000 0.000000 1.000000 ) -} - -10 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( -1.000000 0.000000 0.000000 ) -} - -11 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 1.000000 0.000000 0.000000 ) -} - -12 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 0.000000 -1.000000 0.000000 ) -} - -13 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 0.000000 1.000000 0.000000 ) -} - -14 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 0.000000 0.000000 1.000000 ) -} - -15 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( -1.000000 0.000000 0.000000 ) -} - -16 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 1.000000 0.000000 0.000000 ) -} - -17 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 0.000000 -1.000000 0.000000 ) -} - -18 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 0.000000 1.000000 0.000000 ) -} - -19 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker8 - lightmapAxis ( 0.000000 0.000000 1.000000 ) -} - -20 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/skies/smudge - sampleSize 0 -} - -21 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/skies/smudge - sampleSize 0 -} - -22 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/skies/smudge - sampleSize 0 -} - -23 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/skies/smudge - sampleSize 0 -} - -24 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/skies/smudge - sampleSize 0 -} - -25 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/next/bunker3 - lightmapAxis ( 0.000000 0.000000 1.000000 ) -} - diff --git a/base/test_maps.pk3dir/maps/test/ui.qc b/base/test_maps.pk3dir/maps/test/ui.qc new file mode 100644 index 00000000..fd69b364 --- /dev/null +++ b/base/test_maps.pk3dir/maps/test/ui.qc @@ -0,0 +1,13 @@ +#pragma PROGS_DAT "ui.dat" + +#include "../../../../src/server/api.h" + +void +CSEv_TriggerTarget_s(string toTrigger) +{ + entity findMe = find(world, ::targetname, toTrigger); + + if (findMe) { + sendInput(findMe, "Trigger", "", self); + } +} diff --git a/base/test_maps.pk3dir/maps/test/weapons.bak b/base/test_maps.pk3dir/maps/test/weapons.bak deleted file mode 100644 index c2c2c155..00000000 --- a/base/test_maps.pk3dir/maps/test/weapons.bak +++ /dev/null @@ -1,100 +0,0 @@ - -// entity 0 -{ -"classname" "worldspawn" -// brush 0 -{ -( 248 192 -64 ) ( 248 -192 -64 ) ( -264 192 -64 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 256 192 8 ) ( -256 192 8 ) ( 256 192 0 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 256 192 8 ) ( 256 192 0 ) ( 256 -192 8 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 -128 ) ( 256 -192 -128 ) ( -256 192 -128 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 0 ) ( -256 -192 8 ) ( 256 -192 0 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 0 ) ( -256 192 0 ) ( -256 -192 8 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -} -// brush 1 -{ -( 248 192 192 ) ( 248 -192 192 ) ( -264 192 192 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 256 192 264 ) ( -256 192 264 ) ( 256 192 256 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 256 192 264 ) ( 256 192 256 ) ( 256 -192 264 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 128 ) ( 256 -192 128 ) ( -256 192 128 ) measure/floor [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 256 ) ( -256 -192 264 ) ( 256 -192 256 ) measure/floor [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 -192 256 ) ( -256 192 256 ) ( -256 -192 264 ) measure/floor [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -} -// brush 2 -{ -( 184 192 192 ) ( 184 -192 192 ) ( -328 192 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 192 192 264 ) ( -320 192 264 ) ( 192 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -256 192 8 ) ( -256 192 0 ) ( -256 -192 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -768 -192 -128 ) ( -256 -192 -128 ) ( -768 192 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( -320 -192 256 ) ( -320 -192 264 ) ( 192 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -320 -192 256 ) ( -320 192 256 ) ( -320 -192 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -} -// brush 3 -{ -( 760 192 192 ) ( 760 -192 192 ) ( 248 192 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 768 192 264 ) ( 256 192 264 ) ( 768 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 320 192 8 ) ( 320 192 0 ) ( 320 -192 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -192 -192 -128 ) ( 320 -192 -128 ) ( -192 192 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 256 -192 256 ) ( 256 -192 264 ) ( 768 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 256 -192 256 ) ( 256 192 256 ) ( 256 -192 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -} -// brush 4 -{ -( 184 -192 192 ) ( 184 -576 192 ) ( -328 -192 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 192 -192 264 ) ( -320 -192 264 ) ( 192 -192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 320 96 8 ) ( 320 96 0 ) ( 320 -288 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -768 -576 -128 ) ( -256 -576 -128 ) ( -768 -192 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 272 -256 256 ) ( 272 -256 264 ) ( 784 -256 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -320 -576 256 ) ( -320 -192 256 ) ( -320 -576 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -} -// brush 5 -{ -( 184 256 192 ) ( 184 -128 192 ) ( -328 256 192 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 192 256 264 ) ( -320 256 264 ) ( 192 256 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( 320 544 8 ) ( 320 544 0 ) ( 320 160 8 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -768 -128 -128 ) ( -256 -128 -128 ) ( -768 256 -128 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -1 -0 0 ] -0 0.5 0.5 0 0 0 -( 272 192 256 ) ( 272 192 264 ) ( 784 192 256 ) measure/wall128gr [ 1 0 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -( -320 -128 256 ) ( -320 256 256 ) ( -320 -128 264 ) measure/wall128gr [ 0 1 0 0 ] [ -0 -0 -1 0 ] -0 0.5 0.5 0 0 0 -} -} -// entity 1 -{ -"classname" "info_player_start" -"origin" "0.000000 0.000000 -24.000000" -} -// entity 2 -{ -"classname" "info_player_deathmatch" -"origin" "0.000000 0.000000 -24.000000" -} -// entity 3 -{ -"classname" "light" -"origin" "0.000000 0.000000 96.000000" -"light" "500" -} -// entity 4 -{ -"classname" "env_explosion" -"targetname" "testtrigger" -"origin" "0.000000 0.000000 0.000000" -"iMagnitude" "1024" -} -// entity 5 -{ -"classname" "weapon_bat" -"origin" "-128.000000 0.000000 -8.000000" -"angles" "0 180 0" -} -// entity 6 -{ -"classname" "weapon_pistol" -"origin" "0.000000 -128.000000 -8.000000" -"angles" "0 -90 0" -} -// entity 7 -{ -"classname" "weapon_frag" -"origin" "0.000000 128.000000 -8.000000" -"angles" "0 90 0" -} diff --git a/base/test_maps.pk3dir/maps/test/weapons.srf b/base/test_maps.pk3dir/maps/test/weapons.srf deleted file mode 100644 index ef7fbac7..00000000 --- a/base/test_maps.pk3dir/maps/test/weapons.srf +++ /dev/null @@ -1,44 +0,0 @@ -default -{ - castShadows 1 - receiveShadows 1 - sampleSize 16 - longestCurve 0.000000 -} - -0 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall128gr - lightmapAxis ( 0.000000 -1.000000 0.000000 ) -} - -1 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall128gr - lightmapAxis ( 0.000000 1.000000 0.000000 ) -} - -2 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall128gr - lightmapAxis ( -1.000000 0.000000 0.000000 ) -} - -3 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/wall128gr - lightmapAxis ( 1.000000 0.000000 0.000000 ) -} - -4 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/floor - lightmapAxis ( 0.000000 0.000000 -1.000000 ) -} - -5 // SURFACE_FACE V: 4 I: 6 planar -{ - shader textures/measure/floor - lightmapAxis ( 0.000000 0.000000 1.000000 ) -} - diff --git a/base/test_maps.pk3dir/models/logo.iqm b/base/test_maps.pk3dir/models/logo.iqm new file mode 100644 index 00000000..75e16e4d Binary files /dev/null and b/base/test_maps.pk3dir/models/logo.iqm differ diff --git a/src/botlib/defs.h b/src/botlib/defs.h index 1a1ea6bf..83f4e51c 100644 --- a/src/botlib/defs.h +++ b/src/botlib/defs.h @@ -14,47 +14,54 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "cvars.h" -#include "profiles.h" - -/** @defgroup bot Bot -@brief Multiplayer game opponents, allies. -@ingroup ai - -# Bot {#bot} - -@{ -*/ - +#include "cvars.h" +#include "profiles.h" + +/** @defgroup bot Bot +@brief Multiplayer game opponents, allies. +@ingroup ai + +![](computer.png) Computer controlled opponents are called "Bots". If a game supports them, they will be added with either `bot_minClients #` in the server console, or with the `addBot` command. + +## See also + +- @ref bot_profile +- @ref bot_cvars +- @ref bot_info +- @ref NSBot + +@{ +*/ + vector Route_SelectDestination( NSBot target ); - -var int autocvar_nav_linksize = 256; -var int autocvar_nav_radius = 8; - -void -_BotLog(string functionName, string msg) -{ - print(sprintf("%f ^xF05%s ^7: %s\n", time, functionName, msg)); -} - -/** Logs an bot system specific log message. - The console variable `bot_developer` has to be `1` for them to be visible. - -@param description(...) contains a formatted string containing a description. */ -#define BotLog(...) if (autocvar_bot_developer) _BotLog(__FUNC__, sprintf(__VA_ARGS__)) - -void -_BotEntLog(string className, string functionName, float edictNum, string warnMessage) -{ - print(sprintf("%f ^xF05%s (id: %d) ^7: %s\n", time, functionName, edictNum, warnMessage)); -} - -/** Logs an bot specific entity class log message. - The console variable `bot_developer` has to be `1` for them to be visible. - -@param description(...) contains a formatted string containing a description. */ -#define BotEntLog(...) if (autocvar_bot_developer) _BotEntLog(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__)) - -var string autocvar_bot_prefix = ""; - -/** @} */ // end of bot \ No newline at end of file + +var int autocvar_nav_linksize = 256; +var int autocvar_nav_radius = 8; + +void +_BotLog(string functionName, string msg) +{ + print(sprintf("%f ^xF05%s ^7: %s\n", time, functionName, msg)); +} + +/** Logs an bot system specific log message. + The console variable `bot_developer` has to be `1` for them to be visible. + +@param description(...) contains a formatted string containing a description. */ +#define BotLog(...) if (autocvar_bot_developer) _BotLog(__FUNC__, sprintf(__VA_ARGS__)) + +void +_BotEntLog(string className, string functionName, float edictNum, string warnMessage) +{ + print(sprintf("%f ^xF05%s (id: %d) ^7: %s\n", time, functionName, edictNum, warnMessage)); +} + +/** Logs an bot specific entity class log message. + The console variable `bot_developer` has to be `1` for them to be visible. + +@param description(...) contains a formatted string containing a description. */ +#define BotEntLog(...) if (autocvar_bot_developer) _BotEntLog(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__)) + +var string autocvar_bot_prefix = ""; + +/** @} */ // end of bot diff --git a/src/menu-vgui/background.qc b/src/client/api.h old mode 100755 new mode 100644 similarity index 68% rename from src/menu-vgui/background.qc rename to src/client/api.h index 7d29221a..8f431666 --- a/src/menu-vgui/background.qc +++ b/src/client/api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2022 Vera Visions LLC. + * Copyright (c) 2016-2024 Vera Visions LLC. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -14,21 +14,19 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define BACKGROUND_IMG "gfx/background" +#pragma target fte_5768 +#define CSQC + +#include "../shared/fteextensions.qc" +#include "../shared/api.h" +#include "../shared/input.h" +#include "api_func.h" void -Background_Init(void) +main(void) { - precache_pic(BACKGROUND_IMG); -} - -void -Background_Draw(vector vecSize) -{ - if (clientstate() == 2) { - if (!g_background) - drawfill([ 0, 0 ], vecSize, [ 0, 0, 0 ], 0.5f); - } else - drawpic([ 0, 0 ], BACKGROUND_IMG, vecSize, [ 1, 1, 1 ], 1.0f); + _client_main(); + _shared_main(); + HUD_Init(); } diff --git a/src/client/api.qc b/src/client/api.qc new file mode 100644 index 00000000..1068f668 --- /dev/null +++ b/src/client/api.qc @@ -0,0 +1,391 @@ +/* + * Copyright (c) 2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/* + +This is the Client Game API. Used by client-side scriptobjects, hud progs etc. +There's no header because the main code is not supposed to use this. + +*/ + +/* view functions */ +float +Surface_ScreenWidth(void) +{ + return (g_vidsize[0]); +} + +float +Surface_ScreenHeight(void) +{ + return (g_vidsize[1]); +} + +vector +Surface_ScreenSize(void) +{ + return (g_vidsize); +} + +vector +Surface_HUDMins(void) +{ + return (g_hudmins); +} + +vector +Surface_HUDSize(void) +{ + return (g_hudres); +} + +/* player functions */ +float +Player_GetHealth(void) +{ + return (pSeat->m_ePlayer.health); +} + +float +Player_GetArmor(void) +{ + return (((NSClientPlayer)pSeat->m_ePlayer).armor); +} + +float +Player_GetStamina(void) +{ + return (((NSClientPlayer)pSeat->m_ePlayer).GetStamina()); +} + +int +Player_GetTeam(void) +{ + return (int)getplayerkeyfloat(pSeat->m_ePlayer.entnum-1, "*team"); +} + +bool +Player_HasItem(string itemName) +{ + return (((NSClientPlayer)pSeat->m_ePlayer).HasItem(itemName)); +} + +bool +Player_IsSprinting(string itemName) +{ + return ((NSClientPlayer)pSeat->m_ePlayer).IsSprinting(); +} + +bool +Player_IsCrouching(string itemName) +{ + return ((NSClientPlayer)pSeat->m_ePlayer).IsCrouching(); +} + +bool +Player_IsProne(string itemName) +{ + return ((NSClientPlayer)pSeat->m_ePlayer).IsProne(); +} + +bool +Player_IsStanding(string itemName) +{ + return ((NSClientPlayer)pSeat->m_ePlayer).IsStanding(); +} + +bool +Player_IsLeaning(string itemName) +{ + return ((NSClientPlayer)pSeat->m_ePlayer).IsLeaning(); +} + + +/* teamplay functions */ +string +Team_GetName(int teamNumber) +{ + return serverkey(sprintf("team_%i", teamNumber)); +} + +vector +Team_GetColor(int teamNumber) +{ + return g_vec_null; +} + +int +Team_GetScore(int teamNumber) +{ + return (int)serverkeyfloat(sprintf("teamscore_%i", teamNumber)); +} + +int +Team_GetPlayers(int teamNumber) +{ + return 0i; +} + +int +Team_GetCount(void) +{ + return (int)serverkeyfloat("teams"); +} + +bool +Weapon_IsValid(entity weaponEntity) +{ + NSWeapon weapon = (NSWeapon)weaponEntity; + + if (weapon) { + return (weapon.IsWeapon()); + } + + return (false); +} + +string +Weapon_GetTitle(entity weaponEntity) +{ + NSWeapon weapon = (NSWeapon)weaponEntity; + + if (weapon) { + return (weapon.m_strWeaponTitle); + } + + return "Unknown"; +} + +string +Weapon_GetIcon(entity weaponEntity) +{ + NSWeapon weapon = (NSWeapon)weaponEntity; + + if (weapon) { + return (weapon.m_icon); + } + + return "Unknown"; +} + +string +Weapon_GetSelectedIcon(entity weaponEntity) +{ + NSWeapon weapon = (NSWeapon)weaponEntity; + + if (weapon) { + return (weapon.m_iconSel); + } + + return "Unknown"; +} + +int +Weapon_GetSlot(entity weaponEntity) +{ + NSWeapon weapon = (NSWeapon)weaponEntity; + + if (weapon) { + return (weapon.m_iHudSlot); + } + + return -1i; +} + +int +Weapon_GetSlotPos(entity weaponEntity) +{ + NSWeapon weapon = (NSWeapon)weaponEntity; + + if (weapon) { + return (weapon.m_iHudSlotPos); + } + + return -1i; +} + +int +Weapon_GetClip(void) +{ + NSActor owner = (NSActor)pSeat->m_ePlayer; + NSWeapon weapon = owner.m_activeWeapon; + + if (weapon) { + return (weapon.m_iClip); + } + + return 0; +} + +int +Weapon_GetClipSize(void) +{ + NSActor owner = (NSActor)pSeat->m_ePlayer; + NSWeapon weapon = owner.m_activeWeapon; + + if (weapon) { + return (weapon.m_iClipSize); + } + + return 0; +} + +bool +Weapon_UsesSecondaryAmmo(void) +{ + NSActor owner = (NSActor)pSeat->m_ePlayer; + NSWeapon weapon = owner.m_activeWeapon; + + if (weapon) { + return weapon.UsesSecondaryAmmo(); + } + + return (false); +} + +int +Weapon_GetAmmo1(void) +{ + NSActor owner = (NSActor)pSeat->m_ePlayer; + NSWeapon weapon = owner.m_activeWeapon; + + if (weapon) { + return owner.GetReserveAmmo(weapon.m_primaryAmmoType); + } + + return -1i; +} + +int +Weapon_GetAmmo2(void) +{ + NSActor owner = (NSActor)pSeat->m_ePlayer; + NSWeapon weapon = owner.m_activeWeapon; + + if (weapon) { + return owner.GetReserveAmmo(weapon.m_secondaryAmmoType); + } + + return -1i; +} + +bool +Weapon_AmmoRequired(void) +{ + NSActor owner = (NSActor)pSeat->m_ePlayer; + NSWeapon weapon = owner.m_activeWeapon; + + if (weapon) { + return (weapon.m_fiAmmoRequired); + } + + return (false); +} + +entity +Weapon_GetActiveWeapon(void) +{ + return ((NSActor)pSeat->m_ePlayer).m_activeWeapon; +} + +entity +Weapon_GetFirstWeaponInInventory(void) +{ +#if 0 + return ((NSActor)pSeat->m_ePlayer).m_firstWeapon; +#else + return ((NSActor)pSeat->m_ePlayer).SortWeaponChain(); +#endif +} + +entity +Weapon_GetLastWeaponInInventory(void) +{ + return ((NSActor)pSeat->m_ePlayer).m_firstWeapon.m_prevWeapon; +} + +entity +Weapon_GetNextWeaponRelativeTo(entity weaponCheck) +{ + if (weaponCheck) + return ((NSWeapon)weaponCheck).m_nextWeapon; + + return __NULL__; +} + +entity +Weapon_GetPreviousWeaponRelativeTo(entity weaponCheck) +{ + if (weaponCheck) + return ((NSWeapon)weaponCheck).m_prevWeapon; + + return __NULL__; +} + +bool +Weapon_SelectWeapon(entity weaponCheck) +{ + if (weaponCheck) { + NSWeapon_SelectWeapon((NSWeapon)weaponCheck); + return (true); + } + + return (false); +} + +void +Draw_Rect(vector pos, vector size, vector rgb, float a) +{ + drawfill(pos, size, rgb, a); +} + +void +Draw_RectOutline(vector pos, vector size, float thickness, vector rgb, float a) +{ + drawrect(pos, size, thickness, rgb, a); +} + +void +Draw_RoundedBox(vector pos, vector size, vector rgb, float a) +{ + drawpic(pos, "textures/ui/m_topleft.tga", [16,16], rgb, a, 0); + drawpic(pos + [size[0] - 16, 0], "textures/ui/m_topright.tga", [16,16], rgb, a, 0); + drawpic(pos + [0, size[1] - 16], "textures/ui/m_bottomleft.tga", [16,16], rgb, a, 0); + drawpic(pos + [size[0] - 16, size[1] - 16], "textures/ui/m_bottomright.tga", [16,16], rgb, a, 0); + + if (size_x > 32) { + drawpic(pos + [16, 0], "textures/ui/m_top.tga", [size[0] - 32, 16], rgb, a, 0); + drawpic(pos + [16, size[1] - 16], "textures/ui/m_bottom.tga", [size[0] - 32, 16], rgb, a, 0); + } + + if (size_y > 32) { + drawpic(pos + [0, 16], "textures/ui/m_left.tga", [16, size[1] - 32], rgb, a, 0); + drawpic(pos + [size[0] - 16, 16], "textures/ui/m_right.tga", [16, size[1] - 32], rgb, a, 0); + drawpic(pos + [16, 16], "textures/ui/m_mid.tga", [size[0] - 32, size[1] - 32], rgb, a, 0); + } +} + +void +Draw_Line(float thickness, vector pos1, vector pos2, vector rgb, float a) +{ + drawline(thickness, pos1, pos2, rgb, a); +} + +void +Draw_Pic(vector pos, string material, vector size, vector rgb, float a) +{ + drawpic(pos, material, size, rgb, a); +} diff --git a/src/client/api_func.h b/src/client/api_func.h new file mode 100644 index 00000000..6f48b3b3 --- /dev/null +++ b/src/client/api_func.h @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2016-2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/** Flags for 2D drawing operations. */ +typedef enum +{ + DRAWFLAG_NORMAL = 0, /**< The default. */ + DRAWFLAG_ADDITIVE, /**< Render with an additive blend mode. */ + DRAWFLAG_MODULATE, /**< Not implemented in FTEQW. */ + DRAWFLAG_2XMODULATE /**< Not implemented in FTEQW. */ +} drawflag_t; + +/** Defines the valid alignment flags for text fields. +@sa Font_DrawField */ +typedef enumflags +{ + AF_LEFT, + AF_TOP, + AF_RIGHT, + AF_BOTTOM +} alignflags_t; +#define AF_NONE 0 + +/** Representation of a font. */ +typedef struct +{ + int iID; /**< Internal ID, will be passed to 'drawfont' before rendering text. */ + int iScaleX; /**< Suggested maximum width of a character in the font. */ + int iScaleY; /**< Maximum height of a chracter in the font. */ + vector vecColor; /**< Suggested default color of the font. */ + float flAlpha; /**< Suggested default alpha of the font. */ + int iFlags; /**< Rendering flags that the font posesses. @sa drawflag_t */ + string hexColor; +} font_s; + +/** @defgroup hudc HudC + @brief Client-side Game-Logic API + @ingroup multiprogs + +APIs used by HudC progs and the client progs exclusively. + +@{ +*/ + +/* Font library */ +typedef struct +{ + float GetID(font_s); + void Load(string,font_s &); + string RGBtoHex(vector); + int GetHeight(font_s); + float StringWidth(string,bool,font_s); +} fontAPI_t; +var fontAPI_t font; + + +/* Surface library */ +typedef struct +{ + float Width(void); + float Height(void); + vector HUDMins(void); + vector HUDSize(void); +} surfaceAPI_t; +var surfaceAPI_t screen; + +/* Surface library */ +typedef struct +{ + void Rect(vector, vector, vector, float); + void RectOutline(vector, vector, float, vector, float); + void RoundedBox(vector, vector, vector, float); + void Line(float, vector, vector, vector, float); + void Pic(vector, string, vector, vector, float); + void Text(vector,string,font_s); + void Text_A(vector,string,float,font_s); + void Text_RGB(vector,string,vector,font_s); + void Text_RGBA(vector,string,vector,float,font_s); + void RText(vector,string,font_s); + void RText_A(vector,string,float,font_s); + void RText_RGB(vector,string,vector,font_s); + void RText_RGBA(vector,string,vector,float,font_s); + void TextField(vector,vector,string,font_s,alignflags_t); + void TextFieldAtHeight(vector,vector,int,string,font_s,alignflags_t); +} drawAPI_t; +var drawAPI_t draw; + +/* Player library */ +typedef struct +{ + float GetArmor(void); + float GetHealth(void); + float GetStamina(void); + int GetTeam(void); + bool IsStanding(void); + bool IsLeaning(void); + bool IsSprinting(void); + bool IsCrouched(void); + bool IsProne(void); + bool HasItem(string); +} playerAPI_t; +var playerAPI_t player; + +/* Weapon library */ +typedef struct +{ + bool IsValid(entity); + string GetTitle(entity); + int GetSlot(entity); + int GetSlotPos(entity); + string GetIcon(entity); + string GetSelectedIcon(entity); + int GetAmmo1(void); + int GetAmmo2(void); + int GetClip(void); + int GetClipSize(void); + bool UsesSecondaryAmmo(void); + bool AmmoRequired(void); + + entity GetActiveWeapon(void); + entity GetFirstWeaponInInventory(void); + entity GetLastWeaponInInventory(void); + + entity GetNextWeaponRelativeTo(entity); + entity GetPreviousWeaponRelativeTo(entity); + + void SelectWeapon(entity); +} weaponAPI_t; +var weaponAPI_t weapon; + + +/** @} */ // end of hudC + +/* To be implemented by HUD */ +void HUD_Init(void); + +__variant +linkToClientProgs(string funcName) +{ + static void empty(void) + { + print("Called unimplemented client-side API call.\n"); + breakpoint(); + } + + void *func = externvalue(0, funcName); + + if (func) { + return ((__variant)func); + } else { + return (empty); + } +} + +void +_client_main(void) +{ + font.GetHeight = linkToClientProgs("Font_GetHeight"); + font.GetID = linkToClientProgs("Font_GetID"); + font.Load = linkToClientProgs("Font_Load"); + font.RGBtoHex = linkToClientProgs("Font_RGBtoHex"); + font.StringWidth = linkToClientProgs("Font_StringWidth"); + + screen.Width = linkToClientProgs("Surface_ScreenHeight"); + screen.Height = linkToClientProgs("Surface_ScreenHeight"); + + screen.HUDMins = linkToClientProgs("Surface_HUDMins"); + screen.HUDSize = linkToClientProgs("Surface_HUDSize"); + + player.GetHealth = linkToClientProgs("Player_GetHealth"); + player.GetArmor = linkToClientProgs("Player_GetArmor"); + player.GetStamina = linkToClientProgs("Player_GetStamina"); + player.GetTeam = linkToClientProgs("Player_GetTeam"); + player.HasItem = linkToClientProgs("Player_HasItem"); + player.IsStanding = linkToClientProgs("Player_IsStanding"); + player.IsLeaning = linkToClientProgs("Player_IsLeaning"); + player.IsSprinting = linkToClientProgs("Player_IsSprinting"); + player.IsCrouched = linkToClientProgs("Player_IsCrouched"); + player.IsProne = linkToClientProgs("Player_IsProne"); + + weapon.IsValid = linkToClientProgs("Weapon_IsValid"); + weapon.GetTitle = linkToClientProgs("Weapon_GetTitle"); + weapon.GetIcon = linkToClientProgs("Weapon_GetIcon"); + weapon.GetSelectedIcon = linkToClientProgs("Weapon_GetSelectedIcon"); + weapon.GetSlot = linkToClientProgs("Weapon_GetSlot"); + weapon.GetSlotPos = linkToClientProgs("Weapon_GetSlotPos"); + weapon.GetAmmo1 = linkToClientProgs("Weapon_GetAmmo1"); + weapon.GetAmmo2 = linkToClientProgs("Weapon_GetAmmo2"); + weapon.GetClip = linkToClientProgs("Weapon_GetClip"); + weapon.GetClipSize = linkToClientProgs("Weapon_GetClipSize"); + weapon.UsesSecondaryAmmo = linkToClientProgs("Weapon_UsesSecondaryAmmo"); + weapon.AmmoRequired = linkToClientProgs("Weapon_AmmoRequired"); + weapon.GetActiveWeapon = linkToClientProgs("Weapon_GetActiveWeapon"); + weapon.GetFirstWeaponInInventory = linkToClientProgs("Weapon_GetFirstWeaponInInventory"); + weapon.GetLastWeaponInInventory = linkToClientProgs("Weapon_GetLastWeaponInInventory"); + weapon.GetNextWeaponRelativeTo = linkToClientProgs("Weapon_GetNextWeaponRelativeTo"); + weapon.GetPreviousWeaponRelativeTo = linkToClientProgs("Weapon_GetPreviousWeaponRelativeTo"); + weapon.SelectWeapon = linkToClientProgs("Weapon_SelectWeapon"); + + draw.Rect = linkToClientProgs("Draw_Rect"); + draw.RectOutline = linkToClientProgs("Draw_RectOutline"); + draw.RoundedBox = linkToClientProgs("Draw_RoundedBox"); + draw.Line = linkToClientProgs("Draw_Line"); + draw.Pic = linkToClientProgs("Draw_Pic"); + draw.TextField = linkToClientProgs("Font_DrawField"); + draw.TextFieldAtHeight = linkToClientProgs("Font_DrawFieldAtHeight"); + draw.RText = linkToClientProgs("Font_DrawRText"); + draw.RText_A = linkToClientProgs("Font_DrawRText_A"); + draw.RText_RGB = linkToClientProgs("Font_DrawRText_RGB"); + draw.RText_RGBA = linkToClientProgs("Font_DrawRText_RGBA"); + draw.Text = linkToClientProgs("Font_DrawText"); + draw.Text_A= linkToClientProgs("Font_DrawText_A"); + draw.Text_RGB= linkToClientProgs("Font_DrawText_RGB"); + draw.Text_RGBA = linkToClientProgs("Font_DrawText_RGBA"); +} diff --git a/src/client/cmd.qc b/src/client/cmd.qc index e1e810be..f6dbfef3 100644 --- a/src/client/cmd.qc +++ b/src/client/cmd.qc @@ -14,6 +14,9 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +void Commandmenu_Open(void); +void Commandmenu_Close(void); + static void CMD_testPointLight(void) { @@ -490,6 +493,7 @@ Cmd_Parse(string sCMD) case "removeInventoryItem": case "removeAllInventoryItems": case "listAmmo": + case "joinTeam": localcmd(sprintf("cmd %s\n", sCMD)); break; @@ -504,8 +508,18 @@ Cmd_Parse(string sCMD) break; case "bobdn": break; + + case "+commandmenu": + Commandmenu_Open(); + break; + case "-commandmenu": + Commandmenu_Close(); + break; + case "ragdollCreate": + NSRagdoll_Create(argv(1)); + break; default: - return (false); + return HUD_ConsoleCommand(sCMD); } return (true); } @@ -535,6 +549,7 @@ Cmd_Init(void) registercommand("listServerEntityDef"); registercommand("listInventory"); registercommand("listAmmo"); + registercommand("ragdollCreate"); /* server commands */ registercommand("addBot"); @@ -613,6 +628,9 @@ Cmd_Init(void) registercommand("vote"); registercommand("callvote"); + /* teamplay */ + registercommand("joinTeam"); + /* motd */ registercommand("motd"); @@ -628,6 +646,10 @@ Cmd_Init(void) registercommand("slot9"); registercommand("slot10"); + /* commandmenu */ + registercommand("+commandmenu"); + registercommand("-commandmenu"); + /* scoreboard */ registercommand("+showscores"); registercommand("-showscores"); diff --git a/src/client/commandmenu.qc b/src/client/commandmenu.qc new file mode 100644 index 00000000..5553eeed --- /dev/null +++ b/src/client/commandmenu.qc @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +VGUIWidget g_uiCommandMenu; + +void +Commandmenu_Init(void) +{ + filestream commandFile; + string line; + VGUICommandButton lastButton = __NULL__; + VGUICommandButton newButton = __NULL__; + int braceDepth = 0i; + vector buttonPos = g_vec_null; + vector mainPos = g_vec_null; + string mapFilter = ""; + string ourMap = strtolower(serverkey("map")); + + commandFile = fopen("commandmenu.txt", FILE_READ); + + if (commandFile < 0) { + NSWarning("No command-menu. Missing commandmenu.txt"); + return; + } + + g_uiCommandMenu = spawn(VGUIWidget); + + while ((line = fgets(commandFile))) { + int tokensPerLine = tokenize_console(line); + + if (argv(0) == "{") { + if (!newButton) { + NSError("Cannot add sub-menu to non-existant button."); + fclose(commandFile); + return; + } + + lastButton = newButton; + braceDepth++; + + /* positions are relative to the parent, not absolute */ + buttonPos = [lastButton.GetSizeWidth(), 0]; + } else if (argv(0) == "}") { /* end of button menu */ + braceDepth--; + mapFilter = ""; + + if (braceDepth == 0) { + buttonPos = mainPos; + } else { + buttonPos = lastButton.GetPos() + [0, lastButton.GetSizeHeight()]; + lastButton = (VGUICommandButton)lastButton.m_parent; + } + } else if (tokensPerLine >= 2) { + string buttonTitle = ""; + string buttonCommand = ""; + string buttonKey = ""; + + if (tokensPerLine == 2) { + buttonKey = (argv(0)); + buttonTitle = (argv(1)); + } else if (argv(0) == "MAP") { + mapFilter = strtolower(argv(1)); + buttonKey = (argv(2)); + buttonTitle = (argv(3)); + } else if (substring(argv(0), 0, 4) == "TEAM") { + //newButton.SetTeamCondition(argv(0)); + buttonKey = (argv(1)); + buttonTitle = (argv(2)); + buttonCommand = (argv(3)); + } else if (argv(0) == "CUSTOM") { + buttonKey = (argv(1)); + buttonTitle = (argv(2)); + buttonCommand = (argv(3)); + } else if (tokensPerLine == 3) { + buttonKey = (argv(0)); + buttonTitle = (argv(1)); + buttonCommand = (argv(2)); + } + + /* if this group is filtered, don't add it. */ + if (STRING_SET(mapFilter)) { + if (mapFilter != ourMap) { + continue; + } + } + + newButton = spawn(VGUICommandButton); + newButton.SetPos(buttonPos); + newButton.SetSize([192,24]); + newButton.SetKeyEquivalent(buttonKey); + newButton.SetTitle(buttonTitle); + + if (substring(buttonCommand, 0, 1) == "!") { + newButton.SetExec(strtolower(substring(buttonCommand, 1,-1))); + } else { + newButton.SetExec(buttonCommand); + } + + if (braceDepth == 0) { + g_uiCommandMenu.Add(newButton); + buttonPos = mainPos = newButton.GetPos() + [0, newButton.GetSizeHeight()]; + } else { + buttonPos[1] += newButton.GetSizeHeight(); + lastButton.Add(newButton); + } + } + } + + fclose(commandFile); +} + +void +Commandmenu_Draw(void) +{ + if (pSeat->m_bCommandMenu == false) + return; + + if (g_uiCommandMenu) + g_uiCommandMenu.Draw(); +} + +bool +Commandmenu_Input(float flEvType, float flScanX, float flCharY, float flDevID) +{ + if (pSeat->m_bCommandMenu == false) + return (false); + + if (!g_uiCommandMenu) + return (false); + + return g_uiCommandMenu.Input(flEvType, flScanX, flCharY, flDevID); +} + +void +Commandmenu_Open(void) +{ + pSeat->m_bCommandMenu = true; +} + +void +Commandmenu_Close(void) +{ + pSeat->m_bCommandMenu = false; +} diff --git a/src/client/crosshair.h b/src/client/crosshair.h index 643ecf5d..7b84bca1 100644 --- a/src/client/crosshair.h +++ b/src/client/crosshair.h @@ -26,6 +26,12 @@ @{ */ + +/** Returns the end-coordinates for a crosshair of a given size. + +@param sizeXY is the size in pixels it is meant to take up on screen. */ +vector Cross_GetPos(vector sizeXY); + /** Draws a crosshair on the screen with the desired material and size. @param materialPath is the material to use. @@ -76,4 +82,4 @@ void Cross_DrawSubRGB(string materialPath, vector sizeXY, vector sourcePosXY, ve @param alphaValue is the alpha values to use on the whole surface.*/ void Cross_DrawSubRGBA(string materialPath, vector sizeXY, vector sourcePosXY, vector sourceSizeXY, vector colorRGB, float alphaValue); -/** @} */ // end of client \ No newline at end of file +/** @} */ // end of client diff --git a/src/client/crosshair.qc b/src/client/crosshair.qc index c22c19d8..44ad6d08 100644 --- a/src/client/crosshair.qc +++ b/src/client/crosshair.qc @@ -14,6 +14,38 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +vector +Cross_GetPos(vector sizeXY) +{ + vector crossPos; + + if (cvar("pm_thirdPerson") < 1) { + crossPos = g_hudmins + (g_hudres / 2) + [-(sizeXY[0]/2),-(sizeXY[1]/2)]; + crossPos[0] = rint(crossPos[0]); + crossPos[1] = rint(crossPos[1]); + + /* terrible hack to deal with engine's bad autoscale positioning */ + if (cvar("vid_conautoscale") > 1) { + crossPos[0] -= 0.25f; + crossPos[1] -= 0.25f; + } + } else { + vector vecSrc; + vector vecDst; + NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer; + + vecSrc = pSeat->m_vecPredictedOrigin + pSeat->m_ePlayer.view_ofs; + makevectors(view_angles); + vecDst = (vecSrc + v_forward * 4096); + traceline(vecSrc, vecDst, MOVE_NORMAL, pSeat->m_ePlayer); + crossPos = project(trace_endpos) + [-(sizeXY[0]/2),-(sizeXY[1]/2)]; + crossPos[0] = rint(crossPos[0]); + crossPos[1] = rint(crossPos[1]); + } + + return (crossPos); +} + void Cross_Draw(string materialPath, vector sizeXY) { @@ -47,32 +79,11 @@ Cross_DrawSubRGB(string materialPath, vector sizeXY, vector sourcePosXY, vector void Cross_DrawSubRGBA(string materialPath, vector sizeXY, vector sourcePosXY, vector sourceSizeXY, vector colorRGB, float alphaValue) { - static vector crossPos; + vector crossPos = Cross_GetPos(sizeXY); if (cvar("pm_thirdPerson") < 1) { - crossPos = g_hudmins + (g_hudres / 2) + [-(sizeXY[0]/2),-(sizeXY[1]/2)]; - crossPos[0] = rint(crossPos[0]); - crossPos[1] = rint(crossPos[1]); - - /* terrible hack to deal with engine's bad autoscale positioning */ - if (cvar("vid_conautoscale") > 1) { - crossPos[0] -= 0.25f; - crossPos[1] -= 0.25f; - } - drawsubpic(crossPos, sizeXY, materialPath, sourcePosXY, sourceSizeXY, colorRGB, alphaValue, DRAWFLAG_NORMAL); } else { - vector vecSrc; - vector vecDst; - NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer; - - vecSrc = pSeat->m_vecPredictedOrigin + pSeat->m_ePlayer.view_ofs; - makevectors(view_angles); - vecDst = (vecSrc + v_forward * 4096); - traceline(vecSrc, vecDst, MOVE_NORMAL, pSeat->m_ePlayer); - crossPos = project(trace_endpos) + [-(sizeXY[0]/2),-(sizeXY[1]/2)]; - crossPos[0] = rint(crossPos[0]); - crossPos[1] = rint(crossPos[1]); drawsubpic(crossPos, sizeXY, materialPath, sourcePosXY, sourceSizeXY, colorRGB, alphaValue, DRAWFLAG_NORMAL); } -} \ No newline at end of file +} diff --git a/src/client/defs.h b/src/client/defs.h index 856ad6e6..926981d6 100644 --- a/src/client/defs.h +++ b/src/client/defs.h @@ -14,6 +14,8 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "api_func.h" +#include "../shared/api.h" #include "../shared/entityDef.h" #include "text.h" #include "textmenu.h" @@ -24,6 +26,7 @@ #include "NSView.h" #include "NSRadar.h" #include "crosshair.h" +#include "hud.h" var bool g_net_debug = false; var bool g_cheats = false; @@ -140,6 +143,7 @@ int Util_GetMaxPlayers(void); font_s FONT_16; font_s FONT_20; font_s FONT_CON; +font_s FONT_CENTERPRINT; //var string g_shellchrome; var float g_shellchromeshader; @@ -209,7 +213,6 @@ void drawrect(vector pos, vector sz, float thickness, vector rgb, float al, opti drawfill(pos + [sz[0] - thickness, thickness], [thickness, sz[1] - (thickness * 2)], rgb, al, dfl); } - /** Like drawpic, but instead of screen coords, it will take world coords. Will project the 2D image relative to the active NSView that we're currently rendering in (g_view). So it may only be called within certain contexts. */ @@ -410,6 +413,7 @@ struct int m_iSprinting; int m_iSelectedWeapon; + bool m_bCommandMenu; } g_seats[4], *pSeat; .float modelindex2; diff --git a/src/client/entities.qc b/src/client/entities.qc index c6826553..88a65792 100644 --- a/src/client/entities.qc +++ b/src/client/entities.qc @@ -22,12 +22,18 @@ Entity_EntityUpdate(float type, float new) case ENT_ENTITY: NSENTITY_READENTITY(NSEntity, new) break; + case ENT_SOUND: + NSENTITY_READENTITY(NSSound, new) + break; case ENT_PMOVEVARS: NSENTITY_READENTITY(NSPMoveVars, new) break; case ENT_ENTITYRENDERABLE: NSENTITY_READENTITY(NSRenderableEntity, new) break; + case ENT_RAGDOLL: + NSENTITY_READENTITY(NSRagdoll, new) + break; case ENT_SURFPROP: NSENTITY_READENTITY(NSSurfacePropEntity, new) break; diff --git a/src/client/entry.qc b/src/client/entry.qc index 103dd842..f518300c 100644 --- a/src/client/entry.qc +++ b/src/client/entry.qc @@ -72,6 +72,7 @@ CSQC_Init(float apilevel, string enginename, float engineversion) Way_Init(); Materials_Init(); MOTD_Init(); + Commandmenu_Init(); /* let the menu know we're a multi or a singleplayer game */ if (serverkeyfloat("sv_playerslots") == 1) @@ -87,11 +88,8 @@ CSQC_Init(float apilevel, string enginename, float engineversion) g_overview = NSRadar::InitForCurrentMap(); - Sound_Precache("Player.DenyWeaponSelection"); - Sound_Precache("Player.WeaponSelected"); - Sound_Precache("Player.WeaponSelectionMoveSlot"); - Sound_Precache("Player.WeaponSelectionOpen"); - Sound_Precache("Player.WeaponSelectionClose"); + + HUD_Init(); /* end msg */ NSLog("Client game initialized."); @@ -121,6 +119,7 @@ CSQC_RendererRestarted(string rstr) Font_Load("fonts/font16.font", FONT_16); Font_Load("fonts/font20.font", FONT_20); Font_Load("fonts/fontcon.font", FONT_CON); + Font_Load("fonts/centerprint.font", FONT_CENTERPRINT); /* Particles */ PART_DUSTMOTE = particleeffectnum("volume.dustmote"); @@ -135,7 +134,7 @@ CSQC_RendererRestarted(string rstr) Scores_Init(); View_Init(); ClientGame_RendererRestart(rstr); - HUD_Init(); + HUD_RendererRestarted(); /* GS-Entbase */ Fade_Reload(); @@ -228,6 +227,7 @@ CSQC_UpdateView(float w, float h, float focus) g_vidsize[0] = w; g_vidsize[1] = h; ClientGame_InitDone(); + Sky_Update(true); } } @@ -241,7 +241,7 @@ CSQC_UpdateView(float w, float h, float focus) /* these have to be checked every frame */ Fog_Update(); - Sky_Update(FALSE); + Sky_Update(false); cvar_set("_background", serverkey("background")); /* ensure background maps do not get paused */ @@ -311,6 +311,7 @@ CSQC_UpdateView(float w, float h, float focus) /* 2D calls happen here, after rendering is done */ CSQC_Update2D(w, h, focus); + Commandmenu_Draw(); EFX_UpdateListener(g_view); DSP_UpdateSoundscape(g_view); @@ -385,7 +386,12 @@ CSQC_InputEvent(float fEventType, float fKey, float fCharacter, float fDeviceID) g_vecMousePos = getmousepos(); - bool vgui_pressed = VGUI_Input(fEventType, fKey, fCharacter, fDeviceID); + bool vgui_pressed; + vgui_pressed = Commandmenu_Input(fEventType, fKey, fCharacter, fDeviceID); + + if (!vgui_pressed) { + vgui_pressed = VGUI_Input(fEventType, fKey, fCharacter, fDeviceID); + } if (g_vguiWidgetCount) { setcursormode(TRUE, "gfx/cursor", [0,0,0], 1.0f); @@ -414,7 +420,20 @@ CSQC_Input_Frame(void) if (me.classname == "player" || me.classname == "spectator") { NSClient pl = (NSClient)me; pl.SharedInputFrame(); + float delayInputs = HUD_ClientInputFrame(input_buttons); + + if (delayInputs > 0.0f) { + pSeat->m_flInputBlockTime = time + delayInputs; + } + pl.ClientInputFrame(); + + if (pSeat->m_flInputBlockTime > time) { + input_buttons &= ~INPUT_PRIMARY; + input_buttons &= ~INPUT_SECONDARY; + pSeat->m_iInputAttack2 = false; + return; + } } } diff --git a/src/client/font.h b/src/client/font.h index 32dab818..6cc5e65e 100644 --- a/src/client/font.h +++ b/src/client/font.h @@ -40,6 +40,7 @@ typedef enumflags AF_RIGHT, AF_BOTTOM } alignflags_t; +#define AF_NONE 0 /** Representation of a font. */ typedef struct @@ -50,6 +51,7 @@ typedef struct vector vecColor; /**< Suggested default color of the font. */ float flAlpha; /**< Suggested default alpha of the font. */ int iFlags; /**< Rendering flags that the font posesses. @sa drawflag_t */ + string hexColor; } font_s; /** Load a desired .font definition into memory. @@ -162,4 +164,4 @@ porting old code. @return the internal 'drawfont' id of the specified font. */ float Font_GetID(font_s fnt); -/** @} */ // end of client \ No newline at end of file +/** @} */ // end of client diff --git a/src/client/font.qc b/src/client/font.qc index 1c3448f7..0ecdffdf 100644 --- a/src/client/font.qc +++ b/src/client/font.qc @@ -31,6 +31,7 @@ Font_Load(string strFile, font_s &fntNew) fntNew.iID = 0; fntNew.iScaleX = fntNew.iScaleY = 12; fntNew.vecColor = [1,1,1]; + fntNew.hexColor = "^xFFF"; fntNew.flAlpha = 1.0f; fntNew.iFlags = 0; @@ -44,6 +45,7 @@ Font_Load(string strFile, font_s &fntNew) switch (argv(0)) { case "color": fntNew.vecColor = stov(argv(1)) / 255; + fntNew.hexColor = Font_RGBtoHex(fntNew.vecColor); break; case "alpha": fntNew.flAlpha = stof(argv(1)) / 255; @@ -175,7 +177,7 @@ Font_DrawField(vector vecOrigin, vector vecSize, string strText, font_s fnt, ali drawfont = (float)fnt.iID; drawfontscale[0] = (float)fnt.iScaleX / 8; drawfontscale[1] = (float)fnt.iScaleY / 8; - drawtextfield(vecOrigin, vecSize, (float)iAlignFlags, strText); + drawtextfield(vecOrigin, vecSize, (float)iAlignFlags, strcat(fnt.hexColor, strText)); drawfont = 0; drawfontscale = [1,1,0]; } diff --git a/src/client/hud.h b/src/client/hud.h new file mode 100644 index 00000000..ba0def16 --- /dev/null +++ b/src/client/hud.h @@ -0,0 +1,13 @@ +void HUD_Init(void); +void HUD_Draw(void); +void HUD_DrawSpectator(void); +void HUD_SendStat(string, string); +float HUD_ClientInputFrame(float); +bool HUD_ConsoleCommand(string); + +void HUDProgs_Init(void); +void HUDProgs_Draw(void); +void HUDProgs_DrawSpectator(void); +void HUDProgs_SendStat(string, string); +float HUDProgs_ClientInputFrame(float); +bool HUDProgs_ConsoleCommand(string); diff --git a/src/client/hud.qc b/src/client/hud.qc new file mode 100644 index 00000000..a394298e --- /dev/null +++ b/src/client/hud.qc @@ -0,0 +1,156 @@ + +var float g_flHUDProgs; +var void(void) g_hudInit; +var void(void) g_hudDraw; +var void(void) g_hudDrawSpectator; +var void(string, string) g_hudSendStat; +var void(string) g_hudSwitchedWeapon; +var float(float) g_hudInputFrame; +var bool(string) g_hudConsoleCommand; +var void(void) g_hudRendererRestarted; + +void +HUDProgs_Init(void) +{ + g_flHUDProgs = addprogs("hud.dat"); + + if (g_flHUDProgs > 0) { + g_hudInit = externvalue(g_flHUDProgs, "main"); + g_hudDraw = externvalue(g_flHUDProgs, "HUD_Draw"); + g_hudDrawSpectator = externvalue(g_flHUDProgs, "HUD_DrawSpectator"); + g_hudSendStat = externvalue(g_flHUDProgs, "HUD_SendStat"); + g_hudSwitchedWeapon = externvalue(g_flHUDProgs, "HUD_WeaponSwitched"); + g_hudInputFrame = externvalue(g_flHUDProgs, "HUD_InputFrame"); + g_hudConsoleCommand = externvalue(g_flHUDProgs, "HUD_ConsoleCommand"); + g_hudRendererRestarted = externvalue(g_flHUDProgs, "HUD_RendererRestarted"); + + if (g_hudInit) { + g_hudInit(); + } else { + NSError("HUD progs does not have a main function."); + } + } +} + +void +HUDProgs_RendererRestarted(void) +{ + if (g_flHUDProgs > 0) { + if (g_hudRendererRestarted) { + g_hudRendererRestarted(); + } + } +} + +void +HUDProgs_Draw(void) +{ + if (g_flHUDProgs > 0) { + if (g_hudDraw) { + externset(g_flHUDProgs, clframetime, "clframetime"); + g_hudDraw(); + } + } +} + + void +HUDProgs_DrawSpectator(void) +{ + if (g_flHUDProgs > 0) { + if (g_hudDrawSpectator) { + g_hudDrawSpectator(); + } + } +} + +void +HUDProgs_SendStat(string statName, string statValue) +{ + if (g_flHUDProgs > 0) { + if (g_hudSendStat) { + g_hudSendStat(statName, statValue); + } + } +} + +void +HUDProgs_SwitchedToWeapon(string weaponName) +{ + if (g_flHUDProgs > 0) { + if (g_hudSwitchedWeapon) { + g_hudSwitchedWeapon(weaponName); + } + } +} + +float +HUDProgs_ClientInputFrame(float inputFrame) +{ + if (g_flHUDProgs > 0) { + if (g_hudInputFrame) { + return g_hudInputFrame(inputFrame); + } + } + + return (0.0f); +} + +bool +HUDProgs_ConsoleCommand(string commandString) +{ + if (g_flHUDProgs > 0) { + if (g_hudConsoleCommand) { + return g_hudConsoleCommand(commandString); + } + } + + return (false); +} + +__weak void +HUD_Init(void) +{ + HUDProgs_Init(); +} + +__weak void +HUD_RendererRestarted(void) +{ + HUDProgs_RendererRestarted(); +} + +__weak void +HUD_Draw(void) +{ + HUDProgs_Draw(); +} + +__weak void +HUD_DrawSpectator(void) +{ + HUDProgs_DrawSpectator(); +} + +__weak void +HUD_SendStat(string statName, string statValue) +{ + HUDProgs_SendStat(statName, statValue); +} + +__weak void +HUD_SwitchedToWeapon(string weaponName) +{ + HUDProgs_SwitchedToWeapon(weaponName); +} + +__weak float +HUD_ClientInputFrame(float inputButtons) +{ + return HUDProgs_ClientInputFrame(inputButtons); +} + +__weak bool +HUD_ConsoleCommand(string commandString) +{ + return HUDProgs_ConsoleCommand(commandString); +} diff --git a/src/client/include.src b/src/client/include.src index 2fdfc269..a413d0d6 100644 --- a/src/client/include.src +++ b/src/client/include.src @@ -2,6 +2,7 @@ NSInteractiveSurface.qc NSView.qc NSRadar.qc +hud.qc fog.qc font.qc sky.qc @@ -24,7 +25,9 @@ detailtex.qc shake.qc cmd.qc event.qc +commandmenu.qc entry.qc crosshair.qc util.qc +api.qc #endlist diff --git a/src/client/prints.qc b/src/client/prints.qc index 5f8a848d..3fc25572 100644 --- a/src/client/prints.qc +++ b/src/client/prints.qc @@ -57,8 +57,8 @@ Print_DrawCenterprint(void) vecPos[1] = g_hudmins[1] + (g_hudres[1] / 2) - (pSeat->m_iCenterprintLines - 4) - 69; for (int i = 0; i < (pSeat->m_iCenterprintLines); i++) { - vecPos[0] = g_hudmins[0] + (g_hudres[0] / 2) - (stringwidth(pSeat->m_strCenterprintBuffer[i], TRUE, '12 12') / 2); - Font_DrawText_A(vecPos, pSeat->m_strCenterprintBuffer[i], pSeat->m_flCenterprintAlpha, FONT_CON); + vecPos[0] = g_hudmins[0] + (g_hudres[0] / 2) - (stringwidth(pSeat->m_strCenterprintBuffer[i], TRUE, '18 18') / 2); + Font_DrawText_A(vecPos, pSeat->m_strCenterprintBuffer[i], pSeat->m_flCenterprintAlpha, FONT_CENTERPRINT); vecPos[1] += 8; } } diff --git a/src/client/sky.qc b/src/client/sky.qc index 8d8534fc..0c21f890 100644 --- a/src/client/sky.qc +++ b/src/client/sky.qc @@ -30,7 +30,7 @@ Sky_Update(int force) //print(sprintf("SKY PREFIX: %S\n", skyPrefix)); /* is it a Source Engine material? */ - if (skyPrefix == "sky_") { + if (fileExists(strcat("materials/skybox/", g_strSkyName, "bk.vmt")) == true) { skyPath = strcat("materials/skybox/", g_strSkyName); } else { skyPath = g_strSkyName; diff --git a/src/client/spawnmenu.qc b/src/client/spawnmenu.qc new file mode 100644 index 00000000..177d5cc4 --- /dev/null +++ b/src/client/spawnmenu.qc @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +VGUIWidget g_uiSpawnMenu; + +void +SpawnMenu_Init(void) +{ + filestream commandFile; + string line; + VGUICommandButton lastButton; + VGUICommandButton newButton; + int braceDepth = 0i; + vector buttonPos = g_vec_null; + vector mainPos = g_vec_null; + string mapFilter = ""; + string ourMap = strtolower(serverkey("map")); + + commandFile = fopen("commandmenu.txt", FILE_READ); + + if (commandFile < 0) { + NSLog("Ignoring missing commandmenu.txt"); + return; + } + + g_uiSpawnMenu = spawn(VGUIWidget); + + while ((line = fgets(commandFile))) { + int tokensPerLine = tokenize_console(line); + + if (argv(0) == "{") { + if (!newButton) { + NSError("Cannot add sub-menu to non-existant button."); + fclose(commandFile); + return; + } + + lastButton = newButton; + braceDepth++; + + /* positions are relative to the parent, not absolute */ + buttonPos = [lastButton.GetSizeWidth(), 0]; + } else if (argv(0) == "}") { /* end of button menu */ + braceDepth--; + mapFilter = ""; + + if (braceDepth == 0) { + buttonPos = mainPos; + } else { + buttonPos = lastButton.GetPos() + [0, lastButton.GetSizeHeight()]; + lastButton = (VGUICommandButton)lastButton.m_parent; + } + } else if (tokensPerLine >= 2) { + string buttonTitle = ""; + string buttonCommand = ""; + string buttonKey = ""; + + if (tokensPerLine == 2) { + buttonKey = (argv(0)); + buttonTitle = (argv(1)); + } else if (argv(0) == "MAP") { + mapFilter = strtolower(argv(1)); + buttonKey = (argv(2)); + buttonTitle = (argv(3)); + } else if (substring(argv(0), 0, 4) == "TEAM") { + //newButton.SetTeamCondition(argv(0)); + buttonKey = (argv(1)); + buttonTitle = (argv(2)); + buttonCommand = (argv(3)); + } else if (argv(0) == "CUSTOM") { + buttonKey = (argv(1)); + buttonTitle = (argv(2)); + buttonCommand = (argv(3)); + } else if (tokensPerLine == 3) { + buttonKey = (argv(0)); + buttonTitle = (argv(1)); + buttonCommand = (argv(2)); + } + + /* if this group is filtered, don't add it. */ + if (STRING_SET(mapFilter)) { + if (mapFilter != ourMap) { + continue; + } + } + + newButton = spawn(VGUICommandButton); + newButton.SetPos(buttonPos); + newButton.SetSize([192,24]); + newButton.SetKeyEquivalent(buttonKey); + newButton.SetTitle(buttonTitle); + + if (substring(buttonCommand, 0, 1) == "!") { + newButton.SetExec(strtolower(substring(buttonCommand, 1,-1))); + } else { + newButton.SetExec(buttonCommand); + } + + if (braceDepth == 0) { + g_uiSpawnMenu.Add(newButton); + buttonPos = mainPos = newButton.GetPos() + [0, newButton.GetSizeHeight()]; + } else { + buttonPos[1] += newButton.GetSizeHeight(); + lastButton.Add(newButton); + } + } + } + + fclose(commandFile); +} + +void +SpawnMenu_Draw(void) +{ + if (pSeat->m_bSpawnMenu == false) + return; + + if (g_uiSpawnMenu) + g_uiSpawnMenu.Draw(); +} + +bool +SpawnMenu_Input(float flEvType, float flScanX, float flCharY, float flDevID) +{ + if (pSeat->m_bSpawnMenu == false) + return; + + if (!g_uiSpawnMenu) + return (false); + + return g_uiSpawnMenu.Input(flEvType, flScanX, flCharY, flDevID); +} + +void +SpawnMenu_Open(void) +{ + pSeat->m_bSpawnMenu = true; +} + +void +SpawnMenu_Close(void) +{ + pSeat->m_bSpawnMenu = false; +} diff --git a/src/client/view.qc b/src/client/view.qc index 1ffabab8..58ad960d 100644 --- a/src/client/view.qc +++ b/src/client/view.qc @@ -299,6 +299,7 @@ View_DrawViewModel(void) /* only draw the model when it's 'enabled'... */ if (m_eViewModel.IsHidden() == false) { + float oldModelindex; setorigin(m_eViewModel, m_eViewModel.origin); setorigin(m_eViewModelL, m_eViewModel.origin); @@ -323,21 +324,21 @@ View_DrawViewModel(void) /* TODO: clean this up. */ if (m_eViewModel.modelindex2) { - float oldModelindex = m_eViewModel.modelindex; + oldModelindex = m_eViewModel.modelindex; m_eViewModel.modelindex = m_eViewModel.modelindex2; addentity(m_eViewModel); m_eViewModel.modelindex = oldModelindex; } if (m_eViewModel.modelindex3) { - float oldModelindex = m_eViewModel.modelindex; + oldModelindex = m_eViewModel.modelindex; m_eViewModel.modelindex = m_eViewModel.modelindex3; addentity(m_eViewModel); m_eViewModel.modelindex = oldModelindex; } if (m_eViewModel.modelindex4) { - float oldModelindex = m_eViewModel.modelindex; + oldModelindex = m_eViewModel.modelindex; m_eViewModel.modelindex = m_eViewModel.modelindex4; addentity(m_eViewModel); m_eViewModel.modelindex = oldModelindex; diff --git a/src/cvar_defaults.cfg b/src/cvar_defaults.cfg new file mode 100644 index 00000000..df3a6f48 --- /dev/null +++ b/src/cvar_defaults.cfg @@ -0,0 +1,185 @@ +// generated by Nuclide, do not modify +set _pext_infoblobs "1" // override +set _pext_vrinputs "0" // override +set _q3bsp_bihtraces "1" // override +set ai_debugAlerts "0" // Show prints when AI gets alerted to a position. +set ai_debugLogic "0" // Show prints when AI makes decisions regarding thinking. +set ai_debugNav "0" // Show prints when AI makes decisions regarding navigation. +set ai_debugScripts "0" // Show prints when AI interacts with scripted sequences. +set ai_enable "1" // Disable AI behaviour when set. +set ai_runSpeed "320" // Default run speed chosen by AI characters, in units per second. +set ai_walkSpeed "150" // Default walk speed chosen by AI characters, in units per second. +set bot_aimless "0" // Bots will not set goals for themselves when set. +set bot_backspeed "133" // Bots desired maximum backwards speed. +set bot_crouch "0" // Bots are all forced to move crouched. +set bot_developer "0" // TODO: remove? +set bot_dont_shoot "0" // Bots never actually shoot. +set bot_enable "1" // Bot support enabled when set. +set bot_fastChat "0" // Bots will chat instantly instead of 'typing'. +set bot_forwardspeed "190" // Bots desired maximum forward speed. +set bot_minClients "-1" // How many player slots are to be filled, -1 is 'untouched'. +set bot_noChat "0" // Bots will no longer communicate when set. +set bot_pause "0" // Bots logic will be paused. +set bot_prefix "" // Bot nickname prefix for newly added bots. +set bot_prone "0" // Bots are all forced to move prone. +set bot_sidespeed "152" // Bots desired maximum strafe speed. +set bot_skill "2" // Bot version of cvar "skill". +set bot_walk "0" // Bots are forced to walk slowly. +set cfg_save_auto "1" // override +set cg_chatEnabled "1" // Enable the display of chat messages. +set cg_damageShake "0" // Shake the display upon taking damage. +set cg_hudAspect "0" // Aspect ratio override for the HUD. 1.0 is 1:1 square, 0 is auto. +set cg_modelBobHeight "0.0" // Intensity at which objects with the "spin" flag bob. +set cg_modelBobHeightSpeed "0.0" // Speed at which objects with the "spin" flag bob. +set cg_modelSpinPitch "0.0" // Intensity at which objects with the "spin" flag change their pitch. +set cg_modelSpinPitchSpeed "0.0" // Speed at which objects with the "spin" flag change their pitch. +set cg_modelSpinRoll "0.0" // Intensity at which objects with the "spin" flag roll. +set cg_modelSpinRollSpeed "0.0" // Speed at which objects with the "spin" flag roll. +set cg_modelSpinSpeed "120.0" // Speed at which an object with the "spin" key spins. +set cg_muzzleDLight "1" // Enable dlights being spawned from muzzleflashes. +set cg_muzzleDLightColor "1.0 0.45 0.0" // Color of muzzleflash dlights. +set cg_viewZSmoothingMax "16" // Camera vertical-axis smoothing max delta threshold. +set cg_viewZSmoothingMin "1" // Camera vertical-axis smoothing delta threshold. +set cg_viewZSmoothingTime "0.1" // Camera vertical-axis smoothing steps. +set cg_viewmodelFlip "0" // Flip the viewmodel. +set cg_viewmodelFov "90" // Viewmodel field of view. +set cg_viewmodelLag "0" // Viewmodel lag when camera looks around. +set cg_viewmodelOffset "0 0 0" // Viewmodel offset in relative units (forward, right, up) +set cg_viewmodelPass "1" // Renders viewmodel in separate drawpass (no lighting) +set cg_viewmodelScale "1.0" // Viewmodel scale multiplier, affects bob as well. +set cl_backspeed "400" // Client's desired backwards speed. +set cl_bob "0" // override +set cl_cursor_scale "1" // override +set cl_decals "128" // override +set cl_forwardspeed "400" // Client's desired forward speed. +set cl_musicstyle "0" // override +set cl_sidespeed "400" // Client's desired side-step speed. +set con_color "255 150 0" // HUD color value, R G B, 0-255 for each channel. +set con_notifylines "0" // override +set dev_cornerspeed "0" // Override speed set by path_corner entities. +set dev_loddistance "0" // Override distance at which func_lod entities disappear. +set dev_skyscale "" // Override for the sky_camera room scale. +set dsp_soundscapes "1" // Enable the use of sound scapes. +set g_damageScale "1" // final damage scale on objects +set g_gravity "800" // Global gravity setting. +set g_logLevel "2" // Game console log levels. 0 = None, 1 = Errors, 2 = Warnings, 3 = Extra Messages +set g_logTimestamps "0" // When 1, will print time stamps before the log message +set gl_conback "gfx/devcon" // override +set gl_mindist "4" // override +set gl_blendsprites "0" // override +set gl_specular "1" // override +set gl_specular_fallback "0" // override +set in_zoomSensitivity "1.0" // Input sensitivity multiplier for when you're zoomed in. +set logging_enabled "0" // Enable server-side logging for game specific events. +set maxpitch "89" // override +set menu_helptext_size "11" +set menu_intro "1" +set menu_steambg "0" +set menu_updating "0" +set media_repeat "0" // override +set minpitch "-89" // override +set motdfile "motd.txt" +set mp_allowvote "1" +set mp_decals "128" +set mp_flashlight "1" +set mp_td_dmgToKick "300" +set mp_td_dmgToWarn "200" +set nav_linksize "256" +set nav_radius "32" +set phys_developer "0" // Shows debug prints regarding physics operations when set. +set phys_impactforcescale "100" // Scaler for impact forces on physically simulated entities. +set phys_pushscale "1" // Scaler for push forces on physically simulated entities. +set pm_accelerate "10" +set pm_airaccelerate "10" +set pm_airstepsize "0" +set pm_boxcenter "1" +set pm_boxwidth "32" +set pm_crouchheight "36" +set pm_crouchspeed "90" +set pm_crouchviewheight "30" +set pm_edgefriction "1" +set pm_friction "4" +set pm_gravity "800" +set pm_jumpheight "265" +set pm_maxviewpitch "89" +set pm_minviewpitch "-89" +set pm_noclipaccelerate "5" +set pm_noclipspeed "500" +set pm_normalheight "72" +set pm_normalviewheight "64" +set pm_nospeedcap "0" +set pm_proneheight "0" +set pm_pronespeed "40.5" +set pm_proneviewheight "16" +set pm_runspeed "0" +set pm_stairSmoothing "1" +set pm_stamina "24" +set pm_staminarate "0.75" +set pm_staminathreshold "4" +set pm_stepsize "18" +set pm_stopspeed "100" +set pm_thirdPerson "0" +set pm_walkspeed "270" +set pm_wateraccelerate "10" +set pm_waterjumpheight "350" +set r_autoscale "1" // When set, will ensure the game is at 640x480 type scaling. +set r_drawdecals "1" // Shows decal entities managed by the game when set. +set r_ignoreentpvs "0" // override +set r_imageextensions "tga bmp pcx png jpg" // override +set r_meshpitch "1" // override +set r_pixelscale "0" // When set, will ensure the 3D rendered scene is restricted to 640x480 resolution in definition. +set r_renderEntityInfo "0" // Display visual information about entities in-world. +set r_showDlights "0" // Displays dynamic light representations in-world. +set r_showPhysicsInfo "0" // Displays physics entity information in-world. +set r_skipGlows "0" // Skip rendering of glowing sprites. +set r_skipLensFlares "0" // Skip rendering of lens flares. +set r_skipWorld "0" // Skip rendering of the world. +set rm_unlit_additive "1" // Render entities with the 'additive' rendermode fullbright. +set rm_unlit_texture "1" // Render entities with the 'texture' rendermode fullbright. +set rope_debug "0" // Shows primitive debug rendering of a rope when set. +set rope_fast "1" // Don't perform expensive calculations on the rope when set. +set rope_maxsegments "-1" // Limit rope segments. -1 means no limit. +set rope_sag "2" // Rope sagging multiplier. +set rope_swing "2" // Rope swinging multiplier. +set s_logLevel "2" // Sound console log levels. 0 = None, 1 = Errors, 2 = Warnings, 3 = Extra Messages +set scr_conalpha "1" // override +set sp_decals "128" +set sv_friendlyFire "0" // Team-inflicted damage is possible when set. +set sv_gameplayfix_setmodelrealbox "1" // override +set sv_gameplayfix_setmodelsize_qw "1" // override +set sv_levelexec "1" // Will search and execute `/maps/currentmap.cfg` when set. +set sv_plugins "1" // Enable the use of server-side plugins when set. +set v_contentblend "0" // override +set vehicle_developer "0" // Shows vehicle related debug prints when set. +set vgui_color "255 170 0" // Default primary color for VGUI widgets. +set vid_brightness "0" // Controls display brightness. +set violence_ablood "1" // Enable non-human (alternative) blood. +set violence_agibs "1" // Enable non-human (alternative) gibs. +set violence_hblood "1" // Enable human blood. +set violence_hgibs "1" // Enable human giblets. +set xr_roomScale "1.0" // XR: Room scale multiplier. +set xr_testInputs "0" // XR: Enable fake inputs, to debug the VR camera and weapon inputs. +set xr_viewHeight "-48" // XR: Default view-height offset. +set physics_ode_quadtree_depth "5" // override +set physics_ode_contactsurfacelayer "0" // override +set physics_ode_worldquickstep "1" // override +set physics_ode_worldquickstep_iterations "20" // override +set physics_ode_contact_mu "1" // override +set physics_ode_contact_erp "0.96" // override +set physics_ode_contact_cfm "0.001" // override +set physics_ode_world_damping "-1" // override +set physics_ode_world_damping_linear "-1" // override +set physics_ode_world_damping_linear_threshold "-1" // override +set physics_ode_world_damping_angular "-1" // override +set physics_ode_world_damping_angular_threshold "-1" // override +set physics_ode_world_erp "0.96" // override +set physics_ode_world_cfm "0.001" // override +set physics_ode_iterationsperframe "1" // override +set physics_ode_movelimit "2.0" // override +set physics_ode_spinlimit "10000" // override +set physics_ode_autodisable "1" // override +set physics_ode_autodisable_steps "10" // override +set physics_ode_autodisable_time "0.1" // override +set physics_ode_autodisable_threshold_linear "0.05" // Was 0.2, too lenient. +set physics_ode_autodisable_threshold_angular "0.3" // override +set physics_ode_autodisable_threshold_samples "5" // override diff --git a/src/gs-entbase/client/func_smokevolume.qc b/src/gs-entbase/client/func_smokevolume.qc index d45368af..39b4f358 100644 --- a/src/gs-entbase/client/func_smokevolume.qc +++ b/src/gs-entbase/client/func_smokevolume.qc @@ -82,6 +82,7 @@ float func_smokevolume_cloud::predraw(void) { float alpha; + vector color = m_vecColor; vector vecPlayer = g_view.GetCameraOrigin(); if (checkpvs(vecPlayer, this) == FALSE) { @@ -99,17 +100,17 @@ func_smokevolume_cloud::predraw(void) alpha *= m_flMaxAlpha; if (!(spawnflags & 1)) { - m_vecColor *= (getlight(origin) / 255); - m_vecColor[0] = bound(0.0, m_vecColor[0], 1.0); - m_vecColor[1] = bound(0.0, m_vecColor[1], 1.0); - m_vecColor[2] = bound(0.0, m_vecColor[2], 1.0); + color *= (getlight(origin) / 255); + color[0] = bound(0.0, color[0], 1.0); + color[1] = bound(0.0, color[1], 1.0); + color[2] = bound(0.0, color[2], 1.0); } R_BeginPolygon(m_strMaterial, 0, 0); - R_PolygonVertex(origin + v_right * cloudsize[0] - v_up * cloudsize[1], [1,1], m_vecColor, alpha); - R_PolygonVertex(origin - v_right * cloudsize[0] - v_up * cloudsize[1], [0,1], m_vecColor, alpha); - R_PolygonVertex(origin - v_right * cloudsize[0] + v_up * cloudsize[1], [0,0], m_vecColor, alpha); - R_PolygonVertex(origin + v_right * cloudsize[0] + v_up * cloudsize[1], [1,0], m_vecColor, alpha); + R_PolygonVertex(origin + v_right * cloudsize[0] - v_up * cloudsize[1], [1,1], color, alpha); + R_PolygonVertex(origin - v_right * cloudsize[0] - v_up * cloudsize[1], [0,1], color, alpha); + R_PolygonVertex(origin - v_right * cloudsize[0] + v_up * cloudsize[1], [0,0], color, alpha); + R_PolygonVertex(origin + v_right * cloudsize[0] + v_up * cloudsize[1], [1,0], color, alpha); R_EndPolygon(); if (lifetime >= 10.0f) { @@ -135,16 +136,18 @@ float func_smokevolume::predraw(void) { vector vecPlayer = g_view.GetCameraOrigin(); - float playerDist = vlen(vecPlayer - origin); - float fracDist = 1.0 - bound(0.0, playerDist / 512, 1.0); if (checkpvs(vecPlayer, this) == FALSE) return (PREDRAW_NEXT); + float playerDist = distance(vecPlayer, WorldSpaceCenter()); + if (m_flMaxDrawDistance > 0.0) if (playerDist > m_flMaxDrawDistance) return (PREDRAW_NEXT); + float fracDist = 1.0f - bound(0.0f, playerDist / m_flMaxDrawDistance, 1.0f); + if (m_flNexTime > cltime) return (PREDRAW_NEXT); @@ -158,7 +161,12 @@ func_smokevolume::predraw(void) setorigin(cloud, vecPos); float r = random(); cloud.m_vecColor = vectorLerp(m_vecColor1, m_vecColor2, r); - cloud.m_flMaxAlpha = m_flAlpha * fracDist; + + if (m_flMaxDrawDistance > 0.0f) + cloud.m_flMaxAlpha = m_flAlpha * fracDist; + else + cloud.m_flMaxAlpha = m_flAlpha; + cloud.cloudsize[0] = random(m_flSizeMin, m_flSizeMax); cloud.cloudsize[1] = random(m_flSizeMin, m_flSizeMax); cloud.m_flLifeTime = random(m_flLifetimeMin, m_flLifetimeMax); @@ -229,8 +237,9 @@ func_smokevolume::func_smokevolume(void) m_flSizeMax = 250; m_flLifetimeMin = 3; m_flLifetimeMax = 5; - m_flAlpha = 1.0f; + m_flAlpha = 0.1f; /* making this up, I have no idea */ m_vecColor1 = m_vecColor2 = [0,0,0]; + m_flMaxDrawDistance = 0.0f; solid = SOLID_NOT; isCSQC = true; diff --git a/src/gs-entbase/server.src b/src/gs-entbase/server.src index e63fa4f7..830c9a50 100644 --- a/src/gs-entbase/server.src +++ b/src/gs-entbase/server.src @@ -90,6 +90,7 @@ server/point_camera.qc server/point_servercommand.qc server/point_trigger.qc server/targ_speaker.qc +server/target_speaker.qc server/target_cdaudio.qc server/env_global.qc server/script_model.qc diff --git a/src/gs-entbase/server/env_explosion.qc b/src/gs-entbase/server/env_explosion.qc index 5b30b037..40a67eac 100644 --- a/src/gs-entbase/server/env_explosion.qc +++ b/src/gs-entbase/server/env_explosion.qc @@ -198,7 +198,7 @@ env_explosion::Trigger(entity act, triggermode_t state) damageType = DMG_GENERIC; } - radiusDamage(GetOrigin(), GetExplosionRadius(), 0i, GetExplosionDamage(), act, ""); + combat.RadiusDamage(GetOrigin(), GetExplosionRadius(), 0i, GetExplosionDamage(), act, ""); } if (HasSpawnFlags(ENVEXPLO_REPEATABLE) == false) { diff --git a/src/gs-entbase/server/func_breakable.qc b/src/gs-entbase/server/func_breakable.qc index e6866b0f..982c9d1c 100644 --- a/src/gs-entbase/server/func_breakable.qc +++ b/src/gs-entbase/server/func_breakable.qc @@ -310,7 +310,7 @@ func_breakable::Explode(void) BreakModel_Spawn(absmin, absmax, [0,0,0], m_flExplodeMag, vlen(size) / 10, breakModel); pointparticles(_m_iExplosionParticle, rp, [0,0,0], 1); - radiusDamage(GetOrigin(), m_flExplodeMag, 0i, m_flExplodeRad, this, ""); + combat.RadiusDamage(GetOrigin(), m_flExplodeMag, 0i, m_flExplodeRad, this, ""); UseTargets(this, TRIG_TOGGLE, 0.0f); /* delay... ignored. */ MakeInvulnerable(); Disappear(); diff --git a/src/gs-entbase/server/func_door.qc b/src/gs-entbase/server/func_door.qc index bb8c8e27..142f5d50 100644 --- a/src/gs-entbase/server/func_door.qc +++ b/src/gs-entbase/server/func_door.qc @@ -584,7 +584,7 @@ func_door::Blocked(entity eBlocker) NSDict damageDecl = spawn(NSDict); damageDecl.AddKey("damage", itos(m_iDamage)); m_bCanTouch = false; - entityDamage(eBlocker, this, eBlocker, damageDecl.GetDeclBody(), "", center, dmgDir, eBlocker.origin); + combat.Damage(eBlocker, this, eBlocker, damageDecl.GetDeclBody(), center, dmgDir, eBlocker.origin); remove(damageDecl); } diff --git a/src/gs-entbase/server/func_door_rotating.qc b/src/gs-entbase/server/func_door_rotating.qc index 534a83c6..099e8719 100644 --- a/src/gs-entbase/server/func_door_rotating.qc +++ b/src/gs-entbase/server/func_door_rotating.qc @@ -518,7 +518,7 @@ func_door_rotating::Blocked(entity eBlocker) NSDict damageDecl = spawn(NSDict); damageDecl.AddKey("damage", itos(m_iDamage)); m_bCanTouch = false; - entityDamage(eBlocker, this, eBlocker, damageDecl.GetDeclBody(), "", center, dmgDir, eBlocker.origin); + combat.Damage(eBlocker, this, eBlocker, damageDecl.GetDeclBody(), center, dmgDir, eBlocker.origin); remove(damageDecl); } diff --git a/src/gs-entbase/server/func_mortar_field.qc b/src/gs-entbase/server/func_mortar_field.qc index aa894298..572f2654 100644 --- a/src/gs-entbase/server/func_mortar_field.qc +++ b/src/gs-entbase/server/func_mortar_field.qc @@ -161,7 +161,7 @@ func_mortar_field::Fire(entity firingEnt, vector vecOrg) int maxDamage = 200i; float damageRadius = (float)maxDamage * 2.5f; - radiusDamage(trace_endpos, damageRadius, 0i, maxDamage, this, ""); + combat.RadiusDamage(trace_endpos, damageRadius, 0i, maxDamage, this, ""); pointparticles(particleeffectnum("fx_explosion.main"), trace_endpos, [0,0,0], 1); } diff --git a/src/gs-entbase/server/func_rotating.qc b/src/gs-entbase/server/func_rotating.qc index a3a78b12..279026f1 100644 --- a/src/gs-entbase/server/func_rotating.qc +++ b/src/gs-entbase/server/func_rotating.qc @@ -209,7 +209,7 @@ func_rotating::Blocked(entity eBlocker) vector dmgDir = dirFromTarget(center, eBlocker.origin); NSDict damageDecl = spawn(NSDict); damageDecl.AddKey("damage", ftos(m_flDamage)); - entityDamage(eBlocker, this, eBlocker, damageDecl.GetDeclBody(), "", center, dmgDir, eBlocker.origin); + combat.Damage(eBlocker, this, eBlocker, damageDecl.GetDeclBody(), center, dmgDir, eBlocker.origin); remove(damageDecl); } } diff --git a/src/gs-entbase/server/func_train.qc b/src/gs-entbase/server/func_train.qc index 7da8dbba..97796826 100644 --- a/src/gs-entbase/server/func_train.qc +++ b/src/gs-entbase/server/func_train.qc @@ -204,7 +204,7 @@ func_train::Blocked(entity eBlocker) dmgDir = dirFromTarget(center, eBlocker.origin); damageDecl = spawn(NSDict); damageDecl.AddKey("damage", "500"); - entityDamage(eBlocker, this, eBlocker, damageDecl.GetDeclBody(), "", center, dmgDir, eBlocker.origin); + combat.Damage(eBlocker, this, eBlocker, damageDecl.GetDeclBody(), center, dmgDir, eBlocker.origin); remove(damageDecl); return; } @@ -214,7 +214,7 @@ func_train::Blocked(entity eBlocker) dmgDir = dirFromTarget(center, eBlocker.origin); damageDecl = spawn(NSDict); damageDecl.AddKey("damage", ftos(m_flDamage)); - entityDamage(eBlocker, this, eBlocker, damageDecl.GetDeclBody(), "", center, dmgDir, eBlocker.origin); + combat.Damage(eBlocker, this, eBlocker, damageDecl.GetDeclBody(), center, dmgDir, eBlocker.origin); remove(damageDecl); } else { /* remove(eBlocker); */ diff --git a/src/gs-entbase/server/game_player_hurt.qc b/src/gs-entbase/server/game_player_hurt.qc index 860c0212..5fea0ec8 100644 --- a/src/gs-entbase/server/game_player_hurt.qc +++ b/src/gs-entbase/server/game_player_hurt.qc @@ -98,10 +98,10 @@ game_player_hurt::Trigger(entity activatingEntity, triggermode_t triggerMode) NSDict damageDecl = spawn(NSDict); damageDecl.AddKey("damage", itos(m_iDamage)); - entityDamage(activatingEntity, this, activatingEntity, damageDecl.GetDeclBody(), "", GetOrigin(), g_vec_null, activatingEntity.origin); + combat.Damage(activatingEntity, this, activatingEntity, damageDecl.GetDeclBody(), GetOrigin(), g_vec_null, activatingEntity.origin); remove(damageDecl); if (HasSpawnFlags(1)) { Destroy(); } -} \ No newline at end of file +} diff --git a/src/gs-entbase/server/game_player_team.qc b/src/gs-entbase/server/game_player_team.qc index d2882b53..6572f51c 100644 --- a/src/gs-entbase/server/game_player_team.qc +++ b/src/gs-entbase/server/game_player_team.qc @@ -74,17 +74,17 @@ game_player_team::Trigger(entity entityActivator, triggermode_t state) damageDecl = spawn(NSDict); damageDecl.AddKey("damage", ftos(targetPlayer.health + 100)); damageDecl.AddKey("skip_armor", "1"); - entityDamage(targetPlayer, this, targetPlayer, damageDecl.GetDeclBody(), "", GetOrigin(), g_vec_null, targetPlayer.origin); + combat.Damage(targetPlayer, this, targetPlayer, damageDecl.GetDeclBody(), GetOrigin(), g_vec_null, targetPlayer.origin); remove(damageDecl); } else if (HasSpawnFlags(2) == true) { damageDecl = spawn(NSDict); damageDecl.AddKey("damage", ftos(targetPlayer.health)); damageDecl.AddKey("skip_armor", "1"); - entityDamage(targetPlayer, this, targetPlayer, damageDecl.GetDeclBody(), "", GetOrigin(), g_vec_null, targetPlayer.origin); + combat.Damage(targetPlayer, this, targetPlayer, damageDecl.GetDeclBody(), GetOrigin(), g_vec_null, targetPlayer.origin); remove(damageDecl); } if (HasSpawnFlags(1)) { Destroy(); } -} \ No newline at end of file +} diff --git a/src/gs-entbase/server/light.qc b/src/gs-entbase/server/light.qc index b0e90aa0..22ba9972 100644 --- a/src/gs-entbase/server/light.qc +++ b/src/gs-entbase/server/light.qc @@ -260,11 +260,17 @@ void light::DebugDraw(void) { #ifdef SERVER - R_BeginPolygon(m_strDebugTexture, 0, 0); - R_PolygonVertex(GetOrigin() + v_right * 16 - v_up * 16, [1,1], _lightColor, 1.0f); - R_PolygonVertex(GetOrigin() - v_right * 16 - v_up * 16, [0,1], _lightColor, 1.0f); - R_PolygonVertex(GetOrigin() - v_right * 16 + v_up * 16, [0,0], _lightColor, 1.0f); - R_PolygonVertex(GetOrigin() + v_right * 16 + v_up * 16, [1,0], _lightColor, 1.0f); + if (m_iEnabled) { + m_strEditorIcon = "gfx/icon16/lightbulb"; + } else { + m_strEditorIcon = "gfx/icon16/lightbulb_off"; + } + + R_BeginPolygon(m_strEditorIcon, 0, 0); + R_PolygonVertex(GetOrigin() + v_right * 8 - v_up * 8, [1,1], _lightColor, 1.0f); + R_PolygonVertex(GetOrigin() - v_right * 8 - v_up * 8, [0,1], _lightColor, 1.0f); + R_PolygonVertex(GetOrigin() - v_right * 8 + v_up * 8, [0,0], _lightColor, 1.0f); + R_PolygonVertex(GetOrigin() + v_right * 8 + v_up * 8, [1,0], _lightColor, 1.0f); R_EndPolygon(); #endif } diff --git a/src/gs-entbase/server/point_camera.qc b/src/gs-entbase/server/point_camera.qc index 52c75de4..ebda5b8c 100644 --- a/src/gs-entbase/server/point_camera.qc +++ b/src/gs-entbase/server/point_camera.qc @@ -55,6 +55,7 @@ public: virtual void Restore(string,string); virtual void SpawnKey(string,string); virtual void Input(entity,string,string); + virtual void Respawn(void); private: int m_iUseSAR; @@ -142,6 +143,16 @@ point_camera::SpawnKey(string strKey, string strValue) } } +void +point_camera::Respawn(void) +{ + if (HasSpawnFlags(1)) { + m_iValue = false; + } else { + m_iValue = true; + } +} + void point_camera::Input(entity eAct, string strInput, string strData) { diff --git a/src/gs-entbase/server/targ_speaker.qc b/src/gs-entbase/server/targ_speaker.qc index dd43699e..487ec9ef 100644 --- a/src/gs-entbase/server/targ_speaker.qc +++ b/src/gs-entbase/server/targ_speaker.qc @@ -14,7 +14,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/*! \brief Server-Entity: Redundant Sound Emitter */ +/*! \brief Server-Entity: Redundant Sound Emitter #2 */ /*!QUAKED targ_speaker (1 0 0) (-8 -8 -8) (8 8 8) # OVERVIEW This entity plays a sample upon triggering at a specified volume. @@ -88,6 +88,7 @@ void targ_speaker::SpawnKey(string strKey, string strValue) { switch (strKey) { + case "noise": case "tsnoise": m_strSample = strValue; break; diff --git a/src/gs-entbase/server/target_speaker.qc b/src/gs-entbase/server/target_speaker.qc new file mode 100644 index 00000000..0cdae3ed --- /dev/null +++ b/src/gs-entbase/server/target_speaker.qc @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2016-2022 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/*! \brief Server-Entity: Redundant Sound Emitter #1 */ +/*!QUAKED target_speaker (1 0 0) (-8 -8 -8) (8 8 8) +# OVERVIEW +This entity plays a background sound. + +# KEYS +- "targetname" : Name +- "target" : Target when triggered +- "killtarget" : Target to kill when triggered +- "noise" : Path to the sound file +- "volume" : Volume to play the sound as (normalized, 0.0 - 1.0) +- "attenuation" : Attenuation. -1 = everywhere, 1 = normal, 2 = ATTN_IDLE, 3 = ATTN_STATIC + +# SPAWNFLAGS +- LOOP (1) : Loop sound, always. + +# TRIVIA +It was introduced in Quake II (1997). + +@ingroup server +@ingroup pointentity +*/ +class +target_speaker:NSSound +{ +public: + void target_speaker(void); + + virtual void Respawn(void); + virtual void SpawnKey(string, string); +}; + +void +target_speaker::target_speaker(void) +{ +} + +void +target_speaker::SpawnKey(string keyName, string setValue) +{ + switch (keyName) { + case "noise": + SetSample(setValue); + case "volume": + float ourVolume = ReadFloat(setValue); + + if (ourVolume <= 0.0) { + ourVolume = 1.0f; + } + + SetVolume(ourVolume); + break; + default: + super::SpawnKey(keyName, setValue); + break; + } +} + +void +target_speaker::Respawn(void) +{ + if (HasSpawnFlags(1) == true) { + ForceLoop(true); + } +} diff --git a/src/gs-entbase/server/trigger_hurt.qc b/src/gs-entbase/server/trigger_hurt.qc index 92ddfe6a..71041f80 100644 --- a/src/gs-entbase/server/trigger_hurt.qc +++ b/src/gs-entbase/server/trigger_hurt.qc @@ -278,7 +278,7 @@ trigger_hurt::Touch(entity eToucher) NSDict damageDecl = spawn(NSDict); damageDecl.AddKey("damage", itos(m_iDamage)); damageDecl.AddKey("flags", itos(type)); - entityDamage(eToucher, this, eToucher, damageDecl.GetDeclBody(), "", center, g_vec_null, eToucher.origin); + combat.Damage(eToucher, this, eToucher, damageDecl.GetDeclBody(), center, g_vec_null, eToucher.origin); remove(damageDecl); /* shut it down if used once */ diff --git a/src/gs-entbase/shared.src b/src/gs-entbase/shared.src index 3a0c5018..141e148f 100644 --- a/src/gs-entbase/shared.src +++ b/src/gs-entbase/shared.src @@ -24,6 +24,7 @@ shared/logic_achievement.qc shared/func_monitor.qc shared/func_lod.qc shared/func_illusionary.qc +shared/func_useableladder.qc shared/func_ladder.qc shared/func_wall.qc shared/func_vehicle.qc diff --git a/src/gs-entbase/shared/ambient_generic.qc b/src/gs-entbase/shared/ambient_generic.qc index fa69f7a4..1ed39e6b 100644 --- a/src/gs-entbase/shared/ambient_generic.qc +++ b/src/gs-entbase/shared/ambient_generic.qc @@ -232,6 +232,8 @@ ambient_generic::Respawn(void) super::Respawn(); SetSize([0,0,0], [0,0,0]); + SetSolid(SOLID_NOT); + SetMovetype(MOVETYPE_NONE); m_strActivePath = m_strSpawnPath; m_flPitch = m_flSpawnPitch; @@ -274,6 +276,8 @@ ambient_generic::Respawn(void) Trigger = UseLoop; } + + customphysics = __NULL__; } void @@ -385,27 +389,23 @@ ambient_generic::SendEntity(entity ePEnt, float flChanged) WriteFloat(MSG_ENTITY, flChanged); - if (flChanged & AMBIENT_ORIGIN) { - WriteCoord(MSG_ENTITY, origin[0]); - WriteCoord(MSG_ENTITY, origin[1]); - WriteCoord(MSG_ENTITY, origin[2]); - } - + SENDENTITY_COORD(origin[0], AMBIENT_ORIGIN) + SENDENTITY_COORD(origin[1], AMBIENT_ORIGIN) + SENDENTITY_COORD(origin[2], AMBIENT_ORIGIN) + if (flChanged & AMBIENT_PATH) { if (flChanged & AMBIENT_MODERN) { - WriteString(MSG_ENTITY, m_strActivePath); + SENDENTITY_STRING(m_strActivePath, AMBIENT_PATH) } else { WriteFloat(MSG_ENTITY, getsoundindex(m_strActivePath, true)); + m_strActivePath_net = m_strActivePath; } } - if (flChanged & AMBIENT_VOLUME) - WriteFloat(MSG_ENTITY, m_flVolume); - if (flChanged & AMBIENT_RADIUS) - WriteByte(MSG_ENTITY, m_flRadius); - if (flChanged & AMBIENT_PITCH) - WriteFloat(MSG_ENTITY, m_flPitch); - if (flChanged & AMBIENT_ENABLED) - WriteByte(MSG_ENTITY, m_bLoops); + + SENDENTITY_FLOAT(m_flVolume, AMBIENT_VOLUME) + SENDENTITY_BYTE(m_flRadius, AMBIENT_RADIUS) + SENDENTITY_FLOAT(m_flPitch, AMBIENT_PITCH) + SENDENTITY_BYTE(m_bLoops, AMBIENT_ENABLED) return (1); } @@ -414,6 +414,7 @@ void ambient_generic::ReceiveEntity(float isnew, float flChanged) { if (flChanged & AMBIENT_ORIGIN) { + vector oldOrg = origin; origin[0] = readcoord(); origin[1] = readcoord(); origin[2] = readcoord(); diff --git a/src/gs-entbase/shared/env_beam.qc b/src/gs-entbase/shared/env_beam.qc index 7646ae70..cea9dce9 100644 --- a/src/gs-entbase/shared/env_beam.qc +++ b/src/gs-entbase/shared/env_beam.qc @@ -211,7 +211,7 @@ env_beam::CastLaser(void) damageDecl.AddKey("damage", itos(m_iDamage)); damageDecl.AddKey("type", "electro"); - entityDamage(trace_ent, this, trace_ent, damageDecl.GetDeclBody(), "", center, g_vec_null, trace_ent.origin); + combat.Damage(trace_ent, this, trace_ent, damageDecl.GetDeclBody(), center, g_vec_null, trace_ent.origin); remove(damageDecl); } diff --git a/src/gs-entbase/shared/env_glow.qc b/src/gs-entbase/shared/env_glow.qc index efe83384..0297b78a 100644 --- a/src/gs-entbase/shared/env_glow.qc +++ b/src/gs-entbase/shared/env_glow.qc @@ -346,6 +346,7 @@ env_glow::ReceiveEntity(float flNew, float flChanged) if (flNew) RendererRestarted(); + effects = EF_NODEPTHTEST; drawmask = MASK_GLOWS; setsize(this, g_vec_null, g_vec_null); setorigin(this, origin); diff --git a/src/gs-entbase/shared/env_laser.qc b/src/gs-entbase/shared/env_laser.qc index a1664d61..4db47616 100644 --- a/src/gs-entbase/shared/env_laser.qc +++ b/src/gs-entbase/shared/env_laser.qc @@ -179,7 +179,7 @@ env_laser::CastLaser(void) damageDecl.AddKey("damage", itos(m_iDamage)); damageDecl.AddKey("type", "electro"); - entityDamage(trace_ent, this, trace_ent, damageDecl.GetDeclBody(), "", center, g_vec_null, trace_ent.origin); + combat.Damage(trace_ent, this, trace_ent, damageDecl.GetDeclBody(), center, g_vec_null, trace_ent.origin); remove(damageDecl); m_flTraceTime = time + 1.0f; } diff --git a/src/gs-entbase/shared/env_sprite.qc b/src/gs-entbase/shared/env_sprite.qc index c185d687..e4ec929c 100644 --- a/src/gs-entbase/shared/env_sprite.qc +++ b/src/gs-entbase/shared/env_sprite.qc @@ -78,6 +78,7 @@ public: virtual float SendEntity(entity,float); virtual void SpawnKey(string,string); virtual void NetworkOnce(void); + virtual void Respawn(void); #else virtual float predraw(void); virtual void think(void); @@ -142,7 +143,7 @@ env_sprite::SendEntity(entity ePEnt, float flChanged) return (0); /* strings are expensive. */ - if (!m_strMaterial) + if (!STRING_SET(m_strMaterial)) flChanged &= ~SPRITE_CHANGED_MATERIAL; WriteByte(MSG_ENTITY, ENT_SPRITE); @@ -173,7 +174,12 @@ env_sprite::NetworkOnce(void) WriteCoord(MSG_MULTICAST, origin[0]); WriteCoord(MSG_MULTICAST, origin[1]); WriteCoord(MSG_MULTICAST, origin[2]); - WriteFloat(MSG_MULTICAST, modelindex); + + if (STRING_SET(m_strMaterial)) + WriteFloat(MSG_MULTICAST, 0); + else + WriteFloat(MSG_MULTICAST, modelindex); + WriteFloat(MSG_MULTICAST, m_flFramerate); WriteFloat(MSG_MULTICAST, scale); WriteByte(MSG_MULTICAST, m_iRenderMode); @@ -227,6 +233,26 @@ env_sprite::Spawned(void) if (!targetname) m_iToggled = TRUE; } + +void +env_sprite::Respawn(void) +{ + super::Respawn(); + + string modelTest = GetSpawnString("model"); + + /* HACK: Source Engine support. Yes, they re-used 'model' for this. */ + if (exists.InVFS(modelTest) == false) { + + string sourceVMT = strcat("materials/", Util_ChangeExtension(modelTest, "vmt")); + + if (exists.InVFS(sourceVMT)) { + m_strMaterial = sourceVMT; + model = __NULL__; + modelindex = 0; + } + } +} #else float env_sprite::predraw(void) @@ -246,6 +272,8 @@ env_sprite::predraw(void) traceline(origin, vecPlayer, MOVE_WORLDONLY, this); + trace_fraction = 1.0f; + if (trace_fraction < 1.0) return (PREDRAW_NEXT); @@ -299,6 +327,7 @@ env_sprite::ReceiveEntity(float flNew, float flChanged) READENTITY_BYTE(m_flRenderAmt, SPRITE_CHANGED_RENDERAMT) READENTITY_STRING(m_strMaterial, SPRITE_CHANGED_MATERIAL) + effects = EF_NODEPTHTEST; drawmask = MASK_ENGINE; nextthink = time + (1 / m_flFramerate); m_iMaxFrame = modelframecount(modelindex); diff --git a/src/gs-entbase/shared/func_ladder.qc b/src/gs-entbase/shared/func_ladder.qc index 97ee7b9a..0c1872b2 100644 --- a/src/gs-entbase/shared/func_ladder.qc +++ b/src/gs-entbase/shared/func_ladder.qc @@ -42,6 +42,11 @@ public: }; +void +func_ladder::func_ladder(void) +{ +} + #ifdef SERVER void func_ladder::Trigger(entity act, triggermode_t state) @@ -66,13 +71,8 @@ func_ladder::Respawn(void) /* func_ladder specifics */ SetMovetype(MOVETYPE_NONE); - SetSolid(SOLID_BSP); - SetSkin(CONTENT_LADDER); SetFrame(0); Hide(); -} - -void -func_ladder::func_ladder(void) -{ + SetSolid(SOLID_BSP); + SetSkin(CONTENT_LADDER); } diff --git a/src/gs-entbase/shared/func_monitor.qc b/src/gs-entbase/shared/func_monitor.qc index 6c5e7855..802626a1 100644 --- a/src/gs-entbase/shared/func_monitor.qc +++ b/src/gs-entbase/shared/func_monitor.qc @@ -24,22 +24,23 @@ vector g_vecRenderTargetAngles; void RenderTarget_Monitor_Update(void) { - if (!g_iRenderTargetActive) { + if (g_iRenderTargetActive == false) { return; } clearscene(); - setviewprop(VF_RT_DESTCOLOUR, "base", (float)1, g_iRenderTargetSize); - setviewprop(VF_SIZE, g_iRenderTargetSize); - setviewprop(VF_DRAWENGINESBAR, (float)0); - setviewprop(VF_ORIGIN, g_vecRenderTargetPos); - setviewprop(VF_ANGLES, g_vecRenderTargetAngles); - setviewprop(VF_AFOV, g_flRenderTargetFOV); /* TODO: This is ideally where fog parms should be set... :/ */ addentities(MASK_ENGINE); + + setproperty(VF_RT_DESTCOLOUR, "base", (float)1, g_iRenderTargetSize); + setproperty(VF_SIZE, g_iRenderTargetSize); + setproperty(VF_DRAWENGINESBAR, (float)0); + setproperty(VF_ORIGIN, g_vecRenderTargetPos); + setproperty(VF_ANGLES, g_vecRenderTargetAngles); + setproperty(VF_AFOV, g_flRenderTargetFOV); renderscene(); - setviewprop(VF_RT_DESTCOLOUR, ""); + setproperty(VF_RT_DESTCOLOUR, ""); } #endif @@ -183,32 +184,40 @@ func_monitor::SendEntity(entity ePEnt, float flChanged) void func_monitor::EvaluateEntity(void) { - if (ATTR_CHANGED(origin)) { - SetSendFlags(MONITORFL_CHANGED_BASE); - } - SAVE_STATE(origin) + point_camera viewPoint; /* this monitor is disabled */ - if (!m_bState) + if (!m_bState) { return; + } - point_camera viewer; - viewer = (point_camera)find(world, ::targetname, target); - - if (!viewer) + /* no target set. yet. */ + if (!STRING_SET(target)) { + m_bState = false; return; + } - m_vecCamOrigin = viewer.origin; - m_vecCamAngles = viewer.angles; - m_flFOV = viewer.m_flFOV; - m_iUseSAR = viewer.m_iUseSAR; - m_vecFogColor = viewer.m_vecFogColor; - m_flFogStart = viewer.m_flFogStart; - m_bState = viewer.m_iValue ? true : false; + viewPoint = (point_camera)find(world, ::targetname, target); + + /* target set, but invalid. */ + if (!viewPoint) { + EntError("No valid target %S in map.", target); + Destroy(); + return; + } + + m_vecCamOrigin = viewPoint.origin; + m_vecCamAngles = viewPoint.angles; + m_flFOV = viewPoint.m_flFOV; + m_iUseSAR = viewPoint.m_iUseSAR; + m_vecFogColor = viewPoint.m_vecFogColor; + m_flFogStart = viewPoint.m_flFogStart; + m_bState = viewPoint.m_iValue ? true : false; /* camera is disabled */ - if (!viewer.m_iValue) + if (!viewPoint.m_iValue) { return; + } EVALUATE_FIELD(modelindex, MONITORFL_CHANGED_BASE) EVALUATE_VECTOR(origin, 0, MONITORFL_CHANGED_BASE) diff --git a/src/gs-entbase/shared/func_tankmortar.qc b/src/gs-entbase/shared/func_tankmortar.qc index 577225fa..c81b9328 100644 --- a/src/gs-entbase/shared/func_tankmortar.qc +++ b/src/gs-entbase/shared/func_tankmortar.qc @@ -348,7 +348,7 @@ func_tankmortar::PlayerInput(void) traceline(spos, spos + (dir * 4096), MOVE_NORMAL, this); damageRange = (float)m_iDamage * 2.5f; - radiusDamage(trace_endpos, damageRange, 0i, m_iDamage, m_eDriver, ""); + combat.RadiusDamage(trace_endpos, damageRange, 0i, m_iDamage, m_eDriver, ""); /* fx */ pointparticles(particleeffectnum("fx_explosion.main"), trace_endpos, [0,0,0], 1); diff --git a/src/gs-entbase/shared/func_useableladder.qc b/src/gs-entbase/shared/func_useableladder.qc new file mode 100644 index 00000000..ef0884e8 --- /dev/null +++ b/src/gs-entbase/shared/func_useableladder.qc @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2016-2022 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/*! \brief Shared-Entity: Ladder Volume */ +/*!QUAKED func_useableladder (0 .5 .8) ? +# OVERVIEW +Ladder volume. Climb up ladders with this one simple brush. + +# KEYS +- "targetname" : Name + +# TRIVIA +This entity was introduced in Half-Life 2 (2004). + +@ingroup shared +@ingroup brushentity +*/ +class +func_useableladder:NSRenderableEntity +{ +public: + void func_useableladder(void); + + virtual void SpawnKey(string, string); + virtual void Respawn(void); + +#ifdef SERVER + virtual void Trigger(entity, triggermode_t); +#endif + +private: + vector m_vecPoint0; + vector m_vecPoint1; +}; + +void +func_useableladder::func_useableladder(void) +{ +} + +void +func_useableladder::SpawnKey(string keyName, string setValue) +{ + switch (keyName) { + case "point0": + m_vecPoint0 = ReadVector(setValue); + break; + case "point1": + m_vecPoint1 = ReadVector(setValue); + break; + default: + super::SpawnKey(keyName, setValue); + } +} + +#ifdef SERVER +void +func_useableladder::Trigger(entity act, triggermode_t state) +{ + switch (state) { + case TRIG_OFF: + SetSolid(SOLID_NOT); + break; + case TRIG_ON: + SetSolid(SOLID_BBOX); + break; + default: + m_bEnabled = 1 - m_bEnabled; + SetSolid((m_bEnabled) ? SOLID_BBOX : SOLID_NOT); + } +} +#endif + +void +func_useableladder::Respawn(void) +{ + float height; + + if (m_vecPoint0[2] > m_vecPoint1[2]) { + SetOrigin(m_vecPoint1); + height = m_vecPoint0[2] - m_vecPoint1[2]; + } else { + SetOrigin(m_vecPoint0); + height = m_vecPoint1[2] - m_vecPoint0[2]; + } + + /* func_useableladder specifics */ + SetSize([-16,-16, 0], [16,16, height]); + SetMovetype(MOVETYPE_NONE); + Hide(); + SetSolid(SOLID_BBOX); + SetSkin(CONTENT_LADDER); +} diff --git a/src/gs-entbase/shared/phys_rope.qc b/src/gs-entbase/shared/phys_rope.qc index 13f03c25..abb5f760 100644 --- a/src/gs-entbase/shared/phys_rope.qc +++ b/src/gs-entbase/shared/phys_rope.qc @@ -194,6 +194,7 @@ phys_rope::EvaluateEntity(void) if (!eFind) { EntError("phys_rope: Unable to find target %S", target); + Destroy(); return; } @@ -352,4 +353,4 @@ phys_rope::phys_rope(void) } CLASSEXPORT(move_rope, phys_rope) -CLASSEXPORT(keyframe_rope, phys_rope) \ No newline at end of file +CLASSEXPORT(keyframe_rope, phys_rope) diff --git a/src/gs-entbase/shared/prop_vehicle_driveable.qc b/src/gs-entbase/shared/prop_vehicle_driveable.qc index db2ab688..78c225c9 100644 --- a/src/gs-entbase/shared/prop_vehicle_driveable.qc +++ b/src/gs-entbase/shared/prop_vehicle_driveable.qc @@ -1,45 +1,45 @@ -/* - * Copyright (c) 2016-2022 Vera Visions LLC. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER - * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ +/* + * Copyright (c) 2016-2022 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + + +#define VEH_SKIDDING VFL_USE_RELEASED + +#define VEHSF_NOFLIP 2048 + +enumflags +{ + VEHFL_DRIVER, + VEHFL_MODELINDEX, + VEHFL_ORIGIN, + VEHFL_ANGLES, + VEHFL_VELOCITY, + VEHFL_TURNING, + VEHFL_FLAGS +}; - -#define VEH_SKIDDING VFL_USE_RELEASED - -#define VEHSF_NOFLIP 2048 - -enumflags -{ - VEHFL_DRIVER, - VEHFL_MODELINDEX, - VEHFL_ORIGIN, - VEHFL_ANGLES, - VEHFL_VELOCITY, - VEHFL_TURNING, - VEHFL_FLAGS -}; - static class -prop_vehicle_driveable_wheel -{ +prop_vehicle_driveable_wheel:NSIO +{ public: - void prop_vehicle_driveable_wheel(void); - -#ifdef CLIENT + void prop_vehicle_driveable_wheel(void); + +#ifdef CLIENT virtual void PredictPreFrame(void); virtual void PredictPostFrame(void); -#endif +#endif virtual void UpdateSuspension(float); virtual void Move(float); @@ -48,72 +48,74 @@ public: virtual void Physics(float,float); private: - float m_flSuspension; - float m_flSuspensionForce; - -#ifdef CLIENT - vector origin_net; - vector velocity_net; - vector angles_net; -#endif -}; - + float m_flSuspension; + float m_flSuspensionForce; + +#ifdef CLIENT + vector origin_net; + vector velocity_net; + vector angles_net; +#endif +}; + /*! \brief Shared-Entity: Model Based Vehicle */ -/*!QUAKED prop_vehicle_driveable (1 0 0) (-50 -50 0) (50 50 70) +/*!QUAKED prop_vehicle_driveable (1 0 0) (-50 -50 0) (50 50 70) # OVERVIEW -Point entity defining a 4-wheel vehicle that you can drive. - -# KEYS -- "targetname" : Name - -# SPAWNFLAGS - None currently. - -# NOTES - None currently. - -# TRIVIA -This entity was introduced in Half-Life 2 (2004). +Point entity defining a 4-wheel vehicle that you can drive. + +# KEYS +- "targetname" : Name + +# SPAWNFLAGS + +None currently. + +# NOTES + +None currently. + +# TRIVIA +This entity was introduced in Half-Life 2 (2004). @ingroup shared @ingroup pointentity -*/ -class prop_vehicle_driveable:NSVehicle -{ +*/ +class prop_vehicle_driveable:NSVehicle +{ private: - /* map-entity fields */ - float m_flBounceFactor; - float m_flAcceleration; - float m_flSkidSpeed; - float m_flTraction; - float m_flBreakFactor; - float m_flSteerFactor; - float m_flStraightenFactor; - vector m_vecGravityDir; - float m_flTimeLength; - vector m_vecSeatOffest; - - /* collision boxes */ - NSEntity m_eCollBox1; - NSEntity m_eCollBox2; - - prop_vehicle_driveable_wheel m_wlFL; - prop_vehicle_driveable_wheel m_wlFR; - prop_vehicle_driveable_wheel m_wlBL; - prop_vehicle_driveable_wheel m_wlBR; - vector m_vecControlMins; - vector m_vecControlMaxs; + /* map-entity fields */ + float m_flBounceFactor; + float m_flAcceleration; + float m_flSkidSpeed; + float m_flTraction; + float m_flBreakFactor; + float m_flSteerFactor; + float m_flStraightenFactor; + vector m_vecGravityDir; + float m_flTimeLength; + vector m_vecSeatOffest; + + /* collision boxes */ + NSEntity m_eCollBox1; + NSEntity m_eCollBox2; + + prop_vehicle_driveable_wheel m_wlFL; + prop_vehicle_driveable_wheel m_wlFR; + prop_vehicle_driveable_wheel m_wlBL; + prop_vehicle_driveable_wheel m_wlBR; + vector m_vecControlMins; + vector m_vecControlMaxs; PREDICTED_FLOAT(m_flTurn) - - float m_flBRWheelAxel; - float m_flBLWheelAxel; - float m_flFLWheelAxel; - float m_flFRWheelAxel; - - float m_flUseTime; - + + float m_flBRWheelAxel; + float m_flBLWheelAxel; + float m_flFLWheelAxel; + float m_flFRWheelAxel; + + float m_flUseTime; + public: - void prop_vehicle_driveable(void); + void prop_vehicle_driveable(void); virtual void Spawned(void); virtual void Physics(void); @@ -122,726 +124,747 @@ public: virtual void PlayerInput(void); virtual void OnRemoveEntity(void); -#ifdef CLIENT + nonvirtual void SpawnWheels(); + +#ifdef CLIENT virtual bool HideViewWeapon(void); virtual void PredictPreFrame(void); virtual void PredictPostFrame(void); virtual void ReceiveEntity(float,float); virtual void UpdateView(void); -#else +#else virtual void Respawn(void); virtual void OnPlayerUse(void); virtual void EvaluateEntity(void); virtual float SendEntity(entity,float); -#endif -}; +#endif +}; + +void +prop_vehicle_driveable::prop_vehicle_driveable(void) +{ + m_eDriver = __NULL__; + m_flBounceFactor = 1.25f; + m_flAcceleration = 600.0f; + m_flSkidSpeed = 256.0f; + m_flTraction = 5.0f; + m_flBreakFactor = 2.0f; + m_flSteerFactor = 1.0f; + m_flStraightenFactor = 1.0f; + m_vecGravityDir = [0,0,-1]; + m_iVehicleFlags |= VHF_FROZEN; + + m_eCollBox1 = __NULL__; + m_eCollBox2 = __NULL__; + + m_wlFL = __NULL__; + m_wlFR = __NULL__; + m_wlBL = __NULL__; + m_wlBR = __NULL__; +} + +#ifdef CLIENT +bool +prop_vehicle_driveable::HideViewWeapon(void) +{ + return true; +} +#endif + +void +prop_vehicle_driveable::Physics(void) +{ +#ifdef CLIENT + DriverRelink(); +#endif + + /* if nobody is in the car, we need to run physics here + * with fake input frames */ + if (GetDriver() == __NULL__) { +#ifdef SERVER + m_flTimeLength = frametime; + m_vecMoveValues = [0,0,0]; + m_iMoveButtons = 0; + RunVehiclePhysics(); +#else + setorigin(this, origin); +#endif + } else { + //crossprint(sprintf("Driver: %s\n", GetDriver().classname)); + } -void -prop_vehicle_driveable::prop_vehicle_driveable(void) -{ - m_eDriver = __NULL__; - m_flBounceFactor = 1.25f; - m_flAcceleration = 600.0f; - m_flSkidSpeed = 256.0f; - m_flTraction = 5.0f; - m_flBreakFactor = 2.0f; - m_flSteerFactor = 1.0f; - m_flStraightenFactor = 1.0f; - m_vecGravityDir = [0,0,-1]; - m_iVehicleFlags |= VHF_FROZEN; - hitcontentsmaski = CONTENTBIT_BODY | CONTENTBITS_POINTSOLID | CONTENTBIT_VEHICLECLIP; - - if (!m_eCollBox1) - m_eCollBox1 = spawn(NSEntity); - if (!m_eCollBox2) - m_eCollBox2 = spawn(NSEntity); - - { - m_eCollBox1.SetSize([-32,-32,0], [32,32,32]); - m_eCollBox2.SetSize([-32,-32,0], [32,32,32]); - } - - m_eCollBox1.hitcontentsmaski = hitcontentsmaski; - m_eCollBox2.hitcontentsmaski = hitcontentsmaski; - - if (!m_wlFL) - m_wlFL = spawn(prop_vehicle_driveable_wheel); - if (!m_wlFR) - m_wlFR = spawn(prop_vehicle_driveable_wheel); - if (!m_wlBL) - m_wlBL = spawn(prop_vehicle_driveable_wheel); - if (!m_wlBR) - m_wlBR = spawn(prop_vehicle_driveable_wheel); - - m_eCollBox1.owner = m_eCollBox2.owner = \ - m_wlFL.owner = m_wlFR.owner = \ - m_wlBL.owner = m_wlBR.owner = this; - - customphysics = Physics; -} - -#ifdef CLIENT -bool -prop_vehicle_driveable::HideViewWeapon(void) -{ - return true; -} -#endif - -void -prop_vehicle_driveable::Physics(void) -{ -#ifdef CLIENT - DriverRelink(); -#endif - - /* if nobody is in the car, we need to run physics here - * with fake input frames */ - if (GetDriver() == __NULL__) { -#ifdef SERVER - m_flTimeLength = frametime; - m_vecMoveValues = [0,0,0]; - m_iMoveButtons = 0; - RunVehiclePhysics(); -#else - setorigin(this, origin); -#endif - } else { - //crossprint(sprintf("Driver: %s\n", GetDriver().classname)); - } - HandleThink(); -} - -void -prop_vehicle_driveable::OnRemoveEntity(void) -{ - remove(m_wlFL); - remove(m_wlFR); - remove(m_wlBL); - remove(m_wlBR); - remove(m_eCollBox1); - remove(m_eCollBox2); -} - -#ifdef CLIENT -void -prop_vehicle_driveable::UpdateView(void) -{ - vector vecStart, vecEnd; - - pSeat->m_vecPredictedOrigin = origin; - makevectors(view_angles); - vecStart = [pSeat->m_vecPredictedOrigin[0], pSeat->m_vecPredictedOrigin[1], pSeat->m_vecPredictedOrigin[2] + 16] + (v_right * 4); - vecEnd = vecStart + (v_forward * -256) + [0,0,16] + (v_right * 4); - other = world; - traceline(vecStart, vecEnd, MOVE_OTHERONLY, this); - g_view.SetCameraOrigin(trace_endpos + (v_forward * 16)); - g_view.SetClientAngle(view_angles); -} - -void -prop_vehicle_driveable_wheel::PredictPreFrame(void) -{ - SAVE_STATE(angles) - SAVE_STATE(origin) - SAVE_STATE(velocity) -} - -void -prop_vehicle_driveable_wheel::PredictPostFrame(void) -{ - ROLL_BACK(angles) - ROLL_BACK(origin) - ROLL_BACK(velocity) -} -#endif - -void -prop_vehicle_driveable_wheel::Bounce(vector normal) -{ - prop_vehicle_driveable vehParent; - vehParent = (prop_vehicle_driveable)owner; - - vector vecBounce = (velocity * normal) * normal * vehParent.m_flBounceFactor; - velocity -= vecBounce; - vehParent.velocity = velocity; - -#ifdef SERVER - float flStregth = vlen((velocity * normal) * normal); - - if (flStregth > 96) { - Sound_Play(vehParent, CHAN_VOICE, "prop_vehicle_driveable.bounce"); - } -#endif -} - -void -prop_vehicle_driveable_wheel::Move(float flTimeLength) -{ - vector vecDest; - vector vecSavedNormal; - float flStepped; - float flMovetime; - int i; - - /* have a few attempts */ - for (i = 3, flMovetime = flTimeLength; flMovetime > 0 && i; i--) { - vecDest = origin + (velocity * flMovetime); - tracebox(origin, mins, maxs, vecDest, MOVE_NOMONSTERS, this); - - if (trace_startsolid) { - continue; - } - - origin = trace_endpos; - - if (trace_fraction < 1) { - vecSavedNormal = trace_plane_normal; - flMovetime -= flMovetime * trace_fraction; - - if (flMovetime) { - float roof_fraction; - vector roof_plane_normal; - - /* step up if we can */ - trace_endpos = origin; - trace_endpos[2] += 8; - - tracebox(origin, mins, maxs, trace_endpos, MOVE_NOMONSTERS, this); - flStepped = trace_endpos[2] - origin[2]; - - roof_fraction = trace_fraction; - roof_plane_normal = trace_plane_normal; - - vecDest = trace_endpos + velocity * flMovetime; - - /* only horizontally */ - vecDest[2] = trace_endpos[2]; - - /* move forwards */ - tracebox(trace_endpos, mins, maxs, vecDest, MOVE_NOMONSTERS, this); - - /* if we got anywhere, make this raised-step move count */ - if (trace_fraction != 0) { - float fwfrac; - vector fwplane; - - fwfrac = trace_fraction; - fwplane = trace_plane_normal; - - /* move down */ - vecDest = trace_endpos; - vecDest[2] -= flStepped + 1; - tracebox(trace_endpos, mins, maxs, vecDest, MOVE_NOMONSTERS, this); - - if (trace_fraction < 1 && trace_plane_normal[2] > 0.7f) { - flMovetime -= flMovetime * fwfrac; - - if (roof_fraction < 1) { - Bounce(roof_plane_normal); - } - - /* FIXME: do we need velocity < 0? */ - if (trace_fraction < 1) { - Bounce(trace_plane_normal); - } else if (fwfrac < 1) { - Bounce(fwplane); - } - - origin = trace_endpos; - continue; - } - } - } - - /* stepping failed, assume crash? */ - if (trace_ent == world) { - if (vlen(velocity) > 300) { - float impact; - impact = -dotproduct(trace_plane_normal, velocity); - int iImpactDamage = impact / 100; - } - } - - Bounce(vecSavedNormal); - /* Physics_DoTouch(this, trace_ent); */ - } else { - break; - } - } -} - -void -prop_vehicle_driveable_wheel::Accel(float flMoveTime, float m_flTurn) -{ - prop_vehicle_driveable vehParent; - entity eDriver; - float flTraction; - vector vecAngle; - - vehParent = (prop_vehicle_driveable)owner; - eDriver = vehParent.m_eDriver; - vecAngle = vehParent.angles; - - makevectors(vecAngle); - - if (m_flTurn) { - /* cripple turnrate by our current velocity */ - float turnbreak = bound(0, vlen(velocity), 100) * 0.5; - - /* rotates v_forward */ - rotatevectorsbyangle([ 0, m_flTurn * turnbreak, 0]); - } - - tracebox(origin, mins, maxs, origin - v_up, MOVE_NOMONSTERS, owner); - - /* allow a range, for 1qu's worth of spare tyre pressure. or something */ - flTraction = 1 - trace_fraction; - - /* air friction, doubles up for general rolling friction, ish */ - velocity *= 1 - flMoveTime * 0.1; - - if (flTraction) { - if (eDriver) { - velocity += v_forward * bound(-1, vehParent.m_vecMoveValues[0] / 400, 1) * vehParent.m_flAcceleration * flMoveTime * flTraction; - } - - /* test if this car is skidding */ - float skid = (velocity * v_right); - if ( fabs(skid) > vehParent.m_flSkidSpeed ) { - vehParent.vv_flags |= VEH_SKIDDING; - } - - /* nuke sideways velocity. if a wheel is off the ground this probably - means that it'll be pushed further. players should try not to roll - too much. */ - /* FIXME: push opposite wheel up slightly to model chassis momentum - not slowing as much as the wheel itself (zomg: race conditions!) */ - velocity -= (velocity * v_right) * v_right * vehParent.m_flTraction * flMoveTime * flTraction; - - if (!eDriver || (vehParent.m_iMoveButtons & INPUT_BUTTON2 || vehParent.m_vecMoveValues[2] > 0)) { - vector t; - - /* empty cars are assumed to have their brakes on. - nuke forward velocity. if a wheel is off the ground this probably - means that it'll be pushed further. players should try not to - roll too much. - - Note: really we ought to be applying some axel friction even - when not breaking, but we'll just depend on air friction for - that. */ - velocity -= (velocity * v_forward) * v_forward * vehParent.m_flBreakFactor * flMoveTime * flTraction; - - /* if break is on, nuke the final part of the velocity, so we can - become truely motionless.*/ - t = velocity - velocity * dotproduct(velocity, vehParent.m_vecGravityDir); - if (vlen(t) < 15) { - velocity -= t; - } - - /* don't bother with gravity if we're already on the ground and - breaking. this avoids weird slides. */ - if (!trace_fraction && trace_plane_normal * vehParent.m_vecGravityDir < -0.7f) { - return; - } - } - } - - /* apply gravity */ - velocity += vehParent.m_vecGravityDir * flMoveTime * serverkeyfloat("phy_gravity") * trace_fraction; - - tracebox(origin, mins * 4.0, maxs * 4.0, origin, MOVE_NORMAL, owner); - if (trace_ent && trace_ent != vehParent.m_eDriver) { - int iImpactDamage = vlen(velocity) / 10; - - if (iImpactDamage > 10) { - trace_ent.velocity = velocity * 2.0 + [0,0,500]; - velocity *= 0.25f; -#ifdef SERVER - if (trace_ent.takedamage) { - NSSurfacePropEntity foo = (NSSurfacePropEntity)trace_ent; +} + +void +prop_vehicle_driveable::OnRemoveEntity(void) +{ + if (m_wlFL) + m_wlFL.Destroy(); + if (m_wlFR) + m_wlFR.Destroy(); + if (m_wlBL) + m_wlBL.Destroy(); + if (m_wlBR) + m_wlBR.Destroy(); + if (m_eCollBox1) + m_eCollBox1.Destroy(); + if (m_eCollBox2) + m_eCollBox2.Destroy(); +} + +#ifdef CLIENT +void +prop_vehicle_driveable::UpdateView(void) +{ + vector vecStart, vecEnd; + + pSeat->m_vecPredictedOrigin = origin; + makevectors(view_angles); + vecStart = [pSeat->m_vecPredictedOrigin[0], pSeat->m_vecPredictedOrigin[1], pSeat->m_vecPredictedOrigin[2] + 16] + (v_right * 4); + vecEnd = vecStart + (v_forward * -256) + [0,0,16] + (v_right * 4); + other = world; + traceline(vecStart, vecEnd, MOVE_OTHERONLY, this); + g_view.SetCameraOrigin(trace_endpos + (v_forward * 16)); + g_view.SetClientAngle(view_angles); +} + +void +prop_vehicle_driveable_wheel::PredictPreFrame(void) +{ + SAVE_STATE(angles) + SAVE_STATE(origin) + SAVE_STATE(velocity) +} + +void +prop_vehicle_driveable_wheel::PredictPostFrame(void) +{ + ROLL_BACK(angles) + ROLL_BACK(origin) + ROLL_BACK(velocity) +} +#endif + +void +prop_vehicle_driveable_wheel::Bounce(vector normal) +{ + prop_vehicle_driveable vehParent; + vehParent = (prop_vehicle_driveable)owner; + + vector vecBounce = (velocity * normal) * normal * vehParent.m_flBounceFactor; + velocity -= vecBounce; + vehParent.velocity = velocity; + +#ifdef SERVER + float flStregth = vlen((velocity * normal) * normal); + + if (flStregth > 96) { + Sound_Play(vehParent, CHAN_VOICE, "prop_vehicle_driveable.bounce"); + } +#endif +} + +void +prop_vehicle_driveable_wheel::Move(float flTimeLength) +{ + vector vecDest; + vector vecSavedNormal; + float flStepped; + float flMovetime; + int i; + + /* have a few attempts */ + for (i = 3, flMovetime = flTimeLength; flMovetime > 0 && i; i--) { + vecDest = origin + (velocity * flMovetime); + tracebox(origin, mins, maxs, vecDest, MOVE_NOMONSTERS, this); + + if (trace_startsolid) { + continue; + } + + origin = trace_endpos; + + if (trace_fraction < 1) { + vecSavedNormal = trace_plane_normal; + flMovetime -= flMovetime * trace_fraction; + + if (flMovetime) { + float roof_fraction; + vector roof_plane_normal; + + /* step up if we can */ + trace_endpos = origin; + trace_endpos[2] += 8; + + tracebox(origin, mins, maxs, trace_endpos, MOVE_NOMONSTERS, this); + flStepped = trace_endpos[2] - origin[2]; + + roof_fraction = trace_fraction; + roof_plane_normal = trace_plane_normal; + + vecDest = trace_endpos + velocity * flMovetime; + + /* only horizontally */ + vecDest[2] = trace_endpos[2]; + + /* move forwards */ + tracebox(trace_endpos, mins, maxs, vecDest, MOVE_NOMONSTERS, this); + + /* if we got anywhere, make this raised-step move count */ + if (trace_fraction != 0) { + float fwfrac; + vector fwplane; + + fwfrac = trace_fraction; + fwplane = trace_plane_normal; + + /* move down */ + vecDest = trace_endpos; + vecDest[2] -= flStepped + 1; + tracebox(trace_endpos, mins, maxs, vecDest, MOVE_NOMONSTERS, this); + + if (trace_fraction < 1 && trace_plane_normal[2] > 0.7f) { + flMovetime -= flMovetime * fwfrac; + + if (roof_fraction < 1) { + Bounce(roof_plane_normal); + } + + /* FIXME: do we need velocity < 0? */ + if (trace_fraction < 1) { + Bounce(trace_plane_normal); + } else if (fwfrac < 1) { + Bounce(fwplane); + } + + origin = trace_endpos; + continue; + } + } + } + + /* stepping failed, assume crash? */ + if (trace_ent == world) { + if (vlen(velocity) > 300) { + float impact; + impact = -dotproduct(trace_plane_normal, velocity); + int iImpactDamage = impact / 100; + } + } + + Bounce(vecSavedNormal); + /* Physics_DoTouch(this, trace_ent); */ + } else { + break; + } + } +} + +void +prop_vehicle_driveable_wheel::Accel(float flMoveTime, float m_flTurn) +{ + prop_vehicle_driveable vehParent; + entity eDriver; + float flTraction; + vector vecAngle; + + vehParent = (prop_vehicle_driveable)owner; + eDriver = vehParent.m_eDriver; + vecAngle = vehParent.angles; + + makevectors(vecAngle); + + if (m_flTurn) { + /* cripple turnrate by our current velocity */ + float turnbreak = bound(0, vlen(velocity), 100) * 0.5; + + /* rotates v_forward */ + rotatevectorsbyangle([ 0, m_flTurn * turnbreak, 0]); + } + + tracebox(origin, mins, maxs, origin - v_up, MOVE_NOMONSTERS, owner); + + /* allow a range, for 1qu's worth of spare tyre pressure. or something */ + flTraction = 1 - trace_fraction; + + /* air friction, doubles up for general rolling friction, ish */ + velocity *= 1 - flMoveTime * 0.1; + + if (flTraction) { + if (eDriver) { + velocity += v_forward * bound(-1, vehParent.m_vecMoveValues[0] / 400, 1) * vehParent.m_flAcceleration * flMoveTime * flTraction; + } + + /* test if this car is skidding */ + float skid = (velocity * v_right); + if ( fabs(skid) > vehParent.m_flSkidSpeed ) { + vehParent.vv_flags |= VEH_SKIDDING; + } + + /* nuke sideways velocity. if a wheel is off the ground this probably + means that it'll be pushed further. players should try not to roll + too much. */ + /* FIXME: push opposite wheel up slightly to model chassis momentum + not slowing as much as the wheel itself (zomg: race conditions!) */ + velocity -= (velocity * v_right) * v_right * vehParent.m_flTraction * flMoveTime * flTraction; + + if (!eDriver || (vehParent.m_iMoveButtons & INPUT_BUTTON2 || vehParent.m_vecMoveValues[2] > 0)) { + vector t; + + /* empty cars are assumed to have their brakes on. + nuke forward velocity. if a wheel is off the ground this probably + means that it'll be pushed further. players should try not to + roll too much. + + Note: really we ought to be applying some axel friction even + when not breaking, but we'll just depend on air friction for + that. */ + velocity -= (velocity * v_forward) * v_forward * vehParent.m_flBreakFactor * flMoveTime * flTraction; + + /* if break is on, nuke the final part of the velocity, so we can + become truely motionless.*/ + t = velocity - velocity * dotproduct(velocity, vehParent.m_vecGravityDir); + if (vlen(t) < 15) { + velocity -= t; + } + + /* don't bother with gravity if we're already on the ground and + breaking. this avoids weird slides. */ + if (!trace_fraction && trace_plane_normal * vehParent.m_vecGravityDir < -0.7f) { + return; + } + } + } + + /* apply gravity */ + velocity += vehParent.m_vecGravityDir * flMoveTime * serverkeyfloat("phy_gravity") * trace_fraction; + + tracebox(origin, mins * 4.0, maxs * 4.0, origin, MOVE_NORMAL, owner); + if (trace_ent && trace_ent != vehParent.m_eDriver) { + int iImpactDamage = vlen(velocity) / 10; + + if (iImpactDamage > 10) { + trace_ent.velocity = velocity * 2.0 + [0,0,500]; + velocity *= 0.25f; +#ifdef SERVER + if (trace_ent.takedamage) { + NSSurfacePropEntity foo = (NSSurfacePropEntity)trace_ent; vector dmgDir = dirFromTarget(trace_endpos, foo.origin); NSDict damageDecl = spawn(NSDict); damageDecl.AddKey("damage", itos(iImpactDamage)); - entityDamage(foo, this, vehParent.m_eDriver, damageDecl.GetDeclBody(), "", trace_endpos, dmgDir, foo.origin); + combat.Damage(foo, this, vehParent.m_eDriver, damageDecl.GetDeclBody(), trace_endpos, dmgDir, foo.origin); remove(damageDecl); - //print(sprintf("Delivering %i impact damage\n", iImpactDamage)); - } -#endif - } - } -} - -void -prop_vehicle_driveable_wheel::UpdateSuspension(float flTimeLength) -{ - float flDamp; - float flForce; - - if (fabs(m_flSuspension) > 0.001 || fabs(m_flSuspensionForce) > 0.001) { - m_flSuspension += m_flSuspensionForce * flTimeLength; - - flForce = bound(0, flTimeLength * 65, 2); - flDamp = 1 - (flTimeLength * 4); - if (flDamp < 0) { - flDamp = 0; - } - m_flSuspensionForce *= flDamp; - m_flSuspensionForce -= m_flSuspension * flForce; - m_flSuspension = bound(-15, m_flSuspension, 15); - } -} - -void -prop_vehicle_driveable_wheel::Physics(float turnrate, float flTimeLength) -{ - vector owner_pos; - - /* try to correct the wheel's position, in case it got stuck */ - owner_pos = owner.origin + (owner.mins + owner.maxs) * 0.5f; - tracebox(owner_pos, mins, maxs, origin, MOVE_NORMAL, owner); - setorigin(this, trace_endpos); - - /* see if we're in-air */ - other = world; - tracebox(origin, mins, maxs, origin - [0,0,1], MOVE_OTHERONLY, this); - if (!trace_startsolid) { - if ((trace_fraction < 1) && (trace_plane_normal[2] > 0.7)) { - flags |= FL_ONGROUND; - } else { - flags &= ~FL_ONGROUND; - m_flSuspensionForce += flTimeLength * 200.0; - } - } - - Accel(flTimeLength / 2, turnrate); - Move(flTimeLength); - Accel(flTimeLength / 2, turnrate); - UpdateSuspension(flTimeLength); - //print(sprintf("suspension: %d, force: %d\n", m_flSuspension, m_flSuspensionForce)); -} - -void -prop_vehicle_driveable_wheel::prop_vehicle_driveable_wheel(void) -{ - mins = [-8,-8,-35]; - maxs = [8,8,8]; - hitcontentsmaski = CONTENTBIT_BODY | CONTENTBITS_POINTSOLID | CONTENTBIT_VEHICLECLIP; -} - -#ifdef CLIENT -void -prop_vehicle_driveable::PredictPreFrame(void) -{ - SAVE_STATE(modelindex) - SAVE_STATE(origin) - SAVE_STATE(angles) - SAVE_STATE(velocity) - SAVE_STATE(m_flTurn) - SAVE_STATE(flags) - SAVE_STATE(driver_entnum) - - m_wlFL.PredictPreFrame(); - m_wlFR.PredictPreFrame(); - m_wlBL.PredictPreFrame(); - m_wlBR.PredictPreFrame(); -} - -void -prop_vehicle_driveable::PredictPostFrame(void) -{ - ROLL_BACK(modelindex) - ROLL_BACK(angles) - ROLL_BACK(origin) - ROLL_BACK(velocity) - ROLL_BACK(m_flTurn) - ROLL_BACK(flags) - ROLL_BACK(driver_entnum) - - m_wlFL.PredictPostFrame(); - m_wlFR.PredictPostFrame(); - m_wlBL.PredictPostFrame(); - m_wlBR.PredictPostFrame(); -} -#endif - -void -prop_vehicle_driveable::WeaponInput(void) -{ - -} - -void -prop_vehicle_driveable::PlayerInput(void) -{ - m_vecMoveValues = input_movevalues; - m_iMoveButtons = input_buttons; - m_flTimeLength = input_timelength; - - /* prediction frame... */ - RunVehiclePhysics(); - -#ifdef SERVER - /* allow us to exit */ - if (m_flUseTime < time) { - if (input_buttons & INPUT_BUTTON5) { - eActivator = m_eDriver; - OnPlayerUse(); - input_buttons &= ~INPUT_BUTTON5; - } - } -#endif - - WeaponInput(); - - /* only allow use key */ - input_buttons = (input_buttons & INPUT_BUTTON5); -} - -void -prop_vehicle_driveable::RunVehiclePhysics(void) -{ -#if SERVER - /* eject the dead */ - if (m_eDriver && m_eDriver.health <= 0) { - PlayerLeave((NSClientPlayer)m_eDriver); - } -#endif - - if (m_eDriver) { - float y; - - y = m_vecMoveValues[1]; - y = bound(-200, y, 200) / 200; - y *= m_flSteerFactor; - - if (y) { - if (y < 0 && m_flTurn < 0) { - m_flTurn = 0.0f; - } else if (y > 0 && m_flTurn > 0) { - m_flTurn = 0.0f; - } else { - m_flTurn = bound(-1, m_flTurn - y * m_flTimeLength, 1); - } - } else { - /* straighten wheels forward over time */ - if (m_flTurn < 0) { - m_flTurn = min(0, m_flTurn + m_flTimeLength * m_flStraightenFactor); - } else if (m_flTurn > 0) { - m_flTurn = max(0, m_flTurn - m_flTimeLength * m_flStraightenFactor); - } - } - - PlayerUpdateFlags(); - } - - if (spawnflags & VEHSF_NOFLIP) { - angles[0] = bound (-45, angles[0], 45); - angles[2] = bound (-45, angles[2], 45); - } - - vv_flags &= ~VEH_SKIDDING; - - angles = fixAngle(angles); - - velocity[0] = bound(-1000, velocity[0], 1000); - velocity[1] = bound(-1000, velocity[1], 1000); - velocity[2] = bound(-1000, velocity[2], 1000); - - makevectors(angles); - - setorigin( m_wlFL, origin ); - setorigin( m_wlBL, m_wlFL.origin - v_forward * 85 ); - setorigin( m_wlFL, m_wlFL.origin + v_forward * 85 ); - setorigin( m_wlFR, m_wlFL.origin + v_right * 40 ); - setorigin( m_wlFL, m_wlFL.origin - v_right * 40 ); - setorigin( m_wlBR, m_wlBL.origin + v_right * 40 ); - setorigin( m_wlBL, m_wlBL.origin - v_right * 40 ); - - m_wlFL.Physics( this.m_flTurn, m_flTimeLength); - m_wlFR.Physics( this.m_flTurn, m_flTimeLength); - m_wlBL.Physics( 0, m_flTimeLength); - m_wlBR.Physics( 0, m_flTimeLength); - - velocity = m_wlFL.velocity; - velocity += m_wlFR.velocity; - velocity += m_wlBL.velocity; - velocity += m_wlBR.velocity; - velocity *= 0.25f; - - v_right = (m_wlFR.origin - m_wlFL.origin); - v_right += (m_wlBR.origin - m_wlBL.origin); - v_forward = (m_wlFL.origin + m_wlFR.origin); - v_forward -= (m_wlBL.origin + m_wlBR.origin); - v_up = -crossproduct(v_forward, v_right); - angles = vectoangles( v_forward, v_up ); - - /* figure out the new chassis position */ - vector new_origin; - new_origin = m_wlFL.origin; - new_origin += m_wlFR.origin; - new_origin += m_wlBL.origin; - new_origin += m_wlBR.origin; - new_origin *= 0.25f; - setorigin(this, new_origin); - - makevectors(angles); - m_eCollBox1.SetOrigin(origin + (v_forward * 64)); - m_eCollBox2.SetOrigin(origin + (v_forward * -72)); - m_eCollBox1.SetSolid(SOLID_BBOX); - m_eCollBox2.SetSolid(SOLID_BBOX); - - PlayerAlign(); - - /* actiony stuff */ -} - -#ifdef SERVER -void -prop_vehicle_driveable::OnPlayerUse(void) -{ - if (m_flUseTime > time) - return; - - if (m_eDriver == eActivator) { - PlayerLeave((NSClientPlayer)eActivator); - setorigin(eActivator, GetExitPos()); - } else if (!m_eDriver) { - PlayerEnter((NSClientPlayer)eActivator); - m_vecPlayerPos = [0,0,0]; - } - m_flUseTime = time + 2.0f; -} - -void -prop_vehicle_driveable::Respawn(void) -{ - SetMovetype(MOVETYPE_NONE); - SetSolid(SOLID_BBOX); - SetOrigin(GetSpawnVector("origin") + [0,0,32]); - SetAngles(GetSpawnVector("angles")); - SetModel(GetSpawnString("model")); - - m_flBRWheelAxel = gettagindex( this, "RRWheelAxel" ); - m_flBLWheelAxel = gettagindex( this, "RLWheelAxel" ); - m_flFLWheelAxel = gettagindex( this, "FLWheelAxel" ); - m_flFRWheelAxel = gettagindex( this, "FRWheelAxel" ); - - m_wlFL.velocity = - m_wlFR.velocity = - m_wlBL.velocity = - m_wlBR.velocity = - velocity = [0,0,0]; - PlayerUse = OnPlayerUse; - setsize( this, [-50,-50,0], [50,50,64]); - - if (m_eDriver) - PlayerLeave((NSClientPlayer)m_eDriver); - - SendFlags = -1; -} -#endif - -#ifdef CLIENT -void -prop_vehicle_driveable::ReceiveEntity(float flNew, float flSendFlags) -{ - if (flSendFlags & VEHFL_DRIVER) { - driver_entnum = readentitynum(); - DriverRelink(); - } - - if (flSendFlags & VEHFL_MODELINDEX) { - modelindex = readshort(); - m_vecSeatOffest[0] = readfloat(); - m_vecSeatOffest[1] = readfloat(); - m_vecSeatOffest[2] = readfloat(); - setsize( this, [-50,-50,0], [50,50,64]); - } - - if (flSendFlags & VEHFL_ORIGIN) { - origin[0] = readcoord(); - origin[1] = readcoord(); - origin[2] = readcoord(); - setorigin(this, origin); - - makevectors(angles); - - setorigin( m_wlFL, origin ); - setorigin( m_wlBL, m_wlFL.origin - v_forward * 85 ); - setorigin( m_wlFL, m_wlFL.origin + v_forward * 85 ); - setorigin( m_wlFR, m_wlFL.origin + v_right * 40 ); - setorigin( m_wlFL, m_wlFL.origin - v_right * 40 ); - setorigin( m_wlBR, m_wlBL.origin + v_right * 40 ); - setorigin( m_wlBL, m_wlBL.origin - v_right * 40 ); - m_eCollBox1.SetOrigin(origin + (v_forward * 64)); - m_eCollBox2.SetOrigin(origin + (v_forward * -72)); - } - - if (flSendFlags & VEHFL_ANGLES) { - angles[0] = readfloat(); - angles[1] = readfloat(); - angles[2] = readfloat(); - } - - if (flSendFlags & VEHFL_VELOCITY) { - velocity[0] = readfloat(); - velocity[1] = readfloat(); - velocity[2] = readfloat(); - } - - if (flSendFlags & VEHFL_TURNING) - m_flTurn = readfloat(); - - if (flSendFlags & VEHFL_FLAGS) - flags = readfloat(); - - if (flNew) { - drawmask = MASK_ENGINE; - SetMovetype(MOVETYPE_NONE); - SetSolid(SOLID_BBOX); - - m_flBRWheelAxel = gettagindex( this, "RRWheelAxel" ); - m_flBLWheelAxel = gettagindex( this, "RLWheelAxel" ); - m_flFLWheelAxel = gettagindex( this, "FLWheelAxel" ); - m_flFRWheelAxel = gettagindex( this, "FRWheelAxel" ); - - m_wlFL.velocity = - m_wlFR.velocity = - m_wlBL.velocity = - m_wlBR.velocity = - velocity = [0,0,0]; - RunVehiclePhysics(); - customphysics = Physics; - } - - PredictPreFrame(); -} -#else -void -prop_vehicle_driveable::EvaluateEntity(void) -{ - /* while the engine is still handling physics for these, we can't - * predict when origin/angle might change */ - if (ATTR_CHANGED(origin)) - SetSendFlags(VEHFL_ORIGIN); - - if (ATTR_CHANGED(angles)) { - angles = fixAngle(angles); - SetSendFlags(VEHFL_ANGLES); - } - if (ATTR_CHANGED(modelindex)) - SetSendFlags(VEHFL_MODELINDEX); - if (ATTR_CHANGED(velocity)) - SetSendFlags(VEHFL_VELOCITY); - if (ATTR_CHANGED(m_flTurn)) - SetSendFlags(VEHFL_TURNING); - if (ATTR_CHANGED(m_eDriver)) - SetSendFlags(VEHFL_DRIVER); - if (ATTR_CHANGED(flags)) - SetSendFlags(VEHFL_FLAGS); - + //print(sprintf("Delivering %i impact damage\n", iImpactDamage)); + } +#endif + } + } +} + +void +prop_vehicle_driveable_wheel::UpdateSuspension(float flTimeLength) +{ + float flDamp; + float flForce; + + if (fabs(m_flSuspension) > 0.001 || fabs(m_flSuspensionForce) > 0.001) { + m_flSuspension += m_flSuspensionForce * flTimeLength; + + flForce = bound(0, flTimeLength * 65, 2); + flDamp = 1 - (flTimeLength * 4); + if (flDamp < 0) { + flDamp = 0; + } + m_flSuspensionForce *= flDamp; + m_flSuspensionForce -= m_flSuspension * flForce; + m_flSuspension = bound(-15, m_flSuspension, 15); + } +} + +void +prop_vehicle_driveable_wheel::Physics(float turnrate, float flTimeLength) +{ + vector owner_pos; + + /* try to correct the wheel's position, in case it got stuck */ + owner_pos = owner.origin + (owner.mins + owner.maxs) * 0.5f; + tracebox(owner_pos, mins, maxs, origin, MOVE_NORMAL, owner); + setorigin(this, trace_endpos); + + /* see if we're in-air */ + other = world; + tracebox(origin, mins, maxs, origin - [0,0,1], MOVE_OTHERONLY, this); + if (!trace_startsolid) { + if ((trace_fraction < 1) && (trace_plane_normal[2] > 0.7)) { + flags |= FL_ONGROUND; + } else { + flags &= ~FL_ONGROUND; + m_flSuspensionForce += flTimeLength * 200.0; + } + } + + Accel(flTimeLength / 2, turnrate); + Move(flTimeLength); + Accel(flTimeLength / 2, turnrate); + UpdateSuspension(flTimeLength); + //print(sprintf("suspension: %d, force: %d\n", m_flSuspension, m_flSuspensionForce)); +} + +void +prop_vehicle_driveable_wheel::prop_vehicle_driveable_wheel(void) +{ + mins = [-8,-8,-35]; + maxs = [8,8,8]; + hitcontentsmaski = CONTENTBIT_BODY | CONTENTBITS_POINTSOLID | CONTENTBIT_VEHICLECLIP; +} + +#ifdef CLIENT +void +prop_vehicle_driveable::PredictPreFrame(void) +{ + SAVE_STATE(modelindex) + SAVE_STATE(origin) + SAVE_STATE(angles) + SAVE_STATE(velocity) + SAVE_STATE(m_flTurn) + SAVE_STATE(flags) + SAVE_STATE(driver_entnum) + + m_wlFL.PredictPreFrame(); + m_wlFR.PredictPreFrame(); + m_wlBL.PredictPreFrame(); + m_wlBR.PredictPreFrame(); +} + +void +prop_vehicle_driveable::PredictPostFrame(void) +{ + ROLL_BACK(modelindex) + ROLL_BACK(angles) + ROLL_BACK(origin) + ROLL_BACK(velocity) + ROLL_BACK(m_flTurn) + ROLL_BACK(flags) + ROLL_BACK(driver_entnum) + + m_wlFL.PredictPostFrame(); + m_wlFR.PredictPostFrame(); + m_wlBL.PredictPostFrame(); + m_wlBR.PredictPostFrame(); +} +#endif + +void +prop_vehicle_driveable::WeaponInput(void) +{ + +} + +void +prop_vehicle_driveable::PlayerInput(void) +{ + m_vecMoveValues = input_movevalues; + m_iMoveButtons = input_buttons; + m_flTimeLength = input_timelength; + + /* prediction frame... */ + RunVehiclePhysics(); + +#ifdef SERVER + /* allow us to exit */ + if (m_flUseTime < time) { + if (input_buttons & INPUT_BUTTON5) { + eActivator = m_eDriver; + OnPlayerUse(); + input_buttons &= ~INPUT_BUTTON5; + } + } +#endif + + WeaponInput(); + + /* only allow use key */ + input_buttons = (input_buttons & INPUT_BUTTON5); +} + +void +prop_vehicle_driveable::RunVehiclePhysics(void) +{ +#if SERVER + /* eject the dead */ + if (m_eDriver && m_eDriver.health <= 0) { + PlayerLeave((NSClientPlayer)m_eDriver); + } +#endif + + if (m_eDriver) { + float y; + + y = m_vecMoveValues[1]; + y = bound(-200, y, 200) / 200; + y *= m_flSteerFactor; + + if (y) { + if (y < 0 && m_flTurn < 0) { + m_flTurn = 0.0f; + } else if (y > 0 && m_flTurn > 0) { + m_flTurn = 0.0f; + } else { + m_flTurn = bound(-1, m_flTurn - y * m_flTimeLength, 1); + } + } else { + /* straighten wheels forward over time */ + if (m_flTurn < 0) { + m_flTurn = min(0, m_flTurn + m_flTimeLength * m_flStraightenFactor); + } else if (m_flTurn > 0) { + m_flTurn = max(0, m_flTurn - m_flTimeLength * m_flStraightenFactor); + } + } + + PlayerUpdateFlags(); + } + + if (spawnflags & VEHSF_NOFLIP) { + angles[0] = bound (-45, angles[0], 45); + angles[2] = bound (-45, angles[2], 45); + } + + vv_flags &= ~VEH_SKIDDING; + + angles = fixAngle(angles); + + velocity[0] = bound(-1000, velocity[0], 1000); + velocity[1] = bound(-1000, velocity[1], 1000); + velocity[2] = bound(-1000, velocity[2], 1000); + + makevectors(angles); + + setorigin( m_wlFL, origin ); + setorigin( m_wlBL, m_wlFL.origin - v_forward * 85 ); + setorigin( m_wlFL, m_wlFL.origin + v_forward * 85 ); + setorigin( m_wlFR, m_wlFL.origin + v_right * 40 ); + setorigin( m_wlFL, m_wlFL.origin - v_right * 40 ); + setorigin( m_wlBR, m_wlBL.origin + v_right * 40 ); + setorigin( m_wlBL, m_wlBL.origin - v_right * 40 ); + + m_wlFL.Physics( this.m_flTurn, m_flTimeLength); + m_wlFR.Physics( this.m_flTurn, m_flTimeLength); + m_wlBL.Physics( 0, m_flTimeLength); + m_wlBR.Physics( 0, m_flTimeLength); + + velocity = m_wlFL.velocity; + velocity += m_wlFR.velocity; + velocity += m_wlBL.velocity; + velocity += m_wlBR.velocity; + velocity *= 0.25f; + + v_right = (m_wlFR.origin - m_wlFL.origin); + v_right += (m_wlBR.origin - m_wlBL.origin); + v_forward = (m_wlFL.origin + m_wlFR.origin); + v_forward -= (m_wlBL.origin + m_wlBR.origin); + v_up = -crossproduct(v_forward, v_right); + angles = vectoangles( v_forward, v_up ); + + /* figure out the new chassis position */ + vector new_origin; + new_origin = m_wlFL.origin; + new_origin += m_wlFR.origin; + new_origin += m_wlBL.origin; + new_origin += m_wlBR.origin; + new_origin *= 0.25f; + setorigin(this, new_origin); + + makevectors(angles); + m_eCollBox1.SetOrigin(origin + (v_forward * 64)); + m_eCollBox2.SetOrigin(origin + (v_forward * -72)); + m_eCollBox1.SetSolid(SOLID_BBOX); + m_eCollBox2.SetSolid(SOLID_BBOX); + + PlayerAlign(); + + /* actiony stuff */ +} + +#ifdef SERVER +void +prop_vehicle_driveable::OnPlayerUse(void) +{ + if (m_flUseTime > time) + return; + + if (m_eDriver == eActivator) { + PlayerLeave((NSClientPlayer)eActivator); + setorigin(eActivator, GetExitPos()); + } else if (!m_eDriver) { + PlayerEnter((NSClientPlayer)eActivator); + m_vecPlayerPos = [0,0,0]; + } + m_flUseTime = time + 2.0f; +} + +void +prop_vehicle_driveable::Respawn(void) +{ + SetMovetype(MOVETYPE_NONE); + SetSolid(SOLID_BBOX); + SetOrigin(GetSpawnVector("origin") + [0,0,32]); + SetAngles(GetSpawnVector("angles")); + SetModel(GetSpawnString("model")); + + m_flBRWheelAxel = gettagindex( this, "Rig_Buggy_Axel_RR" ); + m_flBLWheelAxel = gettagindex( this, "Rig_Buggy_Axel_RL" ); + m_flFLWheelAxel = gettagindex( this, "Rig_Buggy_Axel_FL" ); + m_flFRWheelAxel = gettagindex( this, "Rig_Buggy_Axel_FR" ); + + m_wlFL.velocity = + m_wlFR.velocity = + m_wlBL.velocity = + m_wlBR.velocity = + velocity = [0,0,0]; + PlayerUse = OnPlayerUse; + setsize( this, [-50,-50,0], [50,50,64]); + + if (m_eDriver) + PlayerLeave((NSClientPlayer)m_eDriver); + + SendFlags = -1; +} +#endif + +void +prop_vehicle_driveable::SpawnWheels(void) +{ + if (!m_eCollBox1) + m_eCollBox1 = spawn(NSEntity); + if (!m_eCollBox2) + m_eCollBox2 = spawn(NSEntity); + + { + m_eCollBox1.SetSize([-32,-32,0], [32,32,32]); + m_eCollBox2.SetSize([-32,-32,0], [32,32,32]); + } + + m_eCollBox1.hitcontentsmaski = hitcontentsmaski; + m_eCollBox2.hitcontentsmaski = hitcontentsmaski; + + if (!m_wlFL) + m_wlFL = spawn(prop_vehicle_driveable_wheel); + if (!m_wlFR) + m_wlFR = spawn(prop_vehicle_driveable_wheel); + if (!m_wlBL) + m_wlBL = spawn(prop_vehicle_driveable_wheel); + if (!m_wlBR) + m_wlBR = spawn(prop_vehicle_driveable_wheel); + + m_eCollBox1.owner = m_eCollBox2.owner = \ + m_wlFL.owner = m_wlFR.owner = \ + m_wlBL.owner = m_wlBR.owner = this; +} + +#ifdef CLIENT +void +prop_vehicle_driveable::ReceiveEntity(float flNew, float flSendFlags) +{ + if (flSendFlags & VEHFL_DRIVER) { + driver_entnum = readentitynum(); + DriverRelink(); + } + + if (flSendFlags & VEHFL_MODELINDEX) { + modelindex = readshort(); + m_vecSeatOffest[0] = readfloat(); + m_vecSeatOffest[1] = readfloat(); + m_vecSeatOffest[2] = readfloat(); + setsize( this, [-50,-50,0], [50,50,64]); + } + + if (flNew) { + SpawnWheels(); + } + + if (flSendFlags & VEHFL_ORIGIN) { + origin[0] = readcoord(); + origin[1] = readcoord(); + origin[2] = readcoord(); + setorigin(this, origin); + + makevectors(angles); + + setorigin( m_wlFL, origin ); + setorigin( m_wlBL, m_wlFL.origin - v_forward * 85 ); + setorigin( m_wlFL, m_wlFL.origin + v_forward * 85 ); + setorigin( m_wlFR, m_wlFL.origin + v_right * 40 ); + setorigin( m_wlFL, m_wlFL.origin - v_right * 40 ); + setorigin( m_wlBR, m_wlBL.origin + v_right * 40 ); + setorigin( m_wlBL, m_wlBL.origin - v_right * 40 ); + m_eCollBox1.SetOrigin(origin + (v_forward * 64)); + m_eCollBox2.SetOrigin(origin + (v_forward * -72)); + } + + if (flSendFlags & VEHFL_ANGLES) { + angles[0] = readfloat(); + angles[1] = readfloat(); + angles[2] = readfloat(); + } + + if (flSendFlags & VEHFL_VELOCITY) { + velocity[0] = readfloat(); + velocity[1] = readfloat(); + velocity[2] = readfloat(); + } + + if (flSendFlags & VEHFL_TURNING) + m_flTurn = readfloat(); + + if (flSendFlags & VEHFL_FLAGS) + flags = readfloat(); + + if (flNew) { + drawmask = MASK_ENGINE; + SetMovetype(MOVETYPE_NONE); + SetSolid(SOLID_BBOX); + + m_flBRWheelAxel = gettagindex( this, "Rig_Buggy_Axel_RR" ); + m_flBLWheelAxel = gettagindex( this, "Rig_Buggy_Axel_RL" ); + m_flFLWheelAxel = gettagindex( this, "Rig_Buggy_Axel_FL" ); + m_flFRWheelAxel = gettagindex( this, "Rig_Buggy_Axel_FR" ); + + m_wlFL.velocity = + m_wlFR.velocity = + m_wlBL.velocity = + m_wlBR.velocity = + velocity = [0,0,0]; + RunVehiclePhysics(); + customphysics = Physics; + } + + PredictPreFrame(); +} +#else +void +prop_vehicle_driveable::EvaluateEntity(void) +{ + /* while the engine is still handling physics for these, we can't + * predict when origin/angle might change */ + if (ATTR_CHANGED(origin)) + SetSendFlags(VEHFL_ORIGIN); + + if (ATTR_CHANGED(angles)) { + angles = fixAngle(angles); + SetSendFlags(VEHFL_ANGLES); + } + if (ATTR_CHANGED(modelindex)) + SetSendFlags(VEHFL_MODELINDEX); + if (ATTR_CHANGED(velocity)) + SetSendFlags(VEHFL_VELOCITY); + if (ATTR_CHANGED(m_flTurn)) + SetSendFlags(VEHFL_TURNING); + if (ATTR_CHANGED(m_eDriver)) + SetSendFlags(VEHFL_DRIVER); + if (ATTR_CHANGED(flags)) + SetSendFlags(VEHFL_FLAGS); + SAVE_STATE(origin) SAVE_STATE(angles) SAVE_STATE(modelindex); @@ -849,62 +872,69 @@ prop_vehicle_driveable::EvaluateEntity(void) SAVE_STATE(m_flTurn) SAVE_STATE(m_eDriver) SAVE_STATE(flags) -} - -float -prop_vehicle_driveable::SendEntity(entity ePVSent, float flSendFlags) -{ - WriteByte(MSG_ENTITY, ENT_VEH_4WHEEL); - WriteFloat(MSG_ENTITY, flSendFlags); - - if (!modelindex) - return (false); - - if (flSendFlags & VEHFL_DRIVER) { - WriteEntity(MSG_ENTITY, m_eDriver); - } - - if (flSendFlags & VEHFL_MODELINDEX) { - WriteShort(MSG_ENTITY, modelindex); - WriteFloat(MSG_ENTITY, m_vecSeatOffest[0]); - WriteFloat(MSG_ENTITY, m_vecSeatOffest[1]); - WriteFloat(MSG_ENTITY, m_vecSeatOffest[2]); - } - - if (flSendFlags & VEHFL_ORIGIN) { - WriteCoord(MSG_ENTITY, origin[0]); - WriteCoord(MSG_ENTITY, origin[1]); - WriteCoord(MSG_ENTITY, origin[2]); - } - - if (flSendFlags & VEHFL_ANGLES) { - WriteFloat(MSG_ENTITY, angles[0]); - WriteFloat(MSG_ENTITY, angles[1]); - WriteFloat(MSG_ENTITY, angles[2]); - } - - if (flSendFlags & VEHFL_VELOCITY) { - WriteFloat(MSG_ENTITY, velocity[0]); - WriteFloat(MSG_ENTITY, velocity[1]); - WriteFloat(MSG_ENTITY, velocity[2]); - } - - if (flSendFlags & VEHFL_TURNING) - WriteFloat(MSG_ENTITY, m_flTurn); - - if (flSendFlags & VEHFL_FLAGS) - WriteFloat(MSG_ENTITY, flags); - - return true; -} -#endif - -void -prop_vehicle_driveable::Spawned(void) -{ - super::Spawned(); - -#ifdef SERVER - Sound_Precache("prop_vehicle_driveable.bounce"); -#endif -} \ No newline at end of file +} + +float +prop_vehicle_driveable::SendEntity(entity ePVSent, float flSendFlags) +{ + WriteByte(MSG_ENTITY, ENT_VEH_4WHEEL); + WriteFloat(MSG_ENTITY, flSendFlags); + + if (!modelindex) + return (false); + + if (flSendFlags & VEHFL_DRIVER) { + WriteEntity(MSG_ENTITY, m_eDriver); + } + + if (flSendFlags & VEHFL_MODELINDEX) { + WriteShort(MSG_ENTITY, modelindex); + WriteFloat(MSG_ENTITY, m_vecSeatOffest[0]); + WriteFloat(MSG_ENTITY, m_vecSeatOffest[1]); + WriteFloat(MSG_ENTITY, m_vecSeatOffest[2]); + } + + if (flSendFlags & VEHFL_ORIGIN) { + WriteCoord(MSG_ENTITY, origin[0]); + WriteCoord(MSG_ENTITY, origin[1]); + WriteCoord(MSG_ENTITY, origin[2]); + } + + if (flSendFlags & VEHFL_ANGLES) { + WriteFloat(MSG_ENTITY, angles[0]); + WriteFloat(MSG_ENTITY, angles[1]); + WriteFloat(MSG_ENTITY, angles[2]); + } + + if (flSendFlags & VEHFL_VELOCITY) { + WriteFloat(MSG_ENTITY, velocity[0]); + WriteFloat(MSG_ENTITY, velocity[1]); + WriteFloat(MSG_ENTITY, velocity[2]); + } + + if (flSendFlags & VEHFL_TURNING) + WriteFloat(MSG_ENTITY, m_flTurn); + + if (flSendFlags & VEHFL_FLAGS) + WriteFloat(MSG_ENTITY, flags); + + return true; +} +#endif + +void +prop_vehicle_driveable::Spawned(void) +{ + super::Spawned(); + + m_iVehicleFlags |= VHF_FROZEN; + hitcontentsmaski = CONTENTBIT_BODY | CONTENTBITS_POINTSOLID | CONTENTBIT_VEHICLECLIP; + + SpawnWheels(); + + customphysics = Physics; + +#ifdef SERVER + Sound_Precache("prop_vehicle_driveable.bounce"); +#endif +} diff --git a/src/gs-entbase/shared/speaker.qc b/src/gs-entbase/shared/speaker.qc index f8b672f4..70184ea2 100644 --- a/src/gs-entbase/shared/speaker.qc +++ b/src/gs-entbase/shared/speaker.qc @@ -175,6 +175,11 @@ speaker::Respawn(void) if (HasSpawnFlags(SPEAKFL_SILENT) == false) { ScheduleThink(Announce, 10.0f); } + + SetSize([0,0,0], [0,0,0]); + SetSolid(SOLID_NOT); + SetMovetype(MOVETYPE_NONE); + customphysics = __NULL__; } void @@ -240,4 +245,4 @@ speaker::ReceiveEntity(float flNew, float flChanged) READENTITY_COORD(origin[2], MONFL_CHANGED_ORIGIN_Z) SetOrigin(origin); } -#endif \ No newline at end of file +#endif diff --git a/src/menu-fn/background.qc b/src/menu-fn/background.qc deleted file mode 100644 index 510870bd..00000000 --- a/src/menu-fn/background.qc +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2016-2022 Vera Visions LLC. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER - * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -void -drawpic_flip(vector pos, string mat, vector size, vector color, float alpha) -{ - drawsubpic(pos, size, mat, [1,0], [-1,1], color, alpha, 0); -} - -static int g_bg_check; - -void -Background_WON(void) -{ - /* handle missing backgrounds gracefully */ - if (!g_bg_check) { - if (whichpack(strcat(g_bmp[SPLASH], ".bmp"))) { - g_bg_check = 1; - } else { - g_bg_check = 2; /* missing */ - } - } - - if (g_bg_check == 1) { - drawpic([g_menuofs[0],g_menuofs[1]], g_bmp[SPLASH], - [640,480], [1,1,1], 1.0f); - } else { - drawfill([g_menuofs[0],g_menuofs[1]], [640, 480], [0.1,0.1,0.1], 1.0f); - } - - /* just some silly widescreen extension hack that could apply to some games */ -#if 0 - drawpic_flip([g_menuofs[0] - 640,g_menuofs[1]], g_bmp[SPLASH], - [640,480], [1,1,1], 1.0f); - drawpic_flip([g_menuofs[0] + 640,g_menuofs[1]], g_bmp[SPLASH], - [640,480], [1,1,1], 1.0f); -#endif -} - -typedef struct -{ - string strMat; - vector vecSize; - vector vecPos; -} backResource_t; - -backResource_t g_back800[] = -{ - {"resource/background/800_1_a_loading",[256,256,0],[0,0,0]}, - {"resource/background/800_1_b_loading",[256,256,0],[256,0,0]}, - {"resource/background/800_1_c_loading",[256,256,0],[512,0,0]}, - {"resource/background/800_1_d_loading",[32,256,0],[768,0,0]}, - {"resource/background/800_2_a_loading",[256,256,0],[0,256,0]}, - {"resource/background/800_2_b_loading",[256,256,0],[256,256,0]}, - {"resource/background/800_2_c_loading",[256,256,0],[512,256,0]}, - {"resource/background/800_2_d_loading",[32,256,0],[768,256,0]}, - {"resource/background/800_3_a_loading",[256,88,0],[0,512,0]}, - {"resource/background/800_3_b_loading",[256,88,0],[256,512,0]}, - {"resource/background/800_3_c_loading",[256,88,0],[512,512,0]}, - {"resource/background/800_3_d_loading",[32,88,0],[768,512,0]} -}; - -void -Background_Steam(void) -{ - for (int i = 0; i < g_back800.length; i++) { - vector pos = [0.0f, 0.0f, 0.0f]; - vector size = [0.0f, 0.0f, 0.0f]; - - /* scale down 800x600 to 640x480 */ - size = g_back800[i].vecSize * 0.8f; - pos[0] = g_menuofs[0] + (g_back800[i].vecPos[0] * 0.8f); - pos[1] = g_menuofs[1] + (g_back800[i].vecPos[1] * 0.8f); - - drawpic(pos, \ - g_back800[i].strMat, \ - size, \ - [1,1,1], \ - 1.0f); - } -} diff --git a/src/menu-fn/defs.h b/src/menu-fn/defs.h index 67382755..fb8eddce 100644 --- a/src/menu-fn/defs.h +++ b/src/menu-fn/defs.h @@ -31,11 +31,11 @@ var bool autocvar_menu_steambg = false; #define DRAWFLAG_ADDITIVE 1 /* Basic Menu Globals */ -int g_vidsize[2]; -int g_menuofs[2]; -int g_mousepos[2]; +vector g_vidsize; +vector g_menuofs; +vector g_mousepos; vector g_logosize; -int g_lastmousepos[2]; +vector g_lastmousepos; int g_active; float frametime; var int g_background = FALSE; @@ -48,7 +48,7 @@ font_s font_console; font_s font_arial; font_s font_label_p; -var int autocvar_menu_helptext_size = 11; +var int autocvar_menu_helptext_size = 13; #define HELPTXT_SIZE autocvar_menu_helptext_size @@ -130,4 +130,4 @@ bool mp_connected(void) { return (!autocvar__menu_singleplayer && clientstate() == 2 && !g_background) ? true : false; -} \ No newline at end of file +} diff --git a/src/menu-fn/entry.qc b/src/menu-fn/entry.qc index 72c16ecd..e615bc9d 100644 --- a/src/menu-fn/entry.qc +++ b/src/menu-fn/entry.qc @@ -22,7 +22,7 @@ var bool g_input_received = false; /* r_autoscale forces vid_conautoscale to be one of 4 integer values. * this is due to vid_conautoscale 0 scaling with in floating point... which * in turns results in skipped rows/columns and shimmering. */ -var int autocvar_r_autoscale = TRUE; +var int autocvar_r_autoscale = false; var int autocvar_r_pixelscale = FALSE; void Menu_AutoScale(void) @@ -66,7 +66,7 @@ Menu_GammaHack(void) bool Menu_HasStartupVideos(void) { - if (Platform_FileInCurrentGamedir("media/valve.avi")) + if (fileExists("media/valve.avi")) return true; return false; @@ -103,7 +103,6 @@ m_init(void) cvar_set("rate", "30000"); } - Platform_RegisterCommands(); Font_Load("fonts/fontcon.font", font_console); Font_Load("fonts/menu_label.font", font_label); @@ -113,12 +112,11 @@ m_init(void) localcmd("plug_load ffmpeg\n"); + Platform_Init(); + /* don't precache btns_main.bmp directly any more. */ CMainButton_InitSheets(); - - GameLibrary_Init(); Strings_Init(); - MapLibrary_Init(); main_init(); Colors_Init(); @@ -166,6 +164,7 @@ m_init(void) void Menu_RendererRestarted(string rendererdesc) { + Platform_RendererRestarted(); CMainButton_InitSheets(); Menu_AutoScale(); Menu_GammaHack(); @@ -262,21 +261,7 @@ m_draw(vector screensize) return; } - /* when ingame, we'll draw a slight black tint... */ - if (clientstate() == 2) { - /* ...unless we're in background map mode. */ - if (!g_background) - drawpic([0,0], "menutint", screensize, [1,1,1], 1.0f); - } else { - /* clear screen */ - drawfill([0,0], screensize, [0,0,0], 1.0f); - - /* draw either WON or Steam background */ - if (autocvar_menu_steambg == false) - Background_WON(); - else - Background_Steam(); - } + Background_Draw((g_vidsize / 2) - [320,240], [640,480]); /* water mark for version info */ const string ver = "Nuclide (build " __DATE__ ")"; @@ -360,7 +345,7 @@ m_display(void) g_active = TRUE; setkeydest(KEY_MENU); setmousetarget(TARGET_MENU); - setcursormode(TRUE, "gfx/cursor"); + setcursormode(TRUE, "gfx/icon16/cursor"); } /* diff --git a/src/menu-fn/includes.src b/src/menu-fn/includes.src index 8f68e233..b9b5209a 100644 --- a/src/menu-fn/includes.src +++ b/src/menu-fn/includes.src @@ -68,7 +68,6 @@ m_updates.qc m_intro.qc m_main.qc menu.qc -background.qc ../platform/includes.src diff --git a/src/menu-fn/m_loadgame.qc b/src/menu-fn/m_loadgame.qc index edcf7d58..3b120a12 100644 --- a/src/menu-fn/m_loadgame.qc +++ b/src/menu-fn/m_loadgame.qc @@ -14,9 +14,6 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -string *g_savegames; -int g_savegame_count; - CWidget fn_loadgame; CMainButton lg_btnLoad; CMainButton lg_btnDelete; @@ -30,14 +27,14 @@ void lg_btnload(void) { int i = lg_lbSaves.GetSelected(); - localcmd(sprintf("load %s\n", g_savegames[i])); + localcmd(sprintf("load %s\n", Saves_GetInfo(i, SAVEINFO_NAME))); } void lg_btnunsave(void) { int i = lg_lbSaves.GetSelected(); - localcmd(sprintf("unsavegame %s\n", g_savegames[i])); + localcmd(sprintf("unsavegame %s\n", Saves_GetInfo(i, SAVEINFO_NAME))); } void @@ -58,7 +55,7 @@ lg_btncancel_start(void) void lg_lbsaves_changed(int val) { - + } void up_sbsaves_changed(int val) @@ -66,21 +63,19 @@ up_sbsaves_changed(int val) lg_lbSaves.SetScroll(val); } + + + + void menu_loadgame_refreshsaves(void) { - searchhandle searchy; lg_lbSaves.Clear(); - searchy = search_begin("saves/*/info.fsv", SEARCH_NAMESORT, TRUE); - g_savegame_count = search_getsize(searchy); - g_savegames = memalloc(sizeof(string) * g_savegame_count); - for (int i = 0; i < g_savegame_count; i++) { - string fullpath = search_getfilename(searchy, i); - g_savegames[i] = substring(fullpath, 6, strlen(fullpath) - 15); - precache_pic(sprintf("saves/%s/screeny.tga", g_savegames[i])); - lg_lbSaves.AddEntry(g_savegames[i]); + + for (int i = 0; i < Saves_GetSaveCount(); i++) { + lg_lbSaves.AddEntry(Saves_GetInfo(i, SAVEINFO_NAME)); } - search_end(searchy); + lg_lbSaves.SetSelected(0, TRUE); } @@ -125,7 +120,7 @@ menu_loadgame_init(void) lg_sbSaves.SetCallback(up_sbsaves_changed); lg_sbSaves.SetMax(0); Widget_Add(fn_loadgame, lg_sbSaves); - + lg_frPreview = spawn(CFrame); lg_frPreview.SetPos(390,140); lg_frPreview.SetSize(220,165); @@ -145,7 +140,7 @@ menu_loadgame_draw(void) } int i = lg_lbSaves.GetSelected(); - drawpic([g_menuofs[0]+390,g_menuofs[1]+140], sprintf("saves/%s/screeny.tga", g_savegames[i]),[220,165], [1,1,1], 1.0f, 1); + drawpic([g_menuofs[0]+390,g_menuofs[1]+140], Saves_GetInfo(i, SAVEINFO_PREVIEW),[220,165], [1,1,1], 1.0f, 1); } void diff --git a/src/menu-vgui/desktop.qc b/src/menu-vgui/desktop.qc old mode 100755 new mode 100644 index 39adea4e..89ad8747 --- a/src/menu-vgui/desktop.qc +++ b/src/menu-vgui/desktop.qc @@ -26,6 +26,7 @@ void Desktop_Init ( void ) static CUIMenuButton btnMViewer; static CUIMenuButton btnResume; static CUIMenuButton btnDisconnect; + static CUIMenuButton btnMods; static void Desktop_ResumeGame ( void ) { m_toggle( 0 ); @@ -43,7 +44,7 @@ void Desktop_Init ( void ) btnNewgame.SetPos( '32 64' ); btnNewgame.SetFunc( UI_NewGame_Show ); btnNewgame.FlagRemove( MBUTTON_SHOWSP | MBUTTON_SHOWMP ); - btnNewgame.SetIcon( "textures/ui/icons/desktop" ); + btnNewgame.SetIcon( "gfx/icon16/new" ); btnDisconnect = spawn( CUIMenuButton ); btnDisconnect.SetTitle( "Disconnect" ); @@ -51,54 +52,63 @@ void Desktop_Init ( void ) btnDisconnect.SetPos( '32 64' ); btnDisconnect.SetFunc( Desktop_DisconnectGame ); btnDisconnect.FlagRemove( MBUTTON_SHOWOFFLINE ); - btnDisconnect.SetIcon( "textures/ui/icons/disconnect" ); + btnDisconnect.SetIcon( "gfx/icon16/disconnect" ); btnLoadgame = spawn( CUIMenuButton ); btnLoadgame.SetTitle( "Load Game" ); btnLoadgame.SetSize( '128 24' ); btnLoadgame.SetPos( '32 96' ); - btnLoadgame.SetIcon( "textures/ui/icons/folder" ); + btnLoadgame.SetIcon( "gfx/icon16/book_edit" ); + btnLoadgame.SetFunc( UI_LoadGame_Show ); btnFindserver = spawn( CUIMenuButton ); btnFindserver.SetTitle( "Find Servers" ); btnFindserver.SetSize( '128 24' ); btnFindserver.SetPos( '32 128' ); btnFindserver.SetFunc( UI_FindServers_Show ); - btnFindserver.SetIcon( "textures/ui/icons/servers" ); + btnFindserver.SetIcon( "gfx/icon16/world_go" ); btnCreateserver = spawn( CUIMenuButton ); btnCreateserver.SetTitle( "Create Server" ); btnCreateserver.SetSize( '128 24' ); btnCreateserver.SetPos( '32 160' ); btnCreateserver.SetFunc( UI_CreateServer_Show ); - btnCreateserver.SetIcon( "textures/ui/icons/server-new" ); + btnCreateserver.SetIcon( "gfx/icon16/server_add" ); + + btnMods = spawn( CUIMenuButton ); + btnMods.SetTitle( "Custom Game" ); + btnMods.SetSize( '128 24' ); + btnMods.SetPos( '32 192' ); + btnMods.SetIcon( "gfx/icon16/rainbow" ); + btnMods.SetFunc( UI_CustomGame_Show ); + btnMods.FlagRemove( MBUTTON_SHOWSP | MBUTTON_SHOWMP ); btnOptions = spawn( CUIMenuButton ); btnOptions.SetTitle( "Options" ); btnOptions.SetSize( '128 24' ); - btnOptions.SetPos( '32 192' ); - btnOptions.SetIcon( "textures/ui/icons/gear" ); + btnOptions.SetPos( '32 224' ); + btnOptions.SetIcon( "gfx/icon16/cog" ); btnQuit = spawn( CUIMenuButton ); btnQuit.SetTitle( "Quit Game" ); btnQuit.SetSize( '128 24' ); - btnQuit.SetPos( '32 224' ); + btnQuit.SetPos( '32 256' ); btnQuit.SetFunc( UI_QuitGame_Show ); - btnQuit.SetIcon( "textures/ui/icons/cancel" ); + btnQuit.SetIcon( "gfx/icon16/stop" ); btnMPlayer = spawn( CUIMenuButton ); btnMPlayer.SetTitle( "Music Player" ); btnMPlayer.SetSize( '128 24' ); btnMPlayer.SetPos( '32 288' ); btnMPlayer.SetFunc( UI_MusicPlayer_Show ); - btnMPlayer.SetIcon( "textures/ui/icons/cd" ); + btnMPlayer.SetIcon( "gfx/icon16/ipod" ); btnMViewer = spawn( CUIMenuButton ); btnMViewer.SetTitle( "Model Viewer" ); btnMViewer.SetSize( '128 24' ); btnMViewer.SetPos( '32 320' ); btnMViewer.SetFunc( UI_ModelViewer_Show ); - btnMViewer.SetIcon( "textures/ui/icons/hdd" ); + btnMViewer.SetIcon( "gfx/icon16/images" ); btnResume = spawn( CUIMenuButton ); btnResume.SetTitle( "Resume Game" ); @@ -106,6 +116,7 @@ void Desktop_Init ( void ) btnResume.SetPos( '32 384' ); btnResume.SetFunc( Desktop_ResumeGame ); btnResume.FlagRemove( MBUTTON_SHOWOFFLINE ); + btnResume.SetIcon( "gfx/icon16/control_play" ); g_uiDesktop.Add( btnNewgame ); g_uiDesktop.Add( btnLoadgame ); @@ -117,9 +128,16 @@ void Desktop_Init ( void ) g_uiDesktop.Add( btnMViewer ); g_uiDesktop.Add( btnResume ); g_uiDesktop.Add( btnDisconnect ); + g_uiDesktop.Add( btnMods ); } void Desktop_Draw ( void ) { g_uiDesktop.Draw(); } + +void Desktop_CanvasChanged ( void ) +{ + g_uiDesktop.Reposition(); +} + diff --git a/src/menu-vgui/includes.src b/src/menu-vgui/includes.src index 3220828b..48c94150 100644 --- a/src/menu-vgui/includes.src +++ b/src/menu-vgui/includes.src @@ -7,16 +7,17 @@ ../platform/defs.h defs.h ../vgui/include.src -background.qc loading.qc main.h ui_console.qc ui_newgame.qc ui_quitgame.qc ui_createserver.qc +ui_customgame.qc ui_findservers.qc ui_musicplayer.qc ui_modelviewer.qc +ui_loadgame.qc desktop.qc main.qc ../platform/includes.src diff --git a/src/menu-vgui/loading.qc b/src/menu-vgui/loading.qc old mode 100755 new mode 100644 index e0653639..a7ee442a --- a/src/menu-vgui/loading.qc +++ b/src/menu-vgui/loading.qc @@ -14,12 +14,23 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +VGUILoadingPanel loadingPanel; + void Loading_Draw ( vector vecSize ) { - drawpic( [ 0, 0 ], "textures/gfx/background", vecSize, [ 1, 1, 1 ], 1.0f ); + g_vidsize = vecSize; + + if (!loadingPanel) { + loadingPanel = spawn(VGUILoadingPanel); + } + +#if 1 + loadingPanel.Draw(); + loadingPanel.UpdateProgress(); +#else vector vecLoadingSize = [ 256, 96 ]; - vector vecLoadingPos = ( g_vidsize / 2 ) - ( vecLoadingSize / 2 ); + vector vecLoadingPos = ( vecSize / 2 ) - ( vecLoadingSize / 2 ); drawfill( vecLoadingPos, vecLoadingSize, UI_MAINCOLOR, UI_MAINALPHA ); drawfill( vecLoadingPos, [vecLoadingSize[0], 1], [1,1,1], 0.5f ); @@ -27,4 +38,5 @@ void Loading_Draw ( vector vecSize ) drawfill( vecLoadingPos + [ 0, 1], [1, vecLoadingSize[1] - 2], [1,1,1], 0.5f ); drawfill( vecLoadingPos + [ vecLoadingSize[0] - 1, 1], [1, vecLoadingSize[1] - 2], [0,0,0], 0.5f ); Font_DrawText( vecLoadingPos + [ 8, 8 ], "Loading...", g_fntDefault ); +#endif } diff --git a/src/menu-vgui/main.qc b/src/menu-vgui/main.qc index 21557046..fa153849 100644 --- a/src/menu-vgui/main.qc +++ b/src/menu-vgui/main.qc @@ -14,7 +14,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -var int autocvar_r_autoscale = TRUE; +var int autocvar_r_autoscale = false; void Menu_AutoScale(void) @@ -22,6 +22,7 @@ Menu_AutoScale(void) if (autocvar_r_autoscale) { /* override for vid_conautoscales */ vector psize = getproperty(VF_SCREENPSIZE); + if (psize[1] >= (480 * 4)) { cvar_set("vid_conautoscale", "4"); } else if (psize[1] >= (480 * 3)) { @@ -37,10 +38,11 @@ Menu_AutoScale(void) void m_init(void) { + Platform_Init(); UISystem_Init(); - Background_Init(); Desktop_Init(); + registercommand("console"); registercommand("menu_quit"); registercommand("menu_music"); registercommand("map_background"); @@ -50,7 +52,7 @@ m_init(void) void Menu_RendererRestarted(string renderer) { - localcmd("menu_restart\n"); + Platform_RendererRestarted(); Menu_AutoScale(); } @@ -70,6 +72,7 @@ m_draw(vector screensize) g_menuofs[0] = (g_vidsize[0] / 2) - 320; g_menuofs[1] = (g_vidsize[1] / 2) - 240; Menu_AutoScale(); + Desktop_CanvasChanged(); } g_background = cvar("_background"); @@ -79,7 +82,7 @@ m_draw(vector screensize) if (getkeydest() != KEY_MENU) { setkeydest(KEY_MENU); setmousetarget(TARGET_MENU); - setcursormode(TRUE, "gfx/cursor"); + setcursormode(TRUE, "gfx/icon16/cursor"); } } @@ -97,10 +100,24 @@ m_draw(vector screensize) lasttime = time; g_vidsize = screensize; - Background_Draw(screensize); + + Background_Draw([0,0], g_vidsize); Desktop_Draw(); } +void +m_drawloading(vector screensize, float opaque) +{ + vector pos; + pos = (screensize / 2) - [32,32]; + + if (opaque || (clientstate() != 2)) { + Background_Draw([0,0], screensize); + } + + Loading_Draw(screensize); +} + float Menu_InputEvent (float evtype, float scanx, float chary, float devid) { @@ -133,7 +150,7 @@ m_display(void) g_active = TRUE; setkeydest(KEY_MENU); setmousetarget(TARGET_MENU); - setcursormode(TRUE, "gfx/cursor"); + setcursormode(TRUE, "gfx/icon16/cursor"); } /* @@ -170,6 +187,14 @@ m_consolecommand(string cmd) int c = (int)tokenize(cmd); switch (argv(0)) { + case "console": + static VGUIConsole consoleWindow; + + if (!consoleWindow) + consoleWindow = spawn(VGUIConsole); + + g_uiDesktop.Add( consoleWindow ); + break; case "menu_quit": UI_QuitGame_Show(); break; diff --git a/src/menu-vgui/ui_createserver.qc b/src/menu-vgui/ui_createserver.qc old mode 100755 new mode 100644 index 79b176d6..a4b60f57 --- a/src/menu-vgui/ui_createserver.qc +++ b/src/menu-vgui/ui_createserver.qc @@ -48,7 +48,7 @@ void UI_CreateServer_Show ( void ) lsbMaps.SetOffset( scrlMaps.GetValue(), FALSE ); } static void CreateServer_Scrolled ( void ) { - scrlMaps.SetValue( lsbMaps.GetOffset(), FALSE ); + scrlMaps.SetValue( lsbMaps.GetOffset() ); } if ( !g_iCreateServerInitialized ) { @@ -56,20 +56,19 @@ void UI_CreateServer_Show ( void ) winCreate = spawn( CUIWindow ); winCreate.SetTitle( "Create Server" ); winCreate.SetSize( '338 385' ); - winCreate.SetIcon( "textures/ui/icons/server-new" ); + winCreate.SetIcon( "gfx/icon16/server_add" ); - searchhandle shMaps = search_begin( "maps/*.bsp", SEARCH_NAMESORT, TRUE ); lsbMaps = spawn( CUIList ); lsbMaps.SetSize( '128 306' ); lsbMaps.SetPos( '175 32 ' ); - lsbMaps.SetItemCount( search_getsize( shMaps ) ); + lsbMaps.SetItemCount( MapLibrary_GetMapCount() ); lsbMaps.CallOnScroll( CreateServer_Scrolled ); lsbMaps.SetSelected( 0 ); lsbMaps.AddItem( "< Random Map >" ); - for ( int i = 0; i < search_getsize( shMaps ); i++ ) { - string strMap = search_getfilename( shMaps, i ); - lsbMaps.AddItem( substring( strMap, 5, strlen( strMap ) - 9 ) ); + for ( int i = 0; i < MapLibrary_GetMapCount(); i++ ) { + string strMap = MapLibrary_GetInfo(i, MAPINFO_NAME); + lsbMaps.AddItem( strMap ); //lsbMaps.AddItem( search_getfilename( shMaps, i ) ); } @@ -109,7 +108,7 @@ void UI_CreateServer_Show ( void ) txbMaxplayers = spawn( CUITextBox ); txbMaxplayers.SetPos( [ 20, 102 ] ); txbMaxplayers.SetSize( [ 124, 24 ] ); - txbMaxplayers.SetText( cvar_string( "sv_playerslots" ) ); + txbMaxplayers.SetText( cvar_string( "sv_playerslots" ) != "1" ? cvar_string( "sv_playerslots" ) : "8" ); lblPassword = spawn( CUILabel ); lblPassword.SetPos( '20 136' ); @@ -131,7 +130,6 @@ void UI_CreateServer_Show ( void ) winCreate.Add( txbMaxplayers ); winCreate.Add( lblPassword ); winCreate.Add( txbPassword ); - search_end( shMaps ); } winCreate.Show(); diff --git a/src/menu-vgui/ui_customgame.qc b/src/menu-vgui/ui_customgame.qc new file mode 100644 index 00000000..f9818e42 --- /dev/null +++ b/src/menu-vgui/ui_customgame.qc @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2016-2022 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +int g_iCustomGameInitialized; + +void UI_CustomGame_Show ( void ) +{ + static CUIWindow winCustomGame; + static CUIList lsbGames; + static CUIScrollbar scrlGames; + static CUIButton btnLoad; + + static void CustomGame_Play ( void ) { + GameLibrary_Activate(lsbGames.GetSelected()); + } + + static void CustomGame_ScrollUpdate ( void ) { + scrlGames.SetValue( lsbGames.GetOffset(), FALSE ); + } + static void CustomGame_ListUpdate ( void ) { + lsbGames.SetOffset( scrlGames.GetValue(), FALSE ); + } + + if ( !g_iCustomGameInitialized ) { + g_iCustomGameInitialized = TRUE; + + GameLibrary_InitCustom(); + + winCustomGame = spawn( CUIWindow ); + winCustomGame.SetTitle( "Custom Game" ); + winCustomGame.SetSize( [256,180] ); + winCustomGame.SetIcon( "gfx/icon16/rainbow" ); + + lsbGames = spawn( CUIList ); + lsbGames.SetSize( [192, 96] ); + lsbGames.SetPos( [8, 32] ); + lsbGames.SetItemCount( GameLibrary_GetGameCount() ); + lsbGames.CallOnScroll( CustomGame_ScrollUpdate ); + + for ( int i = 0; i < GameLibrary_GetGameCount(); i++ ) { + lsbGames.AddItem( GameLibrary_GetGameInfo(i, GAMEINFO_TITLE) ); + } + + scrlGames = spawn( CUIScrollbar ); + scrlGames.SetLength( 96 ); + scrlGames.SetPos( [201,32] ); + scrlGames.SetMin( 0 ); + scrlGames.SetStep( 1 ); + scrlGames.SetMax( lsbGames.GetMaxVisibleItems() ); + scrlGames.CallOnChange( CustomGame_ListUpdate ); + + btnLoad = spawn( CUIButton ); + btnLoad.SetTitle( "Load" ); + btnLoad.SetIcon( "gfx/icon16/control_play" ); + btnLoad.SetPos( [8,132] ); + btnLoad.SetSize([64,24]); + btnLoad.SetFunc( CustomGame_Play ); + + g_uiDesktop.Add( winCustomGame ); + winCustomGame.Add( lsbGames ); + winCustomGame.Add( scrlGames ); + winCustomGame.Add( btnLoad ); + } + + winCustomGame.Show(); + winCustomGame.SetPos( ( g_vidsize / 2 ) - ( winCustomGame.GetSize() / 2 ) ); +} diff --git a/src/menu-vgui/ui_findservers.qc b/src/menu-vgui/ui_findservers.qc old mode 100755 new mode 100644 index ba3dc774..df51b95e --- a/src/menu-vgui/ui_findservers.qc +++ b/src/menu-vgui/ui_findservers.qc @@ -25,7 +25,7 @@ void UI_FindServers_Show ( void ) winFind = spawn( CUIWindow ); winFind.SetTitle( "Find Servers" ); winFind.SetSize( '600 400' ); - winFind.SetIcon( "textures/ui/icons/servers" ); + winFind.SetIcon( "gfx/icon16/world" ); g_uiDesktop.Add( winFind ); } diff --git a/src/menu-vgui/ui_loadgame.qc b/src/menu-vgui/ui_loadgame.qc new file mode 100644 index 00000000..7a3e094e --- /dev/null +++ b/src/menu-vgui/ui_loadgame.qc @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2016-2022 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +int g_iLoadGameInitialized; + +void UI_LoadGame_Show ( void ) +{ + static CUIWindow winLoadGame; + static CUIList lsbSaves; + static CUIScrollbar scrlSaves; + static CUIButton btnLoad; + + static void LoadGame_Play ( void ) { + string strSong; + strSong = lsbSaves.GetItem( lsbSaves.GetSelected() ); + localcmd( sprintf( "load %s\n", strSong) ); + } + + static void LoadGame_ScrollUpdate ( void ) { + scrlSaves.SetValue( lsbSaves.GetOffset(), FALSE ); + } + static void LoadGame_ListUpdate ( void ) { + lsbSaves.SetOffset( scrlSaves.GetValue(), FALSE ); + } + + if ( !g_iLoadGameInitialized ) { + g_iLoadGameInitialized = TRUE; + winLoadGame = spawn( CUIWindow ); + winLoadGame.SetTitle( "Load Game" ); + winLoadGame.SetSize( [256,180] ); + winLoadGame.SetIcon( "gfx/icon16/music" ); + + lsbSaves = spawn( CUIList ); + lsbSaves.SetSize( [192, 96] ); + lsbSaves.SetPos( [8, 32] ); + lsbSaves.SetItemCount( Saves_GetSaveCount() ); + lsbSaves.CallOnScroll( LoadGame_ScrollUpdate ); + + for ( int i = 0; i < Saves_GetSaveCount(); i++ ) { + lsbSaves.AddItem( Saves_GetInfo(i, SAVEINFO_NAME) ); + } + + scrlSaves = spawn( CUIScrollbar ); + scrlSaves.SetLength( 96 ); + scrlSaves.SetPos( [201,32] ); + scrlSaves.SetMin( 0 ); + scrlSaves.SetStep( 1 ); + scrlSaves.SetMax( lsbSaves.GetMaxVisibleItems() ); + scrlSaves.CallOnChange( LoadGame_ListUpdate ); + + btnLoad = spawn( CUIButton ); + btnLoad.SetTitle( "Load" ); + btnLoad.SetIcon( "gfx/icon16/book_edit" ); + btnLoad.SetPos( [8,132] ); + btnLoad.SetSize([64,24]); + btnLoad.SetFunc( LoadGame_Play ); + + g_uiDesktop.Add( winLoadGame ); + winLoadGame.Add( lsbSaves ); + winLoadGame.Add( scrlSaves ); + winLoadGame.Add( btnLoad ); + } + + winLoadGame.Show(); + winLoadGame.SetPos( ( g_vidsize / 2 ) - ( winLoadGame.GetSize() / 2 ) ); +} diff --git a/src/menu-vgui/ui_modelviewer.qc b/src/menu-vgui/ui_modelviewer.qc index c7ab368c..b55289fb 100644 --- a/src/menu-vgui/ui_modelviewer.qc +++ b/src/menu-vgui/ui_modelviewer.qc @@ -48,6 +48,9 @@ void AngleVectors ( vector angles ) v_up[2] = cr*cp; } +string(float modidx, float framenum) frametoname = #0; +.float modelindex; + void UI_ModelViewer_Show ( void ) { static entity eModel; @@ -80,17 +83,25 @@ void UI_ModelViewer_Show ( void ) viewModel.Set3DPos( [0,0,0] ); } static void UI_ModelViewer_SetFrame( int iFrame ) { + float maxFrame = modelframecount(eModel.modelindex) - 1; eModel.frame = (float)iFrame; - lblSeqFrame.SetTitle( sprintf( "Frame: %i", iFrame ) ); + + if (eModel.frame > maxFrame) { + eModel.frame = (maxFrame); + } + + if (eModel.frame < 0) { + eModel.frame = 0; + } + + lblSeqFrame.SetTitle( sprintf( "Frame %d: %s", eModel.frame, frametoname(eModel.modelindex, eModel.frame) ) ); eModel.frame1time = 0; } static void UI_ModelViewer_SetFrameP( void ) { - UI_ModelViewer_SetFrame( ++eModel.frame ); + UI_ModelViewer_SetFrame( eModel.frame + 1 ); } static void UI_ModelViewer_SetFrameM( void ) { - if ( eModel.frame ) { - UI_ModelViewer_SetFrame( --eModel.frame ); - } + UI_ModelViewer_SetFrame( eModel.frame - 1 ); } static void UI_ModelViewer_SetModel( string strModel ) { setmodel( eModel, strModel ); @@ -111,10 +122,10 @@ void UI_ModelViewer_Show ( void ) if ( chkGround.GetValue() == TRUE ) { R_BeginPolygon( "", 0, FALSE ); - R_PolygonVertex( [ 64, -64, 0 ], '1 0', [1,1,1], 1.0f ); // Top Right - R_PolygonVertex( [ -64, -64, 0 ], '0 0', [1,1,1], 1.0f ); // Top left - R_PolygonVertex( [ -64, 64, 0 ], '0 1', [1,1,1], 1.0f ); // Bottom left - R_PolygonVertex( [ 64, 64, 0 ], '1 1', [1,1,1], 1.0f ); // Bottom right + R_PolygonVertex( [ 64, -64, 0 ], [1,0], [1,1,1], 1.0f ); // Top Right + R_PolygonVertex( [ -64, -64, 0 ], [0,0], [1,1,1], 1.0f ); // Top left + R_PolygonVertex( [ -64, 64, 0 ], [0,1], [1,1,1], 1.0f ); // Bottom left + R_PolygonVertex( [ 64, 64, 0 ], [1,1], [1,1,1], 1.0f ); // Bottom right R_EndPolygon(); } @@ -249,7 +260,7 @@ void UI_ModelViewer_Show ( void ) winViewer.SetMaxSize( [ 9999, 9999 ] ); winViewer.SetStyleMask( VGUIWindowStyleDefault | VGUIWindowResizeable ); winViewer.SetPos( [ 172, 64 ] ); - winViewer.SetIcon( "textures/ui/icons/hdd" ); + winViewer.SetIcon( "gfx/icon16/images" ); winViewer.CallOnResize( UI_ModelViewer_Resize ); picBackground = spawn( CUIPic ); @@ -287,11 +298,14 @@ void UI_ModelViewer_Show ( void ) lblSeqFrame = spawn( CUILabel ); lblSeqFrame.SetTitle( "Frame: 0" ); + lblSeqFrame.SetSize([550,16]); btnSeqNext = spawn( CUIButton ); btnSeqNext.SetTitle( ">>" ); + btnSeqNext.SetSize([48,24]); btnSeqNext.SetFunc( UI_ModelViewer_SetFrameP ); btnSeqPrev = spawn( CUIButton ); btnSeqPrev.SetTitle( "<<" ); + btnSeqPrev.SetSize([48,24]); btnSeqPrev.SetFunc( UI_ModelViewer_SetFrameM ); searchhandle shModels = search_begin( "models/*.mdl:models/*.vvm:models/*/*.mdl:models/*/*.vvm:models/*/*/*.mdl:models/*/*/*.vvm:models/*/*/*/*.mdl:models/*/*/*/*.vvm", SEARCH_NAMESORT | SEARCH_MULTISEARCH, TRUE ); @@ -301,7 +315,7 @@ void UI_ModelViewer_Show ( void ) for ( int i = 0; i < search_getsize( shModels ); i++ ) { string strAdd = search_getfilename( shModels, i ); - lstModels.AddItem( substring( strAdd , 6, strlen( strAdd ) - 6 ) ); + lstModels.AddItem( substring( strAdd , 7, -1 ) ); } search_end( shModels ); @@ -316,7 +330,7 @@ void UI_ModelViewer_Show ( void ) btnLoadModel = spawn( CUIButton ); btnLoadModel.SetTitle( "Load Selected" ); btnLoadModel.SetFunc( UI_ModelViewer_LoadSelected ); - btnLoadModel.SetSize( '192 24' ); + btnLoadModel.SetSize( [192,24] ); UI_ModelViewer_Resize(); UI_ModelViewer_ShowRenderer(); @@ -326,8 +340,8 @@ void UI_ModelViewer_Show ( void ) winViewer.Add( viewModel ); winViewer.Add( btnTabRenderer ); winViewer.Add( btnTabSequence ); - winViewer.Add( btnTabBody ); - winViewer.Add( btnTabTexture ); + //winViewer.Add( btnTabBody ); + //winViewer.Add( btnTabTexture ); winViewer.Add( chkBackground ); winViewer.Add( chkGround ); winViewer.Add( chkMirror ); diff --git a/src/menu-vgui/ui_musicplayer.qc b/src/menu-vgui/ui_musicplayer.qc old mode 100755 new mode 100644 index 2d949064..355a4bab --- a/src/menu-vgui/ui_musicplayer.qc +++ b/src/menu-vgui/ui_musicplayer.qc @@ -27,10 +27,10 @@ void UI_MusicPlayer_Show ( void ) static void MusicPlayer_Play ( void ) { string strSong; strSong = lsbSongs.GetItem( lsbSongs.GetSelected() ); - localcmd( sprintf( "music %s\n", substring( strSong, 11, strlen( strSong ) - 15 ) ) ); + localcmd( sprintf( "play %S\n", strSong ) ); } static void MusicPlayer_Stop ( void ) { - localcmd( "stopmusic\n" ); + localcmd( "stopsound\n" ); } static void MusicPlayer_ScrollUpdate ( void ) { scrlSong.SetValue( lsbSongs.GetOffset(), FALSE ); @@ -43,13 +43,13 @@ void UI_MusicPlayer_Show ( void ) g_iMusicPlayerInitialized = TRUE; winMusicPlayer = spawn( CUIWindow ); winMusicPlayer.SetTitle( "Music Player" ); - winMusicPlayer.SetSize( '256 180' ); - winMusicPlayer.SetIcon( "textures/ui/icons/cd" ); + winMusicPlayer.SetSize( [256,180] ); + winMusicPlayer.SetIcon( "gfx/icon16/ipod" ); - searchhandle shSongs = search_begin( "music/*.ogg", SEARCH_NAMESORT, TRUE ); + searchhandle shSongs = search_begin( "music/*.flac:music/*.wav:music/*.ogg:media/*.mp3:sound/music/*.mp3", SEARCH_NAMESORT | SEARCH_MULTISEARCH, TRUE ); lsbSongs = spawn( CUIList ); - lsbSongs.SetSize( '192 96' ); - lsbSongs.SetPos( '8 32 ' ); + lsbSongs.SetSize( [192, 96] ); + lsbSongs.SetPos( [8, 32] ); lsbSongs.SetItemCount( search_getsize( shSongs ) ); lsbSongs.CallOnScroll( MusicPlayer_ScrollUpdate ); @@ -59,7 +59,7 @@ void UI_MusicPlayer_Show ( void ) scrlSong = spawn( CUIScrollbar ); scrlSong.SetLength( 96 ); - scrlSong.SetPos( '201 32' ); + scrlSong.SetPos( [201,32] ); scrlSong.SetMin( 0 ); scrlSong.SetStep( 1 ); scrlSong.SetMax( lsbSongs.GetMaxVisibleItems() ); @@ -67,12 +67,16 @@ void UI_MusicPlayer_Show ( void ) btnPlay = spawn( CUIButton ); btnPlay.SetTitle( "Play" ); - btnPlay.SetPos( '8 132' ); + btnPlay.SetIcon( "gfx/icon16/control_play" ); + btnPlay.SetPos( [8,132] ); + btnPlay.SetSize([64,24]); btnPlay.SetFunc( MusicPlayer_Play ); btnStop = spawn( CUIButton ); btnStop.SetTitle( "Stop" ); - btnStop.SetPos( '96 132' ); + btnStop.SetIcon( "gfx/icon16/control_stop" ); + btnStop.SetPos( [96,132] ); + btnStop.SetSize([64,24]); btnStop.SetFunc( MusicPlayer_Stop ); g_uiDesktop.Add( winMusicPlayer ); diff --git a/src/menu-vgui/ui_newgame.qc b/src/menu-vgui/ui_newgame.qc old mode 100755 new mode 100644 index e66f71b5..72bd1c9f --- a/src/menu-vgui/ui_newgame.qc +++ b/src/menu-vgui/ui_newgame.qc @@ -27,7 +27,10 @@ void UI_NewGame_Show ( void ) static CUIRadio radHard; static void NewGame_Play ( void ) { - localcmd( "maxplayers 1\nmap measure\n" ); + if (radTraining.GetValue()) + localcmd( sprintf("maxplayers 1\ndeathmatch 0\ncoop 0\n%s", GameLibrary_GetInfo(GAMEINFO_TRAININGMAP)) ); + else + localcmd( sprintf("maxplayers 1\ndeathmatch 0\ncoop 0\n%s", GameLibrary_GetInfo(GAMEINFO_STARTMAP)) ); winNewGame.Hide(); } static void NewGame_Cancel ( void ) { @@ -45,7 +48,7 @@ void UI_NewGame_Show ( void ) winNewGame = spawn( CUIWindow ); winNewGame.SetTitle( "New Game" ); winNewGame.SetSize( '192 168' ); - winNewGame.SetIcon( "textures/ui/icons/desktop" ); + winNewGame.SetIcon( "gfx/icon16/new" ); g_uiDesktop.Add( winNewGame ); btnPlay = spawn( CUIButton ); diff --git a/src/menu-vgui/ui_quitgame.qc b/src/menu-vgui/ui_quitgame.qc old mode 100755 new mode 100644 index fc597ff1..34ce698b --- a/src/menu-vgui/ui_quitgame.qc +++ b/src/menu-vgui/ui_quitgame.qc @@ -35,7 +35,7 @@ void UI_QuitGame_Show ( void ) winQuitGame = spawn( CUIWindow ); winQuitGame.SetTitle( "Quit Game" ); winQuitGame.SetSize( '256 128' ); - winQuitGame.SetIcon( "textures/ui/icons/cancel" ); + winQuitGame.SetIcon( "gfx/icon16/stop" ); g_uiDesktop.Add( winQuitGame ); btnQuit = spawn( CUIButton ); @@ -52,6 +52,7 @@ void UI_QuitGame_Show ( void ) lblSure.SetTitle( "Do you wish to stop playing now?" ); lblSure.SetSize( '256 16' ); lblSure.SetPos( '0 48' ); + lblSure.SetAlignment(AF_NONE); btnQuit.SetFunc( QuitGame_Yes ); btnCancel.SetFunc( QuitGame_No ); diff --git a/src/platform/background.h b/src/platform/background.h new file mode 100644 index 00000000..8ec83273 --- /dev/null +++ b/src/platform/background.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2016-2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +void Background_Draw(vector atPos, vector withSize); diff --git a/src/platform/background.qc b/src/platform/background.qc new file mode 100755 index 00000000..2f6556d2 --- /dev/null +++ b/src/platform/background.qc @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2016-2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#define BACKGROUND_IMG "gfx/background" + +typedef enum +{ + BACK_AUTO = 0, + BACK_MATERIAL, + BACK_VGUI1, + BACK_WON +} bgMode_t; + +var bgMode_t g_bgMode; +var float autocvar_menu_forceBGMode = 0; + +typedef struct +{ + string strMat; + vector vecSize; + vector vecPos; +} backResource_t; + +backResource_t g_back800[] = +{ + {"resource/background/800_1_a_loading",[256,256,0],[0,0,0]}, + {"resource/background/800_1_b_loading",[256,256,0],[256,0,0]}, + {"resource/background/800_1_c_loading",[256,256,0],[512,0,0]}, + {"resource/background/800_1_d_loading",[32,256,0],[768,0,0]}, + {"resource/background/800_2_a_loading",[256,256,0],[0,256,0]}, + {"resource/background/800_2_b_loading",[256,256,0],[256,256,0]}, + {"resource/background/800_2_c_loading",[256,256,0],[512,256,0]}, + {"resource/background/800_2_d_loading",[32,256,0],[768,256,0]}, + {"resource/background/800_3_a_loading",[256,88,0],[0,512,0]}, + {"resource/background/800_3_b_loading",[256,88,0],[256,512,0]}, + {"resource/background/800_3_c_loading",[256,88,0],[512,512,0]}, + {"resource/background/800_3_d_loading",[32,88,0],[768,512,0]} +}; + +void +Background_RendererRestarted(void) +{ + if (fileExists("resource/background/800_1_a_loading.tga")) { + g_bgMode = BACK_VGUI1; + } else if (fileExists("gfx/shell/splash.bmp")) { + g_bgMode = BACK_WON; + } else { + g_bgMode = BACK_MATERIAL; + } + + /* issue `vid_reload` after changing this cvar */ + if (autocvar_menu_forceBGMode) { + g_bgMode = autocvar_menu_forceBGMode; + } + + if (g_bgMode == BACK_VGUI1) { + for (int i = 0; i < g_back800.length; i++) { + precache_pic(g_back800[i].strMat); + } + } else if (g_bgMode == BACK_WON) { + precache_pic("gfx/shell/splash.bmp"); + } else if (g_bgMode == BACK_MATERIAL) { + precache_pic(BACKGROUND_IMG); + } +} + +void +drawpic_flip(vector pos, string mat, vector size, vector color, float alpha) +{ + drawsubpic(pos, size, mat, [1,0], [-1,1], color, alpha, 0); +} + +void +Background_WON(vector vecPos, vector vecSize) +{ + drawpic(vecPos, "gfx/shell/splash.bmp", vecSize, [1,1,1], 1.0f); + /*drawpic_flip(vecPos + [vecSize[0], 0], "gfx/shell/splash.bmp", vecSize, [1,1,1] * 0.5f, 1.0f); + drawpic_flip(vecPos - [vecSize[0], 0], "gfx/shell/splash.bmp", vecSize, [1,1,1] * 0.5f, 1.0f);*/ +} + +void +Background_Steam(vector vecPos, vector vecSize) +{ + for (int i = 0; i < g_back800.length; i++) { + vector pos = [0.0f, 0.0f, 0.0f]; + vector size = [0.0f, 0.0f, 0.0f]; + + /* scale down 800x600 to 640x480 */ + float scaleX = vecSize[0] / 800; + float scaleY = vecSize[1] / 600; + size[0] = g_back800[i].vecSize[0] * scaleX; + size[1] = g_back800[i].vecSize[1] * scaleY; + pos[0] = (g_back800[i].vecPos[0] * scaleX); + pos[1] = (g_back800[i].vecPos[1] * scaleY); + + drawpic(vecPos + pos, \ + g_back800[i].strMat, \ + size, \ + [1,1,1], \ + 1.0f); + } +} + +void +Background_Draw2(vector vecPos, vector vecSize) +{ + switch (g_bgMode) { + case BACK_VGUI1: + Background_Steam(vecPos, vecSize); + break; + case BACK_WON: + Background_WON(vecPos, vecSize); + break; + case BACK_MATERIAL: + default: + drawpic(vecPos, BACKGROUND_IMG, vecSize, [ 1, 1, 1 ], 1.0f); + break; + } +} + +void +Background_Draw(vector vecPos, vector vecSize) +{ + /* when ingame, we'll draw a slight black tint... */ + if (clientstate() == 2) { + /* ...unless we're in background map mode. */ + if (!g_background) { + drawpic([0,0], "menutint", g_vidsize, [1,1,1], 1.0f); + } + } else { + /* clear screen */ + drawfill([0,0], g_vidsize, [0,0,0], 1.0f); + + Background_Draw2(vecPos, vecSize); + } +} diff --git a/src/platform/defs.h b/src/platform/defs.h index 71720159..fcf59ef7 100644 --- a/src/platform/defs.h +++ b/src/platform/defs.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2022 Vera Visions LLC. + * Copyright (c) 2016-2024 Vera Visions LLC. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -14,7 +14,9 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "init.h" #include "cmd.h" +#include "background.h" #include "util.h" #include "achievements.h" #include "activitypub.h" @@ -27,6 +29,7 @@ #include "gamelibrary.h" #include "maplibrary.h" #include "error.h" +#include "saves.h" /** Definitions for FTE's internal package manager. We don't want you to talk to this one directly within Nuclide. */ typedef enum diff --git a/src/platform/gamelibrary.qc b/src/platform/gamelibrary.qc index 7341e93b..a63a85ed 100644 --- a/src/platform/gamelibrary.qc +++ b/src/platform/gamelibrary.qc @@ -33,6 +33,10 @@ GameLibrary_IDForPackageName(string packageName) { string f; + if (!checkbuiltin(getpackagemanagerinfo)) { + return (-1i); + } + for (int i = 0; (getpackagemanagerinfo(i, GPMI_NAME)); i++) { string name; name = getpackagemanagerinfo(i, GPMI_NAME); @@ -444,6 +448,7 @@ GameLibrary_InitCustom(void) } /* count the package installed mods after */ + if (checkextension("getpackagemanagerinfo")) for (int i = 0; (getpackagemanagerinfo(i, GPMI_NAME)); i++) { string packageName = getpackagemanagerinfo(i, GPMI_NAME); string installStatus = getpackagemanagerinfo(i, GPMI_INSTALLED); @@ -496,6 +501,7 @@ GameLibrary_InitCustom(void) } /* iterate through all packages again */ + if (checkextension("getpackagemanagerinfo")) for (int i = 0i; (getpackagemanagerinfo(i, GPMI_NAME)); i++) { string packageName = getpackagemanagerinfo(i, GPMI_NAME); string installStatus = getpackagemanagerinfo(i, GPMI_INSTALLED); @@ -832,8 +838,8 @@ void GameLibrary_DebugList(void) { for (int i = 0; i < gameinfo_count; i++) { - print(sprintf("%i %s (%s)\n", i, games[i].game, games[i].gamedir)); + printf("%i %s (%s)\n", i, games[i].game, games[i].gamedir); } - print(sprintf("\t%i game(s) loaded.", gameinfo_count)); + printf("\t%i game(s) loaded.\n", gameinfo_count); } diff --git a/src/platform/includes.src b/src/platform/includes.src index a5f30b0d..efb14ade 100644 --- a/src/platform/includes.src +++ b/src/platform/includes.src @@ -1,5 +1,6 @@ #includelist achievements.qc +background.qc master.qc modserver.qc music.qc @@ -10,5 +11,7 @@ updates.qc gamelibrary.qc maplibrary.qc activitypub.qc +saves.qc cmd.qc +init.qc #endlist diff --git a/src/server/mapC_math.h b/src/platform/init.h similarity index 86% rename from src/server/mapC_math.h rename to src/platform/init.h index af1dabad..1ceddba5 100644 --- a/src/server/mapC_math.h +++ b/src/platform/init.h @@ -14,8 +14,5 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/*! @file mapC_math.h - @brief Server-side plugin wrappers for math related functions. -*/ - -#include "../shared/math.h" \ No newline at end of file +void Platform_Init(void); +void Platform_RendererRestarted(void); diff --git a/src/platform/init.qc b/src/platform/init.qc new file mode 100644 index 00000000..62434561 --- /dev/null +++ b/src/platform/init.qc @@ -0,0 +1,15 @@ +void +Platform_Init(void) +{ + Platform_RegisterCommands(); + GameLibrary_Init(); + MapLibrary_Init(); + Saves_Init(); + Platform_RendererRestarted(); +} + +void +Platform_RendererRestarted(void) +{ + Background_RendererRestarted(); +} diff --git a/src/platform/maplibrary.qc b/src/platform/maplibrary.qc index 4d8e92b9..7716c109 100644 --- a/src/platform/maplibrary.qc +++ b/src/platform/maplibrary.qc @@ -36,6 +36,8 @@ MapLibrary_MapInGameDir(string fileName, string gameDir) { bool list = true; + //printf("Checking %S %S...\n", fileName, gameDir); + /* only look for maps in the current gamedir, requires SEARCH_FULLPACKAGE */ if (gameDir != MapLibrary_GetMapGamedir()) { return false; @@ -122,7 +124,7 @@ MapLibrary_Init(void) } /* search for all maps in the current PATH */ - mapsearch = search_begin("maps/*.bsp", SEARCH_NAMESORT | SEARCH_FULLPACKAGE, TRUE); + mapsearch = search_begin("maps/*.bsp:maps/*/*.bsp", SEARCH_NAMESORT | SEARCH_FULLPACKAGE | SEARCH_MULTISEARCH, TRUE); mapCount = search_getsize(mapsearch); /* we now iterate over the search entries to filter results out */ @@ -142,7 +144,7 @@ MapLibrary_Init(void) g_mapLibrary = (mapLibrary_t *)memalloc(sizeof(mapLibrary_t) * g_mapLibrary_count); /* let's do it again, but this time we'll sort the data into our array */ - mapsearch = search_begin("maps/*.bsp", SEARCH_NAMESORT | SEARCH_FULLPACKAGE, TRUE); + mapsearch = search_begin("maps/*.bsp:maps/*/*.bsp", SEARCH_NAMESORT | SEARCH_FULLPACKAGE | SEARCH_MULTISEARCH, TRUE); mapCount = search_getsize(mapsearch); for (i = 0i; i < mapCount; i++) { @@ -197,4 +199,4 @@ MapLibrary_GetInfo(int mapID, mapType_t infoType) default: return __NULL__; } -} \ No newline at end of file +} diff --git a/src/platform/saves.h b/src/platform/saves.h new file mode 100644 index 00000000..17c4f404 --- /dev/null +++ b/src/platform/saves.h @@ -0,0 +1,23 @@ + +typedef struct +{ + string m_strName; + string m_strPic; +} savegame_t; +var savegame_t *g_savegames; +var int g_savegame_count; + +/** Options querying Map Library entries using `MapLibrary_GetInfo()`. */ +typedef enum +{ + SAVEINFO_NAME, /**< (string) Name of the save. E.g. quick */ + SAVEINFO_PREVIEW /**< (string) URL to a preview of the save. __NULL__ if not available.*/ +} saveInfo_t; + +/** Returns the total amount of savegames available. */ +int Saves_GetSaveCount(void); + +/** Retrieve information about a given saveID. See saveInfo_t for which fields you can query. */ +__variant Saves_GetInfo(int, saveInfo_t); + +void Saves_Init(void); diff --git a/src/platform/saves.qc b/src/platform/saves.qc new file mode 100644 index 00000000..da66396c --- /dev/null +++ b/src/platform/saves.qc @@ -0,0 +1,44 @@ +void +Saves_Init(void) +{ + searchhandle searchy; + searchy = search_begin("saves/*/info.fsv", SEARCH_NAMESORT, TRUE); + + g_savegame_count = search_getsize(searchy); + g_savegames = memalloc(sizeof(savegame_t) * g_savegame_count); + + for (int i = 0; i < g_savegame_count; i++) { + string fullpath = search_getfilename(searchy, i); + g_savegames[i].m_strName = substring(fullpath, 6, strlen(fullpath) - 15); + g_savegames[i].m_strPic = sprintf("saves/%s/screeny.tga", g_savegames[i].m_strName ); + precache_pic(g_savegames[i].m_strPic); + } + + search_end(searchy); +} + +int +Saves_GetSaveCount(void) +{ + return (g_savegame_count); +} + +__variant +Saves_GetInfo(int saveID, saveInfo_t saveInfo) +{ + if (saveID >= g_savegame_count || saveID < 0i) { + NSError("Invalid save id %i", saveID); + return __NULL__; + } + + switch (saveInfo) { + case SAVEINFO_NAME: + return g_savegames[saveID].m_strName; + break; + case SAVEINFO_PREVIEW: + return g_savegames[saveID].m_strPic; + break; + default: + return __NULL__; + } +} diff --git a/src/platform/servers.h b/src/platform/servers.h new file mode 100644 index 00000000..a76437cc --- /dev/null +++ b/src/platform/servers.h @@ -0,0 +1,15 @@ +/** Options for querying Game Library entry information using `GameLibrary_GetInfo()` */ +typedef enum +{ + SERVERGAME_TITLE, /**< (string) The title of the game. E.g. "Action Game" */ + SERVERGAME_ADDRESS, /**< (string) The game directory name. E.g. "data" */ + SERVERGAME_PING, /**< (int) The directory to be loaded before the game directory. */ + SERVERGAME_PLAYERS, /**< (int) The first game directory to be loaded. */ + SERVERGAME_MAXPLAYERS, /**< (int) The game its official website. */ + SERVERGAME_MAP, /**< (string) Version number string. */ + SERVERGAME_GAME, /**< (string) The size of the game, in bytes. */ +} serverGame_t; + + +/** Retrieves fields for a given game. See gameInfo_t for a list of fields you can query. */ +__variant Servers_GetInfo(int, serverGame_t); diff --git a/src/platform/servers.qc b/src/platform/servers.qc new file mode 100644 index 00000000..2c717825 --- /dev/null +++ b/src/platform/servers.qc @@ -0,0 +1,35 @@ + +__variant +Servers_GetInfo(int serverID, serverGame_t infoType) +{ + if (serverID >= Master_GetTotalServers() || serverID < 0i) { + NSError("Invalid server id %i.", serverID); + return __NULL__; + } + + switch (infoType) { + case SERVERGAME_TITLE: + return (string)gethostcachestring(srv_fldName, i) + break; + case SERVERGAME_ADDRESS: + return (string)gethostcachestring(srv_fldAdress, i) + break; + case SERVERGAME_PING: + return (string)gethostcachestring(srv_fldPing, i) + break; + case SERVERGAME_PLAYERS: + return (string)gethostcachestring(srv_fldPlayers, i) + break; + case SERVERGAME_MAXPLAYERS: + return (string)gethostcachestring(srv_fldMaxplayers, i) + break; + case SERVERGAME_MAP: + return (string)gethostcachestring(srv_fldMap, i) + break; + case SERVERGAME_GAME: + return (string)gethostcachestring(srv_fldGame, i) + break; + default: + return __NULL__; + } +} diff --git a/src/server/NSGameRules.h b/src/server/NSGameRules.h index fbdb6d1c..ac4d7bd6 100644 --- a/src/server/NSGameRules.h +++ b/src/server/NSGameRules.h @@ -32,6 +32,7 @@ public: virtual void Save(float); virtual void Restore(string,string); virtual void RestoreComplete(void); + virtual void Input(entity, string, string); /** Overridable: Called when all map entities have initialized. */ virtual void InitPostEnts(void); @@ -71,6 +72,10 @@ public: In a singleplayer game, it might load the most recent save. @return True/false depending on the respawn succeeded. */ virtual bool PlayerRequestRespawn(NSClientPlayer); + + /** Overridable: called when a NSClientPlayer requests joining a specific team. + @return True/false depending on the team change success. */ + virtual bool PlayerRequestTeam(NSClientPlayer, int team); /* level transitions */ /** Overridable: Called to set up new level parms for any NSClientPlayer. */ @@ -107,6 +112,7 @@ public: /** Returns if the gamerule is a multiplayer game. */ virtual bool IsMultiplayer(void); + /* chat related methods */ /** Called by Nuclide when the server has received a chat message that is to be distributed amongst all clients, regardless of team. */ diff --git a/src/server/NSGameRules.qc b/src/server/NSGameRules.qc index a70dbc55..182db65e 100644 --- a/src/server/NSGameRules.qc +++ b/src/server/NSGameRules.qc @@ -22,6 +22,9 @@ void NSGameRules::NSGameRules(void) { forceinfokey(world, "teamplay", "0"); + forceinfokey(world, sprintf("teamspawn_%d", TEAM_CONNECTING), ""); + forceinfokey(world, sprintf("teamspawn_%d", TEAM_UNASSIGNED), "info_player_start"); + forceinfokey(world, sprintf("teamspawn_%d", TEAM_SPECTATOR), "info_spectator_start"); identity = 2; } @@ -49,6 +52,12 @@ NSGameRules::Restore(string strKey, string strValue) } } +void +NSGameRules::Input(entity eAct, string strInput, string strData) +{ + RuleC_CallInput(m_ruleProgs, eAct, strInput, strData); +} + void NSGameRules::RestoreComplete(void) { @@ -68,6 +77,13 @@ void NSGameRules::FrameStart(void) { //print("StartFrame!\n"); + + /* hack */ + if (time < 2.5f) { + return; + } + + RuleC_CallFrame(m_ruleProgs, "CodeCallback_FrameStart"); } bool NSGameRules::ConsoleCommand(NSClientPlayer pl, string cmd) @@ -202,6 +218,10 @@ NSGameRules::SpectatorThink(NSClientSpectator pl) int NSGameRules::MaxItemPerSlot(int slot) { + if (m_ruleProgs) { + return RuleC_CallMaxItemsPerSlot(m_ruleProgs, slot, "CodeCallback_MaxItemPerSlot"); + } + return (-1); } @@ -368,6 +388,12 @@ NSGameRules::PlayerRequestRespawn(NSClientPlayer pl) return RuleC_CallRequestSpawn(m_ruleProgs, pl, "CodeCallback_PlayerRequestRespawn"); } +bool +NSGameRules::PlayerRequestTeam(NSClientPlayer pl, int teamNum) +{ + return RuleC_CallRequestTeam(m_ruleProgs, pl, teamNum, "CodeCallback_CallRequestTeam"); +} + void NSGameRules::ChatMessageAll(NSClient cl, string strMessage) { @@ -442,7 +468,7 @@ NSGameRules::InitFromProgs(string pathToProgs) if (mainFunction) { externset(newRule.m_ruleProgs, this, "self"); - thread(mainFunction()); + thread(mainFunction()) } else { NSError("%S does not have a main function.", pathToProgs); } @@ -450,15 +476,3 @@ NSGameRules::InitFromProgs(string pathToProgs) return (newRule); } - -void -setServerInfo(string serverKey, string setValue) -{ - forceinfokey(world, serverKey, setValue); -} - -string -getServerInfo(string serverKey) -{ - return infokey(world, serverKey); -} diff --git a/src/server/api.h b/src/server/api.h new file mode 100644 index 00000000..51730300 --- /dev/null +++ b/src/server/api.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#pragma target fte_5768 +#define QWSSQC + +#include "../shared/fteextensions.qc" +#include "../shared/global.h" +#include "../shared/math.h" +#include "api_func.h" +#include "../shared/api.h" + +void +main(void) +{ + _server_main(); + _shared_main(); +} diff --git a/src/server/api.qc b/src/server/api.qc new file mode 100644 index 00000000..87d33a10 --- /dev/null +++ b/src/server/api.qc @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2016-2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +void +SVPF_game_LoadNextMap(void) +{ + localcmd("nextmap\n"); +} + +void +SVPF_game_CleanUpMap(void) +{ + //localcmd("respawnEntities\n"); + + /* user created decals (not sprays) */ + for (entity eFind = world; (eFind = find(eFind, ::classname, "tempdecal"));) { + //ents.Input(eFind, "Destroy", "", world); + } + + /* respawn all entities. */ + for (entity a = world; (a = findfloat(a, ::identity, 1));) { + NSEntity caw = (NSEntity)a; + if (caw.classname != "player") + caw.Respawn(); + } + + /* clear the corpses/items, you name it*/ + for (entity eFind = world; (eFind = find(eFind, ::classname, "remove_me"));) { + if (eFind.identity) { + NSEntity toRemove = (NSEntity)eFind; + toRemove.Destroy(); + } else { + remove(eFind); + } + } + + WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); + WriteByte(MSG_MULTICAST, EV_CLEARDECALS); + msg_entity = world; + multicast([0,0,0], MULTICAST_ALL); +} + +string +SVPF_game_GetMap(void) +{ + return (mapname); +} + +string +SVPF_game_GetNextMap(void) +{ + return ""; +} + +void +SVPF_game_TeleportToSpawn(entity targetClient) +{ + Spawn_TeleportToSpawn(targetClient); +} + +void +SVPF_game_SetSpawnPoint(string spawnPoint) +{ + forceinfokey(world, sprintf("teamspawn_%d", TEAM_UNASSIGNED), spawnPoint); +} + +int +SVPF_actor_GetReserveAmmo(NSActor targetActor, int ammoID) +{ + if (!targetActor) { + return (0i); + } + + return targetActor.GetReserveAmmo(ammoID); +} + +bool +SVPF_actor_MaxAmmo(NSActor targetActor, int ammoID) +{ + /* deny anything funny */ + if (!targetActor) { + return (true); + } + + return targetActor.MaxAmmo(ammoID); +} + +string +SVPF_actor_GetInventory(NSActor targetActor) +{ + string outputString = ""; + NSItem m_listStart = targetActor.m_itemList; + + while (m_listStart) { + outputString = strcat(outputString, m_listStart.classname, " "); + m_listStart = m_listStart.m_nextItem; + } + + return (outputString); +} + +string +SVPF_util_TimeToString(int realTime, int zoneType, string formatString) +{ + /* supposed to take extra (optional parameters...) */ + if (zoneType == 1i) { + return strftime(true, formatString); + } else { + return strftime(true, formatString); + } +} + +bool +SVPF_exists_InPVS(entity testEntity, vector testCoord) +{ + return checkpvs(testCoord, testEntity); +} + +bool +SVPF_exists_InMap(string className) +{ + return find(world, ::classname, className) ? (true) : (false); +} + +bool +SVPF_exists_InVFS(string fileName) +{ + return fileExists(fileName); +} + +/* damage/combat */ +/* helper functions */ + +void +SVPF_combat_Damage(entity targetEnt, entity inflictingEnt, entity attackingEnt, string damageDef, vector damageOrigin, vector damageDir, vector hitLocation) +{ + NSSurfacePropEntity theTarget; + + /* common filters */ + if (targetEnt.takedamage == DAMAGE_NO) { + return; + } + + if (isGodMode(targetEnt) == true) { + return; + } + + theTarget = (NSSurfacePropEntity)targetEnt; + + /* don't use IsAlive(), else we can't gib */ + if (!theTarget.GetHealth()) { + return; + } + + NSDict findDecl = (NSDict)find(world, ::declclass, damageDef); + + if (findDecl) { + theTarget.Damage(inflictingEnt, attackingEnt, findDecl, 1.0, damageDir, hitLocation); + return; + } + + NSError("Cannot find decl %S for damage info.", damageDef); +} + +void +SVPF_combat_RadiusDamage(vector damageCenter, float damageRange, int damageMin, int damageMax, entity attackingEnt, string strDamageDecl) +{ + vector entPos = g_vec_null; + float entDistance = 0.0f; + int newDamage = 0i; + float damageFrac = 0.0f; + vector dmgDir = g_vec_null; + + for (NSSurfacePropEntity e = __NULL__; (e = (NSSurfacePropEntity)nextent(e));) { + if (e.takedamage == DAMAGE_NO) { + continue; + } + + entPos = e.WorldSpaceCenter(); + + /* don't bother if it's not anywhere near us */ + entDistance = length(damageCenter - entPos); + + if (entDistance > damageRange) { + continue; + } + + /* can we physically hit this thing? */ + if (damageMax > 0i) { + if (e.CanBeDamaged(damageCenter, entPos) == false) { + continue; + } + } + + /* calculate new damage values */ + damageFrac = (damageRange - entDistance) / damageRange; + newDamage = (int)lerp(fabs((float)damageMin), (float)damageMax, damageFrac); + dmgDir = dirFromTarget(damageCenter, entPos); + + if (e == attackingEnt) { + newDamage *= 0.5f; + } + + NSDict damageDecl; + + if (STRING_SET(strDamageDecl)) { + int declID = EntityDef_IDFromName(strDamageDecl); + damageDecl = NSDict::InitWithSpawnData(EntityDef_GetSpawnData(declID)); + } else { + damageDecl = spawn(NSDict); + } + + + damageDecl.AddKey("damage", itos(newDamage)); + e.Damage(attackingEnt, attackingEnt, damageDecl, 1.0, dmgDir, trace_endpos); + remove(damageDecl); + } +} + +void +SVPF_combat_Obituary(string targetName, string attackerName, string weaponDef, string meansOfDeath) +{ + obituary(targetName, attackerName, weaponDef, meansOfDeath); +} diff --git a/src/server/api_func.h b/src/server/api_func.h new file mode 100644 index 00000000..2a77c74e --- /dev/null +++ b/src/server/api_func.h @@ -0,0 +1,218 @@ +.float deaths; + +/** @defgroup serverAPI Server-side multiprogs API + @brief Server-side multiprogs API + @ingroup multiprogs + @ingroup server + +APIs used by MapC progs, game rules and the server progs exclusively. + +![Package](package_add.png) + +@{ +*/ + +/* Util library */ +typedef struct +{ + /** Returns the current time. + + @param realTime specifies the time in seconds since 01/01/1970. + @param zoneType specifies the time zone to use. 0 = UTC, 1 = Local. + @param formatString is a C-language, strftime styled string setting the output format + @return Euler-angles generated from the input. */ + string TimeToString(int realTime, int zoneType, string formatString); +} utilAPI_t; +var utilAPI_t util; + +/* Exists library */ +typedef struct +{ + bool InMap(string); + bool InPVS(entity, vector); + bool InVFS(string fileName); +} existsAPI_t; +var existsAPI_t exists; + +/* Ents library */ +typedef struct +{ + /** Creates a new entity of a given class name. + It is guaranteed to return an entity, unless you + have run out of memory. + + @param className the type of entity class to create. + @param spawnPos the position at which it should spawn. + @return The created entity. */ + entity Create(string className, vector spawnPos); + /** Precaches a given entity class. + Ensuring models, sounds and other assets referenced + within are loaded ahead of time. + + @param className to precache + @return Success. */ + bool Precache(string className); + /** Transitions an entity from one class to another. + + @param targetEntity is the target entity. + @param className is the class type to change targetEntity to. + @return The created entity. */ + entity ChangeToClass(entity targetEntity, string className); + /** Sends an input (See NSIO::Input) to an entity. + + While you're able to manipulate entities in most ways using bare MapC, you might want to change Nuclide specific attributes of them as well. This can only be done using the I/O system. + + For the variety of inputs an entity supports, please look at the respective entity-specific documentation. + + @param target is the entity which will receive the input + @param inputName is the name of the input. E.g. "SetOrigin" + @param dataString contains parameters for the input. E.g. "0 0 0" + @param activator references which entity is "responsible" for triggering this input. */ + entity Input(entity target, string inputName, string dataString, entity activator); + /** Returns true/false depending on if the entity is an AI character. + + @param entityToCheck specifies the entity to check.*/ + bool isAI(entity entityToCheck); + /** Returns true/false depending on if the entity is alive. + + @param entityToCheck specifies the entity to check.*/ + bool isAlive(entity entityToCheck); + /** Returns true/false depending on if the entity is in "god" mode. + + @param entityToCheck specifies the entity to check.*/ + bool isGodMode(entity entityToCheck); + /** Returns true/false depending on if the entity is a player. + + @param entityToCheck specifies the entity to check.*/ + bool isPlayer(entity entityToCheck); + /** Returns true/false depending on if the entity is either a player, or AI character. + + @param entityToCheck specifies the entity to check.*/ + bool isSentient(entity entityToCheck); + /** Returns true/false depending on if the entity is a bot. + + @param entityToCheck specifies the entity to check.*/ + bool isBot(entity entityToCheck); +} entsAPI_t; +var entsAPI_t ents; + +/* Game library */ +typedef struct +{ + void LoadNextMap(void); + void CleanUpMap(void); + string GetMap(void); + string GetNextMap(void); + void SetSpawnPoint(string); + void TeleportToSpawn(entity); +} gameAPI_t; +var gameAPI_t game; + +/* MOTD library */ +typedef struct +{ + void LoadDefault(void); + void LoadFromFile(string); +} motdAPI_t; +var motdAPI_t motd; + +/* MOTD library */ +typedef struct +{ + string GetInventory(entity); + int GetReserveAmmo(entity, int); + bool MaxAmmo(entity, int); +} actorAPI_t; +var actorAPI_t actor; + +typedef struct +{ + /** Applies damage to a given entity. + Requires the use of damageDef/entityDef since we're run out of parameters in QuakeC. + + @param targetEnt is the entity receiving the damage. + @param inflictingEnt is the entity causing the damage (e.g. a projectile, rocket) + @param attackingEnt is the entity owning up to the damage. + @param damageDef is the damageDef containing all the info, including damage points + @param damageOrigin is the location where the damage comes from. + @param damageDir is the direction the damage is coming from. + @param hitLocation is the final hit location, where the damage is applied. */ + void Damage(entity targetEnt, entity inflictingEnt, entity attackingEnt, string damageDef, vector damageOrigin, vector damageDir, vector hitLocation); + /** Does damage to all entities within a specified radius with a linear falloff. + If a negative damageMax value is supplied, then no collision checks will be performed. + So radiusDamage calls will not be obstructed by level or entity geometry. + + @param damageCenter is the location of the center, at which the wave originates. + @param damageRange is the radius (in game units) of the wave. + @param damageMax is the maximum damage that can be done by this wave. + @param damageMin is the minimum amount of damage done, at the very edge. + @param attackingEnt is the entity owning up to the damage. + @param attackingEnt is the entity owning up to the damage. */ + void RadiusDamage(vector damageCenter, float damageRange, int damageMin, int damageMax, entity attackingEnt, string damageDef); + /** Lets everyone in the game know that something, or something, has passed. + + @param targetName is the entity that has passed away. + @param attackerName is responsible. Can be empty. + @param weaponDef is the weapon used. Can be empty. + @param meansOfDeath is the additional means. Could mean something extra. */ + void Obituary(string targetName, string attackerName, string weaponDef, string meansOfDeath); +} combatAPI_t; +var combatAPI_t combat; + +/** @} */ // end of multiprogs + +__variant +linkToServerProgs(string funcName) +{ + static void empty(void) + { + print("Called unimplemented server-side API call.\n"); + breakpoint(); + } + + void *func = externvalue(0, funcName); + + if (func) { + return ((__variant)func); + } else { + return (empty); + } +} + +void +_server_main(void) +{ + game.LoadNextMap = linkToServerProgs("SVPF_game_LoadNextMap"); + game.CleanUpMap = linkToServerProgs("SVPF_game_CleanUpMap"); + game.GetMap = linkToServerProgs("SVPF_game_GetMap"); + game.GetNextMap = linkToServerProgs("SVPF_game_GetNextMap"); + game.SetSpawnPoint = linkToServerProgs("SVPF_game_SetSpawnPoint"); + game.TeleportToSpawn = linkToServerProgs("SVPF_game_TeleportToSpawn"); + + combat.Damage = linkToServerProgs("SVPF_combat_Damage"); + combat.RadiusDamage = linkToServerProgs("SVPF_combat_RadiusDamage"); + combat.Obituary = linkToServerProgs("SVPF_combat_Obituary"); + + ents.Create = linkToServerProgs("spawnClass"); + ents.ChangeToClass = linkToServerProgs("changeClass"); + ents.Precache = linkToServerProgs("EntityDef_Precache"); + ents.Input = linkToServerProgs("sendInput"); + ents.isAI = linkToServerProgs("isAI"); + ents.isAlive = linkToServerProgs("isAlive"); + ents.isGodMode = linkToServerProgs("isGodMode"); + ents.isPlayer = linkToServerProgs("isPlayer"); + ents.isSentient = linkToServerProgs("isSentient"); + + actor.GetInventory = linkToServerProgs("SVPF_actor_GetInventory"); + actor.GetReserveAmmo = linkToServerProgs("SVPF_actor_GetReserveAmmo"); + actor.MaxAmmo = linkToServerProgs("SVPF_actor_MaxAmmo"); + + exists.InMap = linkToServerProgs("SVPF_exists_InMap"); + exists.InVFS = linkToServerProgs("SVPF_exists_InVFS"); + exists.InPVS = linkToServerProgs("SVPF_exists_InPVS"); + + motd.LoadDefault = linkToServerProgs("MOTD_LoadDefault"); + motd.LoadFromFile = linkToServerProgs("MOTD_LoadFromFile"); + + util.TimeToString = linkToServerProgs("SVPF_util_TimeToString"); +} diff --git a/src/server/cmd_cl.qc b/src/server/cmd_cl.qc index 43b4421b..13646bc9 100644 --- a/src/server/cmd_cl.qc +++ b/src/server/cmd_cl.qc @@ -29,7 +29,7 @@ Cmd_ParseClientCommand(NSClient sender, string cmd, int commandArguments) if (commandArguments == 2) { g_grMode.ChatMessageTeam(sender, argv(1)); } else { - g_grMode.ChatMessageTeam(sender, substring(cmd, 10, -2)); + g_grMode.ChatMessageTeam(sender, substring(cmd, 9, -1)); } break; case "spectate": @@ -78,7 +78,10 @@ Cmd_ParseClientCommand(NSClient sender, string cmd, int commandArguments) case "listAmmo": Ammo_DebugList(); break; + case "joinTeam": + g_grMode.PlayerRequestTeam((NSClientPlayer)sender, (int)stoi(argv(1))); + break; default: clientcommand(sender, cmd); } -} \ No newline at end of file +} diff --git a/src/server/cmd_sv.qc b/src/server/cmd_sv.qc index f51f3ef3..bdff96c5 100644 --- a/src/server/cmd_sv.qc +++ b/src/server/cmd_sv.qc @@ -112,7 +112,7 @@ CMD_Input(void) if (inputTarget) { inputTarget.Input(self, inputName, inputData); - print(sprintf("Sending input to %d, %S: %S\n", entNum, inputName, inputData)); + printf("Sending input to %d, %S: %S\n", entNum, inputName, inputData); } } @@ -121,7 +121,7 @@ CMD_ListTargets(void) { for (entity a = world; (a = findfloat(a, ::identity, 1));) { if (a.targetname) { - print(sprintf("%d: %s (%s)\n", num_for_edict(a), a.targetname, a.classname)); + printf("%d: %s (%s)\n", num_for_edict(a), a.targetname, a.classname); } } } @@ -181,6 +181,23 @@ CMD_Spawn(void) setorigin(unit, trace_endpos); } +static void +CMD_PropSpawn(void) +{ + string newModel = argv(1); + makevectors(self.v_angle); + traceline(self.origin, self.origin + (v_forward * 1024), MOVE_NORMAL, self); + + prop_physics newProp = spawn(prop_physics); + newProp.SetModel(newModel); + newProp.SetOriginUnstick(trace_endpos + [0,0,32]); + newProp.Spawn(); + newProp.SetModel(newModel); + newProp.SetOriginUnstick(trace_endpos + [0,0,32]); + newProp.ClearVelocity(); + newProp.Wake(); +} + bool Cmd_ParseServerCommand(void) { @@ -227,6 +244,9 @@ Cmd_ParseServerCommand(void) case "spawnDef": CMD_Spawn(); break; + case "propSpawn": + CMD_PropSpawn(); + break; #ifdef BOT_INCLUDED case "way": NodeEdit_Cmd(); @@ -245,4 +265,4 @@ Cmd_ParseServerCommand(void) return (false); } return (true); -} \ No newline at end of file +} diff --git a/src/server/defs.h b/src/server/defs.h index 2df9d398..8411c938 100644 --- a/src/server/defs.h +++ b/src/server/defs.h @@ -14,6 +14,8 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "api_func.h" +#include "../shared/api.h" #include "../shared/entityDef.h" #include "NSOutput.h" #include "NSGameRules.h" @@ -127,7 +129,6 @@ NSEntity g_dmg_eTarget; int g_dmg_iDamage; bodyType_t g_dmg_iHitBody; int g_dmg_iFlags; -int g_dmg_iWeapon; vector g_dmg_vecLocation; var bool g_ents_initialized = FALSE; diff --git a/src/server/entry.qc b/src/server/entry.qc index f06f8616..e3874c42 100644 --- a/src/server/entry.qc +++ b/src/server/entry.qc @@ -43,13 +43,15 @@ The `self` global is the connecting client in question. void ClientConnect(void) { + EntityDef_SpawnClassname("player"); self.gotData = false; /* don't carry over team settings from a previous session */ - forceinfokey(self, "*team", "0"); + self.team = TEAM_CONNECTING; + self.flags |= FL_CLIENT; + userinfo.SetString(self, "*team", "0"); if (g_ents_initialized) { - Entity_CreateClass("player"); g_grMode.PlayerConnect((NSClientPlayer)self); } } @@ -61,8 +63,9 @@ This means the fields will still be accessible inside of this function. void ClientDisconnect(void) { - if (g_ents_initialized) + if (g_ents_initialized) { g_grMode.PlayerDisconnect((NSClientPlayer)self); + } /* this will hide/remove the player from other clients */ NSClientPlayer pl = (NSClientPlayer)self; @@ -86,8 +89,9 @@ The `self` global is the client issuing the command. void ClientKill(void) { - if (g_ents_initialized) + if (g_ents_initialized) { g_grMode.PlayerKill((NSClientPlayer)self); + } } /** This is run every frame on every spectator. @@ -110,7 +114,7 @@ The `self` global is the connecting NSClientSpectator in question. void SpectatorConnect(void) { - spawnfunc_NSClientSpectator(); + ents.ChangeToClass(self, "spectator"); } /** Called when a NSClientSpectator leaves the server. @@ -131,12 +135,15 @@ past levels for the player in question. void PutClientInServer(void) { - if (g_ents_initialized) + /* we're officially in-game now. */ + self.team = TEAM_UNASSIGNED; + + if (g_ents_initialized) { g_grMode.PlayerSpawn((NSClientPlayer)self); + } /* handle transitions */ if (fileExists("data/trans.dat")) { - for (entity a = world; (a = findfloat(a, ::identity, 1));) { NSEntity levelEnt = (NSEntity)a; levelEnt.TransitionComplete(); @@ -155,8 +162,9 @@ PutClientInServer(void) for (entity a = world; (a = find(a, ::targetname, "game_playerspawn"));) { NSEntity t = (NSEntity)a; - if (t.Trigger) + if (t.Trigger) { t.Trigger(self, TRIG_TOGGLE); + } } /* the game and its triggers start when the player is ready to see it */ @@ -191,8 +199,9 @@ PlayerPreThink(void) } #endif - if (g_ents_initialized) + if (g_ents_initialized) { g_grMode.PlayerPreFrame((NSClientPlayer)self); + } } /** Run after game physics have taken place. @@ -221,7 +230,7 @@ PlayerPostThink(void) NSClientPlayer pl = (NSClientPlayer)self; g_grMode.PlayerPostFrame((NSClientPlayer)self); pl.EvaluateEntity(); - forceinfokey(pl, "*score", ftos(pl.score)); + userinfo.SetString(pl, "*score", ftos(pl.score)); } } @@ -286,6 +295,8 @@ SV_RunClientCommand(void) BreakModel_SendClientData(self); self.gotData = true; } + + self.impulse = 0; } /** Any 'cmd' from the client get sent here and handled. @@ -320,13 +331,16 @@ init(float prevprogs) NSLog("Built: %s %s", __DATE__, __TIME__); NSLog("QCC: %s", __QCCVER__); + _server_main(); + _shared_main(); + Skill_Init(); EntityDef_Init(); Ammo_Init(); MapTweaks_Init(); MapC_Init(); - Plugin_Init(); + Plugin_Init(); Constants_Init(); Sound_Init(); PropData_Init(); @@ -334,7 +348,7 @@ init(float prevprogs) DecalGroups_Init(); /* DO NOT EVER CHANGE THESE. */ - cvar_set("r_meshpitch", "1"); + cvars.SetString("r_meshpitch", "1"); /* ENGINE, PLS FIX */ input_cursor_entitynumber = 0; @@ -346,20 +360,21 @@ method called at the beginning of them having spawned. void init_respawn(void) { - int endspawn = 0; + int spawnCounter = 0i; - if (g_ents_initialized) + if (g_ents_initialized) { g_grMode.InitPostEnts(); + } /* of all the map entities that we wanted to spawn, how many are left? */ for (entity a = world; (a = findfloat(a, ::_mapspawned, true));) { - endspawn++; + NSEntity ent = (NSEntity)a; + ent.Respawn(); + spawnCounter++; } - NSLog("...%i entities spawned (%i inhibited)", g_ent_spawned, g_ent_spawned - endspawn); - + NSLog("...%i entities spawned (%i inhibited)", g_ent_spawned, g_ent_spawned - spawnCounter); Nodes_Init(); - remove(self); } @@ -376,8 +391,6 @@ initents(void) MOTD_Init(); PMove_Init(); - /** compat... */ - Sound_Precache("Player.GaspLight"); Sound_Precache("Player.GaspHeavy"); Sound_Precache("Player.WaterEnter"); @@ -398,7 +411,7 @@ initents(void) if (!g_grMode) { Game_InitRules(); - forceinfokey(world, "mode", g_grMode.Title()); + serverinfo.SetString("mode", g_grMode.Title()); } Game_Worldspawn(); @@ -412,16 +425,17 @@ initents(void) g_respawntimer.nextthink = time + 0.1f; /* menu background lock */ - if (cvar("sv_background") == 1) { - forceinfokey(world, "background", "1"); + if (cvars.GetBool("sv_background") == true) { + /* trade them in. */ + serverinfo.SetBool("background", true); localcmd("sv_background 0\n"); } else { - forceinfokey(world, "background", "0"); + serverinfo.SetBool("background", false); } /* the maxclients serverinfo key? yeah, that one lies to the client. so * let's add our own that we can actually trust. */ - forceinfokey(world, "sv_playerslots", cvar_string("sv_playerslots")); + serverinfo.SetInteger("sv_playerslots", cvars.GetInteger("sv_playerslots")); MapC_CallMainFunction(); Plugin_InitEnts(); @@ -432,10 +446,10 @@ initents(void) g_ents_initialized = TRUE; /* engine hacks for dedicated servers */ - cvar_set("s_nominaldistance", "1536"); + cvars.SetFloat("s_nominaldistance", 1536); /* other engine hacks */ - cvar_set("sv_nqplayerphysics", "0"); + cvars.SetBool("sv_nqplayerphysics", false); #ifdef BOT_INCLUDED BotLib_Init(); @@ -471,9 +485,11 @@ ConsoleCmd(string cmd) pl = (NSClientPlayer)self; /* give the game-mode a chance to override us */ - if (g_ents_initialized) - if (g_grMode.ConsoleCommand(pl, cmd) == TRUE) + if (g_ents_initialized) { + if (g_grMode.ConsoleCommand(pl, cmd) == TRUE) { return (1); + } + } /* time to handle commands that apply to all games */ tokenize(cmd); @@ -486,19 +502,19 @@ is being executed. float SV_ShouldPause(float newstatus) { - if (serverkeyfloat("background") == 1) { + if (serverinfo.GetFloat("background") == 1) { return (0); } - if (cvar("pausable") == 1) { + if (cvars.GetFloat("pausable") == 1) { return (1); } - if (cvar("sv_playerslots") > 1) { + if (cvars.GetFloat("sv_playerslots") > 1) { return (0); } - return newstatus; + return (newstatus); } //#define REEDICT 1 @@ -652,6 +668,7 @@ SV_PerformSave(float fh, float entcount, float playerslots) num_saved++; } fclose(fh); + NSLog("saved %i entities", num_saved); } @@ -666,6 +683,7 @@ CheckSpawn(void() spawnfunc) NSEntity ent = (NSEntity)self; string desiredClass = ent.classname; static string lastClass; + bool skipLoad = false; /* cancel out early */ if (ent == world) { @@ -680,9 +698,9 @@ CheckSpawn(void() spawnfunc) __fullspawndata = ""; if (MapTweak_EntitySpawn(ent) == true) { - ; + skipLoad = true; } else if (EntityDef_SpawnClassname(desiredClass) != __NULL__) { - ; + skipLoad = true; } else if (spawnfunc) { spawnfunc(); ent.classname = desiredClass; @@ -707,25 +725,19 @@ CheckSpawn(void() spawnfunc) return; } - /* this entity is good, attempt to spawn it. */ - if (ent.m_strSpawnData) { - for (int i = 1; i < (tokenize(ent.m_strSpawnData) - 1); i += 2) { - ent.SpawnKey(argv(i), argv(i+1)); + ent._mapspawned = true; + + if (skipLoad == false) { + /* this entity is good, attempt to spawn it. */ + if (ent.m_strSpawnData) { + for (int i = 1; i < (tokenize(ent.m_strSpawnData) - 1); i += 2) { + ent.SpawnKey(argv(i), argv(i+1)); + } } + + ent.Spawn(); } /* count and mark as map spawned */ - ent._mapspawned = true; g_ent_spawned++; - - /* has to be called once, after the spawn values have been read in. */ - ent.Spawned(); - - /* entity may be marked as deleted */ - if (wasfreed(ent)) { - return; - } - - /* needs to be called at least once after spawn, then any time after. */ - ent.Respawn(); } diff --git a/src/server/include.src b/src/server/include.src index bbe81746..8d3b0056 100644 --- a/src/server/include.src +++ b/src/server/include.src @@ -14,4 +14,5 @@ cmd_cl.qc cmd_sv.qc entry.qc ../nav/includes.src +api.qc #endlist diff --git a/src/server/logging.qc b/src/server/logging.qc index c27e0f98..5f47b9ba 100644 --- a/src/server/logging.qc +++ b/src/server/logging.qc @@ -28,8 +28,8 @@ Logging_Pickup(entity cl, entity it, string altname) } if (altname) { - print(sprintf("%s picked up %s\n", cl.netname, altname)); + printf("%s picked up %s\n", cl.netname, altname); } else { - print(sprintf("%s picked up %s\n", cl.netname, it.classname)); + printf("%s picked up %s\n", cl.netname, it.classname); } } diff --git a/src/server/mapC.h b/src/server/mapC.h deleted file mode 100644 index 294aaee1..00000000 --- a/src/server/mapC.h +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (c) 2024 Vera Visions LLC. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER - * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#pragma target fte_5768 -#define QWSSQC - -/* MapProgs are map specific QuakeC progs. - Include this file with YOUR MapProgs! */ - -#include "../shared/fteextensions.qc" -#include "../shared/global.h" -#include "mapC_math.h" -#include "mapC_weapons.h" - -.float deaths; - -/** @defgroup mapc MapC - @brief MapC/Shared Game-Logic API - @ingroup multiprogs - -APIs used by MapC progs and the server progs exclusively. - -@{ -*/ - -/** Spawns an entity of a specific class. - -This is the primary, encouraged method of spawning entities in MapC. -If you don't spawn an entity class using this, it will not respond to sendInput(). - -If a specified class does not exist, it will create an info_notnull type entity, but with the new, desired classname. - -The only time when this function returns __NULL__ is if the server is unable to allocated any more entities. - -@param className is the type of class to be instantiated. -@param desiredPos is the world position at which the new entity will be placed. */ -entity -spawnClass(string className, vector desiredPos) -{ - entity(string, vector) spawnFunc = externvalue(0, "spawnClass"); - return spawnFunc(className, desiredPos); -} - -bool -changeClass(entity target, string newClass) -{ - bool(entity, string) spawnFunc = externvalue(0, "changeClass"); - return spawnFunc(target, newClass); -} - -bool -cacheEntityDef(string className) -{ - bool(string) spawnFunc = externvalue(0, "EntityDef_Precache"); - return spawnFunc(className); -} - -/** Sends an input (See NSIO::Input) to an entity. - -While you're able to manipulate entities in most ways using bare MapC, you might want to change Nuclide specific attributes of them as well. This can only be done using the I/O system. - -For the variety of inputs an entity supports, please look at the respective entity-specific documentation. - -@param target is the entity which will receive the input -@param inputName is the name of the input. E.g. "SetOrigin" -@param dataString contains parameters for the input. E.g. "0 0 0" -@param activator references which entity is "responsible" for triggering this input. */ -void -sendInput(entity target, string inputName, string dataString, entity activator) -{ - void(entity, string, string, entity) inputFunc = externvalue(0, "sendInput"); - inputFunc(target, inputName, dataString, activator); -} - -/** Applies damage to a given entity. -Requires the use of damageDef/entityDef since we're run out of parameters in QuakeC. - -@param targetEnt is the entity receiving the damage. -@param inflictingEnt is the entity causing the damage (e.g. a projectile, rocket) -@param attackingEnt is the entity owning up to the damage. -@param damageDef is the damageDef containing all the info, including damage points -@param weaponDef is (if not "") the name of the weapon causing the damage. -@param damageOrigin is the location where the damage comes from. -@param damageDir is the direction the damage is coming from. -@param hitLocation is the final hit location, where the damage is applied. */ -void -entityDamage(entity targetEnt, entity inflictingEnt, entity attackingEnt, string damageDef, string weaponDef, vector damageOrigin, vector damageDir, vector hitLocation) -{ - void(entity,entity,entity,string,string,vector,vector,vector) checkFunc = externvalue(0, "entityDamage"); - return checkFunc(targetEnt, inflictingEnt, attackingEnt, damageDef, weaponDef, damageOrigin, damageDir, hitLocation); -} - -/** Does damage to all entities within a specified radius with a linear falloff. -If a negative damageMax value is supplied, then no collision checks will be performed. -So radiusDamage calls will not be obstructed by level or entity geometry. - -@param damageCenter is the location of the center, at which the wave originates. -@param damageRange is the radius (in game units) of the wave. -@param damageMax is the maximum damage that can be done by this wave. -@param damageMin is the minimum amount of damage done, at the very edge. -@param attackingEnt is the entity owning up to the damage. */ -void -radiusDamage(vector damageCenter, float damageRange, int damageMin, int damageMax, entity attackingEnt) -{ - void(vector, float, int, int, entity) checkFunc = externvalue(0, "radiusDamage"); - return checkFunc(damageCenter, damageRange, damageMin, damageMax, attackingEnt); -} - - -/** Returns true/false depending on if the entity is an AI character. - -@param entityToCheck specifies the entity to check.*/ -bool -isAI(entity entityToCheck) -{ - bool(entity) checkFunc = externvalue(0, "isAI"); - return checkFunc(entityToCheck); -} - -/** Returns true/false depending on if the entity is alive. - -@param entityToCheck specifies the entity to check.*/ -bool -isAlive(entity entityToCheck) -{ - bool(entity) checkFunc = externvalue(0, "isAlive"); - return checkFunc(entityToCheck); -} - -/** Returns true/false depending on if the entity is in "god" mode. - -@param entityToCheck specifies the entity to check.*/ -bool -isGodMode(entity entityToCheck) -{ - bool(entity) checkFunc = externvalue(0, "isGodMode"); - return checkFunc(entityToCheck); -} - -/** Returns true/false depending on if the entity is a player. - -@param entityToCheck specifies the entity to check.*/ -bool -isPlayer(entity entityToCheck) -{ - bool(entity) checkFunc = externvalue(0, "isPlayer"); - return checkFunc(entityToCheck); -} - -/** Returns true/false depending on if the entity is either a player, or AI character. - -@param entityToCheck specifies the entity to check.*/ -bool -isSentient(entity entityToCheck) -{ - bool(entity) checkFunc = externvalue(0, "isSentient"); - return checkFunc(entityToCheck); -} - -/** Returns true/false depending on if the entity is a bot. - -@param entityToCheck specifies the entity to check.*/ -bool -isBot(entity entityToCheck) -{ - bool(entity) checkFunc = externvalue(0, "isBot"); - return checkFunc(entityToCheck); -} - -/* misc helper functions. */ - -/** Returns the current time. - -@param realTime specifies the time in seconds since 01/01/1970. -@param zoneType specifies the time zone to use. 0 = UTC, 1 = Local. -@param formatString is a C-language, strftime styled string setting the output format -@return Euler-angles generated from the input. */ -string -timeToString(int realTime, int zoneType, string formatString) -{ - /* supposed to take extra (optional parameters...) */ - if (zoneType == 1i) { - return strftime(true, formatString); - } else { - return strftime(true, formatString); - } -} - -/** Returns the the value of a console variable. - -@param cvarName specifies the console variable to query. -@return The value in string format. */ -string -getCvar(string cvarName) -{ - return cvar_string(cvarName); -} - -/** Returns the the value of a console variable. - -@param cvarName specifies the console variable to query. -@return The value in integer format. */ -int -getCvarInt(string cvarName) -{ - return (int)cvar(cvarName); -} - -/** Returns the the value of a console variable. - -@param cvarName specifies the console variable to query. -@return The value in integer format. */ -bool -fileExists(string fileName) -{ - bool(string) checkFunc = externvalue(0, "fileExists"); - return checkFunc(fileName); -} - -/** Sets the specified serverinfo key to a set value. - -@param serverKey specifies the serverinfo key to set. -@param setValue specifies the value of said key. */ -void -setServerInfo(string serverKey, string setValue) -{ - void(string, string) checkFunc = externvalue(0, "setServerInfo"); - checkFunc(serverKey, setValue); -} - -/** Returns the the value of a serverinfo key. - -@param serverKey specifies the serverinfo key to query. -@return The value in string format. */ -string -getServerInfo(string serverKey) -{ - string(string) checkFunc = externvalue(0, "getServerInfo"); - return checkFunc(serverKey); -} - -/** Sets the specified userinfo key to a set value. - -@param clientEntity specifies the client to poke. -@param userKey specifies the userinfo key to set. -@param setValue specifies the value of said key. */ -void -setUserInfo(entity clientEntity, string userKey, string setValue) -{ - void(entity, string, string) checkFunc = externvalue(0, "setUserInfo"); - checkFunc(clientEntity, userKey, setValue); -} - -/** Returns the the value of a userinfo key. - -@param clientEntity specifies the client to peek at. -@param userKey specifies the userinfo key to query. -@return The value in string format. */ -string -getUserInfo(entity clientEntity, string userKey) -{ - string(entity, string) checkFunc = externvalue(0, "getUserInfo"); - return checkFunc(clientEntity, userKey); -} - -entity -getSpawnpoint(string className) -{ - entity(string) checkFunc = externvalue(0, "Spawn_SelectRandom"); - return checkFunc(className); -} - -entity -placeSpawnpoint(entity targetEntity) -{ - entity(entity) checkFunc = externvalue(0, "placeSpawnpoint"); - return checkFunc(targetEntity); -} - -void -obituary(string A, string B, string C, string D) -{ - void(string, string, string, string) checkFunc = externvalue(0, "obituary"); - checkFunc(A,B,C,D); -} - -void -damage(entity targetEntity, entity inflictingEntity, entity attackingEntity, int damagePoints, int damageFlags, string meansOfDeath, string weaponDef, vector damageOrigin, vector damageDir, string hitLocation, float timeOffset) -{ - -} - -/** @} */ // end of multiprogs \ No newline at end of file diff --git a/src/server/mapC_weapons.h b/src/server/mapC_weapons.h deleted file mode 100644 index 363c246e..00000000 --- a/src/server/mapC_weapons.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2024 Vera Visions LLC. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER - * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING - * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/** @defgroup mapc_weapons MapC: Weapons - @brief Server-side plugin wrappers for weapon related functions. - @ingroup multiprogs - - @{ -*/ - -string -weaponType(string weaponDef) -{ - string(string) spawnFunc = externvalue(0, "weaponType"); - return spawnFunc(weaponDef); -} - -int -weaponStartAmmo(string weaponDef) -{ - int(string) spawnFunc = externvalue(0, "weaponStartAmmo"); - return spawnFunc(weaponDef); -} - -int -weaponMaxAmmo(string weaponDef) -{ - int(string) spawnFunc = externvalue(0, "weaponMaxAmmo"); - return spawnFunc(weaponDef); -} - -bool -weaponIsSemiAuto(string weaponDef) -{ - bool(string) spawnFunc = externvalue(0, "weaponIsSemiAuto"); - return spawnFunc(weaponDef); -} - -string -weaponInventoryType(string weaponDef) -{ - string(string) spawnFunc = externvalue(0, "weaponInventoryType"); - return spawnFunc(weaponDef); -} - -float -weaponFireTime(string weaponDef) -{ - float(string) spawnFunc = externvalue(0, "weaponFireTime"); - return spawnFunc(weaponDef); -} - -int -weaponClipSize(string weaponDef) -{ - int(string) spawnFunc = externvalue(0, "weaponClipSize"); - return spawnFunc(weaponDef); -} - -string -weaponClass(string weaponDef) -{ - string(string) spawnFunc = externvalue(0, "weaponClass"); - return spawnFunc(weaponDef); -} - -bool -isWeaponClipOnly(string weaponDef) -{ - bool(string) spawnFunc = externvalue(0, "isWeaponClipOnly"); - return spawnFunc(weaponDef); -} - -bool -isWeaponDetonationTimed(string weaponDef) -{ - bool(string) spawnFunc = externvalue(0, "isWeaponDetonationTimed"); - return spawnFunc(weaponDef); -} - -/** @} */ // end of mapc_weapons diff --git a/src/server/mapcycle.qc b/src/server/mapcycle.qc index 599b7b9e..8418b08a 100644 --- a/src/server/mapcycle.qc +++ b/src/server/mapcycle.qc @@ -32,8 +32,9 @@ Mapcycle_Load(string filename) /* read the lines in, see if the map exists and define an enumerated alias */ while ((temp = fgets(fs_mapcycle))) { - if (fileExists(strcat("maps/", temp, ".bsp")) == false) + if (fileExists(strcat("maps/", temp, ".bsp")) == false) { continue; + } localcmd(sprintf("alias m%i \"map %s;alias nextmap m%i\"\n", mapCount, temp, mapCount + 1i)); @@ -73,7 +74,7 @@ Mapcycle_Init(void) InitStart(); /* in case some server admin wants a map to continously loop */ - if (cycleFile == "") { + if (!STRING_SET(cycleFile)) { NSLog("MapCycle disabled via cvar. Skipping."); localcmd("alias nextmap map_restart 0\n"); return; diff --git a/src/server/maptweaks.qc b/src/server/maptweaks.qc index a9eba526..57a5e85d 100644 --- a/src/server/maptweaks.qc +++ b/src/server/maptweaks.qc @@ -31,6 +31,7 @@ static mapTweak_t *g_mapTweakTable; static int g_mapTweakCount; +const string g_maptweakFile = "scripts/maptweaks.txt"; void MapTweaks_Init(void) @@ -42,7 +43,7 @@ MapTweaks_Init(void) InitStart(); - tweakFile = fopen("scripts/maptweaks.txt", FILE_READ); + tweakFile = fopen(g_maptweakFile, FILE_READ); g_mapTweakCount = 0; tempString = newCvar = newInfo = newItem = ""; @@ -55,7 +56,7 @@ MapTweaks_Init(void) } } } else { - NSError("Missing file scripts/maptweaks.txt"); + NSWarning("No map tweaks, missing %S", g_maptweakFile); InitEnd(); return; } @@ -163,7 +164,7 @@ static bool MapTweak_FinishSpawn(entity targetEntity, string newClassname) { /* found the edef alternative. */ - if (EntityDef_SwitchClass(targetEntity, newClassname) != __NULL__) { + if (ents.ChangeToClass((NSEntity)targetEntity, newClassname) != __NULL__) { return (true); } diff --git a/src/server/scripts.h b/src/server/scripts.h index bf7c1497..a7f6bd54 100644 --- a/src/server/scripts.h +++ b/src/server/scripts.h @@ -21,11 +21,15 @@ void MapC_CallMainFunction(void); void MapC_CallNamedFunction(entity, string); bool RuleC_CallFunc(float, entity, string); +bool RuleC_CallFrame(float, string); bool RuleC_CallDamage(float, entity, entity, entity, string, string); bool RuleC_CallRequestSpawn(float, entity, string); +bool RuleC_CallRequestTeam(float, entity, int, string); bool RuleC_CallString(float, entity, string, string); bool RuleC_CallFloat(float, entity, float, string); +int RuleC_CallMaxItemsPerSlot(float, int, string); +void RuleC_CallInput(float, entity, string, string); diff --git a/src/server/scripts.qc b/src/server/scripts.qc index 5127e21b..9cb807d2 100644 --- a/src/server/scripts.qc +++ b/src/server/scripts.qc @@ -26,12 +26,24 @@ MapC_Init(void) /* No mapname.dat, exit out */ if (fileExists(mapProgs) == false) { - NSError("MapC for level %s at %S does not exist.", mapname, mapProgs); + NSWarning("No MapC for level %s loaded. (%s)", cvar_string("mapname"), mapProgs); return; } NSLog("...adding MapC progs %S",mapProgs); g_mapCProgs = addprogs(mapProgs); + + if (g_mapCProgs > 0) { + void(void) mainFunction; + mainFunction = externvalue(g_mapCProgs, "main"); + + if (mainFunction) { + externset(g_mapCProgs, world, "self"); + mainFunction(); + } else { + NSError("%s does not have a main function.", mapProgs); + } + } } void @@ -82,6 +94,25 @@ RuleC_CallFunc(float progsNum, entity pl, string funcName) return (false); } +bool +RuleC_CallFrame(float progsNum, string funcName) +{ + if (progsNum) { + void(void) mainFunction; + mainFunction = externvalue(progsNum, funcName); + + if (mainFunction) { + entity oldSelf = self; + externset(progsNum, frametime, "frametime"); + self = world; + mainFunction(); + self = oldSelf; + return (true); + } + } + + return (false); +} bool RuleC_CallDamage(float progsNum, entity target, entity inflictor, entity attacker, string weapon, string funcName) @@ -126,6 +157,28 @@ RuleC_CallRequestSpawn(float progsNum, entity pl, string funcName) return (returnValue); } +bool +RuleC_CallRequestTeam(float progsNum, entity pl, int teamNum, string funcName) +{ + bool returnValue = false; + + if (progsNum) { + bool(int) mainFunction; + mainFunction = externvalue(progsNum, funcName); + + if (mainFunction) { + entity oldSelf = self; + externset(progsNum, pl, "self"); + self = pl; + returnValue = mainFunction(teamNum); + self = oldSelf; + return (returnValue); + } + } + + return (returnValue); +} + bool RuleC_CallString(float progsNum, entity pl, string targetString, string funcName) { @@ -169,3 +222,36 @@ RuleC_CallFloat(float progsNum, entity pl, float targetFloat, string funcName) return (returnValue); } + +int +RuleC_CallMaxItemsPerSlot(float progsNum, int targetFloat, string funcName) +{ + int returnValue = -1i; + + if (progsNum) { + int(int) mainFunction; + mainFunction = externvalue(progsNum, funcName); + + if (mainFunction) { + returnValue = mainFunction(targetFloat); + return (returnValue); + } + } + + return (returnValue); +} + + + +void +RuleC_CallInput(float progsNum, entity activator, string inputName, string inputData) +{ + if (progsNum) { + void(entity, string, string) mainFunction; + mainFunction = externvalue(progsNum, "CodeCallback_Input"); + + if (mainFunction) { + mainFunction(activator, inputName, inputData); + } + } +} diff --git a/src/server/skill.qc b/src/server/skill.qc index ffe06746..4d1c6db4 100644 --- a/src/server/skill.qc +++ b/src/server/skill.qc @@ -27,7 +27,7 @@ This will almost always result in them using default values, or (worst case) 0. void Skill_Init(void) { - string mapSkillFile = sprintf("maps/%s_skl.cfg", serverkey("mapname")); + string mapSkillFile = sprintf("maps/%s_skl.cfg", serverinfo.GetString("mapname")); Skill_ParseConfig("cfg/skill_manifest.cfg"); @@ -46,17 +46,17 @@ Return a skill variable's value or return a defaultValue if it's undefined. float Skill_GetValue(string variable, float defaultValue) { - float skill = cvar("skill"); + float skill = cvars.GetFloat("skill"); if (skill == 0) { skill = 2; /* default to medium */ } - float val = fabs(cvar(sprintf("sk_%s%d", variable, skill))); + float val = fabs(cvars.GetFloat(sprintf("sk_%s%d", variable, skill))); /* specific skill variable doesn't exist? */ if (val == 0) { - val = fabs(cvar(sprintf("sk_%s", variable))); + val = fabs(cvars.GetFloat(sprintf("sk_%s", variable))); } return (val == 0) ? defaultValue : val; @@ -71,11 +71,11 @@ Skill_GetStringValue(string variable, string defaultValue) skill = 2; /* default to medium */ } - string val = cvar_string(sprintf("sk_%s%d", variable, skill)); + string val = cvars.GetString(sprintf("sk_%s%d", variable, skill)); /* specific skill variable doesn't exist? */ if (val == 0) { - val = cvar_string(sprintf("sk_%s", variable)); + val = cvars.GetString(sprintf("sk_%s", variable)); } return (val == "") ? defaultValue : val; @@ -101,11 +101,11 @@ Skill_ParseConfig(string fileName) Skill_ParseConfig(sprintf("cfg/%s", argv(1))); } else { /* some games, like Source, don't use set/seta */ - cvar_set(argv(0), argv(1)); + cvars.SetString(argv(0), argv(1)); } } else if (argCount == 3i) { if (firstArg == "set" || firstArg == "seta") - cvar_set(argv(1), argv(2)); + cvars.SetString(argv(1), argv(2)); } } diff --git a/src/server/spawn.qc b/src/server/spawn.qc index b5acc427..eaa3ecb4 100644 --- a/src/server/spawn.qc +++ b/src/server/spawn.qc @@ -142,3 +142,30 @@ entity Spawn_SelectRandom(string cname) lastspot = spot; return spot; } + + +void +Spawn_TeleportToSpawn(entity targetEnt) +{ + string desiredSpawn = teams.SpawnPoint((int)targetEnt.team); + + /* singleplayer */ + if (STRING_SET(startspot)) { + targetEnt.origin = Landmark_GetSpot(); + setorigin_safe(targetEnt, targetEnt.origin); + return; + } + + /* if not set, don't bother teleporting */ + if (!STRING_SET(desiredSpawn)) { + return; + } + + entity spawnPoint = Spawn_SelectRandom(desiredSpawn); + + if (spawnPoint) { + targetEnt.origin = spawnPoint.origin; + targetEnt.angles = spawnPoint.angles; + setorigin_safe(targetEnt, targetEnt.origin); + } +} diff --git a/src/server/vote.qc b/src/server/vote.qc index 20cc8bab..6a5122f0 100644 --- a/src/server/vote.qc +++ b/src/server/vote.qc @@ -39,9 +39,9 @@ Make sure all the cached stuff is reset. void Vote_Reset(void) { - forceinfokey(world, "votes_y", "0"); - forceinfokey(world, "votes_n", "0"); - forceinfokey(world, "vote_cmd", ""); + serverinfo.SetFloat("votes_y", 0); + serverinfo.SetFloat("votes_n", 0); + serverinfo.SetString("vote_cmd", ""); for (entity e = world; (e = find(e, ::classname, "player"));) { NSClientPlayer pl = (NSClientPlayer)e; @@ -95,7 +95,7 @@ Vote_Frame(void) if (time >= g_flVoteTime) { if (g_iVoteState == VOTE_INPROGRESS) { - if (serverkeyfloat("votes_y") > serverkeyfloat("votes_n")) { + if (serverinfo.GetFloat("votes_y") > serverinfo.GetFloat("votes_n")) { Vote_Passed(); } else { Vote_Failed(); @@ -131,7 +131,7 @@ CSEv_VoteY(void) return; } - forceinfokey(world, "votes_y", ftos(serverkeyfloat("votes_y")+1)); + serverinfo.SetFloat("votes_y", serverinfo.GetFloat("votes_y") + 1); pl.voted = 1; /* HACK: Is there a better way to do this? */ @@ -141,12 +141,12 @@ CSEv_VoteY(void) } /* We need at least half the players agreeing. */ - if (serverkeyfloat("votes_y") > rint(playernums / 2)) { + if (serverinfo.GetFloat("votes_y") > rint(playernums / 2)) { Vote_Passed(); return; } - if (serverkeyfloat("votes_n") + serverkeyfloat("votes_y") == playernums) { + if (serverinfo.GetFloat("votes_n") + serverinfo.GetFloat("votes_y") == playernums) { g_flVoteTime = time + 0.0f; } } @@ -176,7 +176,7 @@ CSEv_VoteN(void) return; } - forceinfokey(world, "votes_n", ftos(serverkeyfloat("votes_n")+1)); + serverinfo.SetFloat("votes_n", serverinfo.GetFloat("votes_n") + 1); pl.voted = 1; /* HACK: Is there a better way to do this? */ @@ -186,12 +186,12 @@ CSEv_VoteN(void) } /* We need at least half the players disagreeing. */ - if (serverkeyfloat("votes_n") > rint(playernums / 2)) { + if (serverinfo.GetFloat("votes_n") > rint(playernums / 2)) { Vote_Failed(); return; } - if (serverkeyfloat("votes_n") + serverkeyfloat("votes_y") == playernums) { + if (serverinfo.GetFloat("votes_n") + serverinfo.GetFloat("votes_y") == playernums) { g_flVoteTime = time + 0.0f; } } @@ -218,7 +218,7 @@ Vote_InitiateVote(string votemsg) Vote_Reset(); - forceinfokey(world, "vote_cmd", votemsg); + serverinfo.SetString("vote_cmd", votemsg); g_flVoteTime = time + 30.0f; g_iVoteState = VOTE_INPROGRESS; } diff --git a/src/shared/NSAttack.qc b/src/shared/NSAttack.qc index 48bd1ff4..e020265b 100644 --- a/src/shared/NSAttack.qc +++ b/src/shared/NSAttack.qc @@ -73,7 +73,7 @@ NSAttack::Restore(string strKey, string strValue) m_vecSpread = ReadVector(strValue); break; case "m_weaponOwner": - m_weaponOwner = ReadEntity(strValue); + m_weaponOwner = (NSWeapon)ReadEntity(strValue); break; default: super::Restore(strKey, strValue); diff --git a/src/shared/NSClientPlayer.h b/src/shared/NSClientPlayer.h index 24fc3245..2e3156b7 100644 --- a/src/shared/NSClientPlayer.h +++ b/src/shared/NSClientPlayer.h @@ -71,6 +71,7 @@ public: virtual void VehicleRelink(void); virtual void OnRemoveEntity(void); virtual void ReceiveEntity(float,float); + virtual void _ReceiveComplete(float, float); virtual void PredictPreFrame(void); virtual void PredictPostFrame(void); virtual void ClientInputFrame(void); @@ -99,6 +100,7 @@ public: virtual float SendEntity(entity,float); virtual void Death(entity, entity, int, vector, int); virtual void ServerInputFrame(void); + virtual void Input(entity, string, string); /** Helper function that will optimise the changed-flags of your player entity. */ virtual float OptimiseChangedFlags(entity,float); @@ -119,54 +121,55 @@ public: virtual void Footsteps_Update(void); + nonvirtual void _UpdatePMoveVars(void); + private: #ifdef CLIENT - PREDICTED_INT(weaponframe) - PREDICTED_FLOAT(vehicle_entnum) + NETWORKED_INT(weaponframe) + NETWORKED_FLOAT(vehicle_entnum) #endif #ifdef SERVER - PREDICTED_INT_N(weaponframe) + NETWORKED_INT_N(weaponframe) float nadeCookingTime; #endif - PREDICTED_FLOAT(health) + NETWORKED_FLOAT(health) - PREDICTED_FLOAT_N(colormap) - PREDICTED_FLOAT_N(gflags) - PREDICTED_FLOAT(viewzoom) - PREDICTED_VECTOR_N(view_ofs) - PREDICTED_VECTOR_N(basevelocity) - PREDICTED_VECTOR_N(v_angle) - PREDICTED_FLOAT_N(pmove_flags) + NETWORKED_FLOAT_N(colormap) + NETWORKED_FLOAT_N(gflags) + NETWORKED_FLOAT(viewzoom) + NETWORKED_VECTOR_N(view_ofs) + NETWORKED_VECTOR_N(basevelocity) + NETWORKED_VECTOR_N(v_angle) + NETWORKED_FLOAT_N(pmove_flags) - PREDICTED_FLOAT(w_attack_next) - PREDICTED_FLOAT(w_idle_next) - PREDICTED_FLOAT(w_reload_next) - PREDICTED_FLOAT(teleport_time) - PREDICTED_FLOAT(weapontime) - PREDICTED_FLOAT(m_flStamina) - PREDICTED_VECTOR(punchangle) + NETWORKED_FLOAT(w_attack_next) + NETWORKED_FLOAT(w_idle_next) + NETWORKED_FLOAT(w_reload_next) + NETWORKED_FLOAT(teleport_time) + NETWORKED_FLOAT(weapontime) + NETWORKED_VECTOR(punchangle) /* We can't use the default .items field, because FTE will assume * effects of some bits. Such as invisibility, quad, etc. * also, modders probably want 32 bits for items. */ - PREDICTED_INT(g_items) - PREDICTED_FLOAT_N(activeweapon) + NETWORKED_INT(g_items) + NETWORKED_FLOAT_N(activeweapon) NSItem m_itemList_net; int m_iAmmoTypes_net[MAX_AMMO_TYPES]; /* vehicle info */ - PREDICTED_ENT(vehicle) + NETWORKED_ENT(vehicle) /* these are NOT networked */ int a_ammo1; int a_ammo2; int a_ammo3; - PREDICTED_VECTOR(grapvelocity) + NETWORKED_VECTOR(grapvelocity) #ifdef CLIENT int sequence; @@ -177,6 +180,7 @@ private: int p_model_bone; float lastweapon; #endif + NSPMoveVars m_pmoveVars; #ifdef SERVER int voted; diff --git a/src/shared/NSClientPlayer.qc b/src/shared/NSClientPlayer.qc index 673e2ddb..191dfcd5 100644 --- a/src/shared/NSClientPlayer.qc +++ b/src/shared/NSClientPlayer.qc @@ -102,13 +102,16 @@ NSClientPlayer::IsFakeSpectator(void) bool NSClientPlayer::CanSprint(void) { - return g_pmoveVars.pm_runspeed > 0 ? (true) : false; + if ((IsProne() == true) || (IsCrouching() == true)) + return (false); + + return m_pmoveVars.pm_runspeed > 0 ? (true) : false; } bool NSClientPlayer::CanProne(void) { - return g_pmoveVars.pm_proneheight > 0 ? (true) : false; + return m_pmoveVars.pm_proneheight > 0 ? (true) : false; } bool @@ -120,7 +123,19 @@ NSClientPlayer::CanLean(void) bool NSClientPlayer::CanCrouch(void) { - return g_pmoveVars.pm_crouchheight > 0 ? (true) : false; + return m_pmoveVars.pm_crouchheight > 0 ? (true) : false; +} + +void +NSClientPlayer::_UpdatePMoveVars(void) +{ + if (m_pmoveVars) { + m_pmoveVars.Destroy(); + m_pmoveVars = 0; + } + + m_pmoveVars = spawn(NSPMoveVars); + m_pmoveVars.LinkToEntity(declclass); } void @@ -281,6 +296,8 @@ NSClientPlayer::ProcessInput(void) m_activeWeapon.origin = origin; m_activeWeapon.Relink(); + m_activeWeapon.InputFrame(); + /* weapon system */ if (input_buttons & INPUT_SECONDARY) { m_activeWeapon._SecondaryAttack(); @@ -482,6 +499,9 @@ NSClientPlayer::OnRemoveEntity(void) if (p_model) p_model.Destroy(); + if (m_pmoveVars) + m_pmoveVars.Destroy(); + super::OnRemoveEntity(); } @@ -560,13 +580,6 @@ var float autocvar_cl_forwardspeed = 190; var float autocvar_cl_sidespeed = 152; var float autocvar_cl_backspeed = 133; -/* -================= -NSClientPlayer::ClientInputFrame - -This is basically CSQC_Input_Frame! So games can override this as they please. -================= -*/ void NSClientPlayer::ClientInputFrame(void) { @@ -625,14 +638,6 @@ NSClientPlayer::ClientInputFrame(void) input_buttons |= INPUT_PRONE; } - /* prevent accidental input packets */ - if (pSeat->m_flInputBlockTime > time) { - input_buttons &= ~INPUT_PRIMARY; - input_buttons &= ~INPUT_SECONDARY; - pSeat->m_iInputAttack2 = false; - return; - } - /* some input overrides for XR */ if (XR_Available(this)) { if (pSeat->m_bMoveForward) { @@ -676,15 +681,12 @@ NSClientPlayer::ClientInputFrame(void) } } -/* -================= -NSClientPlayer::ReceiveEntity +void +NSClientPlayer::_ReceiveComplete(float flNew, float flChanged) +{ + +} -Receive the generic client attributes from the server. -If you want to override this, do not call this -at the top of player::ReceiveEntity -================= -*/ void NSClientPlayer::ReceiveEntity(float new, float flChanged) { @@ -701,11 +703,12 @@ NSClientPlayer::ReceiveEntity(float new, float flChanged) if (new) { classname = "player"; - mins = g_pmoveVars.GetStandingMins(); - maxs = g_pmoveVars.GetStandingMaxs(); + mins = m_pmoveVars.GetStandingMins(); + maxs = m_pmoveVars.GetStandingMaxs(); Physics_SetViewParms(); } + READENTITY_INT(entityDefID, PLAYER_MODELINDEX) READENTITY_INT(modelindex, PLAYER_MODELINDEX) READENTITY_BYTE(colormap, PLAYER_MODELINDEX) @@ -773,10 +776,20 @@ NSClientPlayer::ReceiveEntity(float new, float flChanged) READENTITY_INT(m_iAmmoTypes[i], PLAYER_AMMOTYPES) } + /* we only really care about the declclass for decl lookups. */ + if (flChanged & PLAYER_MODELINDEX) { + declclass = EntityDef_NameFromNetID(entityDefID); + } + if (flChanged & PLAYER_SIZE) { setsize(this, mins, maxs); } + /* our decl class has changed. refresh movement values. */ + if (flChanged & PLAYER_MODELINDEX && STRING_SET(declclass)) { + _UpdatePMoveVars(); + } + if (pSeat->m_ePlayer != this) { return; } @@ -796,15 +809,6 @@ NSClientPlayer::ReceiveEntity(float new, float flChanged) } } -/* -================= -NSClientPlayer::PredictPreFrame - -Save the state of the last server-confirmed attributes. -If you want to override this, do not call this -at the top of player::PredictPreFrame -================= -*/ void NSClientPlayer::PredictPreFrame(void) { @@ -875,16 +879,6 @@ NSClientPlayer::PredictPreFrame(void) } } -/* -================= -NSClientPlayer::PredictPostFrame - -After running prediction on the client, roll back the values -to the server's confirmed saved attributes from PredictPreFrame. -If you want to override this, do not call this -at the top of player::PredictPostFrame -================= -*/ void NSClientPlayer::PredictPostFrame(void) { @@ -1097,6 +1091,18 @@ NSClientPlayer::Respawn(void) /* make sure nothing happens here */ } +void +NSClientPlayer::Input(entity eAct, string strInput, string strData) +{ + switch (strInput) { + case "Spectate": + MakeTempSpectator(); + break; + default: + super::Input(eAct, strInput, strData); + } +} + /* ================= NSClientPlayer::MakeTempSpectator @@ -1136,13 +1142,6 @@ NSClientPlayer::MakeTempSpectator(void) forceinfokey(this, "*dead", "0"); } -/* -================= -NSClientPlayer::MakeDead - -Sets all the appropriate attributes to make sure we're dead -================= - */ void NSClientPlayer::Death(entity inflictor, entity attacker, int damage, vector dir, int location) { @@ -1175,16 +1174,19 @@ void NSClientPlayer::Spawned(void) { super::Spawned(); - MakePlayer(); + + /* we really need to check if whether we're a real client yet. */ + if (clienttype(this) == CLIENTTYPE_REAL) { + MakePlayer(); + } else { + Disappear(); /* hide us for now */ + } + +#ifdef SERVER + _UpdatePMoveVars(); +#endif } -/* -================= -NSClientPlayer::MakePlayer - -True participating player, can walk around and everything. -================= - */ void NSClientPlayer::MakePlayer(void) { @@ -1212,7 +1214,7 @@ NSClientPlayer::MakePlayer(void) EnableBleeding(); SetScale(1.0f); Physics_SetViewParms(); - SetSize(g_pmoveVars.GetStandingMins(), g_pmoveVars.GetStandingMaxs()); + SetSize(m_pmoveVars.GetStandingMins(), m_pmoveVars.GetStandingMaxs()); forceinfokey(this, "*spectator", "0"); forceinfokey(this, "*deaths", ftos(deaths)); forceinfokey(this, "*dead", "0"); @@ -1224,24 +1226,16 @@ NSClientPlayer::MakeSpectator(void) { ClientKill(); MakeTempSpectator(); - team = 0; + team = TEAM_SPECTATOR; forceinfokey(this, "*team", ftos(team)); } -/* -================= -NSClientPlayer::EvaluateEntity - -Check which attributes have changed and flag the ones that did. -If you want to override this, do not call this -at the top of player::EvaluateEntity -================= -*/ void NSClientPlayer::EvaluateEntity(void) { pvsflags = !HasVFlags(VFL_FAKESPEC) ? 0 : PVSF_IGNOREPVS; + EVALUATE_FIELD(entityDefID, PLAYER_MODELINDEX) EVALUATE_FIELD(modelindex, PLAYER_MODELINDEX) EVALUATE_FIELD(colormap, PLAYER_MODELINDEX) EVALUATE_FIELD(m_iRenderMode, PLAYER_MODELINDEX) @@ -1306,15 +1300,6 @@ NSClientPlayer::EvaluateEntity(void) } } -/* -================= -NSClientPlayer::SendEntity - -Network any attributes that have been flagged for networking. -If you want to override this, do not call this -at the top of player::SendEntity -================= -*/ float NSClientPlayer::SendEntity(entity ePEnt, float flChanged) { @@ -1329,6 +1314,7 @@ NSClientPlayer::SendEntity(entity ePEnt, float flChanged) WriteByte(MSG_ENTITY, ENT_PLAYER); WriteFloat(MSG_ENTITY, flChanged); + SENDENTITY_INT(entityDefID, PLAYER_MODELINDEX) SENDENTITY_INT(modelindex, PLAYER_MODELINDEX) SENDENTITY_BYTE(colormap, PLAYER_MODELINDEX) @@ -1424,19 +1410,12 @@ NSClientPlayer::OptimiseChangedFlags(entity ePEnt, float flChanged) } else { /* always keep us alive to ourselves or the person spectating */ /* this will make prediction smoother */ - flChanged |= PLAYER_MODELINDEX; + //flChanged |= PLAYER_MODELINDEX; } return flChanged; } -/* -==================== -_NSClientPlayer_useworkaround - -A wrapper to cleanly reset 'self' as to not mess up the QC VM -==================== -*/ void _NSClientPlayer_useworkaround(entity eTarget) { @@ -1447,13 +1426,7 @@ _NSClientPlayer_useworkaround(entity eTarget) self = eOldSelf; } -/* -==================== -_NSClientPlayer_useworkaround -A wrapper to cleanly reset 'self' as to not mess up the QC VM -==================== -*/ void _NSClientPlayer_unuseworkaround(entity eTarget) { @@ -1465,14 +1438,6 @@ _NSClientPlayer_unuseworkaround(entity eTarget) self = eOldSelf; } -/* -================= -NSClientPlayer:: InputUse_Down - -Called when we hold down the +use button for the first time, -looks for an entity that has the .PlayerUse field set to a function and calls it. -================= -*/ void NSClientPlayer::InputUse_Down(void) { @@ -1525,13 +1490,6 @@ NSClientPlayer::InputUse_Down(void) } } -/* -================= -NSClientPlayer:: InputUse_Down - -Called when we let go of the +use button -================= -*/ void NSClientPlayer::InputUse_Up(void) { @@ -1768,10 +1726,10 @@ NSClientPlayer::Damage(entity inflictor, entity attacker, NSDict damageDecl, flo /* they died */ if (GetHealth() <= 0) { - g_grMode.PlayerDeath(this, attacker, damageDecl); + g_grMode.PlayerDeath(this, (NSActor)attacker, damageDecl); Death(inflictor, attacker, (int)damagePoints, dmgDir, 0i); } else { - g_grMode.PlayerPain(this, attacker, damageDecl); + g_grMode.PlayerPain(this, (NSActor)attacker, damageDecl); Pain(inflictor, attacker, (int)damagePoints, dmgDir, 0i); } #endif diff --git a/src/shared/NSDict.h b/src/shared/NSDict.h index 53583a6a..a583ea73 100644 --- a/src/shared/NSDict.h +++ b/src/shared/NSDict.h @@ -43,6 +43,7 @@ NSDict public: void NSDict(void); + nonvirtual int GetInteger(string); nonvirtual float GetFloat(string); nonvirtual string GetString(string); nonvirtual vector GetVector(string); @@ -54,11 +55,14 @@ public: nonvirtual void AddKey(string, string); nonvirtual void RemoveKey(string); - nonvirtual NSDict InitWithSpawnData(string); + nonvirtual int TokenCount(void); + + static NSDict InitWithSpawnData(string); + static NSDict LoadDeclFromFile(string, string); private: nonvirtual void _AddRemoveKey(string, string, bool); string m_strBody; }; -/** @} */ // end of decl \ No newline at end of file +/** @} */ // end of decl diff --git a/src/shared/NSDict.qc b/src/shared/NSDict.qc index 9bae91b4..3c5bcc44 100644 --- a/src/shared/NSDict.qc +++ b/src/shared/NSDict.qc @@ -32,6 +32,12 @@ NSDict::SetDeclBody(string textBody) m_strBody = textBody; } +int +NSDict::GetInteger(string keyName) +{ + return (int)stoi(GetString(keyName)); +} + float NSDict::GetFloat(string keyName) { @@ -97,6 +103,12 @@ NSDict::RemoveKey(string keyName) _AddRemoveKey(keyName, "", true); } +int +NSDict::TokenCount(void) +{ + return (int)tokenize_console(m_strBody); +} + NSDict NSDict::InitWithSpawnData(string spawnData) { @@ -104,3 +116,87 @@ NSDict::InitWithSpawnData(string spawnData) newDict.SetDeclBody(spawnData); return (newDict); } + +NSDict +NSDict::LoadDeclFromFile(string declName, string fileName) +{ + filestream fh; + NSDict newDict; + string tempString; + int braceDepth = 0i; + string lastWord = __NULL__; + string lastDecl = ""; + + fh = fopen(strcat("decls/", fileName), FILE_READ); + + if (fh < 0) { + NSError("Can't read %S", fileName); + return __NULL__; + } + + newDict = spawn(NSDict); + + while ((tempString = fgets(fh))) { + int lineSegments = tokenize_console(tempString); + + for (int i = 0i; i < lineSegments; i++) { + string word = argv(i); + + switch (word) { + case "{": + braceDepth++; + break; + case "}": + braceDepth--; + + /* we've reached the end of a definition */ + if (braceDepth == 0) { + /* we found it, we're done */ + if (STRING_SET(lastDecl) && lastDecl == declName) { + break; + } + lastDecl = ""; + } + break; + default: + /* anything outside braces defines the classname for the next def */ + if (braceDepth == 0 && lastWord == "typeInfo") { + lastDecl = word; + } /* else if (braceDepth == 0 && lastWord == "#include") { + g_entDefInclude = strcat(g_entDefInclude, word, ";"); + } else if (braceDepth == 0 && lastWord == "#define") { + Constants_Add(argv(i), argv(i+1)); + } */ else if (braceDepth == 1) { + /* spawnclass is reserved and the next keyword specs it */ + /*if (word == "spawnclass") { + currentDef.spawnClass = argv(i+1); + i++; + } else if (word == "inherit") { + currentDef.inheritKeys = argv(i+1); + i++; + } else*/ if (lastDecl == declName) { /* rest gets dumped into spawndata */ + newDict.m_strBody = strcat(newDict.m_strBody, "\"", word, "\"", " "); + } + } + } + lastWord = word; + } + +#if 0 + if (c == 1) { + + } else if (c == 2) { + newDict.AddKey(argv(0), argv(1)); + } +#endif + } + + /* failed to find any key-value pairs. empty */ + if (!STRING_SET(newDict.m_strBody)) { + remove(newDict); + return (__NULL__); + } + + return (newDict); +} + diff --git a/src/shared/NSEntity.h b/src/shared/NSEntity.h index 3f5f40af..6f709fdb 100644 --- a/src/shared/NSEntity.h +++ b/src/shared/NSEntity.h @@ -75,6 +75,7 @@ public: /* overrides */ virtual void SpawnKey(string,string); virtual void Spawned(void); + nonvirtual void Spawn(void); /** Tells the engine to make the entity static, effectively making it inaccessible. It will be removed from the game-logic but remain visible and it will retain its @@ -398,30 +399,35 @@ private: bool m_bIsBrush; vector m_vecEditorColor; - PREDICTED_FLOAT(entityDefID) - PREDICTED_VECTOR_N(origin) - PREDICTED_VECTOR_N(angles) - PREDICTED_FLOAT_N(modelindex) - PREDICTED_VECTOR_N(size) - PREDICTED_VECTOR_N(mins) - PREDICTED_VECTOR_N(maxs) - PREDICTED_FLOAT_N(solid) - PREDICTED_FLOAT_N(movetype) - PREDICTED_FLOAT_N(scale) - PREDICTED_FLOAT_N(flags) - PREDICTED_FLOAT_N(vv_flags) - PREDICTED_VECTOR_N(velocity) - PREDICTED_VECTOR_N(avelocity) + NETWORKED_INT(entityDefID) + NETWORKED_VECTOR_N(origin) + NETWORKED_VECTOR_N(angles) + NETWORKED_FLOAT_N(modelindex) + NETWORKED_VECTOR_N(size) + NETWORKED_VECTOR_N(mins) + NETWORKED_VECTOR_N(maxs) + NETWORKED_FLOAT_N(solid) + NETWORKED_FLOAT_N(movetype) + NETWORKED_FLOAT_N(scale) + NETWORKED_FLOAT_N(flags) + NETWORKED_FLOAT_N(vv_flags) + NETWORKED_VECTOR_N(velocity) + NETWORKED_VECTOR_N(avelocity) + +#ifdef CLIENT + /** Called once ReceiveEntity has done its job. */ + virtual void _ReceiveComplete(float, float); +#endif + #ifdef SERVER string m_parent; string m_parent_old; string m_parent_attachment; - PREDICTED_FLOAT_N(frame) - PREDICTED_FLOAT_N(skin) - PREDICTED_FLOAT_N(effects) + NETWORKED_FLOAT_N(frame) + NETWORKED_FLOAT_N(skin) + NETWORKED_FLOAT_N(effects) #endif - /** Will read from the named def to perform a projectile attack. */ nonvirtual bool _ProjectileAttack(string, bool); }; @@ -430,6 +436,10 @@ private: unless we're seriously out of memory. */ NSEntity spawnClass(string className, vector desiredPos); +#ifdef SERVER +bool changeClass(entity target, string className) +#endif + void sendInput(entity target, string inputName, string dataString, entity activator); bool isAI(entity entityToCheck); @@ -445,3 +455,7 @@ bool isPlayer(entity entityToCheck); bool isSentient(entity entityToCheck); bool isBot(entity entityToCheck); + +bool isItem(entity entityToCheck); + +bool isWeapon(entity entityToCheck); diff --git a/src/shared/NSEntity.qc b/src/shared/NSEntity.qc index 01f81fe2..6ecce908 100644 --- a/src/shared/NSEntity.qc +++ b/src/shared/NSEntity.qc @@ -33,6 +33,18 @@ NSEntity::NSEntity(void) m_vecEditorColor = [1,1,1]; } +void +NSEntity::Spawn(void) +{ + Spawned(); + + if (wasfreed(this)) { + return; + } + + Respawn(); +} + void NSEntity::Spawned(void) { @@ -227,6 +239,12 @@ NSEntity::ReceiveEntity(float flNew, float flChanged) } } +void +NSEntity::_ReceiveComplete(float flNew, float flChanged) +{ + +} + void NSEntity::ReceiveEvent(float eventType) { @@ -1042,7 +1060,7 @@ NSEntity::Input(entity eAct, string strInput, string strData) break; case "SpawnProjectileDef": if (EntityDef_HasSpawnClass(strData)) { - NSProjectile_SpawnDefAttachment(strData, this, 0); + NSProjectile_SpawnDefAttachment(strData, (NSActor)this, 0); } break; case "StartSoundDef": @@ -1436,7 +1454,7 @@ NSEntity::_ProjectileAttack(string defName, bool wasReleased) for (int i = 0i; i < numProjectiles; i++) { EntLog("Launching %S at %v towards %v", attackDef, GetEyePos(), GetViewAngle()); - NSAttack_SpawnDefAtPosition(attackDef, this, GetEyePos(), GetViewAngle()); + NSAttack_SpawnDefAtPosition(attackDef, (NSActor)this, GetEyePos(), GetViewAngle()); } #endif @@ -1488,156 +1506,3 @@ NSEntity::DisablePlayerCollision(void) dimension_solid = 1; dimension_hit = 1; } - -NSEntity -spawnClass(string className, vector desiredPos) -{ - NSEntity newEntity = __NULL__; - -#ifdef SERVER - newEntity = Entity_CreateClass(className); - - /* That class didn't exist, so let's take the base Nuclide one */ - if (!newEntity) { - newEntity = Entity_CreateClass("NSEntity"); - } - - /* OOM. It's over. */ - if (!newEntity) { - return (__NULL__); - } - - newEntity.classname = className; - newEntity.Input(newEntity, "SetOrigin", vtos(desiredPos)); - newEntity.Respawn(); -#endif - - return (newEntity); -} - -#ifdef SERVER -bool -changeClass(entity target, string className) -{ - return EntityDef_SwitchClass((NSEntity)target, className) ? (true) : (false); -} -#endif - -void -sendInput(entity target, string inputName, string dataString, entity activator) -{ - NSEntity targetEntity = (NSEntity)target; -#ifdef SERVER - targetEntity.Input(activator, inputName, dataString); -#endif -} - -/* helper functions */ -bool -isAI(entity entityToCheck) -{ - if (entityToCheck.flags & FL_MONSTER) { - return (true); - } - - return (false); -} - -bool -isAlive(entity entityToCheck) -{ -#ifdef SERVER - if (entityToCheck.takedamage != DAMAGE_NO) { - NSSurfacePropEntity livingEnt = (NSSurfacePropEntity)entityToCheck; - return livingEnt.IsAlive(); - } -#endif - - return (false); -} - -bool -isGodMode(entity entityToCheck) -{ - if (entityToCheck.flags & FL_GODMODE) { - return (true); - } - - return (false); -} - -bool -isClient(entity entityToCheck) -{ - return (entityToCheck.flags & FL_CLIENT) ? (true) : (false); -} - -bool -isPlayer(entity entityToCheck) -{ - if (isClient(entityToCheck)) { - NSClient pl = (NSClient)entityToCheck; - - return pl.IsPlayer(); - } - - return (false); -} - -bool -isSentient(entity entityToCheck) -{ - if (isAI(entityToCheck) || isPlayer(entityToCheck)) { - return (true); - } - - return (false); -} - -bool -isBot(entity entityToCheck) -{ -#ifdef SERVER - return (clienttype(entityToCheck) == CLIENTTYPE_BOT) ? (true) : (false); -#else - return (false); -#endif -} - - -#ifdef SERVER -void -setUserInfo(entity clientEntity, string serverKey, string setValue) -{ - if (isClient(clientEntity)) { - NSClient client = (NSClient) clientEntity; - client.SetInfoKey(serverKey, setValue); - } -} - -string -getUserInfo(entity clientEntity, string serverKey) -{ - if (isClient(clientEntity)) { - NSClient client = (NSClient) clientEntity; - return client.GetInfoKey(serverKey); - } -} -#endif - -void -placeSpawnpoint(entity target) -{ - vector testorg = target.origin; - - for (int i = 0; i < 32; i++) { - tracebox(testorg, target.mins, target.maxs, testorg, MOVE_NORMAL, target); - - if (!trace_startsolid) { - setorigin(target, testorg); - break; - } - - testorg[2] += 1.0; - } -} diff --git a/src/shared/NSIO.h b/src/shared/NSIO.h index 602b1b4d..d75b3a93 100644 --- a/src/shared/NSIO.h +++ b/src/shared/NSIO.h @@ -184,8 +184,11 @@ public: nonvirtual void DebugBool(string,bool); /** Debug print for a given entity. */ nonvirtual void DebugEntity(string,entity); + /** Sets the editor icon. Must be 16x16 px and located in `gfx/icon16/`. */ + nonvirtual void SetEditorIcon(string); private: + string m_strEditorIcon; string m_strSpawnData; #ifdef SERVER string m_strOnTrigger; @@ -199,6 +202,7 @@ private: #endif }; +.bool isActor; .bool _mapspawned; void diff --git a/src/shared/NSIO.qc b/src/shared/NSIO.qc index e8c51188..755992df 100644 --- a/src/shared/NSIO.qc +++ b/src/shared/NSIO.qc @@ -38,6 +38,8 @@ NSIO::NSIO(void) isCSQC = TRUE; effects |= EF_NOSHADOW; #endif + m_strEditorIcon = "gfx/icon16/bullet_purple"; + isActor = false; } void @@ -59,6 +61,9 @@ NSIO::Spawned(void) if (m_strOnUser4) m_strOnUser4 = CreateOutput(m_strOnUser4); #endif + + _isWeapon = false; + _isItem = false; } void @@ -69,7 +74,6 @@ NSIO::OnRemoveEntity(void) void NSIO::Destroy(void) { - removed = 1; /* mark this as cleanly removed */ OnRemoveEntity(); customphysics = __NULL__; modelindex = 0; @@ -78,24 +82,13 @@ NSIO::Destroy(void) classname = 0; think = __NULL__; nextthink = 0.0f; + identity = 1; + _isWeapon = false; + _isItem = false; + removed = true; remove(this); } -float -NSIO::GetDefAct(string keyName) -{ - float randomValue; - string actValue = EntityDef_GetKeyValue(classname, keyName); - float actCount = tokenizebyseparator(actValue, ","); - - if (actCount == 1) { - return stof(actValue); - } else { - randomValue = floor(pseudorandom() * actCount); - return stof(argv(randomValue)); - } -} - string NSIO::GetDefString(string keyName) { @@ -140,25 +133,31 @@ NSIO::GetSubDefAct(string subDef, string activityName) /* not in class decl either. look it up in the model */ if (!STRING_SET(fireValue)) { - /* look it up in the model itself now */ - float actModelNum = stof(EntityDef_GetKeyValue("activities", actNameCheck)); - float frameGroup = frameforaction(modelindex, actModelNum); - return (frameGroup); - //return (-1); - } + string actValue = EntityDef_GetKeyValue("activities", actNameCheck); - actCount = tokenizebyseparator(fireValue, ","); - - if (actCount == 1) { - return stof(fireValue); + if (STRING_SET(actValue)) { + /* look it up in the model itself now */ + float actModelNum = stof(actValue); + float frameGroup = frameforaction(modelindex, actModelNum); + return (frameGroup); + } } else { - float randomValue = floor(pseudorandom() * actCount); - return stof(argv(randomValue)); + actCount = tokenizebyseparator(fireValue, ","); + + if (actCount == 1) { + return stof(fireValue); + } else { + float randomValue = floor(pseudorandom() * actCount); + return stof(argv(randomValue)); + } } + + /* not in fireInfo, not in model... skip! */ + return (-1); } float -NSIO::GetAct(string activityName) +NSIO::GetDefAct(string activityName) { return GetSubDefAct(classname, activityName); } @@ -556,6 +555,7 @@ NSIO::Save(float handle) SaveString(handle, "m_strOnUser4", m_strOnUser4); SaveString(handle, "m_strModelEventCB", m_strModelEventCB); SaveString(handle, "m_strSpawnData", m_strSpawnData); + SaveString(handle, "m_strEditorIcon", m_strEditorIcon); } void NSIO::Restore(string strKey, string strValue) @@ -851,6 +851,9 @@ NSIO::Restore(string strKey, string strValue) case "m_strSpawnData": m_strSpawnData = ReadString(strValue); break; + case "m_strEditorIcon": + m_strEditorIcon = ReadString(strValue); + break; } } @@ -885,6 +888,9 @@ NSIO::SpawnKey(string strKey, string strValue) case "targetname": targetname = strValue; break; + case "editor_icon": + m_strEditorIcon = ReadString(strValue); + break; #ifdef SERVER /* Input/Output system */ case "OnTrigger": @@ -956,3 +962,8 @@ NSIO::DebugEntity(string key, entity targ) float value = num_for_edict(targ); EntLog("%S \"%f\"", key, value); } +void +NSIO::SetEditorIcon(string newIcon) +{ + m_strEditorIcon = strcat("gfx/icon16/", newIcon); +} diff --git a/src/shared/NSItem.h b/src/shared/NSItem.h index 04a73ebe..2ba91fb4 100644 --- a/src/shared/NSItem.h +++ b/src/shared/NSItem.h @@ -75,6 +75,7 @@ public: virtual void Touch(entity); virtual void Respawn(void); virtual void SpawnKey(string, string); + virtual void Input(entity, string, string); virtual void Save(float); virtual void Restore(string,string); virtual void EvaluateEntity(void); @@ -93,6 +94,9 @@ public: /** Overridable: Called when this item is picked up. */ virtual void OnPickup(void); + /** Overridable: Called when this item is used. */ + virtual void OnUse(entity); + virtual void PrintDebugInfo(void); /** Call to turn a weapon into a pickup. */ nonvirtual void BecomePickup(void); diff --git a/src/shared/NSItem.qc b/src/shared/NSItem.qc index 58cbfd66..f611c4ec 100644 --- a/src/shared/NSItem.qc +++ b/src/shared/NSItem.qc @@ -42,24 +42,12 @@ NSItem::Spawned(void) Sound_Precache(m_sndAcquire); Sound_Precache(m_sndRespawn); pvsflags = PVSF_IGNOREPVS; + _isItem = true; } void NSItem::Respawn(void) { - /* we need to delay the DropToFloor() by at least a frame. - otherwise they may just fall through an entity (func_wall, func_train etc.) - that came after this entity in the lump. */ - static void AdjustSpawnPos(void) { - RestoreAngles(); - SetOrigin(GetSpawnVector("origin")); - placeSpawnpoint(this); - - if (!m_bFloating) { - DropToFloor(); - } - } - super::Respawn(); BecomePickup(); @@ -67,7 +55,12 @@ NSItem::Respawn(void) EnablePlayerCollision(); if (CreatedByMap() == true) { - ScheduleThink(AdjustSpawnPos, 0.0f); + RestoreAngles(); + SetOriginUnstick(GetSpawnVector("origin")); + + if (!m_bFloating) { + DropToFloor(); + } } } @@ -210,6 +203,21 @@ NSItem::Restore(string strKey, string strValue) } } +void +NSItem::Input(entity eAct, string strInput, string strData) +{ + switch (strInput) { + default: + NSTrigger::Input(eAct, strInput, strData); + } +} + +void +NSItem::OnUse(entity user) +{ + +} + bool NSItem::ItemPickupCheck(entity pickerUpper) { @@ -401,7 +409,7 @@ NSItem::SendEntity(entity ePEnt, float flChanged) SENDENTITY_ANGLE(angles[0], ITEMFL_CHANGED_ANGLES_X) SENDENTITY_ANGLE(angles[1], ITEMFL_CHANGED_ANGLES_Y) SENDENTITY_ANGLE(angles[2], ITEMFL_CHANGED_ANGLES_Z) - SENDENTITY_FLOAT(entityDefID, ITEMFL_CHANGED_MODELINDEX) + SENDENTITY_INT(entityDefID, ITEMFL_CHANGED_MODELINDEX) SENDENTITY_SHORT(modelindex, ITEMFL_CHANGED_MODELINDEX) SENDENTITY_BYTE(solid, ITEMFL_CHANGED_SOLID) SENDENTITY_BYTE(movetype, ITEMFL_CHANGED_FLAGS) @@ -489,7 +497,7 @@ NSItem::ReceiveEntity(float flNew, float flChanged) READENTITY_ANGLE(angles[0], ITEMFL_CHANGED_ANGLES_X) READENTITY_ANGLE(angles[1], ITEMFL_CHANGED_ANGLES_Y) READENTITY_ANGLE(angles[2], ITEMFL_CHANGED_ANGLES_Z) - READENTITY_FLOAT(entityDefID, ITEMFL_CHANGED_MODELINDEX) + READENTITY_INT(entityDefID, ITEMFL_CHANGED_MODELINDEX) READENTITY_SHORT(modelindex, ITEMFL_CHANGED_MODELINDEX) READENTITY_BYTE(solid, ITEMFL_CHANGED_SOLID) READENTITY_BYTE(movetype, ITEMFL_CHANGED_FLAGS) @@ -626,7 +634,7 @@ NSItem::_AddedCallback(void) { NSActor ourOwner = (NSActor)owner; -#ifdef CLIENT +#if 0 if (pSeat->m_ePlayer == owner) { localcmd("bf\n"); } @@ -657,11 +665,13 @@ NSItem::_AddedCallback(void) Logging_Pickup(ourOwner, this, __NULL__); ourOwner.StartSoundDef(m_sndAcquire, CHAN_ITEM, true); OnPickup(); - Disappear(); + MakeInvulnerable(); #endif + Disappear(); ourOwner.AddedItemCallback(this); AddedToInventory(); + SetMovetype(MOVETYPE_NONE); } void diff --git a/src/shared/NSMonster.h b/src/shared/NSMonster.h index 2717ad90..5b3a829f 100644 --- a/src/shared/NSMonster.h +++ b/src/shared/NSMonster.h @@ -339,6 +339,14 @@ public: virtual void RouteEnded(void); /** Internal use only. Called every frame to progress through a route. */ virtual void WalkRoute(void); + + /* callbacks */ + /** Called when a player is seen by the monster. */ + virtual void SeenPlayer(NSActor); + /** Called when an enemy is seen by the monster. */ + virtual void SeenEnemy(NSActor); + /** Called when a friend is seen by the monster. */ + virtual void SeenFriend(NSActor); /** Returns the type of sequence they're currently in. */ nonvirtual int GetSequenceState(void); diff --git a/src/shared/NSMonster.qc b/src/shared/NSMonster.qc index 4ce6065d..443f190e 100644 --- a/src/shared/NSMonster.qc +++ b/src/shared/NSMonster.qc @@ -449,19 +449,19 @@ NSMonster::Restore(string strKey, string strValue) int NSMonster::AnimIdle(void) { - return GetAct("idle"); + return GetDefAct("idle"); } int NSMonster::AnimWalk(void) { - return GetAct("walk"); + return GetDefAct("walk"); } int NSMonster::AnimRun(void) { - float runAnim = GetAct("run"); + float runAnim = GetDefAct("run"); return (runAnim == -1) ? AnimWalk() : runAnim; } @@ -642,6 +642,21 @@ NSMonster_TraceAgainsTarget(NSMonster monster, NSEntity target) return false; } +void +NSMonster::SeenPlayer(NSActor theActor) +{ +} + +void +NSMonster::SeenEnemy(NSActor theActor) +{ +} + +void +NSMonster::SeenFriend(NSActor theActor) +{ +} + void NSMonster::SeeThink(void) { @@ -713,14 +728,10 @@ NSMonster::SeeThink(void) } /* iterate through all players, monsters. */ - for (entity w = world; (w = nextent(w));) { + for (entity w = world; (w = findfloat(w, ::isActor, 1));) { if (w.takedamage == DAMAGE_NO) continue; - /* check if 'w' could be a valid enemy */ - if (IsValidEnemy(w) == false) - continue; - /* first, is the potential enemy in our field of view? */ vector v = normalize(w.origin - GetEyePos()); float flDot = v * anglesToForward(angles); @@ -728,15 +739,22 @@ NSMonster::SeeThink(void) if (flDot < SeeFOV()/180) continue; - /* we have line of sight with the player */ + /* we have line of sight with the entity */ if (NSMonster_TraceAgainsTarget(this, (NSEntity)w) == true) { - if (m_eEnemy != w) { - m_eEnemy = w; - m_flTrackingTime = time; - _Alerted(); - AlertNearby(); + /* check if 'w' could be a valid enemy */ + if (IsValidEnemy(w) == true) { + if (m_eEnemy != w) { + SeenEnemy((NSActor)w); + m_eEnemy = w; + m_flTrackingTime = time; + _Alerted(); + AlertNearby(); + } + } else if (isPlayer(w)) { + SeenPlayer((NSActor)w); + } else if (IsFriend(w.m_iAlliance)) { + SeenFriend((NSActor)w); } - return; } } } @@ -789,9 +807,9 @@ NSMonster::_LerpTurnToYaw(vector turnYaw) if (m_bTurning == false) { if (yawDiff < 0) { - AnimPlay(GetAct("turnRight")); + AnimPlay(GetDefAct("turnRight")); } else { - AnimPlay(GetAct("turnLeft")); + AnimPlay(GetDefAct("turnLeft")); } } @@ -980,7 +998,7 @@ NSMonster::AttackRanged(void) float rangedMax = GetSubDefFloat(m_defRanged1, "delay_max"); float burstCount = GetSubDefFloat(m_defRanged1, "burst"); float burstDelay = GetSubDefFloat(m_defRanged1, "burst_delay"); - float actRanged = GetAct("rangeAttack1"); + float actRanged = GetDefAct("rangeAttack1"); float burstTime = 0.0f; if (rangedDly <= 0.0) { @@ -991,7 +1009,7 @@ NSMonster::AttackRanged(void) if (m_flReloadCount) if (_m_flReloadTracker > m_flReloadCount) { float startAmmo = 0; - float actReload = GetAct("reload"); + float actReload = GetDefAct("reload"); /* out of ammo, cannot reload */ if (m_flReserveAmmo == 0) { @@ -1061,7 +1079,7 @@ NSMonster::AttackRanged(void) return 1; } else if (throwAnyway == false && inRanged2Range && trace_ent == m_eEnemy) { - float actRangedSpecial = GetAct("rangeAttack2"); + float actRangedSpecial = GetDefAct("rangeAttack2"); AnimReset(); AnimPlay(actRangedSpecial); ScheduleThink(AttackRanged_RangedSpecial, 0.0f); @@ -1069,7 +1087,7 @@ NSMonster::AttackRanged(void) return 1; } else if (inSpecial1Range) { AnimReset(); - AnimPlay(GetAct("specialAttack1")); + AnimPlay(GetDefAct("specialAttack1")); ScheduleThink(AttackRanged_Throw, m_flProjectileDelay); if (_m_bShouldThrow) @@ -1080,7 +1098,7 @@ NSMonster::AttackRanged(void) return 1; } else if (inSpecial2Range) { AnimReset(); - AnimPlay(GetAct("specialAttack2")); + AnimPlay(GetDefAct("specialAttack2")); ScheduleThink(AttackRanged_Throw, m_flProjectileDelay); if (_m_bShouldThrow) @@ -1098,7 +1116,7 @@ NSMonster::AttackRanged(void) void NSMonster::AttackDraw(void) { - float actDraw = GetAct("arm"); + float actDraw = GetDefAct("arm"); AnimPlay(actDraw); m_flAttackThink = time + frameduration(modelindex, actDraw); @@ -1116,7 +1134,7 @@ NSMonster::AttackDraw(void) void NSMonster::AttackHolster(void) { - float actHolster = GetAct("disarm"); + float actHolster = GetDefAct("disarm"); AnimPlay(actHolster); m_flAttackThink = time + frameduration(modelindex, actHolster); } @@ -1309,7 +1327,7 @@ NSMonster::AnimationUpdate(void) m_flAnimTime = 0.0f; if (fr == -1) - act = GetAct("idle"); + act = GetDefAct("idle"); m_iMoveState = MOVESTATE_IDLE; @@ -1320,7 +1338,7 @@ NSMonster::AnimationUpdate(void) m_flAnimTime = 0.0f; if (fr == -1) - act = GetAct("walk"); + act = GetDefAct("walk"); m_iMoveState = MOVESTATE_WALK; @@ -1331,7 +1349,7 @@ NSMonster::AnimationUpdate(void) m_flAnimTime = 0.0f; if (fr == -1) - act = GetAct("run"); + act = GetDefAct("run"); m_iMoveState = MOVESTATE_RUN; } @@ -1433,11 +1451,6 @@ NSMonster::Physics(void) return; } - /* HACK!!! */ - if (!IsAlive()) { - return; - } - /* editors like Hammer like putting 'sequence' into spawndata of monsters. so only ever force the animation when flagged as dead */ if (_m_bStartDead && m_flForceSequence) { @@ -1447,6 +1460,12 @@ NSMonster::Physics(void) m_flAnimTime = time + 999.0f; frame = m_flForceSequence; m_iSequenceState = SEQUENCESTATE_IDLE; + return; + } + + /* HACK!!! */ + if (!IsAlive()) { + return; } /* unset the leap attack */ @@ -1576,9 +1595,9 @@ NSMonster::HasBeenHit(void) void NSMonster::Pain(entity inflictor, entity attacker, int damage, vector dir, int location) { - float actSmallFlinch = GetAct("smallFlinch"); - float actBigFlinch = GetAct("bigFlinch"); - float actTwitch = GetAct("twitch"); + float actSmallFlinch = GetDefAct("smallFlinch"); + float actBigFlinch = GetDefAct("bigFlinch"); + float actTwitch = GetDefAct("twitch"); float actPain = -1; float baseHealth = GetSpawnFloat("health"); @@ -1616,25 +1635,25 @@ NSMonster::Pain(entity inflictor, entity attacker, int damage, vector dir, int l switch (location) { case BODY_HEAD: - actPain = GetAct("flinchHead"); + actPain = GetDefAct("flinchHead"); break; case BODY_CHEST: - actPain = GetAct("flinchChest"); + actPain = GetDefAct("flinchChest"); break; case BODY_STOMACH: - actPain = GetAct("flinchStomach"); + actPain = GetDefAct("flinchStomach"); break; case BODY_ARMLEFT: - actPain = GetAct("flinchLeftArm"); + actPain = GetDefAct("flinchLeftArm"); break; case BODY_ARMRIGHT: - actPain = GetAct("flinchRightArm"); + actPain = GetDefAct("flinchRightArm"); break; case BODY_LEGLEFT: - actPain = GetAct("flinchLeftLeg"); + actPain = GetDefAct("flinchLeftLeg"); break; case BODY_LEGRIGHT: - actPain = GetAct("flinchRightLeg"); + actPain = GetDefAct("flinchRightLeg"); break; } @@ -1684,11 +1703,11 @@ NSMonster::Death(entity inflictor, entity attacker, int damage, vector dir, int StartSoundDef(m_sndThud, CHAN_BODY, true); } - float actViolent = GetAct("dieViolent"); - float actForward = GetAct("dieForward"); - float actBackward = GetAct("dieBackward"); - float actSimple = GetAct("dieSimple"); - float actBackshot = GetAct("dieBackshot"); + float actViolent = GetDefAct("dieViolent"); + float actForward = GetDefAct("dieForward"); + float actBackward = GetDefAct("dieBackward"); + float actSimple = GetDefAct("dieSimple"); + float actBackshot = GetDefAct("dieBackshot"); float actDeath = -1; @@ -1710,13 +1729,13 @@ NSMonster::Death(entity inflictor, entity attacker, int damage, vector dir, int switch (g_dmg_iHitBody) { case BODY_HEAD: - actDeath = GetAct("dieHeadshot"); + actDeath = GetDefAct("dieHeadshot"); break; case BODY_CHEST: - actDeath = GetAct("dieChestshot"); + actDeath = GetDefAct("dieChestshot"); break; case BODY_STOMACH: - actDeath = GetAct("dieGutshot"); + actDeath = GetDefAct("dieGutshot"); break; } @@ -1784,27 +1803,18 @@ NSMonster::Spawned(void) if (!owner) { owner = this; } + + flags = FL_MONSTER; } void NSMonster::Respawn(void) { - /* we need to delay the DropToFloor() by at least a frame. - otherwise they may just fall through an entity (func_wall, func_train etc.) - that came after this entity in the lump. */ - static void AdjustSpawnPos(void) { - RestoreAngles(); - m_vecSequenceAngle = GetAngles(); - SetOrigin(GetSpawnVector("origin")); - DropToFloor(); - SetOriginUnstick(origin); - } - super::Respawn(); RestoreAngles(); v_angle = fixAngle(GetAngles()); - flags = FL_MONSTER; + m_vecSequenceAngle = GetAngles(); MakeVulnerable(); EnableAimAssist(); SetState(MONSTER_IDLE); @@ -1812,16 +1822,15 @@ NSMonster::Respawn(void) m_eEnemy = __NULL__; m_iFlags = 0x0; EnableBleeding(); + SetSize(GetSpawnVector("mins"), GetSpawnVector("maxs")); + SetSkin(GetSpawnFloat("skin")); customphysics = Physics; SetSolid(SOLID_SLIDEBOX); SetMovetype(MOVETYPE_WALK); - SetSize(GetSpawnVector("mins"), GetSpawnVector("maxs")); SetEyePos([0, 0, m_flEyeHeight]); - SetSkin(m_flSkin); - - if (CreatedByMap() == true) { - ScheduleThink(AdjustSpawnPos, 0.0f); - } + SetOrigin(GetSpawnVector("origin")); + DropToFloor(); + SetOriginUnstick(origin); if (HasSpawnFlags(MSF_MONSTERCLIP)) { hitcontentsmaski = CONTENTBITS_BOXSOLID | CONTENTBIT_MONSTERCLIP; @@ -1851,6 +1860,8 @@ NSMonster::Respawn(void) m_bGagged = false; } + targetname = GetSpawnString("targetname"); + /* automatically start */ if (STRING_SET(targetname)) { if (HasTriggerTarget() == true) { @@ -2253,7 +2264,7 @@ NSMonster::_RenderDebugViewCone(void) float flDot; vector testOrg; - if (health <= 0 || GetSolid(SOLID_CORPSE)) { + if (health <= 0 || GetSolid() == SOLID_CORPSE) { return; } diff --git a/src/shared/NSNavAI.h b/src/shared/NSNavAI.h index bea3749f..ab83cb36 100644 --- a/src/shared/NSNavAI.h +++ b/src/shared/NSNavAI.h @@ -26,7 +26,7 @@ _NSActor_Log(string className, string functionName, float edictNum, string warnM else printf("^5%s (%d) ^7: %s\n", functionName, edictNum, warnMessage); } -#define NSActor_Log(...) _NSActor_Log(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__)) +#define NSActor_Log(...) if (autocvar_g_logLevel >= LOGLEVEL_DEBUG) _NSActor_Log(classname, __FUNC__, num_for_edict(this), sprintf(__VA_ARGS__)) /* for AI identification purposes */ typedef enum @@ -68,6 +68,8 @@ public: /** Overridable: Returns the desired maximum backwardss movement speed. */ virtual float GetBackSpeed(void); + nonvirtual float GetStamina(void); + /** Returns `true` when the entity is ducked/crouching */ nonvirtual bool IsCrouching(void); /** Returns `true` when the entity is ducked/crouching */ @@ -190,6 +192,7 @@ private: NSWeapon m_activeWeapon_net; float activeweapon; NETWORKED_FLOAT(m_flFirstInventoryItem) + NETWORKED_FLOAT(m_flStamina) }; /* for now here to make debugging easier */ diff --git a/src/shared/NSNavAI.qc b/src/shared/NSNavAI.qc index 66aa352c..3745fba3 100644 --- a/src/shared/NSNavAI.qc +++ b/src/shared/NSNavAI.qc @@ -35,6 +35,12 @@ NSActor::NSActor(void) } } +float +NSActor::GetStamina(void) +{ + return (m_flStamina / g_pmoveVars.pm_stamina); +} + bool NSActor::IsCrouching(void) { @@ -148,6 +154,7 @@ void NSActor::Spawned(void) { super::Spawned(); + isActor = true; /* let's not waste time and resources */ if (wasfreed(this)) { @@ -170,33 +177,37 @@ NSActor::Spawned(void) string itemList = GetDefString("item"); int desiredWeapon = GetDefInt("current_weapon"); string switchTo = ""; - int weaponCount = tokenizebyseparator(weaponList, ","); + float weaponCount = 0; + + float desiredTeam = GetSpawnFloat("team"); + + if (desiredTeam == 0) + SetTeam(TEAM_UNASSIGNED); + else + SetTeam(desiredTeam); /* append items to the end */ - if (itemList != "") { + if (STRING_SET(itemList)) { weaponList = sprintf("%s,%s", weaponList, itemList); } - for (int i = 0; i < weaponCount; i++) { + for (float i = 0; i < tokenizebyseparator(weaponList, ","); i++) { string itemName = argv(i); GiveItem(itemName); if (i == desiredWeapon) { switchTo = itemName; } - - /* re-calculate because GiveItem may overwrite argv() */ - weaponCount = tokenizebyseparator(weaponList, ","); } - if (switchTo != "") { + if (STRING_SET(switchTo)) { SwitchToWeapon(switchTo); } /* give them their desired appearance */ string spawnModel = GetSpawnString("model"); - if (spawnModel != "") { + if (STRING_SET(spawnModel)) { SetModel(GetSpawnString("model")); } } @@ -216,6 +227,22 @@ void NSActor::Input(entity eAct, string strInput, string strData) { switch (strInput) { + case "UseItem": + if (HasItem(strData)) { + NSItem linkedList; + + linkedList = m_itemList; + + while (linkedList) { + /* inventory item may not be a weapon */ + if (linkedList.classname == strData) { + linkedList.OnUse(eAct); + break; + } + linkedList = (NSItem)linkedList.m_nextItem; + } + } + break; case "GiveItem": GiveItem(strData); break; @@ -245,13 +272,18 @@ NSActor::RouteEnded(void) void NSActor::CheckRoute_Path(void) { - float flDist = floor(vlen(m_pathEntity.GetOrigin() - GetOrigin())); + float flDist = distance(m_pathEntity.GetOrigin(), GetOrigin()); //print(sprintf("Check Path! %f\n", flDist)); /* close enough...? */ if (flDist < 80) { - NSActor_Log("Reached path node %S", m_pathTarget); + + if (targetname) { + NSActor_Log("%S reached path node %S", targetname, m_pathTarget); + } else { + NSActor_Log("Reached path node %S", m_pathTarget); + } m_pathTarget = m_pathEntity.target; m_pathEntity = (NSEntity)m_pathEntity.GetTargetEntity(); @@ -266,7 +298,12 @@ NSActor::CheckRoute(void) float flNodeRadius; vector evenpos; - if (m_pathTarget) { + /* if we're targetting ourselves, we act like a turret */ + if (m_pathTarget == targetname) { + return; + } + + if (STRING_SET(m_pathTarget)) { CheckRoute_Path(); return; } @@ -799,7 +836,7 @@ NSActor::AddedItemCallback(NSItem itemAdded) #ifdef SERVER if (!m_activeWeapon) { if (itemAdded.IsWeapon()) { - SwitchToExactWeapon(itemAdded); + SwitchToExactWeapon((NSWeapon)itemAdded); } } #endif diff --git a/src/shared/NSPhysicsEntity.qc b/src/shared/NSPhysicsEntity.qc index 937f3a9b..aea8ea14 100644 --- a/src/shared/NSPhysicsEntity.qc +++ b/src/shared/NSPhysicsEntity.qc @@ -14,52 +14,42 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* all the documented phys vars...*/ +.float geomtype; +.float friction; +.float erp; +.float jointtype; +.float mass; +.float bouncefactor; +.float bouncestop; .float max_angular; /* taken from VPhysics-Jolt (with permission!) */ const float InchesToMeters = 0.0254f; const float MetersToInches = 1.0f / 0.0254f; +bool +Physics_Simple(void) +{ + if (time < 5.0f) { + return (true); + } + + return (false); +} + void NSPhysicsEntity::NSPhysicsEntity(void) { mass = 1.0f; isPhysics = true; m_flInertiaScale = 1.0f; - m_iEnabled = 0i; - m_iShape = PHYSM_BOX; + m_iShape = GEOMTYPE_TRIMESH; m_iMaterial = 0i; m_iFlags = 0i; - damp_linear = 1.0f; - damp_angular = 1.0f; - max_angular = -1.0f; m_flMass = 1.0f; - - - cvar_set("physics_ode_quadtree_depth", "5"); - cvar_set("physics_ode_contactsurfacelayer", "0"); - cvar_set("physics_ode_worldquickstep", "1"); - cvar_set("physics_ode_worldquickstep_iterations", "20"); - cvar_set("physics_ode_contact_mu", "1"); - cvar_set("physics_ode_contact_erp", "0.96"); - cvar_set("physics_ode_contact_cfm", "0.001"); - cvar_set("physics_ode_world_damping", "1"); - cvar_set("physics_ode_world_damping_linear", "-1"); - cvar_set("physics_ode_world_damping_linear_threshold", "-1"); - cvar_set("physics_ode_world_damping_angular", "-1"); - cvar_set("physics_ode_world_damping_angular_threshold", "-1"); - cvar_set("physics_ode_world_erp", "-1"); - cvar_set("physics_ode_world_cfm", "-1"); - cvar_set("physics_ode_iterationsperframe", "4"); - cvar_set("physics_ode_movelimit", "0.5"); - cvar_set("physics_ode_spinlimit", "10000"); - cvar_set("physics_ode_autodisable", "1"); - cvar_set("physics_ode_autodisable_steps", "10"); - cvar_set("physics_ode_autodisable_time", "0.1"); - cvar_set("physics_ode_autodisable_threshold_linear", "0.2"); - cvar_set("physics_ode_autodisable_threshold_angular", "0.3"); - cvar_set("physics_ode_autodisable_threshold_samples", "5"); + max_angular = 6500.0f; #ifdef SERVER m_strOnDamaged = __NULL__; @@ -124,14 +114,6 @@ bool physics_supported(void) } #endif -/* all the documented phys vars...*/ -.float geomtype; -.float friction; -.float erp; -.float jointtype; -.float mass; -.float bouncefactor; -.float bouncestop; #ifdef SERVER void @@ -407,12 +389,11 @@ NSPhysicsEntity::CalculateImpactDamage(int iDamage, int dmgType) } int -NSPhysicsEntity_Contents(vector org) +NSPhysicsEntity_Contents(entity target, vector org) { - int oldhitcontents = self.hitcontentsmaski; - self.hitcontentsmaski = -1; - traceline(org, org, MOVE_EVERYTHING, self); - self.hitcontentsmaski = oldhitcontents; + target.hitcontentsmaski = -1; + traceline(org, org, MOVE_EVERYTHING, target); + target.hitcontentsmaski = CONTENTBITS_POINTSOLID; return trace_endcontentsi; } @@ -429,18 +410,24 @@ NSPhysicsEntity::Touch(entity eToucher) return; } - if (IsAsleep() == true) { + if (time < 10.0) { + return; + } + + if (Physics_Simple() == true) { return; } float impactForce = length(GetVelocity()) * 0.01; + //printf("Impact force: %d; required: %d\n", impactForce, GetHealth()); + if (impactForce > GetHealth()) { NSDict damageDecl = spawn(NSDict); damageDecl.AddKey("damage", ftos(impactForce)); Damage(eToucher, eToucher, damageDecl, 1.0f, g_vec_null, GetOrigin()); remove(damageDecl); - printf("New health: %d, impact force: %d\n", health, impactForce); + //printf("New health: %d, impact force: %d\n", health, impactForce); } if (eToucher) @@ -456,7 +443,7 @@ NSPhysicsEntity::_TouchThink(void) return; } - if (physics_supported() == FALSE && GetSolid() != SOLID_TRIGGER) { + if (physics_supported() == FALSE && GetSolid() != SOLID_CORPSE) { EnablePlayerCollision(); tracebox(origin, mins, maxs, origin, FALSE, this); @@ -478,13 +465,13 @@ NSPhysicsEntity::_TouchThink(void) #if 1 if (m_flCheckTime < time) { - bool should - if (vlen(m_vecPrevAngles - angles) < 1) { - avelocity = [0,0,0]; + if (lengthSquared(m_vecPrevAngles - angles) < 4) { + avelocity = g_vec_null; } - if (vlen(m_vecPrevOrigin - origin) < 1) { - velocity = [0,0,0]; + if (lengthSquared(m_vecPrevOrigin - origin) < 4) { + velocity = g_vec_null; } + m_flCheckTime = time + 1.0f; m_vecPrevOrigin = origin; m_vecPrevAngles = angles; @@ -511,33 +498,31 @@ NSPhysicsEntity::_TouchThink(void) } #endif -#if 0 +#if 1 if (m_flBuoyancyRatio > 0.0) - if (NSPhysicsEntity_Contents(origin) & CONTENTBIT_WATER) { - makevectors([0,0,0]); - velocity[2] += m_flBuoyancyRatio; + if (NSPhysicsEntity_Contents(this, origin) & CONTENTBIT_WATER) { + velocity[2] += m_flBuoyancyRatio * frametime; } #endif - hitcontentsmaski &= ~CONTENTBITS_FLUID; - - if (physics_supported() == FALSE && GetSolid() != SOLID_TRIGGER) { + if (physics_supported() == FALSE && GetSolid() != SOLID_CORPSE) { DisablePlayerCollision(); } /* continue testing next frame */ nextthink = time; - effects &= ~EF_NOSHADOW; - solid = SOLID_BSP; } #ifdef SERVER void NSPhysicsEntity::Pain(entity inflictor, entity attacker, int damage, vector dir, int location) { - vector forceDir; float force; + if (modelindex == 0) { + return; + } + if (m_strOnDamaged) { UseOutput(this, m_strOnDamaged); } @@ -566,10 +551,14 @@ NSPhysicsEntity::Pain(entity inflictor, entity attacker, int damage, vector dir, void NSPhysicsEntity::Death(entity inflictor, entity attacker, int damage, vector dir, int location) { + if (modelindex == 0) { + return; + } + Pain(inflictor, attacker, damage, dir, location); super::Death(inflictor, attacker, damage, dir, location); - /* make sure touch think is called */ - nextthink = time; + SetSolid(SOLID_NOT); + ReleaseThink(); } #endif @@ -579,51 +568,45 @@ NSPhysicsEntity::Respawn(void) super::Respawn(); ClearVelocity(); - SetMovetype(MOVETYPE_PHYSICS); - SetSolid(SOLID_BSP); + Sleep(); #ifdef SERVER MakeVulnerable(); #endif - Sleep(); SetMass(1.0f); SetFriction(1.0f); SetBuoyancyRatio(1.0f); - bouncefactor = 0.9f; - bouncestop = 0.1f / cvar("sv_gravity"); - - bouncefactor = 0.0f; - bouncestop = 0.0f; geomtype = GEOMTYPE_BOX; friction = 1.0f; m_flBuoyancyRatio = 1.0f; - SetDamping(1.0f, 1.0f); + SetDamping(0.0f, 0.0f); EnableGravity(true); - hitcontentsmaski &= ~CONTENTBITS_FLUID; + hitcontentsmaski = CONTENTBITS_POINTSOLID; - if (physics_supported() == FALSE && GetSolid() != SOLID_TRIGGER) { + if (physics_supported() == FALSE && GetSolid() != SOLID_CORPSE) { DisablePlayerCollision(); } - think = _TouchThink; - nextthink = time + 0.1f; - - effects &= ~EF_NOSHADOW; + Wake(); #ifdef SERVER if (HasPropData()) { - SetHealth(GetPropData(PROPINFO_HEALTH)); SetMass(GetPropData(PROPINFO_MASS)); SetDamping(GetPropData(PROPINFO_DAMPING_LINEAR), GetPropData(PROPINFO_DAMPING_ANGULAR)); SetInertia(GetPropData(PROPINFO_INERTIA)); SetSurfaceData(GetPropData(PROPINFO_SURFACEPROP)); + } + + + if (HasPropData()) { + SetHealth(GetPropData(PROPINFO_HEALTH)); } else { - health = 0; + health = 1; } /* no health set, either indistructible or too weak */ @@ -634,7 +617,7 @@ NSPhysicsEntity::Respawn(void) health = 10000; } else { /* something like glass bottles, maybe. */ - health = 1.0f; + health = 1; } } #endif @@ -648,7 +631,7 @@ NSPhysicsEntity::SpawnKey(string strKey, string strValue) switch (strKey) { case "physmodel": m_iShape = ReadInt(strValue); - if (m_iShape > PHYSM_CYLINDER) + if (m_iShape > GEOMTYPE_CYLINDER) m_iShape = 0; break; case "massscale": @@ -972,36 +955,58 @@ NSPhysicsEntity::SetMass(float val) void NSPhysicsEntity::Wake(void) { + if (!modelindex) { + return; + } + if (physics_supported() == TRUE) { SetMovetype(MOVETYPE_PHYSICS); SetSolid(SOLID_BSP); /* Don't need a lot of precision during this */ - if (time < 5.0) { + if (Physics_Simple() == true) { geomtype = GEOMTYPE_BOX; + friction = 10000.0f; + //SetDamping(1.0f, 1.0f); } else { - geomtype = GEOMTYPE_TRIMESH; + geomtype = m_iShape; + friction = 1.0f; + //SetDamping(0.0f, 0.0f); } - + physics_enable(this, TRUE); } else { SetMovetype(MOVETYPE_BOUNCE); SetSolid(SOLID_CORPSE); } + + if (isItem(this) == true) { + SetSolid(SOLID_CORPSE); + } + m_iEnabled = TRUE; } void NSPhysicsEntity::Sleep(void) { - if (physics_supported() == TRUE) { - ClearVelocity(); - physics_enable(this, FALSE); - SetMovetype(MOVETYPE_NONE); + if (!modelindex) { + return; + } + + ClearVelocity(); + SetMovetype(MOVETYPE_NONE); + + if (isItem(this) == true) { SetSolid(SOLID_CORPSE); } else { - SetMovetype(MOVETYPE_NONE); SetSolid(SOLID_BBOX); } + + if (physics_supported() == TRUE) { + physics_enable(this, FALSE); + } + + Relink(); m_iEnabled = FALSE; } diff --git a/src/shared/NSPointTrigger.h b/src/shared/NSPointTrigger.h index 3aa1e098..e3eb3e1b 100644 --- a/src/shared/NSPointTrigger.h +++ b/src/shared/NSPointTrigger.h @@ -38,8 +38,5 @@ public: virtual void SpawnKey(string, string); virtual void Save(float); virtual void Restore(string, string); - -private: - string m_strDebugTexture; #endif }; diff --git a/src/shared/NSPointTrigger.qc b/src/shared/NSPointTrigger.qc index c484b054..d22f84a5 100644 --- a/src/shared/NSPointTrigger.qc +++ b/src/shared/NSPointTrigger.qc @@ -17,9 +17,6 @@ void NSPointTrigger::NSPointTrigger(void) { -#ifdef SERVER - m_strDebugTexture = __NULL__; -#endif } void @@ -39,10 +36,6 @@ NSPointTrigger::InitPointTrigger(void) #ifdef SERVER RestoreAngles(); m_bEnabled = (m_bStartDisabled) ? false : true; - - if (m_strDebugTexture == __NULL__) { - m_strDebugTexture = strcat("textures/editor/", classname); - } #endif } @@ -50,13 +43,17 @@ void NSPointTrigger::DebugDraw(void) { #ifdef SERVER + if (!STRING_SET(m_strEditorIcon)) { + return; + } + vector centerPos = WorldSpaceCenter(); super::DebugDraw(); - R_BeginPolygon(m_strDebugTexture, 0, 0); - R_PolygonVertex(centerPos + v_right * 16 - v_up * 16, [1,1], [1,1,1], 1.0f); - R_PolygonVertex(centerPos - v_right * 16 - v_up * 16, [0,1], [1,1,1], 1.0f); - R_PolygonVertex(centerPos - v_right * 16 + v_up * 16, [0,0], [1,1,1], 1.0f); - R_PolygonVertex(centerPos + v_right * 16 + v_up * 16, [1,0], [1,1,1], 1.0f); + R_BeginPolygon(m_strEditorIcon, 0, 0); + R_PolygonVertex(centerPos + v_right * 8 - v_up * 8, [1,1], [1,1,1], 1.0f); + R_PolygonVertex(centerPos - v_right * 8 - v_up * 8, [0,1], [1,1,1], 1.0f); + R_PolygonVertex(centerPos - v_right * 8 + v_up * 8, [0,0], [1,1,1], 1.0f); + R_PolygonVertex(centerPos + v_right * 8 + v_up * 8, [1,0], [1,1,1], 1.0f); R_EndPolygon(); #endif } @@ -67,9 +64,6 @@ void NSPointTrigger::SpawnKey(string strKey, string strValue) { switch (strKey) { - case "editor_sprite": - m_strDebugTexture = ReadString(strValue); - break; default: super::SpawnKey(strKey, strValue); break; @@ -80,16 +74,12 @@ void NSPointTrigger::Save(float handle) { super::Save(handle); - SaveString(handle, "m_strDebugTexture", m_strDebugTexture); } void NSPointTrigger::Restore(string strKey, string strValue) { switch (strKey) { - case "m_strDebugTexture": - m_strDebugTexture = ReadString(strValue); - break; default: super::Restore(strKey, strValue); break; diff --git a/src/shared/NSProjectile.h b/src/shared/NSProjectile.h index b7e239dd..4648a812 100644 --- a/src/shared/NSProjectile.h +++ b/src/shared/NSProjectile.h @@ -52,6 +52,7 @@ public: #ifdef CLIENT virtual void ReceiveEntity(float, float); virtual float predraw(void); + virtual void postdraw(void); #endif #ifdef SERVER @@ -179,6 +180,7 @@ private: bool m_bStickToActor; bool m_bThrustHoming; bool m_bInheritVelocity; + bool m_bReflect; NSTimer m_thrustHandler; diff --git a/src/shared/NSProjectile.qc b/src/shared/NSProjectile.qc index 65949516..7b9c86d1 100644 --- a/src/shared/NSProjectile.qc +++ b/src/shared/NSProjectile.qc @@ -283,6 +283,9 @@ NSProjectile::SpawnKey(string strKey, string strValue) case "thrown": m_bThrown = ReadBool(strValue); break; + case "reflects": + m_bReflect = ReadBool(strValue); + break; default: super::SpawnKey(strKey, strValue); break; @@ -522,11 +525,25 @@ NSProjectile::Spawned(void) SetSize(m_vecSpawnMins, m_vecSpawnMaxs); } + + void NSProjectile::Touch(entity eToucher) { m_vecImpactPos = trace_endpos; + if (eToucher == world && m_bReflect) { + vector currentAngle = GetAngles(); + currentAngle[0] *= -1; + vector currentVelocity = anglesToForward(currentAngle); + SetMovetype(MOVETYPE_FLYMISSILE); + SetVelocity(reflect(currentVelocity, trace_plane_normal) * m_vecLaunchVelocity[0]); + SetAngles(vectoangles(GetVelocity())); + SetOrigin(GetOrigin() + (anglesToForward(GetAngles() * 2.0f))); + StartSoundDef(m_sndBounce, CHAN_BODY, true); + return; + } + if (eToucher.takedamage != DAMAGE_NO) { NSSurfacePropEntity toucher = (NSSurfacePropEntity)eToucher; NSDict damageDecl = spawn(NSDict); @@ -780,7 +797,7 @@ NSProjectile::_Explode(entity explodedOn) flDamage *= m_flDmgMultiplier; } - radiusDamage(damagePos, flRadius, (int)flMinDamage, (int)flDamage, owner, m_defSplashDamage); + combat.RadiusDamage(damagePos, flRadius, (int)flMinDamage, (int)flDamage, owner, m_defSplashDamage); } /* another def that'll be spawned when this one detonates */ @@ -788,7 +805,7 @@ NSProjectile::_Explode(entity explodedOn) float movementAmount = 360.0f / (float)m_iDebrisCount; for (int i = 0; i < m_iDebrisCount; i++) { - NSProjectile_SpawnDefAtPosition(m_defProjectileDebris, (NSEntity)owner, debrisPos, debrisAngle); + NSProjectile_SpawnDefAtPosition(m_defProjectileDebris, (NSActor)owner, debrisPos, debrisAngle); debrisAngle[1] += movementAmount; } } @@ -849,9 +866,9 @@ NSProjectile::_ApplyDamage(void) damageDecl.AddKey("hitbody", itos(trace_surface_id)); damageDecl.AddKey("damage", itos(m_iMultiValue)); - vector dmgDir = normalize(angles); - - entityDamage(m_eMultiTarget, owner, owner, damageDecl.GetDeclBody(), GetWeaponOwner().classname, GetOrigin(), dmgDir, trace_endpos); + damageDecl.AddKey("weapon", GetWeaponOwner().classname); + vector dmgDir = anglesToForward(angles); + m_eMultiTarget.Damage(this, owner, damageDecl, m_flDmgMultiplier, vectorNormalize(angles), m_vecImpactPos); remove(damageDecl); m_eMultiTarget = __NULL__; @@ -979,7 +996,7 @@ NSProjectile::_ThrustThink(void) newVelocity = v_forward * (newSpeed); /* prevent thrusting early */ - if ((m_flThrustStart > 0) && GetSpawnAge() < m_flThrustStart) { + if ((m_flThrustStart > 0) && GetSpawnAge() < m_flThrustStart) { return; } @@ -1005,11 +1022,13 @@ NSProjectile::Launch(vector startPos, vector launchDir, float fuseOffset, float SetAngles(launchDir); SetSize(m_vecSpawnMins, m_vecSpawnMaxs); - if (dmgMultiplier <= 0.0) + if (dmgMultiplier <= 0.0) { dmgMultiplier = 1.0f; + } - if (powerMultiplier <= 0.0) + if (powerMultiplier <= 0.0) { powerMultiplier = 1.0f; + } m_flDmgMultiplier = dmgMultiplier; @@ -1083,7 +1102,14 @@ NSProjectile::Launch(vector startPos, vector launchDir, float fuseOffset, float MakeInvulnerable(); } - if (m_flFuse > 0) { + if (m_flFuse > 0.0f) { + /* quit early */ + if ((m_flFuse - fuseOffset)<= 0.0f) { + m_vecImpactPos = startPos; + _Explode(owner); + return; + } + ScheduleThink(_FuseEnded, m_flFuse - fuseOffset); } @@ -1209,6 +1235,16 @@ NSProjectile::ReceiveEntity(float flNew, float flChanged) drawmask = MASK_ENGINE; } +void +NSProjectile::postdraw(void) +{ +#if 1 + if (m_flLightRadius > 0.0) { + env_sun_lensflare(origin, 1.0f, m_vecLightColor, false); + } +#endif +} + float NSProjectile::predraw(void) { diff --git a/src/shared/NSRagdoll.h b/src/shared/NSRagdoll.h new file mode 100644 index 00000000..65790dd9 --- /dev/null +++ b/src/shared/NSRagdoll.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2016-2022 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/** Ragdoll master entity. + +@ingroup baseclass +*/ +class NSRagdoll:NSRenderableEntity +{ +public: + void NSRagdoll(void); + +#ifdef SERVER + virtual void EvaluateEntity(void); + virtual float SendEntity(entity,float); +#endif + +#ifdef CLIENT + virtual void ReceiveEntity(float,float); + virtual float predraw(void); +#endif + + +private: + float m_skelRagdoll; +}; + + +#ifdef CLIENT +void NSRagdoll_Create(string modelFile); +#endif diff --git a/src/shared/NSRagdoll.qc b/src/shared/NSRagdoll.qc new file mode 100644 index 00000000..c250bad4 --- /dev/null +++ b/src/shared/NSRagdoll.qc @@ -0,0 +1,273 @@ +/* + * Copyright (c) 2016-2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +void +NSRagdoll::NSRagdoll(void) +{ + m_skelRagdoll = 0; +} + +#ifdef SERVER +void +NSRagdoll::EvaluateEntity(void) +{ + EVALUATE_VECTOR(origin, 0, RDENT_CHANGED_ORIGIN_X) + EVALUATE_VECTOR(origin, 1, RDENT_CHANGED_ORIGIN_Y) + EVALUATE_VECTOR(origin, 2, RDENT_CHANGED_ORIGIN_Z) + EVALUATE_VECTOR(angles, 0, RDENT_CHANGED_ANGLES_X) + EVALUATE_VECTOR(angles, 1, RDENT_CHANGED_ANGLES_Y) + EVALUATE_VECTOR(angles, 2, RDENT_CHANGED_ANGLES_Z) + EVALUATE_FIELD(modelindex, RDENT_CHANGED_MODELINDEX) + EVALUATE_FIELD(colormap, RDENT_CHANGED_MODELINDEX) + EVALUATE_FIELD(solid, RDENT_CHANGED_SOLIDMOVETYPE) + EVALUATE_FIELD(movetype, RDENT_CHANGED_SOLIDMOVETYPE) + EVALUATE_FIELD(flags, RDENT_CHANGED_FLAGS) + EVALUATE_FIELD(modelflags, RDENT_CHANGED_FLAGS) + EVALUATE_VECTOR(mins, 0, RDENT_CHANGED_SIZE) + EVALUATE_VECTOR(mins, 1, RDENT_CHANGED_SIZE) + EVALUATE_VECTOR(mins, 2, RDENT_CHANGED_SIZE) + EVALUATE_VECTOR(maxs, 0, RDENT_CHANGED_SIZE) + EVALUATE_VECTOR(maxs, 1, RDENT_CHANGED_SIZE) + EVALUATE_VECTOR(maxs, 2, RDENT_CHANGED_SIZE) + EVALUATE_FIELD(frame, RDENT_CHANGED_FRAME) + EVALUATE_FIELD(frame1time, RDENT_CHANGED_FRAME) + EVALUATE_FIELD(skin, RDENT_CHANGED_SKIN) + EVALUATE_FIELD(effects, RDENT_CHANGED_EFFECTS) + EVALUATE_FIELD(m_iBody, RDENT_CHANGED_BODY) + EVALUATE_FIELD(scale, RDENT_CHANGED_SCALE) + EVALUATE_VECTOR(m_vecAxialScale, 0, RDENT_CHANGED_SCALE) + EVALUATE_VECTOR(m_vecAxialScale, 1, RDENT_CHANGED_SCALE) + EVALUATE_VECTOR(m_vecAxialScale, 2, RDENT_CHANGED_SCALE) + EVALUATE_VECTOR(velocity, 0, RDENT_CHANGED_VELOCITY) + EVALUATE_VECTOR(velocity, 1, RDENT_CHANGED_VELOCITY) + EVALUATE_VECTOR(velocity, 2, RDENT_CHANGED_VELOCITY) + EVALUATE_VECTOR(avelocity, 0, RDENT_CHANGED_ANGULARVELOCITY) + EVALUATE_VECTOR(avelocity, 1, RDENT_CHANGED_ANGULARVELOCITY) + EVALUATE_VECTOR(avelocity, 2, RDENT_CHANGED_ANGULARVELOCITY) + EVALUATE_FIELD(m_iRenderMode, RDENT_CHANGED_RENDERMODE) + EVALUATE_FIELD(m_iRenderFX, RDENT_CHANGED_RENDERMODE) + EVALUATE_VECTOR(m_vecRenderColor, 0, RDENT_CHANGED_RENDERCOLOR) + EVALUATE_VECTOR(m_vecRenderColor, 1, RDENT_CHANGED_RENDERCOLOR) + EVALUATE_VECTOR(m_vecRenderColor, 2, RDENT_CHANGED_RENDERCOLOR) + EVALUATE_VECTOR(glowmod, 0, RDENT_CHANGED_RENDERCOLOR) + EVALUATE_VECTOR(glowmod, 1, RDENT_CHANGED_RENDERCOLOR) + EVALUATE_VECTOR(glowmod, 2, RDENT_CHANGED_RENDERCOLOR) + EVALUATE_FIELD(m_flRenderAmt, RDENT_CHANGED_RENDERAMT) + EVALUATE_FIELD(m_flBoneControl1, RDENT_CHANGED_CONTROLLER) + EVALUATE_FIELD(m_flBoneControl2, RDENT_CHANGED_CONTROLLER) + EVALUATE_FIELD(m_flBoneControl3, RDENT_CHANGED_CONTROLLER) + EVALUATE_FIELD(m_flBoneControl4, RDENT_CHANGED_CONTROLLER) + EVALUATE_FIELD(m_flBoneControl5, RDENT_CHANGED_CONTROLLER) +} + +/* Make sure StartFrame calls this */ +float +NSRagdoll::SendEntity(entity ePEnt, float flChanged) +{ + if (!modelindex && solid == SOLID_NOT) + return (0); + + WriteByte(MSG_ENTITY, ENT_RAGDOLL); + + /* optimisation */ + { + /* we'll never network these if we aren't moving. */ + if (movetype == MOVETYPE_NONE) { + flChanged &= ~RDENT_CHANGED_VELOCITY; + flChanged &= ~RDENT_CHANGED_ANGULARVELOCITY; + } + + /* no rendermode means no extra fields */ + if (m_iRenderMode == RM_NORMAL && m_iRenderFX == RFX_NORMAL) { + flChanged &= ~RDENT_CHANGED_RENDERMODE; + //flChanged &= ~RDENT_CHANGED_RENDERCOLOR; /* glowmod needs this */ + flChanged &= ~RDENT_CHANGED_RENDERAMT; + } + + if (m_bIsBrush == true) { + flChanged &= ~RDENT_CHANGED_FLAGS; + flChanged &= ~RDENT_CHANGED_BODY; + flChanged &= ~RDENT_CHANGED_SCALE; + flChanged &= ~RDENT_CHANGED_CONTROLLER; + } + } + + /* broadcast how much data is expected to be read */ + WriteFloat(MSG_ENTITY, flChanged); + + SENDENTITY_COORD(origin[0], RDENT_CHANGED_ORIGIN_X) + SENDENTITY_COORD(origin[1], RDENT_CHANGED_ORIGIN_Y) + SENDENTITY_COORD(origin[2], RDENT_CHANGED_ORIGIN_Z) + SENDENTITY_ANGLE(angles[0], RDENT_CHANGED_ANGLES_X) + SENDENTITY_ANGLE(angles[1], RDENT_CHANGED_ANGLES_Y) + SENDENTITY_ANGLE(angles[2], RDENT_CHANGED_ANGLES_Z) + SENDENTITY_SHORT(modelindex, RDENT_CHANGED_MODELINDEX) + SENDENTITY_BYTE(colormap, RDENT_CHANGED_MODELINDEX) + SENDENTITY_BYTE(solid, RDENT_CHANGED_SOLIDMOVETYPE) + SENDENTITY_BYTE(movetype, RDENT_CHANGED_SOLIDMOVETYPE) + SENDENTITY_INT(flags, RDENT_CHANGED_FLAGS) + SENDENTITY_INT(modelflags, RDENT_CHANGED_FLAGS) + SENDENTITY_COORD(mins[0], RDENT_CHANGED_SIZE) + SENDENTITY_COORD(mins[1], RDENT_CHANGED_SIZE) + SENDENTITY_COORD(mins[2], RDENT_CHANGED_SIZE) + SENDENTITY_COORD(maxs[0], RDENT_CHANGED_SIZE) + SENDENTITY_COORD(maxs[1], RDENT_CHANGED_SIZE) + SENDENTITY_COORD(maxs[2], RDENT_CHANGED_SIZE) + SENDENTITY_FLOAT(frame, RDENT_CHANGED_FRAME) + SENDENTITY_FLOAT(frame1time, RDENT_CHANGED_FRAME) + SENDENTITY_FLOAT(skin, RDENT_CHANGED_SKIN) + SENDENTITY_FLOAT(effects, RDENT_CHANGED_EFFECTS) + SENDENTITY_SHORT(m_iBody, RDENT_CHANGED_BODY) + SENDENTITY_FLOAT(scale, RDENT_CHANGED_SCALE) + SENDENTITY_FLOAT(m_vecAxialScale[0], RDENT_CHANGED_SCALE) + SENDENTITY_FLOAT(m_vecAxialScale[1], RDENT_CHANGED_SCALE) + SENDENTITY_FLOAT(m_vecAxialScale[2], RDENT_CHANGED_SCALE) + SENDENTITY_COORD(velocity[0], RDENT_CHANGED_VELOCITY) + SENDENTITY_COORD(velocity[1], RDENT_CHANGED_VELOCITY) + SENDENTITY_COORD(velocity[2], RDENT_CHANGED_VELOCITY) + SENDENTITY_COORD(avelocity[0], RDENT_CHANGED_ANGULARVELOCITY) + SENDENTITY_COORD(avelocity[1], RDENT_CHANGED_ANGULARVELOCITY) + SENDENTITY_COORD(avelocity[2], RDENT_CHANGED_ANGULARVELOCITY) + SENDENTITY_BYTE(m_iRenderMode, RDENT_CHANGED_RENDERMODE) + SENDENTITY_BYTE(m_iRenderFX, RDENT_CHANGED_RENDERMODE) + SENDENTITY_COLOR(m_vecRenderColor[0], RDENT_CHANGED_RENDERCOLOR) + SENDENTITY_COLOR(m_vecRenderColor[1], RDENT_CHANGED_RENDERCOLOR) + SENDENTITY_COLOR(m_vecRenderColor[2], RDENT_CHANGED_RENDERCOLOR) + /* these need more precision for shader hacks... */ + SENDENTITY_FLOAT(glowmod[0], RDENT_CHANGED_RENDERCOLOR) + SENDENTITY_FLOAT(glowmod[1], RDENT_CHANGED_RENDERCOLOR) + SENDENTITY_FLOAT(glowmod[2], RDENT_CHANGED_RENDERCOLOR) + SENDENTITY_ANGLE(m_flRenderAmt, RDENT_CHANGED_RENDERAMT) + SENDENTITY_ANGLE(m_flBoneControl1, RDENT_CHANGED_CONTROLLER) + SENDENTITY_ANGLE(m_flBoneControl2, RDENT_CHANGED_CONTROLLER) + SENDENTITY_ANGLE(m_flBoneControl3, RDENT_CHANGED_CONTROLLER) + SENDENTITY_ANGLE(m_flBoneControl4, RDENT_CHANGED_CONTROLLER) + SENDENTITY_ANGLE(m_flBoneControl5, RDENT_CHANGED_CONTROLLER) + + return (1); +} +#else +/* +============ +NSRagdoll::ReceiveEntity +============ +*/ +void +NSRagdoll::ReceiveEntity(float flNew, float flChanged) +{ + READENTITY_COORD(origin[0], RDENT_CHANGED_ORIGIN_X) + READENTITY_COORD(origin[1], RDENT_CHANGED_ORIGIN_Y) + READENTITY_COORD(origin[2], RDENT_CHANGED_ORIGIN_Z) + READENTITY_ANGLE(angles[0], RDENT_CHANGED_ANGLES_X) + READENTITY_ANGLE(angles[1], RDENT_CHANGED_ANGLES_Y) + READENTITY_ANGLE(angles[2], RDENT_CHANGED_ANGLES_Z) + READENTITY_SHORT(modelindex, RDENT_CHANGED_MODELINDEX) + READENTITY_BYTE(colormap, RDENT_CHANGED_MODELINDEX) + READENTITY_BYTE(solid, RDENT_CHANGED_SOLIDMOVETYPE) + READENTITY_BYTE(movetype, RDENT_CHANGED_SOLIDMOVETYPE) + READENTITY_INT(flags, RDENT_CHANGED_FLAGS) + READENTITY_INT(modelflags, RDENT_CHANGED_FLAGS) + READENTITY_COORD(mins[0], RDENT_CHANGED_SIZE) + READENTITY_COORD(mins[1], RDENT_CHANGED_SIZE) + READENTITY_COORD(mins[2], RDENT_CHANGED_SIZE) + READENTITY_COORD(maxs[0], RDENT_CHANGED_SIZE) + READENTITY_COORD(maxs[1], RDENT_CHANGED_SIZE) + READENTITY_COORD(maxs[2], RDENT_CHANGED_SIZE) + READENTITY_FLOAT(frame, RDENT_CHANGED_FRAME) + READENTITY_FLOAT(frame1time, RDENT_CHANGED_FRAME) + READENTITY_FLOAT(skin, RDENT_CHANGED_SKIN) + READENTITY_FLOAT(effects, RDENT_CHANGED_EFFECTS) + READENTITY_SHORT(m_iBody, RDENT_CHANGED_BODY) + READENTITY_FLOAT(scale, RDENT_CHANGED_SCALE) + READENTITY_FLOAT(m_vecAxialScale[0], RDENT_CHANGED_SCALE) + READENTITY_FLOAT(m_vecAxialScale[1], RDENT_CHANGED_SCALE) + READENTITY_FLOAT(m_vecAxialScale[2], RDENT_CHANGED_SCALE) + READENTITY_COORD(velocity[0], RDENT_CHANGED_VELOCITY) + READENTITY_COORD(velocity[1], RDENT_CHANGED_VELOCITY) + READENTITY_COORD(velocity[2], RDENT_CHANGED_VELOCITY) + READENTITY_COORD(avelocity[0], RDENT_CHANGED_ANGULARVELOCITY) + READENTITY_COORD(avelocity[1], RDENT_CHANGED_ANGULARVELOCITY) + READENTITY_COORD(avelocity[2], RDENT_CHANGED_ANGULARVELOCITY) + READENTITY_BYTE(m_iRenderMode, RDENT_CHANGED_RENDERMODE) + READENTITY_BYTE(m_iRenderFX, RDENT_CHANGED_RENDERMODE) + READENTITY_COLOR(m_vecRenderColor[0], RDENT_CHANGED_RENDERCOLOR) + READENTITY_COLOR(m_vecRenderColor[1], RDENT_CHANGED_RENDERCOLOR) + READENTITY_COLOR(m_vecRenderColor[2], RDENT_CHANGED_RENDERCOLOR) + /* these need more precision for shader hacks... */ + READENTITY_FLOAT(glowmod[0], RDENT_CHANGED_RENDERCOLOR) + READENTITY_FLOAT(glowmod[1], RDENT_CHANGED_RENDERCOLOR) + READENTITY_FLOAT(glowmod[2], RDENT_CHANGED_RENDERCOLOR) + READENTITY_ANGLE(m_flRenderAmt, RDENT_CHANGED_RENDERAMT) + READENTITY_ANGLE(m_flBoneControl1, RDENT_CHANGED_CONTROLLER) + READENTITY_ANGLE(m_flBoneControl2, RDENT_CHANGED_CONTROLLER) + READENTITY_ANGLE(m_flBoneControl3, RDENT_CHANGED_CONTROLLER) + READENTITY_ANGLE(m_flBoneControl4, RDENT_CHANGED_CONTROLLER) + READENTITY_ANGLE(m_flBoneControl5, RDENT_CHANGED_CONTROLLER) + + movetype = MOVETYPE_PHYSICS; + + if (!skeletonindex && modelindex) { + skeletonindex = skel_create(modelindex); + skel_build(skeletonindex, this, modelindex, 0, 0, 0, 1); + skel_ragupdate(this, "doll models/rt2/human.doll", 0); + skel_ragupdate(this, "animate 0", 0); + } + + if (scale == 0.0) + scale = 1.0f; + + if (flChanged & RDENT_CHANGED_SIZE) + setsize(this, mins * scale, maxs * scale); + if (flChanged & RDENT_CHANGED_BODY) + _UpdateGeomset(); + if (flChanged & RDENT_CHANGED_MODELINDEX) + _UpdateBoneCount(); +} + +float +NSRagdoll::predraw(void) +{ + if (!modelindex || !skeletonindex) { + return (PREDRAW_NEXT); + } + + frame1time = time; + frame2time = time; + frame = 0; + frame2 = 1; + lerpfrac = 0.0; + skel_build(this.skeletonindex, this, this.modelindex, 0, 0, 0, 1); + skel_ragupdate(this, "", 0); + addentity(this); + return (PREDRAW_NEXT); +} + +void +NSRagdoll_Create(string modelFile) +{ + NSRagdoll rag = spawn(NSRagdoll); + rag.Spawn(); + rag.movetype = MOVETYPE_PHYSICS; + rag.drawmask = MASK_ENGINE; + rag.SetOrigin(g_view.GetCameraOrigin()); + rag.SetModel("models/humans/group03/male_07.mdl"); + + rag.skeletonindex = skel_create(rag.modelindex); + skel_build(rag.skeletonindex, rag, rag.modelindex, 0, 0, 0, 1); + skel_ragupdate(rag, "doll models/rt2/human.doll", 0); + skel_ragupdate(rag, "animate 0", 0); +} +#endif diff --git a/src/shared/NSRenderableEntity.qc b/src/shared/NSRenderableEntity.qc index 5d24729d..99c11180 100644 --- a/src/shared/NSRenderableEntity.qc +++ b/src/shared/NSRenderableEntity.qc @@ -482,10 +482,10 @@ NSRenderableEntity::RenderFXPass(void) case RFX_GLOWSHELL2: /* make this entity shellchrome */ effects = EF_ADDITIVE; - fatness = 0; + fatness = m_flRenderAmt / 25.5; colormod = (m_vecRenderColor / 255); forceshader = g_shellchromeshader_cull; - alpha = (m_flRenderAmt / 255); + alpha = 1.0f; /* copy entity into rendering queue */ addentity(this); /* reset */ @@ -498,10 +498,10 @@ NSRenderableEntity::RenderFXPass(void) case RFX_GLOWSHELL: /* make this entity shellchrome */ effects = EF_ADDITIVE; - fatness = 0; + fatness = m_flRenderAmt / 25.5; colormod = (m_vecRenderColor / 255); forceshader = g_shellchromeshader; - alpha = (m_flRenderAmt / 255); + alpha = 1.0f; /* copy entity into rendering queue */ addentity(this); /* reset */ @@ -621,6 +621,7 @@ NSRenderableEntity::predraw(void) RenderFXPass(); RenderDebugSkeleton(); + if (modelflags & MF_ROTATE) { angles[1] = g_modelSpinAngle; angles[2] = g_modelSpinRoll; @@ -789,17 +790,14 @@ NSRenderableEntity::Respawn(void) SetRenderAmt(GetSpawnFloat("renderamt")); SetRenderColor(GetSpawnVector("rendercolor")); + SetScale(GetSpawnFloat("modelscale")); + SetSkin(GetSpawnInt("skin")); SetBody(GetSpawnInt("body")); SetBodyInGroup(0, GetSpawnInt("body0")); SetBodyInGroup(1, GetSpawnInt("body1")); SetBodyInGroup(2, GetSpawnInt("body2")); SetBodyInGroup(3, GetSpawnInt("body3")); - - //SetRenderFX(GetSpawnRenderFX()); - //SetRenderMode(GetSpawnRenderMode()); - //SetRenderAmt(GetSpawnRenderAmt()); - //SetRenderColor(GetSpawnRenderColor()); } #endif @@ -1224,8 +1222,10 @@ NSRenderableEntity::SpawnKey(string strKey, string strValue) } } +#if 0 float NSRenderableEntity::PlayActOnChannel(float animChannel, string activityName) { - + } +#endif diff --git a/src/shared/NSSound.h b/src/shared/NSSound.h index 2937c13e..a9982adb 100644 --- a/src/shared/NSSound.h +++ b/src/shared/NSSound.h @@ -14,77 +14,56 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -class NSSound:NSPointTrigger { +enumflags +{ + SOUND_SAMPLE, + SOUND_VOLUME, + SOUND_RADIUS, + SOUND_PITCH, + SOUND_ORIGIN, + SOUND_ENABLED +}; + +class +NSSound:NSPointTrigger +{ public: void NSSound( void ); nonvirtual void SetSample( string ); nonvirtual void SetVolume( float ); nonvirtual void SetRadius( float ); + nonvirtual void SetPitch( float ); nonvirtual void SetSoundOffset( float ); nonvirtual void MakeOmniDirectional( void ); nonvirtual void MakeDirectional( void ); nonvirtual void EnableReverb( void ); nonvirtual void DisableReverb( void ); - nonvirtual virtual void Play( void ); + nonvirtual void ForceLoop( bool ); + nonvirtual void Play( void ); + + virtual void Spawned(void); + virtual void OnRemoveEntity(void); + +#ifdef SERVER + virtual void Respawn(void); + virtual void EvaluateEntity(void); + virtual float SendEntity(entity, float); +#endif + +#ifdef CLIENT + virtual void ReceiveEntity(float,float); +#endif private: - float m_radius; - float m_volume; + NETWORKED_FLOAT(m_radius) + NETWORKED_FLOAT(m_volume) + NETWORKED_FLOAT(m_soundIndex) + NETWORKED_FLOAT(m_pitch) + NETWORKED_BOOL(m_isLooping) string m_sample; bool m_omniDirectional; float m_offset; + bool m_ignoreReverb; + bool m_forceLoop; }; - -void NSSound::NSSound( void ) { - m_radius = 128.0f; - m_volume = 0.5f; - m_sample = "common/null.wav"; -} - -void NSSound::SetSample( string newSample ) { - m_sample = newSample; -} - -void NSSound::SetVolume( float newVolume ) { - m_volume = newVolume; -} - -void NSSound::SetRadius( float newRadius ) { - m_radius = newRadius; -} - -void NSSound::SetSoundOffset( float newRadius ) { - m_offset = newRadius; -} - -void NSSound::MakeOmniDirectional( void ) { - m_omniDirectional = true; -} - -void NSSound::MakeDirectional( void ) { - m_omniDirectional = false; -} - -void NSSound::EnableReverb( void ) { - m_ignoreReverb = false; -} - -void NSSound::DisableReverb( void ) { - m_ignoreReverb = true; -} - -void NSSound::Play( void ) { - float soundFlags = 0; - - if ( m_ignoreReverb ) { - soundFlags |= SOUNDFLAG_NOREVERB; - } -#ifdef CLIENT - if ( m_omniDirectional ) { - soundFlags |= SOUNDFLAG_NOSPACIALISE; - } -#endif - - sound( this, CHAN_AUTO, m_sample, m_volume, m_radius, m_pitch, soundFlags, m_offset ); -} diff --git a/src/shared/NSSound.qc b/src/shared/NSSound.qc index e69de29b..d5a3593b 100644 --- a/src/shared/NSSound.qc +++ b/src/shared/NSSound.qc @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + + +void +NSSound::NSSound( void ) +{ + m_radius = 128.0f; + m_volume = 0.5f; + m_sample = "common/null.wav"; + m_soundIndex = 0; + m_offset = 0.0f; + m_pitch = 100.0f; + m_omniDirectional = false; + m_ignoreReverb = false; + m_forceLoop = true; +} + +void +NSSound::Spawned( void ) +{ + super::Spawned(); + m_soundIndex = getsoundindex(m_sample, false); + +#ifdef SERVER + pvsflags = PVSF_USEPHS; +#endif +} + +void +NSSound::SetSample( string newSample ) +{ + m_sample = newSample; + m_soundIndex = getsoundindex(m_sample, true); +} + +void +NSSound::SetVolume( float newVolume ) +{ + m_volume = newVolume; +} + +void +NSSound::SetPitch( float newPitch ) +{ + m_pitch = newPitch; +} + +void +NSSound::SetRadius( float newRadius ) +{ + m_radius = newRadius; +} + +void +NSSound::SetSoundOffset( float newOffset ) +{ + m_offset = newOffset; +} + +void +NSSound::MakeOmniDirectional( void ) +{ + m_omniDirectional = true; +} + +void +NSSound::MakeDirectional( void ) +{ + m_omniDirectional = false; +} + +void +NSSound::EnableReverb( void ) +{ + m_ignoreReverb = false; +} + +void +NSSound::DisableReverb( void ) +{ + m_ignoreReverb = true; +} + +void +NSSound::ForceLoop( bool forceLooping ) +{ + m_forceLoop = forceLooping; + +#ifdef SERVER + if (m_forceLoop) { + m_isLooping = true; + } else { + m_isLooping = false; + } + SendFlags |= SOUND_ENABLED; +#endif +} + +void +NSSound::Play( void ) +{ + float soundFlags = 0; + + if ( m_ignoreReverb ) { + soundFlags |= SOUNDFLAG_NOREVERB; + } +#ifdef CLIENT + if ( m_omniDirectional ) { + soundFlags |= SOUNDFLAG_NOSPACIALISE; + } +#endif + + sound(this, CHAN_BODY, m_sample, m_volume, (cvar("s_nominaldistance") / m_radius), m_pitch, soundFlags, m_offset); +} + +#ifdef SERVER +void +NSSound::Respawn(void) +{ + super::Respawn(); +} + +void +NSSound::EvaluateEntity(void) +{ + EVALUATE_VECTOR(origin, 0, RDENT_CHANGED_ORIGIN_X) + EVALUATE_VECTOR(origin, 1, RDENT_CHANGED_ORIGIN_Y) + EVALUATE_VECTOR(origin, 2, RDENT_CHANGED_ORIGIN_Z) + EVALUATE_FIELD(m_soundIndex, SOUND_SAMPLE) + EVALUATE_FIELD(m_volume, SOUND_VOLUME) + EVALUATE_FIELD(m_radius, SOUND_RADIUS) + EVALUATE_FIELD(m_pitch, SOUND_PITCH) + EVALUATE_FIELD(m_isLooping, SOUND_ENABLED) +} + +float +NSSound::SendEntity(entity ePEnt, float flChanged) +{ + if (distance(ePEnt.origin, origin) >= m_radius) { + return (false); + } + + WriteByte(MSG_ENTITY, ENT_SOUND); + WriteFloat(MSG_ENTITY, flChanged); + + SENDENTITY_COORD(origin[0], SOUND_ORIGIN) + SENDENTITY_COORD(origin[1], SOUND_ORIGIN) + SENDENTITY_COORD(origin[2], SOUND_ORIGIN) + SENDENTITY_FLOAT(m_soundIndex, SOUND_SAMPLE) + SENDENTITY_FLOAT(m_volume, SOUND_VOLUME) + SENDENTITY_FLOAT(m_radius, SOUND_RADIUS) + SENDENTITY_FLOAT(m_pitch, SOUND_PITCH) + SENDENTITY_BYTE(m_isLooping, SOUND_ENABLED) + + return (true); +} +#endif + +#ifdef CLIENT +void +NSSound::ReceiveEntity(float isnew, float flChanged) +{ + READENTITY_COORD(origin[0], SOUND_ORIGIN) + READENTITY_COORD(origin[1], SOUND_ORIGIN) + READENTITY_COORD(origin[2], SOUND_ORIGIN) + READENTITY_FLOAT(m_soundIndex, SOUND_SAMPLE) + READENTITY_FLOAT(m_volume, SOUND_VOLUME) + READENTITY_FLOAT(m_radius, SOUND_RADIUS) + READENTITY_FLOAT(m_pitch, SOUND_PITCH) + READENTITY_BYTE(m_isLooping, SOUND_ENABLED) + + if (flChanged & SOUND_ORIGIN) { + SetSolid(SOLID_NOT); + SetSize([0,0,0], [0,0,0]); + Relink(); + } + + if (flChanged & SOUND_SAMPLE) { + m_sample = soundnameforindex(m_soundIndex); + } + + if (m_isLooping) + SndEntLog("^2start ^7%S Volume: %d%%; Radius: %d units; Pitch: %d, Org: %v", m_sample, m_volume * 100, m_radius, m_pitch, origin); + else + SndEntLog("^1stop: ^7%S Volume: %d%%; Radius: %d units; Pitch: %d, Org: %v", m_sample, m_volume * 100, m_radius, m_pitch, origin); + + if (flChanged & SOUND_ENABLED) + if (m_isLooping == true) { + soundupdate(this, CHAN_BODY, m_sample, m_volume, (cvar("s_nominaldistance") / m_radius), m_pitch, SOUNDFLAG_FORCELOOP, 0); + } else { + OnRemoveEntity(); + } +} +#endif + +void +NSSound::OnRemoveEntity(void) +{ + SndEntLog("stopping\n"); + StopSound(CHAN_BODY, true); +} diff --git a/src/shared/NSSpawnPoint.h b/src/shared/NSSpawnPoint.h index 37964c22..d58e5551 100644 --- a/src/shared/NSSpawnPoint.h +++ b/src/shared/NSSpawnPoint.h @@ -25,9 +25,4 @@ public: /* overrides */ virtual void Respawn(void); - virtual void SpawnKey(string, string); - -private: - vector m_vecMins; - vector m_vecMaxs; }; diff --git a/src/shared/NSSpawnPoint.qc b/src/shared/NSSpawnPoint.qc index f359095f..c5c8e6ea 100644 --- a/src/shared/NSSpawnPoint.qc +++ b/src/shared/NSSpawnPoint.qc @@ -24,33 +24,19 @@ NSSpawnPoint::Respawn(void) { vector newMins, newMaxs; - if (m_vecMins == g_vec_null) { + newMins = GetSpawnVector("mins"); + newMaxs = GetSpawnVector("maxs"); + + if (newMins == g_vec_null) { newMins = VEC_HULL_MIN; newMaxs = VEC_HULL_MAX; - } else { - newMins = m_vecMins; - newMaxs = m_vecMaxs; } - super::Respawn(); - - SetOriginUnstick(GetSpawnVector("origin")); + SetSolid(SOLID_BBOX); SetSize(newMins, newMaxs); + SetOriginUnstick(GetSpawnVector("origin")); SetBotTag(BOTINFO_SPAWNPOINT); + SetSolid(SOLID_NOT); + SetMovetype(MOVETYPE_NONE); + Disappear(); } - -void -NSSpawnPoint::SpawnKey(string keyName, string setValue) -{ - switch (keyName) { - case "mins": - m_vecMins = ReadVector(setValue); - break; - case "maxs": - m_vecMaxs = ReadVector(setValue); - break; - default: - super::SpawnKey(keyName, setValue); - } -} - diff --git a/src/shared/NSSurfacePropEntity.h b/src/shared/NSSurfacePropEntity.h index a1122b28..a40cf1af 100644 --- a/src/shared/NSSurfacePropEntity.h +++ b/src/shared/NSSurfacePropEntity.h @@ -198,6 +198,3 @@ private: #ifdef CLIENT void NSSurfacePropEntity_ReadEntity(bool); #endif - -void entityDamage(entity, entity, entity, string, string, vector, vector, vector); -void radiusDamage(vector, float, int, int, entity, string); diff --git a/src/shared/NSSurfacePropEntity.qc b/src/shared/NSSurfacePropEntity.qc index a87c70b3..93afd375 100644 --- a/src/shared/NSSurfacePropEntity.qc +++ b/src/shared/NSSurfacePropEntity.qc @@ -532,6 +532,9 @@ NSSurfacePropEntity::BreakModel(int damage, vector dir, int location) Disappear(); } + SetSolid(SOLID_NOT); + SetMovetype(MOVETYPE_NONE); + /* handle explosions */ float flExplodeMag, flExplodeRad; flExplodeMag = GetPropData(PROPINFO_EXPLOSIVE_DMG); @@ -543,7 +546,7 @@ NSSurfacePropEntity::BreakModel(int damage, vector dir, int location) } pointparticles(particleeffectnum("fx_explosion.main"), origin, angles, 1); - radiusDamage(origin, flExplodeRad, 0i, (int)flExplodeMag, this, ""); + combat.RadiusDamage(origin, flExplodeRad, 0i, (int)flExplodeMag, this, ""); } } @@ -559,15 +562,6 @@ NSSurfacePropEntity::SetPropData(string type) { m_strPropData = type; _PropDataFinish(); - - /* no surfdata? maybe the propdata has got one set. */ - if (m_iMaterial == -1i) { - string propDataSurf = GetPropData(PROPINFO_SURFACEPROP); - - if (propDataSurf != "") { - SetSurfaceData(propDataSurf); - } - } } void @@ -575,7 +569,7 @@ NSSurfacePropEntity::_SurfaceDataFinish(void) { SurfData_SetStage(m_strSurfData); - if (m_strSurfData) { + if (STRING_SET(m_strSurfData)) { m_iMaterial = SurfData_Finish(); } else { m_iMaterial = -1i; @@ -587,11 +581,20 @@ NSSurfacePropEntity::_PropDataFinish(void) { PropData_SetStage(m_strPropData); - if (m_strPropData) { + if (STRING_SET(m_strPropData)) { m_iPropData = PropData_Finish(); } else { m_iPropData = -1i; } + + /* no surfdata? maybe the propdata has got one set. */ + if (m_iMaterial == -1i && m_iPropData != -1i) { + string propDataSurf = GetPropData(PROPINFO_SURFACEPROP); + + if (STRING_SET(propDataSurf)) { + SetSurfaceData(propDataSurf); + } + } } float @@ -778,7 +781,7 @@ NSSurfacePropEntity::ReceiveEntity(float flNew, float flChanged) void NSSurfacePropEntity::RenderFire(void) { - if (IsOnFire()) { + if (IsOnFire() == true) { vector randomOrg; if (m_flBurnNext < time) { @@ -794,12 +797,15 @@ NSSurfacePropEntity::RenderFire(void) float NSSurfacePropEntity::predraw(void) { - float returnValue = super::predraw(); + float oldEffects = effects; - if (returnValue) { + if (modelindex != 0) { RenderFire(); } + float returnValue = super::predraw(); + + effects = oldEffects; return returnValue; } @@ -824,96 +830,10 @@ NSSurfacePropEntity::SetModel(string newModel) NSRenderableEntity::SetModel(newModel); #ifdef SERVER - if (model && HasPropData() == false) { + if (STRING_SET(model) && HasPropData() == false) { m_iPropData = PropData_ForModel(model); - } -#endif -} - -/* helper functions */ - -void -entityDamage(entity targetEnt, entity inflictingEnt, entity attackingEnt, string damageDef, string weaponDef, vector damageOrigin, vector damageDir, vector hitLocation) -{ -#ifdef SERVER - NSSurfacePropEntity theTarget; - - /* common filters */ - if (targetEnt.takedamage == DAMAGE_NO) { - return; - } - - if (isGodMode(targetEnt) == true) { - return; - } - - theTarget = (NSSurfacePropEntity)targetEnt; - - /* don't use IsAlive(), else we can't gib */ - if (!theTarget.GetHealth()) { - return; - } - - NSDict damageDecl = NSDict::InitWithSpawnData(damageDef); - damageDecl.AddKey("weapon", weaponDef); - theTarget.Damage(inflictingEnt, attackingEnt, damageDecl, 1.0, damageDir, hitLocation); - remove(damageDecl); -#endif -} - -void -radiusDamage(vector damageCenter, float damageRange, int damageMin, int damageMax, entity attackingEnt, string strDamageDecl) -{ -#ifdef SERVER - vector entPos = g_vec_null; - float entDistance = 0.0f; - int newDamage = 0i; - float damageFrac = 0.0f; - vector dmgDir = g_vec_null; - - for (NSSurfacePropEntity e = __NULL__; (e = (NSSurfacePropEntity)nextent(e));) { - if (e.takedamage == DAMAGE_NO) { - continue; - } - - entPos = e.WorldSpaceCenter(); - - /* don't bother if it's not anywhere near us */ - entDistance = length(damageCenter - entPos); - - if (entDistance > damageRange) { - continue; - } - - /* can we physically hit this thing? */ - if (damageMax > 0i) { - if (e.CanBeDamaged(damageCenter, entPos) == false) { - continue; - } - } - - /* calculate new damage values */ - damageFrac = (damageRange - entDistance) / damageRange; - newDamage = (int)lerp(fabs((float)damageMin), (float)damageMax, damageFrac); - dmgDir = dirFromTarget(damageCenter, entPos); - - if (e == attackingEnt) { - newDamage *= 0.5f; - } - - NSDict damageDecl; - - if (STRING_SET(strDamageDecl)) { - int declID = EntityDef_IDFromName(strDamageDecl); - damageDecl = NSDict::InitWithSpawnData(EntityDef_GetSpawnData(declID)); - } else { - damageDecl = spawn(NSDict); - } - - - damageDecl.AddKey("damage", itos(newDamage)); - e.Damage(attackingEnt, attackingEnt, damageDecl, 1.0, dmgDir, trace_endpos); - remove(damageDecl); + m_strPropData = model; + _PropDataFinish(); } #endif } diff --git a/src/shared/NSTalkMonster.h b/src/shared/NSTalkMonster.h index 2f7d4539..3e7b0e3a 100644 --- a/src/shared/NSTalkMonster.h +++ b/src/shared/NSTalkMonster.h @@ -124,9 +124,9 @@ public: /** Called when they want to ask the player a question. */ virtual void TalkPlayerAsk(void); /** Called when they are greeting the player. */ - virtual void TalkPlayerGreet(void); + virtual void SeenPlayer(NSActor); /** Called when they are chit-chatting with the player. */ - virtual void TalkPlayerIdle(void); + virtual void SeenFriend(NSActor); /** Called when they tell the player that they're wounded. */ virtual void TalkPlayerWounded1(void); /** Called when they tell the player that severely wounded. */ diff --git a/src/shared/NSTalkMonster.qc b/src/shared/NSTalkMonster.qc index 6976b0a6..ad8c0550 100644 --- a/src/shared/NSTalkMonster.qc +++ b/src/shared/NSTalkMonster.qc @@ -314,7 +314,7 @@ NSTalkMonster::Speak(string sentence) } void -NSTalkMonster::TalkPlayerGreet(void) +NSTalkMonster::SeenPlayer(NSActor thePlayer) { if (m_iSequenceState != SEQUENCESTATE_NONE) { return; @@ -329,24 +329,14 @@ NSTalkMonster::TalkPlayerGreet(void) return; } - for (entity p = world; (p = find(p, ::classname, "player"));) { - /* Find players in a specific radius */ - if (vlen(p.origin - origin) < PLAYER_DETECT_RADIUS) { - /* If we can't physically see him, don't do anything */ - if (VisibleVec(p.origin + p.view_ofs) == false) - continue; - - Sentence(m_talkPlayerGreet); - m_flNextSentence = time + 10.0; - m_iFlags |= MONSTER_METPLAYER; - m_eLookAt = p; - break; - } - } + Sentence(m_talkPlayerGreet); + m_flNextSentence = time + 10.0; + m_iFlags |= MONSTER_METPLAYER; + m_eLookAt = thePlayer; } void -NSTalkMonster::TalkPlayerIdle(void) +NSTalkMonster::SeenFriend(NSActor theActor) { if (m_iSequenceState != SEQUENCESTATE_NONE) { return; @@ -358,25 +348,8 @@ NSTalkMonster::TalkPlayerIdle(void) return; } - for (entity p = world; (p = find(p, ::classname, "player"));) { - if (IsFriend(p.m_iAlliance) == false) { - continue; - } - - /* Find players in a specific radius */ - if (vlen(p.origin - origin) < PLAYER_DETECT_RADIUS) { - /* If we can't physically see him, don't do anything */ - traceline(origin, p.origin, FALSE, this); - - if (trace_ent != p) { - continue; - } - - Sentence(m_talkPlayerIdle); - m_flNextSentence = time + 10.0; - break; - } - } + Sentence(m_talkPlayerIdle); + m_flNextSentence = time + 10.0; } void @@ -603,7 +576,7 @@ NSTalkMonster::FollowPlayer(void) vector vecParent = m_eFollowingChain.origin; vecParent[2] = origin[2]; - flPlayerDist = vlen(vecParent - origin); + flPlayerDist = distance(vecParent, origin); /* Give up after 1024 units */ if (flPlayerDist > m_flMaxFollowDistance) { @@ -742,11 +715,15 @@ NSTalkMonster::FollowChain(void) void NSTalkMonster::RunAI(void) { + if (GetMovetype() == MOVETYPE_NONE) { + return; + } + SeeThink(); AttackThink(); - TalkPlayerGreet(); FollowChain(); +#if 0 if (m_eFollowing != world && m_iNodes <= 0) { m_eLookAt = m_eFollowing; FollowPlayer(); @@ -756,9 +733,9 @@ NSTalkMonster::RunAI(void) if (random() < 0.5) { TalkPlayerAsk(); } else { - TalkPlayerIdle(); } } +#endif } void diff --git a/src/shared/NSWeapon.h b/src/shared/NSWeapon.h index a9bbfe98..3b3cd0e3 100644 --- a/src/shared/NSWeapon.h +++ b/src/shared/NSWeapon.h @@ -41,13 +41,15 @@ typedef enumflags typedef enum { WEAPONSTATE_IDLE, - WEAPONSTATE_RELOAD_START, - WEAPONSTATE_RELOAD, - WEAPONSTATE_RELOAD_END, + WEAPONSTATE_COCK, WEAPONSTATE_CHARGING, WEAPONSTATE_FIRELOOP, WEAPONSTATE_RELEASED, - WEAPONSTATE_OVERHEATED + WEAPONSTATE_OVERHEATED, + WEAPONSTATE_DRAW, + WEAPONSTATE_RELOAD_START, + WEAPONSTATE_RELOAD, + WEAPONSTATE_RELOAD_END } nsweapon_state_t; string nsweapon_state_s[] = @@ -169,6 +171,7 @@ NSWeapon:NSItem public: void NSWeapon(void); + virtual void InputFrame(void); virtual void AddedToInventory(void); virtual void RemovedFromInventory(void); @@ -193,6 +196,7 @@ public: virtual void ReceiveEvent(float); #endif + virtual bool UsesSecondaryAmmo(void); virtual bool IsEmpty(void); virtual bool IsWeapon(void); virtual bool HasReserveAmmo(void); @@ -218,7 +222,7 @@ public: nonvirtual void SetWorldModel(string); nonvirtual void SetPlayerModel(string); nonvirtual void SetWeaponFrame(float); - nonvirtual void PlaySound(string, bool); + nonvirtual void PlaySound(string, float, bool); /* state */ nonvirtual nsweapon_state_t GetWeaponState(void); @@ -284,6 +288,12 @@ private: #endif /* weapon related spawn keys */ + string m_strWeaponTitle; + int m_iHudSlot; + int m_iHudSlotPos; + string m_icon; + string m_iconSel; + string m_strWeaponViewModel; string m_strWeaponPlayerModel; string m_strWeaponScript; @@ -350,6 +360,10 @@ private: string m_fiSndFireStart; string m_fiSndFireStop; string m_fiSndFireLoop; + bool m_fiDrawAfterRelease; + + bool m_fiCocks; + string m_fiSndCock; /* overheating */ float m_fiOverheatLength; @@ -370,55 +384,3 @@ private: .NSWeapon m_nextWeapon; .NSWeapon m_prevWeapon; -/* Helper functions for plugins, the rest of the codebase etc. - -These are, according to IW, common operations. Makes sense to -handle the implementation ourselves as it'll prevent -entityDefs changing from breaking plugins as a result. -Some of these don't just do direct look-ups of keys. */ - -/** @return the "attack" type of the weapon. -@param weaponDef the name of the entityDef that defines the weapon. -@return Attack type of the weapon. */ -string weaponType(string weaponDef); - -/** @return The amount of ammo the specified weapon is meant to start with, when first given to the player. This can be distributed to both clip and reserve ammo types. -@param weaponDef the name of the entityDef that defines the weapon. */ -int weaponStartAmmo(string weaponDef); - -/** @return The amount of ammo the weapon can hold in total when it comes to reserve ammo. So this is really returning the max ammo of a given ammo type. -@param weaponDef the name of the entityDef that defines the weapon. */ -int weaponMaxAmmo(string weaponDef); - -/** @return Whether the weapon is semi automatic. -@param weaponDef the name of the entityDef that defines the weapon. */ -bool weaponIsSemiAuto(string weaponDef); - -/** @return How this weapon is stored. Usually "item", unless it's temporary. -@param weaponDef the name of the entityDef that defines the weapon. */ -string weaponInventoryType(string weaponDef); - -/** @return The delay (in seconds) betwen shots of the specified weapon. -@param weaponDef the name of the entityDef that defines the weapon. */ -float weaponFireTime(string weaponDef); - -/** -@return The delay (in seconds) betwen shots of the specified weapon. -@param weaponDef the name of the entityDef that defines the weapon. */ -int weaponClipSize(string weaponDef); - -/** -@return The 'class' of weapon. Not spawnclass. -@param weaponDef the name of the entityDef that defines the weapon.*/ -string weaponClass(string weaponDef); - -/** -@return true/false whether the weapon takes its ammo only through its clip. -@param weaponDef the name of the entityDef that defines the weapon.*/ -bool isWeaponClipOnly(string weaponDef); - -/** -@return true/false whether or not the weapon creates a timed, fused detonating charge of sorts. -@param weaponDef the name of the entityDef that defines the weapon.*/ -bool isWeaponDetonationTimed(string weaponDef); - diff --git a/src/shared/NSWeapon.qc b/src/shared/NSWeapon.qc index 748f27ff..0dfa0554 100644 --- a/src/shared/NSWeapon.qc +++ b/src/shared/NSWeapon.qc @@ -154,6 +154,8 @@ NSWeapon::UpdateFireInfoCache(void) /* only check if it's present. */ m_bHasLoop = GetSubDefBool(m_strLastFireInfo, "loop"); + m_fiCocks = GetSubDefBool(m_strLastFireInfo, "cocks"); + m_fiDrawAfterRelease = GetSubDefBool(m_strLastFireInfo, "drawAfterRelease"); /* keep the last valid value (don't 0.0f it) to prevent overlay dropouts. */ if (m_fiOverheatPoints) { @@ -238,6 +240,7 @@ NSWeapon::Spawned(void) SetViewModel(m_strWeaponViewModel); SetWorldModel(model); SetPlayerModel(m_strWeaponPlayerModel); + _isWeapon = true; } void @@ -373,10 +376,6 @@ NSWeapon::Restore(string strKey, string strValue) float NSWeapon::SendEntity(entity ePEnt, float flChanged) { - if (InInventory() == false) { - return NSItem::SendEntity(ePEnt, flChanged); - } - /* item is in somebody elses inventory. */ if (InInventory() == true && ePEnt != GetOwner()) { return (false); @@ -398,7 +397,7 @@ NSWeapon::SendEntity(entity ePEnt, float flChanged) SENDENTITY_ANGLE(angles[0], WEAPONFL_CHANGED_ANGLES) SENDENTITY_ANGLE(angles[1], WEAPONFL_CHANGED_ANGLES) SENDENTITY_ANGLE(angles[2], WEAPONFL_CHANGED_ANGLES) - SENDENTITY_FLOAT(entityDefID, WEAPONFL_CHANGED_MODELINDEX) + SENDENTITY_INT(entityDefID, WEAPONFL_CHANGED_MODELINDEX) SENDENTITY_SHORT(m_viewModel, WEAPONFL_CHANGED_MODELINDEX) SENDENTITY_FLOAT(m_flFireRate, WEAPONFL_CHANGED_MODELINDEX) SENDENTITY_BYTE(solid, WEAPONFL_CHANGED_SOLID) @@ -521,7 +520,7 @@ NSWeapon::ReceiveEntity(float flNew, float flChanged) READENTITY_ANGLE(angles[0], WEAPONFL_CHANGED_ANGLES) READENTITY_ANGLE(angles[1], WEAPONFL_CHANGED_ANGLES) READENTITY_ANGLE(angles[2], WEAPONFL_CHANGED_ANGLES) - READENTITY_FLOAT(entityDefID, WEAPONFL_CHANGED_MODELINDEX) + READENTITY_INT(entityDefID, WEAPONFL_CHANGED_MODELINDEX) READENTITY_SHORT(m_viewModel, WEAPONFL_CHANGED_MODELINDEX) READENTITY_FLOAT(m_flFireRate, WEAPONFL_CHANGED_MODELINDEX) READENTITY_BYTE(solid, WEAPONFL_CHANGED_SOLID) @@ -686,6 +685,10 @@ NSWeapon::_CacheWeaponDefVariables(void) string muzzleModel; string ammoRequired; + m_strWeaponTitle = GetDefString("inv_name"); + m_iHudSlot = GetDefInt("hudSlot"); + m_iHudSlotPos = GetDefInt("hudSlotPos"); + /* movement vars */ m_flSpeedMod = GetDefFloat("speed_mod"); m_bBuggyIdleAnim = GetDefBool("buggyIdleAnim"); @@ -753,6 +756,7 @@ NSWeapon::_SwitchedToCallback(void) #ifdef CLIENT pSeat->m_iHUDWeaponSelected = GetSharedID(); PredictPreFrame(); + HUD_SwitchedToWeapon(classname); #endif } @@ -855,7 +859,7 @@ NSWeapon::Draw(void) } #ifdef SERVER - PlaySound(GetDefString("snd_draw"), false); + PlaySound(GetDefString("snd_draw"), CHAN_AUTO, false); #endif SetAttackNext(drawTime); @@ -975,6 +979,12 @@ NSWeapon::FiredWeaponAttack(string fireInfo) } } +void +NSWeapon::InputFrame(void) +{ + +} + void NSWeapon::ReleasedWeaponAttack(string fireInfo) { @@ -1030,12 +1040,12 @@ NSWeapon::Attack(string fireInfo) } /* will release projectile upon release. */ - if (m_fiOnRelease != "") { - m_fiWillRelease = true; + if (!(ourOwner.vv_flags & VFL_PRIMEDFUSE) && STRING_SET(m_fiOnRelease)) { + _SetWeaponState(WEAPONSTATE_RELEASED); ourOwner.vv_flags |= VFL_PRIMEDFUSE; } - if (UseAmmo(fireInfo) == false) { + if (IsEmpty() == true) { return; } @@ -1048,6 +1058,7 @@ NSWeapon::Attack(string fireInfo) #ifdef SERVER ourOwner.nadeCookingTime = time; + PlaySound(GetSubDefString(fireInfo, "snd_delay"), CHAN_WEAPON, false); #endif /* mark as charging, play loop anim in Idle() next */ @@ -1055,8 +1066,14 @@ NSWeapon::Attack(string fireInfo) SetWeaponFrame(shotAnim); _SetWeaponState(WEAPONSTATE_CHARGING); return; + } if (UseAmmo(fireInfo) == false) { + return; } } else { + if (UseAmmo(fireInfo) == false) { + return; + } + #ifdef SERVER ourOwner.nadeCookingTime = time; #endif @@ -1112,6 +1129,8 @@ NSWeapon::Attack(string fireInfo) if (m_flOverheating >= m_fiOverheatLength) { _SetWeaponState(WEAPONSTATE_OVERHEATED); } + } else if (m_fiCocks) { + _SetWeaponState(WEAPONSTATE_COCK); } float animTime = frameduration(m_viewModel, shotAnim); @@ -1165,17 +1184,17 @@ NSWeapon::_SwitchedWeaponMode(void) } void -NSWeapon::PlaySound(string soundDef, bool clientOnly) +NSWeapon::PlaySound(string soundDef, float soundChannel, bool clientOnly) { #ifdef CLIENT if (clientOnly) { - Sound_Play(owner, CHAN_WEAPON, soundDef); + Sound_Play(owner, soundChannel, soundDef); } #endif #ifdef SERVER if (!clientOnly) { - Sound_Play(owner, CHAN_WEAPON, soundDef); + Sound_Play(owner, soundChannel, soundDef); } #endif } @@ -1240,7 +1259,7 @@ NSWeapon::Idle(void) idleAnim = GetSubDefAct(m_strLastFireInfo, "reloadStart"); _SetWeaponState(WEAPONSTATE_RELOAD); #ifdef SERVER - PlaySound(GetDefString("snd_reload_start"), false); + PlaySound(GetDefString("snd_reload_start"), CHAN_AUTO, false); #endif SetAttackNext(frameduration(m_viewModel, idleAnim)); break; @@ -1260,7 +1279,7 @@ NSWeapon::Idle(void) reloadTime = m_flReloadSpeed; } #ifdef SERVER - PlaySound(GetDefString("snd_reload"), false); + PlaySound(GetDefString("snd_reload"), CHAN_AUTO, false); #endif SetWeaponFrame(idleAnim); SetIdleNext(reloadTime); @@ -1271,7 +1290,7 @@ NSWeapon::Idle(void) idleAnim = GetSubDefAct(m_strLastFireInfo, "reloadEnd"); _SetWeaponState(WEAPONSTATE_IDLE); #ifdef SERVER - PlaySound(GetDefString("snd_reload_end"), false); + PlaySound(GetDefString("snd_reload_end"), CHAN_AUTO, false); #endif SetAttackNext(frameduration(m_viewModel, idleAnim)); break; @@ -1281,11 +1300,38 @@ NSWeapon::Idle(void) case WEAPONSTATE_CHARGING: idleAnim = GetSubDefAct(m_strLastFireInfo, "loop"); break; + case WEAPONSTATE_COCK: + //breakpoint(); + idleAnim = GetSubDefAct(m_strLastFireInfo, "cock"); +#ifdef SERVER + PlaySound(GetDefString("snd_cock"), CHAN_AUTO, false); +#endif + _SetWeaponState(WEAPONSTATE_IDLE); + SetAttackNext(frameduration(m_viewModel, idleAnim)); + break; case WEAPONSTATE_RELEASED: //breakpoint(); + + if (m_fiSndRelease) { + ourOwner.StartSoundDef(m_fiSndRelease, CHAN_WEAPON, true); + } + + UseAmmo(m_strLastFireInfo); + ReleasedWeaponAttack(m_strLastFireInfo); + ourOwner.vv_flags &= ~VFL_PRIMEDFUSE; idleAnim = GetSubDefAct(m_strLastFireInfo, "release"); - _SetWeaponState(WEAPONSTATE_IDLE); + SetAttackNext(frameduration(m_viewModel, idleAnim)); + + if (m_fiDrawAfterRelease == true) { + _SetWeaponState(WEAPONSTATE_DRAW); + } else { + _SetWeaponState(WEAPONSTATE_IDLE); + } break; + case WEAPONSTATE_DRAW: + Draw(); + _SetWeaponState(WEAPONSTATE_IDLE); + return; case WEAPONSTATE_OVERHEATED: /* prevent fire for the next N seconds */ _SetWeaponState(WEAPONSTATE_IDLE); @@ -1376,9 +1422,9 @@ NSWeapon::SecondaryAttack(void) #ifdef SERVER if (ourOwner.viewzoom == 1.0) { - PlaySound(GetDefString("snd_lower_scope"), false); + PlaySound(GetDefString("snd_lower_scope"), CHAN_AUTO, false); } else { - PlaySound(GetDefString("snd_raise_scope"), false); + PlaySound(GetDefString("snd_raise_scope"), CHAN_AUTO, false); } #endif @@ -1631,31 +1677,29 @@ NSWeapon::Release(void) NSClientPlayer ourOwner = (NSClientPlayer)GetOwner(); ourOwner.gflags &= ~GF_SEMI_TOGGLED; - if (m_fiWillRelease) { - /* delayed shot release */ - idleAnim = GetSubDefAct(m_strLastFireInfo, "release"); - - if (m_fiSndRelease) { - ourOwner.StartSoundDef(m_fiSndRelease, CHAN_WEAPON, true); - } - - ReleasedWeaponAttack(m_strLastFireInfo); - m_fiWillRelease = false; - - if (idleAnim >= 0) { - SetWeaponFrame(idleAnim); - } - - SetAttackNext(1.0f); - SetIdleNext(1.0f); - ourOwner.vv_flags &= ~VFL_PRIMEDFUSE; - return; + /* we're allowed to release any time. allow it! */ + if (ourOwner.vv_flags & VFL_PRIMEDFUSE) { + _SetWeaponState(WEAPONSTATE_RELEASED); + SetIdleNext(0.0f); } + if (GetWeaponState() == WEAPONSTATE_CHARGING) { + if (CanFire() == true) { + /* hack to get around the ammo usage when charging */ + float oldChargeTime = m_fiChargeTime; + m_fiChargeTime = 0.0f; + Attack(m_strLastFireInfo); + m_fiChargeTime = oldChargeTime; + return; + } + } + +#if 0 /* already in a reload? */ if (!(m_dState >= WEAPONSTATE_RELOAD_START && m_dState <= WEAPONSTATE_RELOAD_END)) { _SetWeaponState(WEAPONSTATE_IDLE); } +#endif #ifdef SERVER if (m_bFiring == true) { @@ -1840,93 +1884,9 @@ NSWeapon::GetPreviousWeapon(void) return (m_prevWeapon); } -/* required because we might need to look it up inside the -info for the primary attack mode. */ -static string -NSWeapon_GetPrimaryKeyValue(string weaponDef, string keyName) -{ - string fireInfo1 = EntityDef_GetKeyValue(weaponDef, "def_fireInfo"); - string defValue = EntityDef_GetKeyValue(weaponDef, keyName); - string fireInfoValue = EntityDef_GetKeyValue(fireInfo1, keyName); - - /* fireinfo takes priority */ - if (fireInfoValue) { - return (fireInfoValue); - } - - return (defValue); -} - -string -weaponType(string weaponDef) -{ - return ("unknown"); -} - -int -weaponStartAmmo(string weaponDef) -{ - return (int)stof(EntityDef_GetKeyValue(weaponDef, "clipSize")); -} - -int -weaponMaxAmmo(string weaponDef) -{ - string ammoType = NSWeapon_GetPrimaryKeyValue(weaponDef, "ammoType"); - return (ammoMaxForName(ammoType)); -} - bool -weaponIsSemiAuto(string weaponDef) +NSWeapon::UsesSecondaryAmmo(void) { - return (bool)stof(NSWeapon_GetPrimaryKeyValue(weaponDef, "semiAuto")); -} - -string -weaponInventoryType(string weaponDef) -{ - return ("item"); -} - -float -weaponFireTime(string weaponDef) -{ - return stof(NSWeapon_GetPrimaryKeyValue(weaponDef, "fireRate")); -} - -int -weaponClipSize(string weaponDef) -{ - return (int)stoi(EntityDef_GetKeyValue(weaponDef, "clipSize")); -} - -string -weaponClass(string weaponDef) -{ - return ("unknown"); -} - -bool -isWeaponClipOnly(string weaponDef) -{ - int clipSize = (int)stoi(EntityDef_GetKeyValue(weaponDef, "clipSize")); - string ammoType = NSWeapon_GetPrimaryKeyValue(weaponDef, "ammoType"); - - /* no ammo type... */ - if (!ammoType) { - /* but a clip is defined */ - if (clipSize > 0i) { - return (true); - } - } - return (false); -} - -bool -isWeaponDetonationTimed(string weaponDef) -{ - string projectileDef = NSWeapon_GetPrimaryKeyValue(weaponDef, "def_projectile"); - bool isFused = (bool)stof(EntityDef_GetKeyValue(projectileDef, "detonate_on_fuse")); - return (isFused); + return (m_secondaryAmmoType && m_primaryAmmoType != m_secondaryAmmoType) ? (true) : (false); } diff --git a/src/shared/ammo.qc b/src/shared/ammo.qc index bb53c02f..2fc81eba 100644 --- a/src/shared/ammo.qc +++ b/src/shared/ammo.qc @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2016-2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ /** Data holding ammo variant entries. */ typedef struct @@ -52,7 +67,7 @@ Ammo_Init(void) string ammoTypeData; if (ammoTypeID == -1) { - NSError("Decl `ammo_types` not defined in `def/`. Ammo unavailable."); + NSWarning("Decl `ammo_types` not defined in `def/`. Ammo unavailable."); return; } diff --git a/src/shared/api.h b/src/shared/api.h new file mode 100644 index 00000000..4e1a9e49 --- /dev/null +++ b/src/shared/api.h @@ -0,0 +1,505 @@ +/* + * Copyright (c) 2016-2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + + +/** @defgroup sharedAPI Shared multiprogs API + @brief Shared multiprogs API + @ingroup multiprogs + @ingroup shared + +APIs used by both client and server progs. + +@{ +*/ + +typedef struct +{ + /** Returns the name of the specified ammo type. Returns __NULL__ when invalid. */ + string NameForNum(int); + /** Returns the ammo id of a given name of ammo. Return -1 when invalid. */ + int NumForName(string); + /** Returns the max ammo given name of ammo. Returns 0 when invalid. */ + int MaxForName(string); + /** Returns the max ammo given name of ammo. Returns 0 when invalid. */ + int MaxForNum(int); +} ammoAPI_t; + +ammoAPI_t ammo; + + +/* CVar library */ +typedef struct +{ + /** Returns the string value of a console variable. + + @param cvarName specifies the console variable key to query. + @return The value in string format. */ + string GetString(string cvarName); + /** Returns the integer value of a console variable. + + @param cvarName specifies the console variable key to query. + @return The value in integer format. */ + int GetInteger(string cvarName); + /** Returns the floating-point value of a console variable. + + @param cvarName specifies the console variable key to query. + @return The value in floating-point format. */ + float GetFloat(string cvarName); + /** Returns the boolean value of a console variable. + + @param cvarName specifies the console variable key to query. + @return The value in boolean form. */ + bool GetBool(string cvarName); + /** Returns the vector value of a console variable. + + @param cvarName specifies the console variable key to query. + @return The value in vector form. */ + vector GetVector(string cvarName); + /** Sets the specified console variable to a set string value. + + @param cvarName specifies the console variable to set. + @param setValue specifies the value of said key. */ + void SetString(string cvarName, string setValue); + /** Sets the specified console variable to a set integer value. + + @param cvarName specifies the console variable to set. + @param setValue specifies the value of said key. */ + void SetInteger(string cvarName, int setValue); + /** Sets the specified console variable to a set boolean value. + + @param cvarName specifies the console variable to set. + @param setValue specifies the value of said key. */ + void SetBool(string cvarName, bool setValue); + /** Sets the specified console variable to a set floating-point value. + + @param cvarName specifies the console variable to set. + @param setValue specifies the value of said key. */ + void SetFloat(string cvarName, float setValue); + /** Sets the specified console variable to a set vector. + + @param cvarName specifies the console variable to set. + @param setValue specifies the value of said key. */ + void SetVector(string cvarName, vector setValue); +} cvarAPI_t; + +cvarAPI_t cvars; + +/* ServerInfo library */ +typedef struct +{ + /** Returns the string value of a server info-key. + + @param serverKey specifies the server info-key to query. + @return The value in string format. */ + string GetString(string serverKey); + /** Returns the integer value of a server info-key. + + @param serverKey specifies the server info-key to query. + @return The value in integer format. */ + int GetInteger(string serverKey); + /** Returns the floating-point value of a server info-key. + + @param serverKey specifies the server info-key to query. + @return The value in floating-point format. */ + float GetFloat(string serverKey); + /** Returns the boolean value of a server info-key. + + @param serverKey specifies the server info-key to query. + @return The value in boolean form. */ + bool GetBool(string serverKey); + /** Returns the vector value of a server info-key. + + @param serverKey specifies the server info-key to query. + @return The value in vector form. */ + vector GetVector(string serverKey); + /** Sets the specified server info-key to a set string value. + + @param serverKey specifies the server info-key to set. + @param setValue specifies the value of said key. */ + void SetString(string serverKey, string setValue); + /** Sets the specified server info-key to a set integer value. + + @param serverKey specifies the server info-key to set. + @param setValue specifies the value of said key. */ + void SetInteger(string serverKey, int setValue); + /** Sets the specified server info-key to a set boolean value. + + @param serverKey specifies the server info-key to set. + @param setValue specifies the value of said key. */ + void SetBool(string serverKey, bool setValue); + /** Sets the specified server info-key to a set floating-point value. + + @param serverKey specifies the server info-key to set. + @param setValue specifies the value of said key. */ + void SetFloat(string serverKey, float setValue); + /** Sets the specified server info-key to a set vector. + + @param serverKey specifies the server info-key to set. + @param setValue specifies the value of said key. */ + void SetVector(string serverKey, vector setValue); +} serverinfoAPI_t; + +serverinfoAPI_t serverinfo; + +/* UserInfo library */ +typedef struct +{ + /** Returns the string value of a user info-key. + + @param clientEnt specifies which user to query. + @param userKey specifies the user info-key to query. + @return The value in string format. */ + string GetString(entity clientEnt, string userKey); + /** Returns the integer value of a user info-key. + + @param clientEnt specifies which user to query. + @param userKey specifies the user info-key to query. + @return The value in integer format. */ + int GetInteger(entity clientEnt, string userKey); + /** Returns the floating-point value of a user info-key. + + @param clientEnt specifies which user to query. + @param userKey specifies the user info-key to query. + @return The value in floating-point format. */ + float GetFloat(entity clientEnt, string userKey); + /** Returns the boolean value of a user info-key. + + @param clientEnt specifies which user to query. + @param userKey specifies the user info-key to query. + @return The value in boolean form. */ + bool GetBool(entity clientEnt, string userKey); + /** Returns the vector value of a user info-key. + + @param clientEnt specifies which user to query. + @param userKey specifies the user info-key to query. + @return The value in vector form. */ + vector GetVector(entity clientEnt, string userKey); + /** Sets the specified user info-key to a set string value. + + @param clientEnt specifies which user to query. + @param userKey specifies the user info-key to set. + @param setValue specifies the value of said key. */ + void SetString(entity clientEnt, string userKey, string setValue); + /** Sets the specified user info-key to a set integer value. + + @param clientEnt specifies which user to query. + @param userKey specifies the user info-key to set. + @param setValue specifies the value of said key. */ + void SetInteger(entity clientEnt, string userKey, int setValue); + /** Sets the specified user info-key to a set boolean value. + + @param clientEnt specifies which user to query. + @param userKey specifies the user info-key to set. + @param setValue specifies the value of said key. */ + void SetBool(entity clientEnt, string userKey, bool setValue); + /** Sets the specified user info-key to a set floating-point value. + + @param clientEnt specifies which user to query. + @param userKey specifies the user info-key to set. + @param setValue specifies the value of said key. */ + void SetFloat(entity clientEnt, string userKey, float setValue); + /** Sets the specified user info-key to a set vector. + + @param clientEnt specifies which user to query. + @param userKey specifies the user info-key to set. + @param setValue specifies the value of said key. */ + void SetVector(entity clientEnt, string userKey, vector setValue); +} userinfoAPI_t; + +userinfoAPI_t userinfo; + +typedef struct +{ + /** @return the "attack" type of the weapon. + @param weaponDef the name of the entityDef that defines the weapon. + @return Attack type of the weapon. */ + string Type(string weaponDef); + /** @return The amount of ammo the specified weapon is meant to start with, when first given to the player. This can be distributed to both clip and reserve ammo types. + @param weaponDef the name of the entityDef that defines the weapon. */ + int StartAmmo(string weaponDef); + /** @return The amount of ammo the weapon can hold in total when it comes to reserve ammo. So this is really returning the max ammo of a given ammo type. + @param weaponDef the name of the entityDef that defines the weapon. */ + int MaxAmmo(string weaponDef); + /** @return Whether the weapon is semi automatic. + @param weaponDef the name of the entityDef that defines the weapon. */ + bool IsSemiAuto(string weaponDef); + + /** @return How this weapon is stored. Usually "item", unless it's temporary. + @param weaponDef the name of the entityDef that defines the weapon. */ + string InventoryType(string weaponDef); + /** @return The delay (in seconds) betwen shots of the specified weapon. + @param weaponDef the name of the entityDef that defines the weapon. */ + float FireTime(string weaponDef); + /** + @return The delay (in seconds) betwen shots of the specified weapon. + @param weaponDef the name of the entityDef that defines the weapon. */ + int ClipSize(string weaponDef); + /** + @return The 'class' of weapon. Not spawnclass. + @param weaponDef the name of the entityDef that defines the weapon.*/ + string Class(string weaponDef); + /** + @return true/false whether the weapon takes its ammo only through its clip. + @param weaponDef the name of the entityDef that defines the weapon.*/ + bool IsClipOnly(string weaponDef); + /** + @return true/false whether or not the weapon creates a timed, fused detonating charge of sorts. + @param weaponDef the name of the entityDef that defines the weapon.*/ + bool IsDetonationTimed(string weaponDef); +} weaponInfo_t; + +weaponInfo_t weaponInfo; + +/* Team library */ +typedef struct +{ + int BestAutoJoinTeam(void); + int TeamCount(void); + vector Color(int); + string Name(int); + int Score(int); + string SpawnPoint(int); + int NumPlayers(int); + int NumAlivePlayers(int); + int NumDeadPlayers(int); + int TotalDeaths(int); + int TotalFrags(int); + bool Valid(int); + + void AddScore(int, int); + void SetScore(int, int); + entity RandomPlayer(int); + + + /** Sets up a team for the current session. Will flush the team specific scores. + + @param teamID specifies which team slot to occupy. + @param teamTitle specifies the title of the team. + @param teamColor specifies the color of the team (e.g. [0, 255, 0] for green). + @param openTeam specifies whether people can join the team manually. */ + void SetUp(int teamID, string teamTitle, vector teamColor, bool openTeam); + + + void SetSpawnPoint(int, string); +} teamAPI_t; + +teamAPI_t teams; + + + +/* ServerInfo library */ +typedef struct +{ + /** Returns the string value of a EntityDef key. + + @param defName specifies the EntityDef name in question + @param keyName specifies the EntityDef key to query. + @return The value in string format. */ + string GetString(string defName, string keyName); + /** Returns the integer value of a EntityDef key. + + @param defName specifies the EntityDef name in question + @param keyName specifies the EntityDef key to query. + @return The value in integer format. */ + int GetInteger(string defName, string keyName); + /** Returns the floating-point value of a EntityDef key. + + @param defName specifies the EntityDef name in question + @param keyName specifies the EntityDef key to query. + @return The value in floating-point format. */ + float GetFloat(string defName, string keyName); + /** Returns the boolean value of a EntityDef key. + + @param defName specifies the EntityDef name in question + @param keyName specifies the EntityDef key to query. + @return The value in boolean form. */ + bool GetBool(string defName, string keyName); + /** Returns the vector value of a EntityDef key. + + @param defName specifies the EntityDef name in question + @param keyName specifies the EntityDef key to query. + @return The value in vector form. */ + vector GetVector(string defName, string keyName); +} entityDefAPI_t; + +entityDefAPI_t entityDef; + +typedef string decl; + +typedef struct +{ + /** Returns the name of a new decl in which you can store + * key/value pairs in. */ + decl New(void); + + /** Returns the string value of a key from a decl. + + @param declHandle is the `decl` reference to update. + @param keyName specifies the name of the key to query within the decl. + @return The key its value in string format. */ + string GetString(decl declHandle, string keyName); + /** Returns the integer value of a decl key. + + @param declHandle is the `decl` reference to update. + @param keyName specifies the name of the key to query within the decl. + @return The key its value in integer format. */ + int GetInteger(decl declHandle, string keyName); + /** Returns the floating-point value of a decl key. + + @param declHandle is the `decl` reference to update. + @param keyName specifies the name of the key to query within the decl. + @return The key its value in floating-point format. */ + float GetFloat(decl declHandle, string keyName); + /** Returns the boolean value of a decl key. + + @param declHandle is the `decl` reference to update. + @param keyName specifies the name of the key to query within the decl. + @return The key its value in boolean form. */ + bool GetBool(decl declHandle, string keyName); + /** Returns the vector value of a decl key. + + @param declHandle is the `decl` reference to update. + @param keyName specifies the name of the key to query within the decl. + @return The key its value in vector form. */ + vector GetVector(decl declHandle, string keyName); + + /** Adds/updates a named key within a decl with + a new string value. + + @param declHandle is the `decl` reference to update. + @param keyName specifies the key to set. + @param setValue specifies the value we'll set the key to. */ + void AddKey(decl declHandle, string keyName, string setValue); + + /** Removes a named key from a decl entirely. + + @param declHandle is the `decl` reference to update. + @param keyName specifies the key to remove. */ + void RemoveKey(decl declHandle, string keyName); + + /** Removes a named decl from the game. + + @param declHandle specifies the decl to delete. */ + void Delete(decl declHandle); +} declAPI_t; + +declAPI_t declManager; + +__variant +linkToSharedProgs(string funcName) +{ + static void empty(void) + { + print("Called unimplemented shared API call.\n"); + breakpoint(); + } + + float func = externvalue( 0, funcName); + + if (func) { + return ((__variant)func); + } else { + return (empty); + } +} + +void +_shared_main(void) +{ + ammo.NameForNum = linkToSharedProgs("SHPF_ammo_NameForNum"); + ammo.NumForName = linkToSharedProgs("SHPF_ammo_NumForName"); + ammo.MaxForName = linkToSharedProgs("SHPF_ammo_MaxForName"); + ammo.MaxForNum = linkToSharedProgs("SHPF_ammo_MaxForNum"); + + cvars.SetString = linkToSharedProgs("SHPF_cvars_SetString"); + cvars.SetBool = linkToSharedProgs("SHPF_cvars_SetBool"); + cvars.SetInteger = linkToSharedProgs("SHPF_cvars_SetInteger"); + cvars.SetFloat = linkToSharedProgs("SHPF_cvars_SetFloat"); + cvars.SetVector = linkToSharedProgs("SHPF_cvars_SetVector"); + cvars.GetString = linkToSharedProgs("SHPF_cvars_GetString"); + cvars.GetInteger = linkToSharedProgs("SHPF_cvars_GetInteger"); + cvars.GetBool = linkToSharedProgs("SHPF_cvars_GetBool"); + cvars.GetFloat = linkToSharedProgs("SHPF_cvars_GetFloat"); + cvars.GetVector = linkToSharedProgs("SHPF_cvars_GetVector"); + + declManager.New = linkToSharedProgs("SHPF_declManager_New"); + declManager.GetFloat = linkToSharedProgs("SHPF_declManager_GetFloat"); + declManager.GetString = linkToSharedProgs("SHPF_declManager_GetString"); + declManager.GetVector = linkToSharedProgs("SHPF_declManager_GetVector"); + declManager.GetBool = linkToSharedProgs("SHPF_declManager_GetBool"); + declManager.AddKey = linkToSharedProgs("SHPF_declManager_AddKey"); + declManager.RemoveKey = linkToSharedProgs("SHPF_declManager_RemoveKey"); + declManager.Delete = linkToSharedProgs("SHPF_declManager_Delete"); + + userinfo.SetString = linkToSharedProgs("SHPF_userinfo_SetString"); + userinfo.SetBool = linkToSharedProgs("SHPF_userinfo_SetBool"); + userinfo.SetInteger = linkToSharedProgs("SHPF_userinfo_SetInteger"); + userinfo.SetFloat = linkToSharedProgs("SHPF_userinfo_SetFloat"); + userinfo.SetVector = linkToSharedProgs("SHPF_userinfo_SetVector"); + userinfo.GetString = linkToSharedProgs("SHPF_userinfo_GetString"); + userinfo.GetInteger = linkToSharedProgs("SHPF_userinfo_GetInteger"); + userinfo.GetBool = linkToSharedProgs("SHPF_userinfo_GetBool"); + userinfo.GetFloat = linkToSharedProgs("SHPF_userinfo_GetFloat"); + userinfo.GetVector = linkToSharedProgs("SHPF_userinfo_GetVector"); + + serverinfo.SetString = linkToSharedProgs("SHPF_serverinfo_SetString"); + serverinfo.SetBool = linkToSharedProgs("SHPF_serverinfo_SetBool"); + serverinfo.SetInteger = linkToSharedProgs("SHPF_serverinfo_SetInteger"); + serverinfo.SetFloat = linkToSharedProgs("SHPF_serverinfo_SetFloat"); + serverinfo.SetVector = linkToSharedProgs("SHPF_serverinfo_SetVector"); + serverinfo.GetString = linkToSharedProgs("SHPF_serverinfo_GetString"); + serverinfo.GetInteger = linkToSharedProgs("SHPF_serverinfo_GetInteger"); + serverinfo.GetBool = linkToSharedProgs("SHPF_serverinfo_GetBool"); + serverinfo.GetFloat = linkToSharedProgs("SHPF_serverinfo_GetFloat"); + serverinfo.GetVector = linkToSharedProgs("SHPF_serverinfo_GetVector"); + + teams.BestAutoJoinTeam = linkToSharedProgs("SHPF_teams_BestAutoJoinTeam"); + teams.TeamCount = linkToSharedProgs("SHPF_teams_TeamCount"); + teams.Color = linkToSharedProgs("SHPF_teams_Color"); + teams.Name = linkToSharedProgs("SHPF_teams_Name"); + teams.Score = linkToSharedProgs("SHPF_teams_Score"); + teams.SpawnPoint = linkToSharedProgs("SHPF_teams_SpawnPoint"); + teams.NumPlayers = linkToSharedProgs("SHPF_teams_NumPlayers"); + teams.NumAlivePlayers = linkToSharedProgs("SHPF_teams_NumAlivePlayers"); + teams.NumDeadPlayers = linkToSharedProgs("SHPF_teams_NumDeadPlayers"); + teams.TotalDeaths = linkToSharedProgs("SHPF_teams_TotalDeaths"); + teams.TotalFrags = linkToSharedProgs("SHPF_teams_TotalFrags"); + teams.Valid = linkToSharedProgs("SHPF_teams_Valid"); + teams.RandomPlayer = linkToSharedProgs("SHPF_teams_RandomPlayer"); + + /* server */ + teams.AddScore = linkToSharedProgs("SHPF_teams_AddScore"); + teams.SetScore = linkToSharedProgs("SHPF_teams_SetScore"); + teams.SetUp = linkToSharedProgs("SHPF_teams_SetUp"); + teams.SetSpawnPoint = linkToSharedProgs("SHPF_teams_SetSpawnPoint"); + + weaponInfo.Type = linkToSharedProgs("SHPF_weaponInfo_Type"); + weaponInfo.StartAmmo = linkToSharedProgs("SHPF_weaponInfo_StartAmmo"); + weaponInfo.MaxAmmo = linkToSharedProgs("SHPF_weaponInfo_MaxAmmo"); + weaponInfo.IsSemiAuto = linkToSharedProgs("SHPF_weaponInfo_IsSemiAuto"); + weaponInfo.InventoryType = linkToSharedProgs("SHPF_weaponInfo_InventoryType"); + weaponInfo.FireTime = linkToSharedProgs("SHPF_weaponInfo_FireTime"); + weaponInfo.ClipSize = linkToSharedProgs("SHPF_weaponInfo_ClipSize"); + weaponInfo.Class = linkToSharedProgs("SHPF_weaponInfo_Class"); + weaponInfo.IsClipOnly = linkToSharedProgs("SHPF_weaponInfo_IsClipOnly"); + weaponInfo.IsDetonationTimed = linkToSharedProgs("SHPF_weaponInfo_IsDetonationTimed"); + + entityDef.GetString = linkToSharedProgs("SHPF_entityDef_GetString"); + entityDef.GetInteger = linkToSharedProgs("SHPF_entityDef_GetInteger"); + entityDef.GetBool = linkToSharedProgs("SHPF_entityDef_GetBool"); + entityDef.GetFloat = linkToSharedProgs("SHPF_entityDef_GetFloat"); + entityDef.GetVector = linkToSharedProgs("SHPF_entityDef_GetVector"); +} diff --git a/src/shared/api.qc b/src/shared/api.qc new file mode 100644 index 00000000..76405949 --- /dev/null +++ b/src/shared/api.qc @@ -0,0 +1,922 @@ +/* + * Copyright (c) 2016-2024 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/* cvars library */ +string +SHPF_cvars_GetString(string cvarName) +{ + return cvar_string(cvarName); +} + +float +SHPF_cvars_GetFloat(string cvarName) +{ + return cvar(cvarName); +} + +int +SHPF_cvars_GetInteger(string cvarName) +{ + return (int)cvar(cvarName); +} + +bool +SHPF_cvars_GetBool(string cvarName) +{ + return (cvar(cvarName) > 0) ? (true) : (false); +} + +vector +SHPF_cvars_GetVector(string cvarName) +{ + return stov(cvar_string(cvarName)); +} + +void +SHPF_cvars_SetString(string cvarName, string setValue) +{ + cvar_set(cvarName, setValue); +} + +void +SHPF_cvars_SetInteger(string cvarName, int setValue) +{ + cvar_set(cvarName, itos(setValue)); +} + +void +SHPF_cvars_SetBool(string cvarName, bool setValue) +{ + cvar_set(cvarName, ftos(setValue)); +} + +void +SHPF_cvars_SetFloat(string cvarName, float setValue) +{ + cvar_set(cvarName, ftos(setValue)); +} + +void +SHPF_cvars_SetVector(string cvarName, vector setValue) +{ + cvar_set(cvarName, vtos(setValue)); +} + +/* decl library */ +string +SHPF_declManager_New(void) +{ + NSDict newDict = spawn(NSDict); + + /* not out of memory */ + if (newDict) { + /* assign it a new name, return */ + newDict.declclass = sprintf("NSDict_%x", num_for_edict(newDict)); + return (newDict.declclass); + } + + NSError("Unable to create decl"); + return (__NULL__); +} + +string +SHPF_declManager_GetString(string defName, string keyName) +{ + NSDict findDecl = (NSDict)find(world, ::declclass, defName); + + if (findDecl) { + return (findDecl.GetString(keyName)); + } + + NSError("Decl %S is not loaded.", defName); + return (__NULL__); +} + +int +SHPF_declManager_GetInteger(string defName, string keyName) +{ + NSDict findDecl = (NSDict)find(world, ::declclass, defName); + + if (findDecl) { + return (findDecl.GetInteger(keyName)); + } + + NSError("Decl %S is not loaded.", defName); + return (__NULL__); +} + +float +SHPF_declManager_GetFloat(string defName, string keyName) +{ + NSDict findDecl = (NSDict)find(world, ::declclass, defName); + + if (findDecl) { + return (findDecl.GetFloat(keyName)); + } + + NSError("Decl %S is not loaded.", defName); + return (__NULL__); +} + +bool +SHPF_declManager_GetBool(string defName, string keyName) +{ + NSDict findDecl = (NSDict)find(world, ::declclass, defName); + + if (findDecl) { + return (findDecl.GetBool(keyName)); + } + + NSError("Decl %S is not loaded.", defName); + return (__NULL__); +} + +vector +SHPF_declManager_GetVector(string defName, string keyName) +{ + NSDict findDecl = (NSDict)find(world, ::declclass, defName); + + if (findDecl) { + return (findDecl.GetVector(keyName)); + } + + NSError("Decl %S is not loaded.", defName); + return (__NULL__); +} + +void +SHPF_declManager_AddKey(string defName, string keyName, string setValue) +{ + NSDict findDecl = (NSDict)find(world, ::declclass, defName); + + if (findDecl) { + findDecl.AddKey(keyName, setValue); + return; + } + + NSError("Decl %S is not loaded.", defName); +} + +void +SHPF_declManager_RemoveKey(string defName, string keyName) +{ + NSDict findDecl = (NSDict)find(world, ::declclass, defName); + + if (findDecl) { + findDecl.RemoveKey(keyName); + return; + } + + NSError("Decl %S is not loaded.", defName); +} + +void +SHPF_declManager_Delete(string defName, string keyName) +{ + NSDict findDecl = (NSDict)find(world, ::declclass, defName); + + if (findDecl) { + remove(findDecl); + return; + } + + NSError("Decl %S is not loaded.", defName); +} + +/* ammo library */ +string +SHPF_ammo_NameForNum(int ammoIndex) +{ + return ammoNameForNum(ammoIndex); +} + +int +SHPF_ammo_NumForName(string ammoName) +{ + return ammoNumForName(ammoName); +} + +int +SHPF_ammo_MaxForName(string ammoName) +{ + return ammoMaxForName(ammoName); +} + +int +SHPF_ammo_MaxForNum(int ammoIndex) +{ + return ammoMaxForNum(ammoIndex); +} + +/* userinfo library */ +string +SHPF_userinfo_GetString(entity client, string keyName) +{ +#ifdef SERVER + return infokey(client, keyName); +#endif + +#ifdef CLIENT + return getplayerkeyvalue(client.entnum-1, keyName); +#endif +} + +int +SHPF_userinfo_GetInteger(entity client, string keyName) +{ + return stoi(SHPF_userinfo_GetString(client, keyName)); +} + +float +SHPF_userinfo_GetFloat(entity client, string keyName) +{ + return stof(SHPF_userinfo_GetString(client, keyName)); +} + +bool +SHPF_userinfo_GetBool(entity client, string keyName) +{ + return stof(SHPF_userinfo_GetString(client, keyName)) ? (true) : (false); +} + +vector +SHPF_userinfo_GetVector(entity client, string keyName) +{ + return stov(SHPF_userinfo_GetString(client, keyName)); +} + +void +SHPF_userinfo_SetString(entity client, string keyName, string setValue) +{ +#ifdef SERVER + forceinfokey(client, keyName, setValue); +#endif +} + +void +SHPF_userinfo_SetInteger(entity client, string keyName, int setValue) +{ + SHPF_userinfo_SetString(client, keyName, itos(setValue)); +} + +void +SHPF_userinfo_SetFloat(entity client, string keyName, float setValue) +{ + SHPF_userinfo_SetString(client, keyName, ftos(setValue)); +} + +void +SHPF_userinfo_SetBool(entity client, string keyName, bool setValue) +{ + SHPF_userinfo_SetString(client, keyName, ftos(setValue)); +} + +void +SHPF_userinfo_SetVector(entity client, string keyName, vector setValue) +{ + SHPF_userinfo_SetString(client, keyName, vtos(setValue)); +} + + +/* serverinfo library */ +string +SHPF_serverinfo_GetString(string serverKey) +{ + return serverkey(serverKey); +} + +float +SHPF_serverinfo_GetFloat(string serverKey) +{ + return serverkeyfloat(serverKey); +} + +int +SHPF_serverinfo_GetInteger(string serverKey) +{ + return (int)serverkeyfloat(serverKey); +} + +bool +SHPF_serverinfo_GetBool(string serverKey) +{ + return (serverkeyfloat(serverKey) > 0) ? (true) : (false); +} + +vector +SHPF_serverinfo_GetVector(string serverKey) +{ + return stov(serverkey(serverKey)); +} + +void +SHPF_serverinfo_SetString(string serverKey, string setValue) +{ +#ifdef SERVER + forceinfokey(world, serverKey, setValue); +#else +#endif +} + +void +SHPF_serverinfo_SetInteger(string serverKey, int setValue) +{ +#ifdef SERVER + forceinfokey(world, serverKey, itos(setValue)); +#else +#endif +} + +void +SHPF_serverinfo_SetBool(string serverKey, bool setValue) +{ +#ifdef SERVER + forceinfokey(world, serverKey, ftos(setValue)); +#else +#endif +} + +void +SHPF_serverinfo_SetFloat(string serverKey, float setValue) +{ +#ifdef SERVER + forceinfokey(world, serverKey, ftos(setValue)); +#else +#endif +} + +void +SHPF_serverinfo_SetVector(string serverKey, vector setValue) +{ +#ifdef SERVER + forceinfokey(world, serverKey, vtos(setValue)); +#else +#endif +} + + +/* team library */ + + +int +SHPF_teams_TeamCount(void) +{ + return SHPF_serverinfo_GetInteger("teams"); +} + +vector +SHPF_teams_Color(int teamID) +{ + return SHPF_serverinfo_GetVector(sprintf("teamcolor_%i", teamID)); +} + +string +SHPF_teams_Name(int teamID) +{ + return SHPF_serverinfo_GetString(sprintf("team_%i", teamID)); +} + +int +SHPF_teams_Score(int teamID) +{ + return SHPF_serverinfo_GetInteger(sprintf("teamscore_%i", teamID)); +} + +string +SHPF_teams_SpawnPoint(int teamID) +{ + return SHPF_serverinfo_GetString(sprintf("teamspawn_%i", teamID)); +} + +int +SHPF_teams_NumPlayers(int teamID) +{ + int countedPlayers = 0i; + +#ifdef CLIENT + for (int i = -1; i > -32; i--) { + int playerTeam = (int)getplayerkeyfloat(i, "*team"); + + if (playerTeam == teamID) { + countedPlayers++; + } + } +#else + for (entity teamPlayer = world; (teamPlayer = find(teamPlayer, ::classname, "player"));) { + if (teamPlayer.team == (float)teamID) { + countedPlayers++; + } + } +#endif + + return (countedPlayers); +} + +int +SHPF_teams_NumAlivePlayers(int teamID) +{ + int countedPlayers = 0i; + +#ifdef CLIENT + for (int i = -1; i > -32; i--) { + int playerTeam = (int)getplayerkeyfloat(i, "*team"); + bool playerDead = getplayerkeyfloat(i, "*dead"); + + if (playerTeam == teamID && playerDead == false) { + countedPlayers++; + } + } +#else + for (entity teamPlayer = world; (teamPlayer = find(teamPlayer, ::classname, "player"));) { + if (teamPlayer.team == (float)teamID && teamPlayer.health > 0) { + countedPlayers++; + } + } +#endif + + return (countedPlayers); +} + +entity +SHPF_teams_RandomPlayer(int teamID) +{ +#ifdef SERVER + int randomCounter = floor(random(1, (float)SHPF_teams_NumAlivePlayers(teamID))); + int countVal = 0i; + + for (entity teamPlayer = world; (teamPlayer = find(teamPlayer, ::classname, "player"));) { + if (teamPlayer.team == teamID) { + countVal++; + + if (countVal == randomCounter) { + return (teamPlayer); + } + } + } +#endif + + return __NULL__; +} + +int +SHPF_teams_NumDeadPlayers(int teamID) +{ + int countedPlayers = 0i; + +#ifdef CLIENT + for (int i = -1; i > -32; i--) { + int playerTeam = (int)getplayerkeyfloat(i, "*team"); + bool playerDead = getplayerkeyfloat(i, "*dead"); + + if (playerTeam == teamID && playerDead == true) { + countedPlayers++; + } + } +#else + for (entity a = world; (a = findfloat(a, ::identity, 1));) { + if (isPlayer(a)) { + NSClientPlayer pl = (NSClientPlayer)a; + if (pl.GetTeam() == (float)teamID && pl.IsAlive() == false) { + countedPlayers++; + } + } + } +#endif + + return (countedPlayers); +} + +int +SHPF_teams_TotalDeaths(int teamID) +{ + int deathCounter = 0i; + +#ifdef CLIENT + for (int i = -1; i > -32; i--) { + int playerTeam = (int)getplayerkeyfloat(i, "*team"); + + if (playerTeam == teamID) { + deathCounter += (int)getplayerkeyfloat(i, "*deaths"); + } + } +#else + for (entity a = world; (a = findfloat(a, ::identity, 1));) { + if (isPlayer(a)) { + NSClientPlayer pl = (NSClientPlayer)a; + if (pl.GetTeam() == (float)teamID) { + deathCounter += pl.deaths; + } + } + } +#endif + return (deathCounter); +} + +int +SHPF_teams_TotalFrags(int teamID) +{ + int fragCounter = 0i; + +#ifdef CLIENT + for (int i = -1; i > -32; i--) { + int playerTeam = (int)getplayerkeyfloat(i, "*team"); + + if (playerTeam == teamID) { + fragCounter += (int)getplayerkeyfloat(i, INFOKEY_P_FRAGS); + } + } +#else + for (entity a = world; (a = findfloat(a, ::identity, 1));) { + if (isPlayer(a)) { + NSClientPlayer pl = (NSClientPlayer)a; + if (pl.GetTeam() == (float)teamID) { + fragCounter += pl.frags; + } + } + } +#endif + + return (fragCounter); +} + +bool +SHPF_teams_Valid(int teamID) +{ + string teamName = SHPF_teams_Name(teamID); + + if (teamName == "") { + return (false); + } + + return (true); +} + +int +SHPF_teams_BestAutoJoinTeam(void) +{ + int sadTeam = 0i; + int sadCount = 1995i; /* unlikely high player number. */ + + /* maximum of 1000 teams. */ + for (int i = 0; i <= 1000; i++) { + /* gaps in team id setup can now act as divider, allowing which teams are auto-join. */ + if (SHPF_teams_Valid(i) == false) { + break; + } + + int playerCount = SHPF_teams_NumPlayers(i); + + if (playerCount < sadCount) { + sadCount = playerCount; + sadTeam = i; + } + } + + return (sadTeam); +} + +void +SHPF_teams_SetScore(int teamID, int setValue) +{ +#ifdef SERVER + SHPF_serverinfo_SetInteger(sprintf("teamscore_%i", teamID), setValue); +#else +#endif +} + +void +SHPF_teams_AddScore(int teamID, int addValue) +{ +#ifdef SERVER + int newValue = SHPF_teams_Score(teamID) + addValue; + SHPF_teams_SetScore(teamID, newValue); +#endif +} + +void +SHPF_teams_SetUp(int teamID, string teamTitle, vector teamColor, bool openTeam) +{ +#ifdef SERVER + int teamCount = 0i; + + if (!teamTitle || teamTitle == "") { + NSError("Team title cannot be empty."); + } + + if (teamID <= 0i) { + NSError("Team ID cannot be 0 or negative."); + } + + if (teamID > 1000i) { + NSError("Team ID cannot be over 1000. Reserved."); + } + + SHPF_serverinfo_SetString(sprintf("team_%i", teamID), teamTitle); + SHPF_serverinfo_SetString(sprintf("teamscore_%i", teamID), "0"); + SHPF_serverinfo_SetVector(sprintf("teamcolor_%i", teamID), teamColor / 255); + + if (openTeam) { + SHPF_serverinfo_SetString(sprintf("teamclosed_%i", teamID), ""); + } else { + SHPF_serverinfo_SetString(sprintf("teamclosed_%i", teamID), "1"); + } + + /* buh */ + for (teamCount = 0i; teamCount <= 1000; teamCount++) { + //printf("Checking validity of team %i\n", teamCount + 1i); + + if (SHPF_teams_Valid(teamCount + 1i) == false) { + break; + } + } + + //printf("SHPF_serverinfo_SetInteger %i\n", teamCount); + SHPF_serverinfo_SetInteger("teams", teamCount); +#else +#endif +} + +void +SHPF_teams_SetSpawnPoint(int teamID, string spawnPoint) +{ +#ifdef SERVER + SHPF_serverinfo_SetString(sprintf("teamspawn_%i", teamID), spawnPoint); +#else +#endif +} + +/* weaponInfo library */ + +/* required because we might need to look it up inside the +info for the primary attack mode. */ +static string +NSWeapon_GetPrimaryKeyValue(string weaponDef, string keyName) +{ + string fireInfo1 = EntityDef_GetKeyValue(weaponDef, "def_fireInfo"); + string defValue = EntityDef_GetKeyValue(weaponDef, keyName); + string fireInfoValue = EntityDef_GetKeyValue(fireInfo1, keyName); + + /* fireinfo takes priority */ + if (fireInfoValue) { + return (fireInfoValue); + } + + return (defValue); +} + +string +SHPF_weaponInfo_Type(string weaponDef) +{ + return ("unknown"); +} + +int +SHPF_weaponInfo_StartAmmo(string weaponDef) +{ + return (int)stof(EntityDef_GetKeyValue(weaponDef, "clipSize")); +} + +int +SHPF_weaponInfo_MaxAmmo(string weaponDef) +{ + string ammoType = NSWeapon_GetPrimaryKeyValue(weaponDef, "ammoType"); + return (ammoMaxForName(ammoType)); +} + +bool +SHPF_weaponInfo_IsSemiAuto(string weaponDef) +{ + return (bool)stof(NSWeapon_GetPrimaryKeyValue(weaponDef, "semiAuto")); +} + +string +SHPF_weaponInfo_InventoryType(string weaponDef) +{ + return ("item"); +} + +float +SHPF_weaponInfo_FireTime(string weaponDef) +{ + return stof(NSWeapon_GetPrimaryKeyValue(weaponDef, "fireRate")); +} + +int +SHPF_weaponInfo_ClipSize(string weaponDef) +{ + return (int)stoi(EntityDef_GetKeyValue(weaponDef, "clipSize")); +} + +string +SHPF_weaponInfo_Class(string weaponDef) +{ + return ("unknown"); +} + +bool +SHPF_weaponInfo_IsClipOnly(string weaponDef) +{ + int clipSize = (int)stoi(EntityDef_GetKeyValue(weaponDef, "clipSize")); + string ammoType = NSWeapon_GetPrimaryKeyValue(weaponDef, "ammoType"); + + /* no ammo type... */ + if (!ammoType) { + /* but a clip is defined */ + if (clipSize > 0i) { + return (true); + } + } + return (false); +} + +bool +SHPF_weaponInfo_IsDetonationTimed(string weaponDef) +{ + string projectileDef = NSWeapon_GetPrimaryKeyValue(weaponDef, "def_projectile"); + bool isFused = (bool)stof(EntityDef_GetKeyValue(projectileDef, "detonate_on_fuse")); + return (isFused); +} + + +NSEntity +spawnClass(string className, vector desiredPos) +{ + NSEntity newEntity = __NULL__; + +#ifdef SERVER + newEntity = Entity_CreateClass(className); + + /* That class didn't exist, so let's take the base Nuclide one */ + if (!newEntity) { + newEntity = Entity_CreateClass("NSEntity"); + } + + /* OOM. It's over. */ + if (!newEntity) { + return (__NULL__); + } + + newEntity.classname = className; + newEntity.Spawn(); + newEntity.SetOrigin(desiredPos); +#endif + + return (newEntity); +} + +#ifdef SERVER +bool +changeClass(entity target, string className) +{ + /* hijack that decl. you don't to mess with this. */ + if (target.flags & FL_CLIENT) { + if (className == "spectator") { + NSClientPlayer theClient = (NSClientPlayer)target; + changeClass(theClient, "player"); + theClient.MakeTempSpectator(); + theClient.team = TEAM_SPECTATOR; + return (true); + } + } + + return EntityDef_SwitchClass((NSEntity)target, className) ? (true) : (false); +} +#endif + +void +sendInput(entity target, string inputName, string dataString, entity activator) +{ + NSEntity targetEntity = (NSEntity)target; +#ifdef SERVER + targetEntity.Input(activator, inputName, dataString); +#endif +} + +/* helper functions */ +bool +isAI(entity entityToCheck) +{ + if (entityToCheck.flags & FL_MONSTER) { + return (true); + } + + return (false); +} + +bool +isAlive(entity entityToCheck) +{ +#ifdef SERVER + if (entityToCheck.takedamage != DAMAGE_NO) { + NSSurfacePropEntity livingEnt = (NSSurfacePropEntity)entityToCheck; + return livingEnt.IsAlive(); + } +#endif + + return (false); +} + +bool +isGodMode(entity entityToCheck) +{ + if (entityToCheck.flags & FL_GODMODE) { + return (true); + } + + return (false); +} + +bool +isClient(entity entityToCheck) +{ + return (entityToCheck.flags & FL_CLIENT) ? (true) : (false); +} + +bool +isPlayer(entity entityToCheck) +{ + if (isClient(entityToCheck)) { + NSClient pl = (NSClient)entityToCheck; + + return pl.IsPlayer(); + } + + return (false); +} + +bool +isSentient(entity entityToCheck) +{ + if (isAI(entityToCheck) || isPlayer(entityToCheck)) { + return (true); + } + + return (false); +} + +bool +isBot(entity entityToCheck) +{ +#ifdef SERVER + return (clienttype(entityToCheck) == CLIENTTYPE_BOT) ? (true) : (false); +#else + return (false); +#endif +} + +bool +isWeapon(entity entityToCheck) +{ + return (entityToCheck._isWeapon) ? (true) : (false); +} + +bool +isItem(entity entityToCheck) +{ + return (entityToCheck._isItem) ? (true) : (false); +} + +string +SHPF_entityDef_GetString(string declName, string keyName) +{ + return EntityDef_GetKeyValue(declName, keyName); +} + +int +SHPF_entityDef_GetInteger(string declName, string keyName) +{ + return (int)stoi(SHPF_entityDef_GetString(declName, keyName)); +} + +bool +SHPF_entityDef_GetBool(string declName, string keyName) +{ + + return stof(SHPF_entityDef_GetString(declName, keyName)) ? (true) : (false); +} + +float +SHPF_entityDef_GetFloat(string declName, string keyName) +{ + + return stof(SHPF_entityDef_GetString(declName, keyName)); +} + +vector +SHPF_entityDef_GetVector(string declName, string keyName) +{ + return stov(SHPF_entityDef_GetString(declName, keyName)); +} diff --git a/src/shared/cloader.qc b/src/shared/cloader.qc index ac37d4a9..5be51839 100644 --- a/src/shared/cloader.qc +++ b/src/shared/cloader.qc @@ -19,7 +19,8 @@ #endif string g_constIndex[MAX_CONSTANTS_ID]; -static int g_constCount; +static int g_constCount; +const string g_constantsFile = "scripts/constants.txt"; void Constants_Init(void) @@ -28,20 +29,20 @@ Constants_Init(void) string tempString; int arguments = 0i; int indexCount = 0i; - - InitStart(); - - g_constCount = 0i; + + InitStart(); + + g_constCount = 0i; if (!g_hashConstants) { g_hashConstants = hash_createtab(2, HASH_ADD); } - constFile = fopen("scripts/constants.txt", FILE_READ); + constFile = fopen(g_constantsFile, FILE_READ); if (constFile < 0) { - NSError("Missing file scripts/constants.txt"); - InitEnd(); + NSWarning("No constants, missing %S", g_constantsFile); + InitEnd(); return; } @@ -54,28 +55,30 @@ Constants_Init(void) /* sanity bounds check */ if (!Constants_Add(argv(0), argv(1))) { - InitEnd(); + fclose(constFile); + InitEnd(); return; } } - - InitEnd(); + + fclose(constFile); + InitEnd(); } - -bool -Constants_Add(string constantName, string constantValue) -{ + +bool +Constants_Add(string constantName, string constantValue) +{ /* sanity bounds check */ if (g_constCount == MAX_CONSTANTS_ID) { NSError("Hit maximum number of %d constants.", MAX_CONSTANTS_ID); return (false); } - + g_constIndex[g_constCount] = constantValue; hash_add(g_hashConstants, constantName, g_constCount); g_constCount++; - return (true); -} + return (true); +} string Constants_LookUp(string constName, string returnValue) @@ -83,8 +86,9 @@ Constants_LookUp(string constName, string returnValue) int constIndex = -1i; /* only if we're prefixed */ - if (substring(constName, 0, 1) == "$") + if (substring(constName, 0, 1) == "$") { constIndex = hash_get(g_hashConstants, substring(constName, 1, -1), -1i); + } return (constIndex == -1i) ? returnValue : g_constIndex[constIndex]; } diff --git a/src/shared/decalgroups.qc b/src/shared/decalgroups.qc index 854afb13..49325ce8 100644 --- a/src/shared/decalgroups.qc +++ b/src/shared/decalgroups.qc @@ -109,6 +109,9 @@ DecalGroups_Parse(string line) } } + +const string g_decalGroupFile = "scripts/decals.txt"; + void DecalGroups_Init(void) { @@ -123,21 +126,32 @@ DecalGroups_Init(void) g_hashdecalgroup = hash_createtab(2, EV_STRING | HASH_REPLACE); } - fh = fopen("scripts/decals.txt", FILE_READ); + fh = fopen(g_decalGroupFile, FILE_READ); + if (fh < 0) { - NSError("Missing file scripts/decals.txt"); + NSWarning("No groups, no %S", g_decalGroupFile); InitEnd(); return; } #ifdef CLIENT + int dgMemSize; + /* count content */ while ((line = fgets(fh))) { DecalGroups_CountLine(line); } /* alocate our stuff */ - g_decalgroup = (decalGroup_t *)memalloc(sizeof(decalGroup_t) * g_decalgroup_count); + dgMemSize = sizeof(decalGroup_t) * g_decalgroup_count; + g_decalgroup = (decalGroup_t *)memalloc(dgMemSize); + + if (!g_decalgroup) { + NSError("Memory allocation failed for %i bytes.", dgMemSize); + g_decalgroup_count = 0; + InitEnd(); + return; + } /* Defaults */ for (int i = 0; i < g_decalgroup_count; i++) { diff --git a/src/shared/defs.h b/src/shared/defs.h index c301f04d..592e8837 100644 --- a/src/shared/defs.h +++ b/src/shared/defs.h @@ -46,12 +46,15 @@ typedef entity id; #define NSENTITY_READENTITY(x, y) \ { \ local x x ##_e = ( x )self;\ + local float x ##receivedFlags;\ if (y == true) { \ self.classname = strcat("spawnfunc_", #x); \ callfunction(self.classname); \ } \ - x ##_e.ReceiveEntity( y, readfloat() );\ + x ##receivedFlags = readfloat();\ + x ##_e.ReceiveEntity( y, x ##receivedFlags );\ x ##_e.Relink();\ + x ##_e._ReceiveComplete( y, x ##receivedFlags );\ } #else @@ -65,8 +68,6 @@ typedef entity id; #define ATTR_CHANGED(x) (x ##_net != x) #define VEC_CHANGED(x,y) (x ##_net[y] != x[y]) -#define STRING_SET(x) ((x != __NULL__) && (x != "")) - #ifndef MAX_AMMO_TYPES #define MAX_AMMO_TYPES 16i #endif @@ -101,6 +102,7 @@ string __fullspawndata; #include "NSTimer.h" #include "NSRenderableEntity.h" #include "NSSurfacePropEntity.h" +#include "NSRagdoll.h" #include "NSMoverEntity.h" #include "NSPhysicsConstraint.h" #include "NSPhysicsEntity.h" @@ -118,12 +120,14 @@ string __fullspawndata; #include "NSProjectile.h" #include "NSSpraylogo.h" #include "NSPortal.h" +#include "NSSound.h" #include "NSDebris.h" #include "../xr/defs.h" #include "../botlib/NSBot.h" #include "NSClient.h" #include "NSClientSpectator.h" +#include "pmove.h" #include "NSClientPlayer.h" #include "NSVehicle.h" @@ -132,10 +136,7 @@ string __fullspawndata; #include "damage.h" #include "flags.h" #include "entities.h" -#include "events.h" -#include "flags.h" #include "hitmesh.h" -#include "pmove.h" #include "memory.h" #include "platform.h" #include "propdata.h" @@ -162,24 +163,7 @@ const vector VEC_HULL_MAX = [16,16,36]; const vector VEC_CHULL_MIN = [-16,-16,-18]; const vector VEC_CHULL_MAX = [16,16,18]; -// Actually used by input_button etc. -#define INPUT_BUTTON0 0x00000001 /* attack 1*/ -#define INPUT_BUTTON2 0x00000002 /* jumping */ -#define INPUT_BUTTON3 0x00000004 /* prone */ -#define INPUT_BUTTON4 0x00000008 /* reload */ -#define INPUT_BUTTON5 0x00000010 /* secondary */ -#define INPUT_BUTTON6 0x00000020 /* use */ -#define INPUT_BUTTON7 0x00000040 /* reserved */ -#define INPUT_BUTTON8 0x00000080 /* crouching */ - -#define INPUT_PRIMARY INPUT_BUTTON0 -#define INPUT_JUMP INPUT_BUTTON2 -#define INPUT_PRONE INPUT_BUTTON3 -#define INPUT_RELOAD INPUT_BUTTON4 -#define INPUT_SECONDARY INPUT_BUTTON6 -#define INPUT_USE INPUT_BUTTON5 /* This can NEVER change. Engine hard-coded. */ -#define INPUT_SPRINT INPUT_BUTTON7 -#define INPUT_CROUCH INPUT_BUTTON8 +#include "input.h" /* sendflags */ #define UPDATE_ALL 16777215 @@ -200,6 +184,10 @@ enumflags .float teleport_time; .vector basevelocity; .float gflags; +.float identity; + +.bool _isWeapon; +.bool _isItem; void Empty(void) @@ -355,7 +343,6 @@ memalloc(int size) return prior(size); } -.float identity; .float removed; __wrap void remove(entity target) @@ -431,7 +418,7 @@ unpackStringCommand(string commandString) } /* is this supposed to be read from a skill cvar? */ if (substring(commandString, 0, 5) == "cvar:") { - return cvar_string(substring(commandString, 5, -1), ""); + return cvar_string(substring(commandString, 5, -1)); } #endif @@ -613,16 +600,6 @@ Route_GetJumpVelocity(vector vecFrom, vector vecTo, float flGravMod) return vecJump; } -bool -fileExists(string filePath) -{ - if (filePath != "") /* not empty */ - if not(whichpack(filePath)) /* not present on disk */ - return false; - - return true; -} - void DebugBox(vector absPos, vector minSize, vector maxSize, vector boxColor, float boxAlpha) { diff --git a/src/shared/entities.h b/src/shared/entities.h index df24f028..0fe8e5f6 100644 --- a/src/shared/entities.h +++ b/src/shared/entities.h @@ -36,6 +36,7 @@ typedef enum { ENT_NONE = 0, /**< invalid, but reserved. */ ENT_ENTITY, /**< of type NSEntity */ + ENT_SOUND, /**< of type NSSound */ ENT_PMOVEVARS, /**< of type NSPMoveVars */ ENT_ENTITYRENDERABLE, /**< of type NSRenderableEntity */ ENT_ENTITYPROJECTILE, /**< of type NSProjectile */ @@ -47,6 +48,7 @@ typedef enum ENT_PLAYER, /**< of type NSClientPlayer */ ENT_ITEM, /**< of type NSItem */ ENT_WEAPON, /**< of type NSWeapon */ + ENT_RAGDOLL, /**< of type NSRagdoll */ ENT_SPECTATOR, /**< of type NSClientSpectator */ ENT_PORTAL, /**< of type NSPortal */ ENT_AMBIENTSOUND, /**< of type ambient_generic */ diff --git a/src/shared/entityDef.h b/src/shared/entityDef.h index 7de60fb8..4b51b54b 100644 --- a/src/shared/entityDef.h +++ b/src/shared/entityDef.h @@ -41,7 +41,7 @@ and populate it with key/value pairs. # Overview -Using this example definition, we can re-invent func_illusionary using an already existing entity class (func_wall) and making it non-solid: +Using this example definition, we can re-invent func_illusionary using an already existing entity class (func_wall), making it non-solid: ``` entityDef func_illusionary { @@ -50,7 +50,7 @@ entityDef func_illusionary { } ``` -We also have features exclusive to our entityDef format. In the following example, you can change the `body` key equals `1`, the switch will `skin` to id `4`. You can as many conditions as you like. +We also have features exclusive to our entityDef format. In the following example, when the`body` key equals `1`, it will switch `skin` to id `4`. You can have as many conditions as you like. ``` entityDef foobar { @@ -62,10 +62,10 @@ entityDef foobar { } ``` -Will allow developers to configure other fields when certain +It essentially allows developers to configure other fields when certain conditions are met. -This is also expanded to include model event callbacks to the tried +Another feature exclusive to our entityDef spec is how we can tie model event callbacks to the tried and true I/O system: ``` @@ -78,10 +78,13 @@ entityDef foobar { } ``` +This way, an animation that is played by a weapon or a monster can call back +to in-game events without you having to dig into the source code. + # See Also -- [1] http://www.teamfortress.com/tfii/mc2mapc.html -- [2] http://icculus.org/~marco/notmine/id-dev/www.iddevnet.com/doom3/entitydefs.html +- [1] http://icculus.org/~marco/notmine/id-dev/www.iddevnet.com/doom3/entitydefs.html +- [2] http://www.teamfortress.com/tfii/mc2mapc.html @{ @@ -120,8 +123,8 @@ typedef struct void EntityDef_Init(void); void EntityDef_DebugList(void); string EntityDef_GetKeyValue(string, string); -float EntityDef_NetIDFromName(string); -string EntityDef_NameFromNetID(float); +int EntityDef_NetIDFromName(string); +string EntityDef_NameFromNetID(int); int EntityDef_IDFromName(string); string EntityDef_GetSpawnData(int); bool EntityDef_HasSpawnClass(string className); diff --git a/src/shared/entityDef.qc b/src/shared/entityDef.qc index a72b846e..fce6c5a3 100644 --- a/src/shared/entityDef.qc +++ b/src/shared/entityDef.qc @@ -268,8 +268,6 @@ EntityDef_CheckCondition(NSEntity target, int id, string keyWord, float tweakCon tmp1 = stof(keyValue); tmp2 = stof(value); - print(sprintf("%d & %d\n", tmp1, tmp2)); - if (key == keyWord && tmp2 & tmp1) return true; break; @@ -393,8 +391,9 @@ EntityDef_PrepareEntity(entity target, int id) for (int i = 1; i < (spawnWords - 1); i+= 2) { /* ignore this, always */ - if (argv(i) != "classname") + if (argv(i) != "classname") { targetEnt.SpawnKey(argv(i), argv(i+1)); + } } /* now after everything else is done, check our entityDef tweaks */ @@ -410,7 +409,7 @@ EntityDef_PrepareEntity(entity target, int id) string keyValue = argv(2); /* iterate through a bunch of different data to check our condition */ - if (EntityDef_CheckCondition(target, id, keyWord, tweakCondition, keyValue)) { + if (EntityDef_CheckCondition((NSEntity)target, id, keyWord, tweakCondition, keyValue)) { int tweakGroups = tokenizebyseparator(g_entDefTable[id].tweakKeys, ";"); //print(sprintf("%S passed the check\n", keyWord)); @@ -432,16 +431,6 @@ EntityDef_PrepareEntity(entity target, int id) /* retokenize */ tweakGroups = tokenizebyseparator(g_entDefTable[id].tweakKeys, ";"); } - - print("\n"); - print("\n"); - print("\n"); - print("\n"); - print(targetEnt.m_strSpawnData); - print("\n"); - print("\n"); - print("\n"); - print("\n"); } /* retokenize our condition */ @@ -457,8 +446,7 @@ EntityDef_PrepareEntity(entity target, int id) targetEnt.classname = g_entDefTable[id].entClass; targetEnt.entityDefID = EntityDef_NetIDFromName(targetEnt.classname); - targetEnt.Spawned(); - targetEnt.Respawn(); + targetEnt.Spawn(); } g_lastSpawnData = ""; @@ -555,7 +543,6 @@ NSEntity EntityDef_SwitchClass(NSEntity target, string className) { NSEntity returnEntity = __NULL__; - float oldTeam = target.team; g_lastSpawnData = target.m_strSpawnData; for (int i = 0i; i < g_entDefCount; i++) { @@ -566,7 +553,6 @@ EntityDef_SwitchClass(NSEntity target, string className) NSLog("Spawning eDef %S", className); returnEntity = EntityDef_PrepareEntity(target, i); - returnEntity.team = oldTeam; return (returnEntity); } } @@ -649,11 +635,18 @@ EntityDef_DebugList(void) } } -float +int +ourCRC(string name) +{ + int crcValue = (int)(stoh(digest_hex("CRC16", strtolower(name)))); + return (crcValue); +} + +int EntityDef_NetIDFromName(string defName) { #if 1 - return crc16(true, defName); + return ourCRC(defName); #else if (defName) { for (int i = 0i; i < g_entDefCount; i++) { @@ -682,10 +675,10 @@ EntityDef_IDFromName(string defName) } string -EntityDef_NameFromNetID(float defNum) +EntityDef_NameFromNetID(int defNum) { for (int i = 0i; i < g_entDefCount; i++) { - int checkSum = crc16(true, g_entDefTable[i].entClass); + int checkSum = ourCRC(g_entDefTable[i].entClass); if (checkSum == defNum) { return (g_entDefTable[i].entClass); @@ -695,7 +688,6 @@ EntityDef_NameFromNetID(float defNum) return ""; } - string EntityDef_GetSpawnData(int defNum) { diff --git a/src/shared/fteextensions.qc b/src/shared/fteextensions.qc index 6c03b4eb..f1402fce 100644 --- a/src/shared/fteextensions.qc +++ b/src/shared/fteextensions.qc @@ -1,3841 +1,3841 @@ -/* -This file was generated by FTE Quake 6278M, dated Jun 27 2022. -This file can be regenerated by issuing the following command: -pr_dumpplatform -(Use the -help arg for a list of available args) -*/ -#pragma noref 1 -//#pragma flag enable logicops -#pragma warning error Q101 /*too many parms. The vanilla qcc didn't validate properly, hence why fteqcc normally treats it as a warning.*/ -#pragma warning error Q105 /*too few parms. The vanilla qcc didn't validate properly, hence why fteqcc normally treats it as a warning.*/ -#pragma warning error Q106 /*assignment to constant/lvalue. Define them as var if you want to initialise something.*/ -#pragma warning error Q208 /*system crc unknown. Compatibility goes out of the window if you disable this.*/ -#pragma warning enable F301 /*non-utf-8 strings. Think of the foreigners! Also think of text editors that insist on screwing up your char encodings.*/ -#pragma warning enable F302 /*uninitialised locals. They usually default to 0 in qc (except in recursive functions), but its still probably a bug*/ -#if !defined(CSQC) && !defined(NQSSQC) && !defined(QWSSQC)&& !defined(MENU) - #ifdef QUAKEWORLD - #define QWSSQC - #else - #define NQSSQC - #endif -#endif -#if !defined(SSQC) && (defined(QWSSQC) || defined(NQSSQC)) - #define SSQC -#endif -#if defined(CSQC) || defined(MENU) - #define DEP_CSQC DEP -#else - #define DEP_CSQC __deprecated("Use CSQC for this") -#endif -#ifndef DEP - #define DEP __deprecated //predefine this if you want to avoid our deprecation warnings. -#endif -#ifndef FTEDEP - #define FTEDEP(reason) //for symbols deprecated in FTE that may still be useful/required for other engines -#endif -#define BX_COLOREDTEXT -#define DP_CON_SET /* The 'set' console command exists, and can be used to create/set cvars. */ -#define DP_CON_SETA /* The 'seta' console command exists, like the 'set' command, but also marks the cvar for archiving, allowing it to be written into the user's config. Use this command in your default.cfg file. */ -#define DP_CSQC_ROTATEMOVES -#define DP_EF_ADDITIVE -#define DP_ENT_ALPHA -#define DP_EF_BLUE -#define DP_EF_FULLBRIGHT -#define DP_EF_NODEPTHTEST -#define DP_EF_NODRAW -#define DP_EF_NOGUNBOB -#define DP_EF_NOSHADOW -#define DP_EF_RED -#define DP_ENT_COLORMOD -#define DP_ENT_CUSTOMCOLORMAP -#define DP_ENT_EXTERIORMODELTOCLIENT -#define DP_ENT_SCALE -#define DP_ENT_TRAILEFFECTNUM /* self.traileffectnum=particleeffectnum("myeffectname"); can be used to attach a particle trail to the given server entity. This is equivelent to calling trailparticles each frame. */ -#define DP_ENT_VIEWMODEL -#define DP_GECKO_SUPPORT -#define DP_GFX_FONTS -#define DP_GFX_QUAKE3MODELTAGS -#define DP_GFX_SKINFILES -#define DP_GFX_SKYBOX -#define DP_HALFLIFE_MAP -#define DP_HALFLIFE_MAP_CVAR -#define DP_INPUTBUTTONS -#define DP_LIGHTSTYLE_STATICVALUE -#define DP_LITSUPPORT -#define DP_MONSTERWALK /* MOVETYPE_WALK is valid on non-player entities. Note that only players receive acceleration etc in line with none/bounce/fly/noclip movetypes on the player, thus you will have to provide your own accelerations (incluing gravity) yourself. */ -#define DP_MOVETYPEBOUNCEMISSILE -#define DP_MOVETYPEFOLLOW -#define DP_QC_ASINACOSATANATAN2TAN -#define DP_QC_CHANGEPITCH -#define DP_QC_COPYENTITY -#define DP_QC_CRC16 -#define DP_QC_CVAR_DEFSTRING -#define DP_QC_CVAR_STRING -#define DP_QC_CVAR_TYPE -#define DP_QC_DIGEST_SHA256 -#define DP_QC_EDICT_NUM -#define DP_QC_ENTITYDATA -#define DP_QC_ETOS -#define DP_QC_FINDCHAIN -#define DP_QC_FINDCHAINFLOAT -#define DP_QC_FINDFLAGS -#define DP_QC_FINDCHAINFLAGS -#define DP_QC_FINDFLOAT -#define DP_QC_FS_SEARCH -#define DP_QC_FS_SEARCH_PACKFILE -#define DP_QC_GETLIGHT -#define DP_QC_GETSURFACE -#define DP_QC_GETSURFACEPOINTATTRIBUTE -#define DP_QC_GETTAGINFO -#define DP_QC_I18N /* Specifies that the engine uses $MODULE.dat.$LANG.po files that translates the dotranslate_* globals on load - these are usually created via the _("foo") qcc intrinsic. */ -#define DP_QC_MINMAXBOUND -#define DP_QC_MULTIPLETEMPSTRINGS /* Superseded by DP_QC_UNLIMITEDTEMPSTRINGS. Functions that return a temporary string will not overwrite/destroy previous temporary strings until at least 16 strings are returned (or control returns to the engine). */ -#define DP_QC_RANDOMVEC -#define DP_QC_RENDER_SCENE /* clearscene+addentity+setviewprop+renderscene+setmodel are available to menuqc. WARNING: DP advertises this extension without actually supporting it, FTE does actually support it. */ -#define DP_QC_SINCOSSQRTPOW -#define DP_QC_SPRINTF /* Provides the sprintf builtin, which allows for rich formatting along the lines of C's function with the same name. Not to be confused with QC's sprint builtin. */ -#define DP_QC_STRFTIME -#define DP_QC_STRING_CASE_FUNCTIONS -#define DP_QC_STRINGBUFFERS -#define DP_QC_STRINGCOLORFUNCTIONS -#define DP_QC_STRREPLACE -#define DP_QC_TOKENIZEBYSEPARATOR -#define DP_QC_TRACEBOX -#define DP_QC_TRACETOSS -#define DP_QC_TRACE_MOVETYPE_HITMODEL -#define DP_QC_TRACE_MOVETYPE_WORLDONLY -#define DP_QC_TRACE_MOVETYPES -#define DP_QC_UNLIMITEDTEMPSTRINGS /* Supersedes DP_QC_MULTIPLETEMPSTRINGS, superseded by FTE_QC_PERSISTENTTEMPSTRINGS. Specifies that all temp strings will be valid at least until the QCVM returns. */ -#define DP_QC_URI_ESCAPE -#define DP_QC_URI_GET -#define DP_QC_URI_POST -#define DP_QC_VECTOANGLES_WITH_ROLL -#define DP_QC_VECTORVECTORS -#define DP_QC_WHICHPACK -#define DP_QUAKE2_MODEL -#define DP_QUAKE2_SPRITE -#define DP_QUAKE3_MAP -#define DP_QUAKE3_MODEL -#define DP_REGISTERCVAR -#define DP_SND_SOUND7_WIP2 -#define DP_SND_STEREOWAV -#define DP_SND_OGGVORBIS -#define DP_SOLIDCORPSE -#define DP_SPRITE32 -#define DP_SV_BOTCLIENT -#define DP_SV_CLIENTCAMERA /* Works like svc_setview except also handles pvs. */ -#define DP_SV_CLIENTCOLORS /* Provided only for compatibility with DP. */ -#define DP_SV_CLIENTNAME /* Provided only for compatibility with DP. */ -#define DP_SV_CUSTOMIZEENTITYFORCLIENT /* Deprecated feature for compat with DP. Can be slow, incompatible with splitscreen, usually malfunctions with mvds. */ -#define DP_SV_DRAWONLYTOCLIENT -#define DP_SV_DROPCLIENT /* Equivelent to quakeworld's stuffcmd(self,"disconnect\n"); hack */ -#define DP_SV_EFFECT -#define DP_SV_EXTERIORMODELFORCLIENT -#define DP_SV_NODRAWTOCLIENT -#define DP_SV_PLAYERPHYSICS /* Allows reworking parts of NQ player physics. USE AT OWN RISK - this necessitates NQ physics and is thus guarenteed to break prediction. */ -#define DP_SV_POINTSOUND -#define DP_SV_PRECACHEANYTIME /* Specifies that the various precache builtins can be called at any time. WARNING: precaches are sent reliably while sound events, modelindexes, and particle events are not. This can mean sounds and particles might not work the first time around, or models may take a while to appear (after the reliables are received and the model is loaded from disk). Always attempt to precache a little in advance in order to reduce these issues (preferably at the start of the map...) */ -#define DP_SV_PRINT /* Says that the print builtin can be used from nqssqc (as well as just csqc), bypassing the developer cvar issues. */ -#define DP_SV_ROTATINGBMODEL /* Engines that support this support avelocity on MOVETYPE_PUSH entities, pushing entities out of the way as needed. */ -#define DP_SV_SETCOLOR -#define DP_SV_SHUTDOWN -#define DP_SV_SPAWNFUNC_PREFIX -#define DP_SV_WRITEPICTURE -#define DP_SV_WRITEUNTERMINATEDSTRING -#define DP_TE_BLOOD -#define DP_TE_CUSTOMFLASH -#define DP_TE_EXPLOSIONRGB -#define DP_TE_PARTICLECUBE -#define DP_TE_PARTICLERAIN -#define DP_TE_PARTICLESNOW -#define DP_TE_SMALLFLASH -#define DP_TE_SPARK -#define DP_TE_STANDARDEFFECTBUILTINS -#define DP_VIEWZOOM -#define EXT_BITSHIFT -#define EXT_CSQC -#define EXT_CSQC_SHARED -#define EXT_DIMENSION_VISIBILITY -#define EXT_DIMENSION_PHYSICS -#define EXT_DIMENSION_GHOST -#define FRIK_FILE -#define FTE_CALLTIMEOFDAY /* Replication of mvdsv functionality (call calltimeofday to cause 'timeofday' to be called, with arguments that can be saved off to a global). Generally strftime is simpler to use. */ -#define FTE_CSQC_ALTCONSOLES /* The engine tracks multiple consoles. These may or may not be directly visible to the user. */ -#define FTE_CSQC_BASEFRAME /* Specifies that .basebone, .baseframe2, .baselerpfrac, baseframe1time, etc exist in csqc. These fields affect all bones in the entity's model with a lower index than the .basebone field, allowing you to give separate control to the legs of a skeletal model, without affecting the torso animations. */ -#define FTE_CSQC_HALFLIFE_MODELS -#define FTE_CSQC_SERVERBROWSER /* Provides builtins to query the engine's serverbrowser servers list from ssqc. Note that these builtins are always available in menuqc. */ -#define FTE_CSQC_SKELETONOBJECTS /* Provides container objects for skeletal bone data, which can be modified on a per bone basis if needed. This allows you to dynamically generate animations (or just blend them with greater customisation) instead of being limited to a single animation or two. */ -#define FTE_CSQC_RAWIMAGES /* Provides raw rgba image access to csqc. With this, the csprogs can read textures into qc-accessible memory, modify it, and then upload it to the renderer. */ -#define FTE_CSQC_RENDERTARGETS /* VF_RT_DESTCOLOUR exists and can be used to redirect any rendering to a texture instead of the screen. */ -#define FTE_CSQC_REVERB /* Specifies that the mod can create custom reverb effects. Whether they will actually be used or not depends upon the sound driver. */ -#define FTE_CSQC_WINDOWCAPTION /* Provides csqc with the ability to change the window caption as displayed when running windowed or in the task bar when switched out. */ -#define FTE_ENT_SKIN_CONTENTS /* self.skin = CONTENTS_WATER; makes a brush entity into water. use -16 for a ladder. */ -#define FTE_ENT_UNIQUESPAWNID -#define FTE_EXTENDEDTEXTCODES -#define FTE_FORCESHADER /* Allows csqc to override shaders on models with an explicitly named replacement. Also allows you to define shaders with a fallback if it does not exist on disk. */ -#define FTE_FORCEINFOKEY /* Provides an easy way to change a user's userinfo from the server. */ -#define FTE_GFX_QUAKE3SHADERS /* specifies that the engine has full support for vanilla quake3 shaders */ -#define FTE_GFX_REMAPSHADER /* With the raw power of stuffcmds, the r_remapshader console command is exposed! This mystical command can be used to remap any shader to another. Remapped shaders that specify $diffuse etc in some form will inherit the textures implied by the surface. */ -#define FTE_GFX_IQM_HITMESH /* Supports hitmesh iqm extensions. Also supports geomsets and embedded events. */ -#define FTE_GFX_MODELEVENTS /* Provides a query for per-animation events in model files, including from progs/foo.mdl.events files. */ -#define FTE_ISBACKBUFFERED /* Allows you to check if a client has too many reliable messages pending. */ -#define FTE_MEMALLOC /* Allows dynamically allocating memory. Use pointers to access this memory. Memory will not be saved into saved games. */ -#define FTE_MEDIA_CIN /* playfilm command supports q2 cin files. */ -#define FTE_MEDIA_ROQ /* playfilm command supports q3 roq files. */ -#define FTE_MULTIPROGS /* Multiple progs.dat files can be loaded inside the same qcvm. Insert new ones with addprogs inside the 'init' function, and use externvalue+externset to rewrite globals (and hook functions) to link them together. Note that the result is generally not very clean unless you carefully design for it beforehand. */ -#define FTE_MULTITHREADED /* Faux multithreading, allowing multiple contexts to run in sequence. */ -#define FTE_MVD_PLAYERSTATS /* In csqc, getplayerstat can be used to query any player's stats when playing back MVDs. isdemo will return 2 in this case. */ -#define FTE_PART_SCRIPT /* Specifies that the r_particledesc cvar can be used to select a list of particle effects to load from particles/foo.cfg, the format of which is documented elsewhere. */ -#define FTE_PART_NAMESPACES /* Specifies that the engine can use foo.bar to load effect foo from particle description bar. When used via ssqc, this should cause the client to download whatever effects as needed. */ -#define FTE_PART_NAMESPACE_EFFECTINFO /* Specifies that effectinfo.bar can load effects from effectinfo.txt for DP compatibility. */ -#define FTE_PEXT_SETVIEW /* NQ's svc_setview works correctly even in quakeworld */ -#define FTE_PEXT_LIGHTSTYLECOL -#define FTE_PEXT_VIEW2 -#define FTE_PEXT_FATNESS -#define FTE_PEXT_TE_BULLET -#define FTE_PEXT_FLOATCOORDS -#define FTE_PEXT_Q2BSP /* Specifies that the client supports q2bsps. */ -#define FTE_PEXT_Q3BSP /* Specifies that the client supports q3bsps. */ -#define FTE_HEXEN2 -#define FTE_PEXT_SPAWNSTATIC -#define FTE_PEXT_CUSTOMTENTS -#define FTE_PEXT_256PACKETENTITIES /* Specifies that the client is not limited to vanilla's limit of only 64 ents visible at once. */ -#define FTE_QC_BASEFRAME /* Specifies that .basebone and .baseframe exist in ssqc. These fields affect all bones in the entity's model with a lower index than the .basebone field, allowing you to give separate control to the legs of a skeletal model, without affecting the torso animations, from ssqc. */ -#define FTE_QC_FILE_BINARY /* Extends FRIK_FILE with binary read+write, as well as allowing seeking. Requires pointers. */ -#define FTE_QC_CHANGELEVEL_HUB /* Adds an extra argument to changelevel which is carried over to the next map in the 'spawnspot' global. Maps will be saved+reloaded until the extra argument is omitted again, purging all saved maps. Saved games will contain a copy of each preserved map. parm1-parm64 globals can be used, giving more space to transfer more player data. */ -#define FTE_QC_CHECKCOMMAND /* Provides a way to test if a console command exists, and whether its a command/alias/cvar. Does not say anything about the expected meanings of any arguments or values. */ -#define FTE_QC_CHECKPVS -#define FTE_QC_CROSSPRODUCT -#define FTE_QC_CUSTOMSKINS /* The engine supports the use of q3 skins, as well as the use of such skin 'files' to specify rich top+bottom colours, qw skins, geomsets, or texture composition even on non-players.. */ -#define FTE_QC_DIGEST_SHA1 /* The digest_hex builtin supports 160-bit sha1 hashes. */ -#define FTE_QC_DIGEST_SHA224 /* The digest_hex builtin supports 224-bit sha2 hashes. */ -#define FTE_QC_DIGEST_SHA384 /* The digest_hex builtin supports 384-bit sha2 hashes. */ -#define FTE_QC_DIGEST_SHA512 /* The digest_hex builtin supports 512-bit sha2 hashes. */ -#define FTE_QC_FS_SEARCH_SIZEMTIME -#define FTE_QC_HARDWARECURSORS /* setcursormode exists in both csqc+menuqc, and accepts additional arguments to specify a cursor image to use when this module has focus. If the image exceeds hardware limits (or hardware cursors are unsupported), it will be emulated using regular draws - this at least still avoids conflicting cursors as only one will ever be used, even if console+menu+csqc are all overlayed. */ -#define FTE_QC_HASHTABLES /* Provides efficient string-based lookups. */ -#define FTE_QC_INFOKEY /* QuakeWorld's infokey builtin works, and reports at least name+topcolor+bottomcolor+ping(in ms)+ip(unmasked, but not always ipv4)+team(aka bottomcolor in nq). Does not require actual localinfo/serverinfo/userinfo, but they're _highly_ recommended to any engines with csqc */ -#define FTE_QC_INTCONV /* Provides string<>int conversions, including hex representations. */ -#define FTE_QC_MATCHCLIENTNAME -#define FTE_QC_MULTICAST /* QuakeWorld's multicast builtin works along with MSG_MULTICAST, but also with unicast support. */ -#define FTE_QC_PAUSED -#define FTE_QC_PERSISTENTTEMPSTRINGS /* Supersedes DP_QC_MULTIPLETEMPSTRINGS. Temp strings are garbage collected automatically, and do not expire while they're still in use. This makes strzone redundant. */ -#define FTE_QC_RAGDOLL_WIP -#define FTE_QC_SENDPACKET /* Allows the use of out-of-band udp packets to/from other hosts. Includes the SV_ParseConnectionlessPacket event. */ -#define FTE_QC_STUFFCMDFLAGS /* Variation on regular stuffcmd that gives control over how spectators/mvds should be treated. */ -#define FTE_QC_TRACETRIGGER -#define FTE_QUAKE2_CLIENT /* This engine is able to act as a quake2 client */ -#define FTE_QUAKE2_SERVER /* This engine is able to act as a quake2 server */ -#define FTE_QUAKE3_CLIENT /* This engine is able to act as a quake3 client */ -#define FTE_QUAKE3_SERVER /* This engine is able to act as a quake3 server */ -#define FTE_SOLID_BSPTRIGGER /* Allows for mappers to use shaped triggers instead of being limited to axially aligned triggers. */ -#define FTE_SOLID_LADDER /* Allows a simple trigger to remove effects of gravity (solid 20). obsolete. will prolly be removed at some point as it is not networked properly. Use FTE_ENT_SKIN_CONTENTS */ -#define FTE_SPLITSCREEN /* Client supports splitscreen, controlled via cl_splitscreen. Servers require allow_splitscreen 1 if splitscreen is to be used over the internet. Mods that use csqc will need to be aware for this to work properly. per-client networking may be problematic. */ -#define FTE_SQL /* Provides sql* builtins which can be used for sql database access */ -#define FTE_SQL_SQLITE /* SQL functionality is able to utilise sqlite databases */ -#define FTE_STRINGS /* Extra builtins (and additional behaviour) to make string manipulation easier */ -#define FTE_SV_POINTPARTICLES /* Specifies that particleeffectnum, pointparticles, and trailparticles exist in ssqc as well as csqc. particleeffectnum acts as a precache, allowing ssqc values to be networked up with csqc for use. Use in combination with FTE_PART_SCRIPT+FTE_PART_NAMESPACES to use custom effects. This extension is functionally identical to the DP version, but avoids any misplaced assumptions about the format of the client's particle descriptions. */ -#define FTE_SV_REENTER -#define FTE_TE_STANDARDEFFECTBUILTINS /* Provides builtins to replace writebytes, with a QW compatible twist. */ -#define FTE_TERRAIN_MAP /* This engine supports .hmp files, as well as terrain embedded within bsp files. */ -#define FTE_RAW_MAP /* This engine supports directly loading .map files, as well as realtime editing of the various brushes. */ -#define FTE_INFOBLOBS /* Removes the length limits on user/server/local info strings, and allows embedded nulls and other otherwise-reserved characters. This can be used to network avatar images and the like, or other binary data. */ -#define FTE_VRINPUTS /* input_weapon, input_left_*, input_right_*, input_head_* work, both in csqc (as inputs with suitable plugin/hardware support) and ssqc (available in PlayerPreThink). */ -#define KRIMZON_SV_PARSECLIENTCOMMAND /* SSQC's SV_ParseClientCommand function is able to handle client 'cmd' commands. The tokenizing parts also work in csqc. */ -#define NEH_CMD_PLAY2 -#define NEH_RESTOREGAME -#define QSG_CVARSTRING -#define QW_ENGINE -#define QWE_MVD_RECORD /* You can use the easyrecord command to record MVD demos serverside. */ -#define TEI_MD3_MODEL -#define TEI_SHOWLMP2 -#define TENEBRAE_GFX_DLIGHTS /* Allows ssqc to attach rtlights to entities with various special properties. */ -#define ZQ_MOVETYPE_FLY /* MOVETYPE_FLY works on players. */ -#define ZQ_MOVETYPE_NOCLIP /* MOVETYPE_NOCLIP works on players. */ -#define ZQ_MOVETYPE_NONE /* MOVETYPE_NONE works on players. */ -#define ZQ_VWEP -#define ZQ_QC_STRINGS /* The strings-only subset of FRIK_FILE is supported. */ - -#ifdef _ACCESSORS -accessor strbuf : float; -accessor searchhandle : float; -accessor hashtable : float; -accessor infostring : string; -accessor filestream : float; -accessor filestream : float; -#else -#define strbuf float -#define searchhandle float -#define hashtable float -#define infostring string -#define filestream float -#endif - -entity self; /* The magic me */ -#if defined(CSQC) || defined(SSQC) -entity other; /* Valid in touch functions, this is the entity that we touched. */ -entity world; /* The null entity. Hurrah. Readonly after map spawn time. */ -float time; /* The current game time. Stops when paused. */ -#endif -#ifdef CSQC -float cltime; /* A local timer that ticks relative to local time regardless of latency, packetloss, or pause. */ -#endif -#if defined(CSQC) || defined(SSQC) -float frametime; /* The time since the last physics/render/input frame. */ -#endif -#ifdef CSQC -float player_localentnum; /* This is entity number the player is seeing from/spectating, or the player themself, can change mid-map. */ -float player_localnum; /* The 0-based player index, valid for getplayerkeyvalue calls. */ -float maxclients; /* Maximum number of player slots on the server. */ -float clientcommandframe; /* This is the input-frame sequence. frames < clientcommandframe have been sent to the server. frame==clientcommandframe is still being generated and can still change. */ -float servercommandframe; /* This is the input-frame that was last acknowledged by the server. Input frames greater than this should be applied to the player's entity. */ -#endif -#if defined(QWSSQC) -entity newmis; /* A named entity that should be run soon, to reduce the effects of latency. */ -#endif -#ifdef SSQC -float force_retouch; /* If positive, causes all entities to check for triggers. */ -#endif -#if defined(CSQC) || defined(SSQC) -string mapname; /* The short name of the map. */ -#endif -#if defined(NQSSQC) -float deathmatch; -float coop; -float teamplay; -#endif -#ifdef SSQC -float serverflags; -float total_secrets; -float total_monsters; -float found_secrets; -float killed_monsters; -float parm1; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm2; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm3; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm4; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm5; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm6; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm7; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm8; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm9; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm10; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm11; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm12; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm13; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm14; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm15; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -float parm16; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ -#endif -#ifdef CSQC -float intermission; -#endif -#if defined(CSQC) || defined(SSQC) -vector v_forward; -vector v_up; -vector v_right; -#endif -#ifdef CSQC -vector view_angles; /* +x=DOWN */ -#endif -#if defined(CSQC) || defined(SSQC) -float trace_allsolid; -float trace_startsolid; -float trace_fraction; -vector trace_endpos; -vector trace_plane_normal; -float trace_plane_dist; -entity trace_ent; -float trace_inopen; -float trace_inwater; -#endif -#ifdef CSQC -float input_timelength; -vector input_angles; /* +x=DOWN */ -vector input_movevalues; -float input_buttons; -float input_impulse; -#endif -#ifdef SSQC -entity msg_entity; -void() main; /* This function is never called, and is effectively dead code. */ -void() StartFrame; /* Called at the start of each new physics frame. Player entities may think out of sequence so try not to depend upon explicit ordering too much. */ -void() PlayerPreThink; /* With Prediction(QW compat/FTE default): Called before the player's input commands are processed. -No Prediction(NQ compat): Called AFTER the player's movement intents have already been processed (ie: velocity will have already changed according to input_*, but before the actual position change. */ -void() PlayerPostThink; /* Called after the player's input commands are processed. */ -void() ClientKill; /* Called in response to 'cmd kill' (or just 'kill'). */ -void() ClientConnect; /* Called after the connecting client has finished loading and is ready to receive active entities. Note that this is NOT the first place that a client might be referred to. To determine if the client has csqc active (and kick anyone that doesn't), you can use if(infokeyf(self,INFOKEY_P_CSQCACTIVE)) {sprint(self, "CSQC is required for this server\n");dropclient(self);} */ -void() PutClientInServer; /* Enginewise, this is only ever called immediately after ClientConnect and is thus a little redundant. Modwise, this is also called for respawning a player etc. */ -void() ClientDisconnect; /* Called once a client disconnects or times out. Not guarenteed to be called on map changes. */ -void() SetNewParms; /* Called without context when a new client initially connects (before ClientConnect is even called). This function is expected to only set the parm* globals so that they can be decoded properly later. You should not rely on 'self' being set. */ -void() SetChangeParms; /* Called for each client on map changes. Should copy various entity fields to the parm* globals. */ -#endif -void end_sys_globals; -#if defined(CSQC) || defined(SSQC) -.float modelindex; /* This is the model precache index for the model that was set on the entity, instead of having to look up the model according to the .model field. Use setmodel to change it. */ -.vector absmin; /* Set by the engine when the entity is relinked (by setorigin, setsize, or setmodel). This is in world coordinates. */ -.vector absmax; /* Set by the engine when the entity is relinked (by setorigin, setsize, or setmodel). This is in world coordinates. */ -#endif -#ifdef SSQC -.float ltime; /* On MOVETYPE_PUSH entities, this is used as an alternative to the 'time' global, and .nextthink is synced to this instead of time. This allows time to effectively freeze if the entity is blocked, ensuring the think happens when the entity reaches the target point instead of randomly. */ -#endif -#ifdef CSQC -.float entnum; /* The entity number as its known on the server. */ -.float drawmask; /* Acts as a filter in the addentities call. */ -.float() predraw; /* Called by addentities after the filter and before the entity is actually drawn. Do your interpolation and animation in here. Should return one of the PREDRAW_* constants. */ -#endif -#if defined(QWSSQC) -.float lastruntime; /* This field used to be used to avoid running an entity multiple times in a single frame due to quakeworld's out-of-order thinks. It is no longer used by FTE due to precision issues, but may still be updated for compatibility reasons. */ -#endif -#if defined(CSQC) || defined(SSQC) -.float movetype; /* Describes how the entity moves. One of the MOVETYPE_ constants. */ -.float solid; /* Describes whether the entity is solid or not, and any special properties infered by that. Must be one of the SOLID_ constants */ -.vector origin; /* The current location of the entity in world space. Inline bsp entities (ie: ones placed by a mapper) will typically have a value of '0 0 0' in their neutral pose, as the geometry is offset from that. It is the reference point of the entity rather than the center of its geometry, for non-bsp models, this is often not a significant distinction. */ -.vector oldorigin; /* This is often used on players to reset the player back to where they were last frame if they somehow got stuck inside something due to fpu precision. Never change a player's oldorigin field to inside a solid, because that might cause them to become pemanently stuck. */ -.vector velocity; /* The direction and speed that the entity is moving in world space. */ -.vector angles; /* The eular angles the entity is facing in, in pitch, yaw, roll order. Due to a legacy bug, mdl/iqm/etc formats use +x=UP, bsp/spr/etc formats use +x=DOWN. */ -.vector avelocity; /* The amount the entity's angles change by per second. Note that this is direct eular angles, and thus the angular change is non-linear and often just looks buggy if you're changing more than one angle at a time. */ -#endif -#ifdef CSQC -.float pmove_flags; -#endif -#if defined(NQSSQC) -.vector punchangle; -#endif -#if defined(CSQC) || defined(SSQC) -.string classname; /* Identifies the class/type of the entity. Useful for debugging, also used for loading, but its value is not otherwise significant to the engine, this leaves the mod free to set it to whatever it wants and randomly test strings for values in whatever inefficient way it chooses fit. */ -#endif -#ifdef CSQC -.float renderflags; -#endif -#if defined(CSQC) || defined(SSQC) -.string model; /* The model name that was set via setmodel, in theory. Often, this is cleared to null to prevent the engine from being seen by clients while not changing modelindex. This behaviour allows inline models to remain solid yet be invisible. */ -.float frame; /* The current frame the entity is meant to be displayed in. In CSQC, note the lerpfrac and frame2 fields as well. if it specifies a framegroup, the framegroup will autoanimate in ssqc, but not in csqc. */ -#endif -#ifdef CSQC -.float frame1time; /* The absolute time into the animation/framegroup specified by .frame. */ -.float frame2; /* The alternative frame. Visible only when lerpfrac is set to 1. */ -.float frame2time; /* The absolute time into the animation/framegroup specified by .frame2. */ -.float lerpfrac; /* If 0, use frame1 only. If 1, use frame2 only. Mix them together for values between. */ -#endif -#if defined(CSQC) || defined(SSQC) -.float skin; /* The skin index to use. on a bsp entity, setting this to 1 will switch to the 'activated' texture instead. A negative value will be understood as a replacement contents value, so setting it to CONTENTS_WATER will make a movable pool of water. */ -.float effects; /* Lots of random flags that change random effects. See EF_* constants. */ -.vector mins; /* The minimum extent of the model (ie: the bottom-left coordinate relative to the entity's origin). Change via setsize. May also be changed by setmodel. */ -.vector maxs; /* like mins, but in the other direction. */ -.vector size; /* maxs-mins. Updated when the entity is relinked (by setorigin, setsize, setmodel) */ -.void() touch; -#endif -#ifdef SSQC -.void() use; -#endif -#if defined(CSQC) || defined(SSQC) -.void() think; -.void() blocked; -.float nextthink; /* The time at which the entity is next scheduled to fire its think event. For MOVETYPE_PUSH entities, this is relative to that entity's ltime field, for all other entities it is relative to the time gloal. */ -#endif -#ifdef SSQC -.entity groundentity; -.float health; -.float frags; -.float weapon; -.string weaponmodel; -.float weaponframe; -.float currentammo; -.float ammo_shells; -.float ammo_nails; -.float ammo_rockets; -.float ammo_cells; -.float items; -.float takedamage; -#endif -#if defined(CSQC) || defined(SSQC) -.entity chain; -#endif -#ifdef SSQC -.float deadflag; -.vector view_ofs; -.float button0; -.float button1; -.float button2; -.float impulse; -.float fixangle; /* Forces the clientside view angles to change to the value of .angles (has some lag). If set to 1/TRUE, the server will guess whether to send a delta or an explicit angle. If 2, will always send a delta (due to lag between transmission and acknowledgement, this cannot be spammed reliably). If 3, will always send an explicit angle. */ -.vector v_angle; /* The angles a player is viewing. +x is DOWN (pitch, yaw, roll) */ -#endif -#if defined(NQSSQC) -.float idealpitch; -#endif -#ifdef SSQC -.string netname; -#endif -#if defined(CSQC) || defined(SSQC) -.entity enemy; -.float flags; -.float colormap; -#endif -#ifdef SSQC -.float team; -.float max_health; -.float teleport_time; /* While active, prevents the player from using the +back command, also blocks waterjumping. */ -.float armortype; -.float armorvalue; -.float waterlevel; -.float watertype; -.float ideal_yaw; -.float yaw_speed; -.entity aiment; -.entity goalentity; -.float spawnflags; -.string target; -.string targetname; -.float dmg_take; -.float dmg_save; -.entity dmg_inflictor; -#endif -#if defined(CSQC) || defined(SSQC) -.entity owner; -#endif -#ifdef SSQC -.vector movedir; -.string message; -.float sounds; -.string noise; -.string noise1; -.string noise2; -.string noise3; -#endif -void end_sys_fields; -#ifdef MENU -float time; /* The current local time. Increases while paused. */ -#endif -#if defined(CSQC) || defined(SSQC) -float input_sequence; /* This is the client-generated input sequence number. 0 for unsequenced movements. */ -float input_servertime; /* Server's timestamp of the client's interpolation state. */ -#endif -#ifdef SSQC -float input_timelength; -vector input_angles; /* +x=DOWN */ -vector input_movevalues; -float input_buttons; -float input_impulse; -#endif -#if defined(CSQC) || defined(SSQC) -int trace_endcontents; -int trace_surfaceflags; -int trace_brush_id; -int trace_brush_faceid; -int trace_surface_id; /* 1-based. 0 if not known. */ -int trace_bone_id; /* 1-based. 0 if not known. typically needs MOVE_HITMODEL. */ -int trace_triangle_id; /* 1-based. 0 if not known. */ -#endif -#ifdef CSQC -float trace_networkentity; /* Repots which ssqc entnum was hit when a csqc traceline impacts an ssqc-based brush entity. */ -vector pmove_org; /* Reports the origin of the engineside player (after prediction). Does not work when the player is a csqc-owned entity. */ -vector pmove_vel; /* Reports the velocity of the engineside player (after prediction). Does not work when the player is a csqc-owned entity. */ -float pmove_onground; /* Reports the onground state of the engineside player (after prediction). Does not work when the player is a csqc-owned entity. */ -#endif -#if defined(CSQC) || defined(SSQC) -vector global_gravitydir = '0 0 -1'; /* The direction gravity should act in if not otherwise specified per entity. */ -int serverid; /* The unique id of this server within the server cluster. */ -#endif -#ifdef CSQC -.string message; /* Allows the csqc to read the map description from the server. */ -#endif -#ifdef SSQC -.float button3; -.float button4; -.float button5; -.float button6; -.float button7; -.float button8; -#endif -#if defined(NQSSQC) -.float buttonuse; /* For DP compat only. */ -.float buttonchat; /* For DP compat only. */ -.float cursor_active; /* For DP compat only. */ -.float button9; /* For DP compat only. */ -.float button10; /* For DP compat only. */ -.float button11; /* For DP compat only. */ -.float button12; /* For DP compat only. */ -.float button13; /* For DP compat only. */ -.float button14; /* For DP compat only. */ -.float button15; /* For DP compat only. */ -.float button16; /* For DP compat only. */ -.vector cursor_screen; /* For DP compat only. */ -.vector cursor_start; /* For DP compat only. */ -.vector cursor_impact; /* For DP compat only. */ -.entity cursor_entitynumber; /* For DP compat only. */ -.float lastruntime; /* This field used to be used to avoid running an entity multiple times in a single frame due to quakeworld's out-of-order thinks. It is no longer used by FTE due to precision issues, but may still be updated for compatibility reasons. */ -#endif -#if defined(CSQC) || defined(QWSSQC) -.vector punchangle; -#endif -#if defined(CSQC) || defined(SSQC) -.float gravity; /* Multiplier applied in addition to sv_gravity (not absolute units), to control the gravity affecting this entity specifically. */ -.float hull; /* Overrides the hull used by the entity for walkmove/movetogoal and not traceline/tracebox. */ -.entity movechain; /* This is a linked list of entities which will be moved whenever this entity moves, logically they are attached to this entity. */ -.void() chainmoved; /* Called when the entity is moved as a result of being part of another entity's .movechain */ -.void(float old, float new) contentstransition; /* This function is called when the entity moves between water and air. If specified, default splash sounds will be disabled allowing you to provide your own. */ -.float dimension_solid; /* This is the bitmask of dimensions which the entity is solid within. This is not networked, instead csqc traces impacting ssqc entities assumes the ssqc entity to have a dimension_solid of 1. */ -.float dimension_hit; /* This is the bitmask of dimensions which the entity will be blocked by. If other.dimension_solid & self.dimension_hit, our traces will impact and not proceed. If its false, the traces will NOT impact, allowing self to pass straight through. */ -.int hitcontentsmaski; /* Traces performed for this entity will impact against surfaces that match this contents mask (CONTENTBITS_* constants). */ -__deprecated("Does not support mod-specific contents.") .float dphitcontentsmask; /* Some crappy field that inefficiently requires translating to the native contents flags. Ditch the 'dp', do it properly. */ -.float scale; /* Multiplier that resizes the entity. 1 is normal sized, 2 is double sized. scale 0 is remapped to 1. In SSQC, this is limited to 1/16th precision, with a maximum just shy of 16. */ -.float fatness; /* How many QuakeUnits to push the entity's verticies along their normals by. */ -.float alpha; /* The transparency of the entity. 1 means opaque, 0.0001 means virtually invisible. 0 is remapped to 1, for compatibility. */ -.float modelflags; /* Used to override the flags set in the entity's model. Should be set according to the MF_ constants. Use effects|=EF_NOMODELFLAGS to ignore the model's flags completely. The traileffectnum field is more versatile. */ -#endif -#ifdef SSQC -.float frame1time; /* This controls the time into the framegroup/animation named by .frame, you should increment this value according to frametime or to distance moved, depending on the sort of animation you're attempting. You may wish to avoid incrementing this while lerpfrac is still changing, to avoid wasting parts of the animation. */ -#endif -#if defined(CSQC) || defined(SSQC) -.float basebone; /* The base* frame animations are equivelent to their non-base versions, except that they only affect bone numbers below the 'basebone' value. This means that the base* animation can affect the legs of a skeletal model independantly of the normal animation fields affecting the torso area. For more complex animation than this, use skeletal objects. */ -.float baseframe; /* See basebone */ -.void() customphysics; /* Called once each physics frame, overriding the entity's .movetype field and associated logic. You'll probably want to use tracebox to move it through the world. Be sure to call .think as appropriate. */ -.entity tag_entity; /* Specifies which entity this entity's origin+angles is 'attached' to. */ -.float tag_index; /* Specifies the tag or bone on the parent entity that we're attached to. If this is -1 then the entity is instead a q3-like camera portal, with the tag_entity saying the entity to display for. If tag_entity is world then this is a q3-like portal surface marker with a separate camera (with a tag_entity referring to the portal surface). */ -.float skeletonindex; /* This object serves as a container for the skeletal bone states used to override the animation data. */ -.vector colormod; /* Provides a colour tint for the entity (does not affect fullbrights). */ -.vector glowmod; /* Scaler for an entity's fullbright textures. */ -.vector gravitydir; /* Specifies the direction in which gravity acts. Must be normalised. '0 0 0' also means down. Use '0 0 1' if you want the player to be able to run on ceilings. */ -.vector(vector org, vector ang) camera_transform; /* A callback that provides portal transform information for portal surfaces attached to this entity. Also used to open up pvs in ssqc. */ -#endif -#ifdef SSQC -.float pmove_flags; -#endif -#if defined(CSQC) || defined(SSQC) -.float geomtype; -.float friction; -.float erp; -.float jointtype; -.float mass; -.float bouncefactor; -.float bouncestop; -#endif -#if defined(CSQC) || defined(QWSSQC) -.float idealpitch; -#endif -#if defined(CSQC) || defined(SSQC) -.float pitch_speed; -.float drawflags; /* Various flags that affect lighting values and scaling. Typically set to 96 in quake for proper compatibility with DP_QC_SCALE. */ -.float abslight; /* Allows overriding light levels. Use drawflags to state that this field should actually be used. */ -.vector color; /* This affects the colour of realtime lights that were enabled via the pflags field. */ -.float light_lev; /* This is the radius of an entity's light. This is not normally used by the engine, but is used for realtime lights (ones that are enabled with the pflags field). */ -.float style; /* Used by the light util to decide how an entity's light should animate. On an entity with pflags set, this also affects realtime lights. */ -.float pflags; /* Realtime lighting flags */ -#endif -#ifdef SSQC -.float maxspeed; -.entity view2; /* defines a second viewpoint, typically displayed in a corner of the screen (also punches open pvs). */ -.vector movement; /* These are the directions that the player is currently trying to move in (ie: which +forward/+moveright/+moveup etc buttons they have held), expressed relative to that player's angles. Order is forward, right, up. */ -.float vw_index; /* This acts as a second modelindex, using the same frames etc. */ -__deprecated("Cannot be recorded in MVDs, nor work properly with splitscreen. Use CSQC instead.") .entity nodrawtoclient; /* This entity will not be sent to the player named by this field. They will be invisible and not emit dlights/particles. Does not work in MVD-recorded game. */ -__deprecated("Cannot be recorded in MVDs, nor work properly with splitscreen. Use CSQC instead.") .entity drawonlytoclient; /* This entity will be sent *only* to the player named by this field. To other players they will be invisible and not emit dlights/particles. Does not work in MVD-recorded game. */ -__deprecated("Redundant. Cannot be recorded in MVDs, nor work properly with splitscreen. Use CSQC instead.") .entity viewmodelforclient; /* This entity will be sent only to the player named by this field, and this entity will be attached to the player's view as an additional weapon model. */ -__deprecated("Cannot be recorded in MVDs, nor work properly with splitscreen. Use CSQC instead.") .entity exteriormodeltoclient; /* This entity will be invisible to the player named by this field, except in mirrors or mirror-like surfaces, where it will be visible as normal. It may still cast shadows as normal, and generate lights+particles, depending on client settings. Does not affect how other players see the entity. */ -.entity clientcamera; /* Controls which entity to use for this client's camera. */ -.float glow_size; /* Some outdated particle trail thing. */ -.float glow_color; /* Some outdated particle trail thing. */ -.float glow_trail; /* Some outdated particle trail thing. */ -.float traileffectnum; /* This should be set to the result of particleeffectnum, in order to attach a custom trail effect to an entity as it moves. */ -.float emiteffectnum; /* This should be set to the result of particleeffectnum, in order to continually spawn particles in the direction that this entity faces. */ -__deprecated("Does not work with MVDs nor splitscreen.") .float dimension_see; /* This is the dimension mask (bitfield) that the client is allowed to see. Entities and events not in this dimension mask will be invisible. */ -__deprecated("Does not work with MVDs nor splitscreen.") .float dimension_seen; /* This is the dimension mask (bitfield) that the client is visible within. Clients that cannot see this dimension mask will not see this entity. */ -__deprecated("Does not work with MVDs nor splitscreen.") .float dimension_ghost; /* If this entity is visible only within these dimensions, it will become transparent, as if a ghost. */ -__deprecated("Does not work with MVDs nor splitscreen.") .float dimension_ghost_alpha; /* If this entity is subject to dimension_ghost, this is the scaler for its alpha value. If 0, 0.5 will be used instead. */ -.float(entity playerent, float changedflags) SendEntity; /* Called by the engine whenever an entity needs to be (re)sent to a client's csprogs, either because SendFlags was set or because data was lost. Must write its data to the MSG_ENTITY buffer. Will be called at the engine's leasure. */ -.float SendFlags; /* Indicates that something in the entity has been changed, and that it needs to be updated to all players that can see it. The engine will clear it at some point, with the cleared bits appearing in the 'changedflags' argument of the SendEntity method. */ -__deprecated("Use SendFlags instead.") .float Version; /* Obsolete */ -__deprecated("Doesn't support RGB player colours.") .float clientcolors; -.float viewzoom; -.float playerclass; -.float hasted; -.float light_level; /* Used by hexen2 to indicate the light level where the player is standing. */ -.float pvsflags; /* Reconfigures when the entity is visible to clients */ -.float uniquespawnid; /* Incremented by 1 whenever the entity is respawned. Persists across remove calls, for when the two-second grace period is insufficient. */ -DEP_CSQC .float() customizeentityforclient; /* Called just before an entity is sent to a client (non-csqc protocol). This gives you a chance to tailor 'self' according to what 'other' should see. */ -#endif -#ifdef CSQC -.float frame3; /* Some people just don't understand how to use framegroups... */ -.float frame3time; /* .frame3 equivelent of frame1time. */ -.float lerpfrac3; /* Weight of .frame3 - .frame's weight is automatically calculated as 1-(lerpfrac+lerpfrac3+lerpfrac4), as a result these fields should NEVER add to above 1. */ -.float frame4; -.float frame4time; /* .frame4 equivelent of frame1time. */ -.float lerpfrac4; -.float forceshader; /* Contains a shader handle used to replace all surfaces upon the entity. */ -.float baseframe2; /* See basebone */ -.float baseframe1time; /* See basebone */ -.float baseframe2time; /* See basebone */ -.float baselerpfrac; /* See basebone */ -.float bonecontrol1; /* Halflife model format bone controller. On player models, this typically affects the spine's yaw. */ -.float bonecontrol2; /* Halflife model format bone controller. On player models, this typically affects the spine's yaw. */ -.float bonecontrol3; /* Halflife model format bone controller. On player models, this typically affects the spine's yaw. */ -.float bonecontrol4; /* Halflife model format bone controller. On player models, this typically affects the spine's yaw. */ -.float bonecontrol5; /* Halflife model format bone controller. This typically affects the mouth. */ -.float subblendfrac; /* Weird animation value specific to halflife models. On player models, this typically affects the spine's pitch, or yaw, or... */ -.float subblend2frac; /* Weird animation value specific to halflife models. I've no idea what this does, probably nothing for most models. */ -.float basesubblendfrac; /* See basebone */ -.float basesubblend2frac; /* See basebone */ -#endif -void(float reqid, float responsecode, string resourcebody, int resourcebytes) URI_Get_Callback; /* Called as an eventual result of the uri_get builtin. */ -#ifdef SSQC -void() SpectatorConnect; /* Called when a spectator joins the game. */ -void() SpectatorDisconnect; /* Called when a spectator disconnects from the game. */ -void() SpectatorThink; /* Called each frame for each spectator. */ -void(string cmd) SV_ParseClientCommand; /* Provides QC with a way to intercept 'cmd foo' commands from the client. Very handy. Self will be set to the sending client, while the 'cmd' argument can be tokenize()d and each element retrieved via argv(argno). Unrecognised cmds MUST be passed on to the clientcommand builtin. */ -void(string dest, string from, string cmd, string info) SV_ParseClusterEvent; /* Part of cluster mode. Handles cross-node events that were sent via clusterevent, on behalf of the named client. */ -float(string sender, string body) SV_ParseConnectionlessPacket; /* Provides QC with a way to communicate between servers, or with client server browsers. Sender is the sender's ip. Body is the body of the message. You'll need to add your own password/etc support as required. Self is not valid. */ -void(float pauseduration) SV_PausedTic; /* For each frame that the server is paused, this function will be called to give the gamecode a chance to unpause the server again. the pauseduration argument says how long the server has been paused for (the time global is frozen and will not increment while paused). Self is not valid. */ -float(float newstatus) SV_ShouldPause; /* Called to give the qc a change to block pause/unpause requests. Return false for the pause request to be ignored. newstatus is 1 if the user is trying to pause the game. For the duration of the call, self will be set to the player who tried to pause, or to world if it was triggered by a server-side event. */ -void() SV_RunClientCommand; /* Called each time a player movement packet was received from a client. Self is set to the player entity which should be updated, while the input_* globals specify the various properties stored within the input packet. The contents of this function should be somewaht identical to the equivelent function in CSQC, or prediction misses will occur. If you're feeling lazy, you can simply call 'runstandardplayerphysics' after modifying the inputs. */ -void() SV_AddDebugPolygons; /* Called each video frame. This is the only place where ssqc is allowed to call the R_BeginPolygon/R_PolygonVertex/R_EndPolygon builtins. This is exclusively for debugging, and will break in anything but single player as it will not be called if the engine is not running both a client and a server. */ -DEP_CSQC void() SV_PlayerPhysics; /* Compatibility method to tweak player input that does not reliably work with prediction (prediction WILL break). Mods that care about prediction should use SV_RunClientCommand instead. If pr_no_playerphysics is set to 1, this function will never be called, which will either fix prediction or completely break player movement depending on whether the feature was even useful. */ -void(float fd, float entcount, float playerslots) SV_PerformSave; /* Called by the engine as part of saved games. The QC is responsible for writing any data that will be required to restore the game. Save files are not limited to just text, you can use fwrite (and later fread) for binary data. Remember to close the passed file. */ -void(float fd, float entcount, float playerslots) SV_PerformLoad; /* Called by the engine to restore a saved game that was saved via SV_PerformSave, the server will have already started the game to its inital state (for precaches+makestatic calls), so entities+globals will have their post-spawn values (you will likely want to remove most of them, you can use the two extra args as helpers for that). You can use respawn_edict to un-remove specific entities, with parseentitydata or putentityfieldstring(findentityfield(NAME), ent, value) to assign to fields by name strings. Don't expect bprints/etc to work - players are likely in a pending state. Remember to close the passed file. */ -void() RestoreGame; /* Called for each reconnecting player as part of loading a saved game. Part of NEH_RESTOREGAME. */ -void() EndFrame; /* Called after non-player entities have been run at the end of the physics frame. Player physics is performed out of order and can/will still occur between EndFrame and BeginFrame. */ -void() SetTransferParms; /* Called as an alternative to SetChangeParms when a player is transferring to another server. Part of FTE_SV_CLUSTER. */ -string(string addr, string uinfo, string features) SV_CheckRejectConnection; /* Called to give the mod a chance to ignore connection requests based upon client protocol support or other properties. Use infoget to read the uinfo and features arguments. */ -#endif -#ifdef CSQC -void(float apilevel, string enginename, float engineversion) CSQC_Init; /* Called at startup. enginename and engineversion are arbitary hints and can take any form. enginename should be consistant between revisions, but this cannot truely be relied upon. */ -void() CSQC_WorldLoaded; /* Called after the server's model+sound precaches have been executed. Gives a chance for the qc to read the entity lump from the bsp (via getentitytoken). */ -void() CSQC_Shutdown; /* Specifies that the csqc is going down. Save your persistant settings here. */ -void(float vwidth, float vheight, float notmenu) CSQC_UpdateView; /* Called every single video frame. The CSQC is responsible for rendering the entire screen. */ -void(float vwidth, float vheight, float notmenu) CSQC_UpdateViewLoading; /* Alternative to CSQC_UpdateView, called when the engine thinks there should be a loading screen. If present, will inhibit the engine's normal loading screen, deferring to qc to draw it. */ -void(vector viewsize, float scoresshown) CSQC_DrawHud; /* Part of simple csqc, called after drawing the 3d view whenever CSQC_UpdateView is not defined. */ -void(vector viewsize, float scoresshown) CSQC_DrawScores; /* Part of simple csqc, called after CSQC_DrawHud whenever CSQC_UpdateView is not defined, and when there are no menus/console active. */ -void(string msg) CSQC_Parse_StuffCmd; /* Gives the CSQC a chance to intercept stuffcmds. Use the tokenize builtin to parse the message. Unrecognised commands would normally be localcmded, but its probably better to drop unrecognised stuffcmds completely. */ -float(string msg) CSQC_Parse_CenterPrint; /* Gives the CSQC a chance to intercept centerprints. Return true if you wish the engine to otherwise ignore the centerprint. */ -float(float save, float take, vector inflictororg) CSQC_Parse_Damage; /* Called as a result of player.dmg_save or player.dmg_take being set on the server. -Return true to completely inhibit the engine's colour shift and damage rolls, allowing you to do your own thing. -You can use punch_roll += (normalize(inflictororg-player.origin)*v_right)*(take+save)*autocvar_v_kickroll; as a modifier for the roll angle should the player be hit from the side, and slowly fade it away over time. */ -void(string printmsg, float printlvl) CSQC_Parse_Print; /* Gives the CSQC a chance to intercept sprint/bprint builtin calls. CSQC should filter by the client's current msg setting and then pass the message on to the print command, or handle them itself. */ -void() CSQC_Parse_Event; /* Called when the client receives an SVC_CGAMEPACKET. The csqc should read the data or call the error builtin if it does not recognise the message. */ -float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent; /* Called whenever a key is pressed, the mouse is moved, etc. evtype will be one of the IE_* constants. The other arguments vary depending on the evtype. Key presses are not guarenteed to have both scan and unichar values set at the same time. */ -__used void() CSQC_Input_Frame; /* Called just before each time clientcommandframe is updated. You can edit the input_* globals in order to apply your own player inputs within csqc, which may allow you a convienient way to pass certain info to ssqc. */ -void(string rendererdescription) CSQC_RendererRestarted; /* Called by the engine after the video was restarted. This serves to notify the CSQC that any render targets that it may have cached were purged, and will need to be regenerated. */ -float(string cmd) CSQC_ConsoleCommand; /* Called if the user uses any console command registed via registercommand. */ -float(string text, string info) CSQC_ConsoleLink; /* Called if the user clicks a ^[text\infokey\infovalue^] link. Use infoget to read/check each supported key. Return true if you wish the engine to not attempt to handle the link itself. -WARNING: link text can potentially come from other players, so be careful about what you allow to be changed. */ -void(float entnum) CSQC_Ent_Spawn; /* Clumsily defined function for compat with DP. Should call spawn, set that ent's entnum field, and return the entity inside the 'self' global which will then be used for fllowing Ent_Updates. MUST NOT PARSE ANY NETWORK DATA (which makes it kinda useless). */ -void(float isnew) CSQC_Ent_Update; /* Parses the data sent by ssqc's various SendEntity functions (must use the exact same reads as the ssqc used writes - to debug this rule more easily, you may wish to use sv_csqcdebug). 'self' provides context between frames, and self.entnum should normally report which ssqc entity . Be aware that interpolation will need to happen separately. */ -void() CSQC_Ent_Remove; -float(float entnum, float channel, string soundname, float vol, float attenuation, vector pos, float pitchmod, float flags) CSQC_Event_Sound; -float() CSQC_Parse_TempEntity; /* Please don't use this. Use CSQC_Parse_Event and multicasts instead. -The use of serverside protocol translation to handle QW vs NQ protocols mean that you're likely to end up reading slightly different data. Which is bad. -Return true to say that you fully handled the tempentity. Return false to have the client attempt to rewind the network stream and parse the message itself. */ -#endif -#if defined(CSQC) || defined(MENU) -void(string cmdtext) GameCommand; -#endif -string(string uri, string method, string postdata, __in string requestheaders, __inout string responseheaders) Cef_GeneratePage; /* Provides an entrypoint to generate pages for the CEF plugin from within QC. Headers are --separated key/value pairs (use tokenizebyseparator). */ -#ifdef SSQC +/* +This file was generated by FTE Quake 6278M, dated Jun 27 2022. +This file can be regenerated by issuing the following command: +pr_dumpplatform +(Use the -help arg for a list of available args) +*/ +#pragma noref 1 +//#pragma flag enable logicops +#pragma warning error Q101 /*too many parms. The vanilla qcc didn't validate properly, hence why fteqcc normally treats it as a warning.*/ +#pragma warning error Q105 /*too few parms. The vanilla qcc didn't validate properly, hence why fteqcc normally treats it as a warning.*/ +#pragma warning error Q106 /*assignment to constant/lvalue. Define them as var if you want to initialise something.*/ +#pragma warning error Q208 /*system crc unknown. Compatibility goes out of the window if you disable this.*/ +#pragma warning enable F301 /*non-utf-8 strings. Think of the foreigners! Also think of text editors that insist on screwing up your char encodings.*/ +#pragma warning enable F302 /*uninitialised locals. They usually default to 0 in qc (except in recursive functions), but its still probably a bug*/ +#if !defined(CSQC) && !defined(NQSSQC) && !defined(QWSSQC)&& !defined(MENU) + #ifdef QUAKEWORLD + #define QWSSQC + #else + #define NQSSQC + #endif +#endif +#if !defined(SSQC) && (defined(QWSSQC) || defined(NQSSQC)) + #define SSQC +#endif +#if defined(CSQC) || defined(MENU) + #define DEP_CSQC DEP +#else + #define DEP_CSQC __deprecated("Use CSQC for this") +#endif +#ifndef DEP + #define DEP __deprecated //predefine this if you want to avoid our deprecation warnings. +#endif +#ifndef FTEDEP + #define FTEDEP(reason) //for symbols deprecated in FTE that may still be useful/required for other engines +#endif +#define BX_COLOREDTEXT +#define DP_CON_SET /* The 'set' console command exists, and can be used to create/set cvars. */ +#define DP_CON_SETA /* The 'seta' console command exists, like the 'set' command, but also marks the cvar for archiving, allowing it to be written into the user's config. Use this command in your default.cfg file. */ +#define DP_CSQC_ROTATEMOVES +#define DP_EF_ADDITIVE +#define DP_ENT_ALPHA +#define DP_EF_BLUE +#define DP_EF_FULLBRIGHT +#define DP_EF_NODEPTHTEST +#define DP_EF_NODRAW +#define DP_EF_NOGUNBOB +#define DP_EF_NOSHADOW +#define DP_EF_RED +#define DP_ENT_COLORMOD +#define DP_ENT_CUSTOMCOLORMAP +#define DP_ENT_EXTERIORMODELTOCLIENT +#define DP_ENT_SCALE +#define DP_ENT_TRAILEFFECTNUM /* self.traileffectnum=particleeffectnum("myeffectname"); can be used to attach a particle trail to the given server entity. This is equivelent to calling trailparticles each frame. */ +#define DP_ENT_VIEWMODEL +#define DP_GECKO_SUPPORT +#define DP_GFX_FONTS +#define DP_GFX_QUAKE3MODELTAGS +#define DP_GFX_SKINFILES +#define DP_GFX_SKYBOX +#define DP_HALFLIFE_MAP +#define DP_HALFLIFE_MAP_CVAR +#define DP_INPUTBUTTONS +#define DP_LIGHTSTYLE_STATICVALUE +#define DP_LITSUPPORT +#define DP_MONSTERWALK /* MOVETYPE_WALK is valid on non-player entities. Note that only players receive acceleration etc in line with none/bounce/fly/noclip movetypes on the player, thus you will have to provide your own accelerations (incluing gravity) yourself. */ +#define DP_MOVETYPEBOUNCEMISSILE +#define DP_MOVETYPEFOLLOW +#define DP_QC_ASINACOSATANATAN2TAN +#define DP_QC_CHANGEPITCH +#define DP_QC_COPYENTITY +#define DP_QC_CRC16 +#define DP_QC_CVAR_DEFSTRING +#define DP_QC_CVAR_STRING +#define DP_QC_CVAR_TYPE +#define DP_QC_DIGEST_SHA256 +#define DP_QC_EDICT_NUM +#define DP_QC_ENTITYDATA +#define DP_QC_ETOS +#define DP_QC_FINDCHAIN +#define DP_QC_FINDCHAINFLOAT +#define DP_QC_FINDFLAGS +#define DP_QC_FINDCHAINFLAGS +#define DP_QC_FINDFLOAT +#define DP_QC_FS_SEARCH +#define DP_QC_FS_SEARCH_PACKFILE +#define DP_QC_GETLIGHT +#define DP_QC_GETSURFACE +#define DP_QC_GETSURFACEPOINTATTRIBUTE +#define DP_QC_GETTAGINFO +#define DP_QC_I18N /* Specifies that the engine uses $MODULE.dat.$LANG.po files that translates the dotranslate_* globals on load - these are usually created via the _("foo") qcc intrinsic. */ +#define DP_QC_MINMAXBOUND +#define DP_QC_MULTIPLETEMPSTRINGS /* Superseded by DP_QC_UNLIMITEDTEMPSTRINGS. Functions that return a temporary string will not overwrite/destroy previous temporary strings until at least 16 strings are returned (or control returns to the engine). */ +#define DP_QC_RANDOMVEC +#define DP_QC_RENDER_SCENE /* clearscene+addentity+setviewprop+renderscene+setmodel are available to menuqc. WARNING: DP advertises this extension without actually supporting it, FTE does actually support it. */ +#define DP_QC_SINCOSSQRTPOW +#define DP_QC_SPRINTF /* Provides the sprintf builtin, which allows for rich formatting along the lines of C's function with the same name. Not to be confused with QC's sprint builtin. */ +#define DP_QC_STRFTIME +#define DP_QC_STRING_CASE_FUNCTIONS +#define DP_QC_STRINGBUFFERS +#define DP_QC_STRINGCOLORFUNCTIONS +#define DP_QC_STRREPLACE +#define DP_QC_TOKENIZEBYSEPARATOR +#define DP_QC_TRACEBOX +#define DP_QC_TRACETOSS +#define DP_QC_TRACE_MOVETYPE_HITMODEL +#define DP_QC_TRACE_MOVETYPE_WORLDONLY +#define DP_QC_TRACE_MOVETYPES +#define DP_QC_UNLIMITEDTEMPSTRINGS /* Supersedes DP_QC_MULTIPLETEMPSTRINGS, superseded by FTE_QC_PERSISTENTTEMPSTRINGS. Specifies that all temp strings will be valid at least until the QCVM returns. */ +#define DP_QC_URI_ESCAPE +#define DP_QC_URI_GET +#define DP_QC_URI_POST +#define DP_QC_VECTOANGLES_WITH_ROLL +#define DP_QC_VECTORVECTORS +#define DP_QC_WHICHPACK +#define DP_QUAKE2_MODEL +#define DP_QUAKE2_SPRITE +#define DP_QUAKE3_MAP +#define DP_QUAKE3_MODEL +#define DP_REGISTERCVAR +#define DP_SND_SOUND7_WIP2 +#define DP_SND_STEREOWAV +#define DP_SND_OGGVORBIS +#define DP_SOLIDCORPSE +#define DP_SPRITE32 +#define DP_SV_BOTCLIENT +#define DP_SV_CLIENTCAMERA /* Works like svc_setview except also handles pvs. */ +#define DP_SV_CLIENTCOLORS /* Provided only for compatibility with DP. */ +#define DP_SV_CLIENTNAME /* Provided only for compatibility with DP. */ +#define DP_SV_CUSTOMIZEENTITYFORCLIENT /* Deprecated feature for compat with DP. Can be slow, incompatible with splitscreen, usually malfunctions with mvds. */ +#define DP_SV_DRAWONLYTOCLIENT +#define DP_SV_DROPCLIENT /* Equivelent to quakeworld's stuffcmd(self,"disconnect\n"); hack */ +#define DP_SV_EFFECT +#define DP_SV_EXTERIORMODELFORCLIENT +#define DP_SV_NODRAWTOCLIENT +#define DP_SV_PLAYERPHYSICS /* Allows reworking parts of NQ player physics. USE AT OWN RISK - this necessitates NQ physics and is thus guarenteed to break prediction. */ +#define DP_SV_POINTSOUND +#define DP_SV_PRECACHEANYTIME /* Specifies that the various precache builtins can be called at any time. WARNING: precaches are sent reliably while sound events, modelindexes, and particle events are not. This can mean sounds and particles might not work the first time around, or models may take a while to appear (after the reliables are received and the model is loaded from disk). Always attempt to precache a little in advance in order to reduce these issues (preferably at the start of the map...) */ +#define DP_SV_PRINT /* Says that the print builtin can be used from nqssqc (as well as just csqc), bypassing the developer cvar issues. */ +#define DP_SV_ROTATINGBMODEL /* Engines that support this support avelocity on MOVETYPE_PUSH entities, pushing entities out of the way as needed. */ +#define DP_SV_SETCOLOR +#define DP_SV_SHUTDOWN +#define DP_SV_SPAWNFUNC_PREFIX +#define DP_SV_WRITEPICTURE +#define DP_SV_WRITEUNTERMINATEDSTRING +#define DP_TE_BLOOD +#define DP_TE_CUSTOMFLASH +#define DP_TE_EXPLOSIONRGB +#define DP_TE_PARTICLECUBE +#define DP_TE_PARTICLERAIN +#define DP_TE_PARTICLESNOW +#define DP_TE_SMALLFLASH +#define DP_TE_SPARK +#define DP_TE_STANDARDEFFECTBUILTINS +#define DP_VIEWZOOM +#define EXT_BITSHIFT +#define EXT_CSQC +#define EXT_CSQC_SHARED +#define EXT_DIMENSION_VISIBILITY +#define EXT_DIMENSION_PHYSICS +#define EXT_DIMENSION_GHOST +#define FRIK_FILE +#define FTE_CALLTIMEOFDAY /* Replication of mvdsv functionality (call calltimeofday to cause 'timeofday' to be called, with arguments that can be saved off to a global). Generally strftime is simpler to use. */ +#define FTE_CSQC_ALTCONSOLES /* The engine tracks multiple consoles. These may or may not be directly visible to the user. */ +#define FTE_CSQC_BASEFRAME /* Specifies that .basebone, .baseframe2, .baselerpfrac, baseframe1time, etc exist in csqc. These fields affect all bones in the entity's model with a lower index than the .basebone field, allowing you to give separate control to the legs of a skeletal model, without affecting the torso animations. */ +#define FTE_CSQC_HALFLIFE_MODELS +#define FTE_CSQC_SERVERBROWSER /* Provides builtins to query the engine's serverbrowser servers list from ssqc. Note that these builtins are always available in menuqc. */ +#define FTE_CSQC_SKELETONOBJECTS /* Provides container objects for skeletal bone data, which can be modified on a per bone basis if needed. This allows you to dynamically generate animations (or just blend them with greater customisation) instead of being limited to a single animation or two. */ +#define FTE_CSQC_RAWIMAGES /* Provides raw rgba image access to csqc. With this, the csprogs can read textures into qc-accessible memory, modify it, and then upload it to the renderer. */ +#define FTE_CSQC_RENDERTARGETS /* VF_RT_DESTCOLOUR exists and can be used to redirect any rendering to a texture instead of the screen. */ +#define FTE_CSQC_REVERB /* Specifies that the mod can create custom reverb effects. Whether they will actually be used or not depends upon the sound driver. */ +#define FTE_CSQC_WINDOWCAPTION /* Provides csqc with the ability to change the window caption as displayed when running windowed or in the task bar when switched out. */ +#define FTE_ENT_SKIN_CONTENTS /* self.skin = CONTENTS_WATER; makes a brush entity into water. use -16 for a ladder. */ +#define FTE_ENT_UNIQUESPAWNID +#define FTE_EXTENDEDTEXTCODES +#define FTE_FORCESHADER /* Allows csqc to override shaders on models with an explicitly named replacement. Also allows you to define shaders with a fallback if it does not exist on disk. */ +#define FTE_FORCEINFOKEY /* Provides an easy way to change a user's userinfo from the server. */ +#define FTE_GFX_QUAKE3SHADERS /* specifies that the engine has full support for vanilla quake3 shaders */ +#define FTE_GFX_REMAPSHADER /* With the raw power of stuffcmds, the r_remapshader console command is exposed! This mystical command can be used to remap any shader to another. Remapped shaders that specify $diffuse etc in some form will inherit the textures implied by the surface. */ +#define FTE_GFX_IQM_HITMESH /* Supports hitmesh iqm extensions. Also supports geomsets and embedded events. */ +#define FTE_GFX_MODELEVENTS /* Provides a query for per-animation events in model files, including from progs/foo.mdl.events files. */ +#define FTE_ISBACKBUFFERED /* Allows you to check if a client has too many reliable messages pending. */ +#define FTE_MEMALLOC /* Allows dynamically allocating memory. Use pointers to access this memory. Memory will not be saved into saved games. */ +#define FTE_MEDIA_CIN /* playfilm command supports q2 cin files. */ +#define FTE_MEDIA_ROQ /* playfilm command supports q3 roq files. */ +#define FTE_MULTIPROGS /* Multiple progs.dat files can be loaded inside the same qcvm. Insert new ones with addprogs inside the 'init' function, and use externvalue+externset to rewrite globals (and hook functions) to link them together. Note that the result is generally not very clean unless you carefully design for it beforehand. */ +#define FTE_MULTITHREADED /* Faux multithreading, allowing multiple contexts to run in sequence. */ +#define FTE_MVD_PLAYERSTATS /* In csqc, getplayerstat can be used to query any player's stats when playing back MVDs. isdemo will return 2 in this case. */ +#define FTE_PART_SCRIPT /* Specifies that the r_particledesc cvar can be used to select a list of particle effects to load from particles/foo.cfg, the format of which is documented elsewhere. */ +#define FTE_PART_NAMESPACES /* Specifies that the engine can use foo.bar to load effect foo from particle description bar. When used via ssqc, this should cause the client to download whatever effects as needed. */ +#define FTE_PART_NAMESPACE_EFFECTINFO /* Specifies that effectinfo.bar can load effects from effectinfo.txt for DP compatibility. */ +#define FTE_PEXT_SETVIEW /* NQ's svc_setview works correctly even in quakeworld */ +#define FTE_PEXT_LIGHTSTYLECOL +#define FTE_PEXT_VIEW2 +#define FTE_PEXT_FATNESS +#define FTE_PEXT_TE_BULLET +#define FTE_PEXT_FLOATCOORDS +#define FTE_PEXT_Q2BSP /* Specifies that the client supports q2bsps. */ +#define FTE_PEXT_Q3BSP /* Specifies that the client supports q3bsps. */ +#define FTE_HEXEN2 +#define FTE_PEXT_SPAWNSTATIC +#define FTE_PEXT_CUSTOMTENTS +#define FTE_PEXT_256PACKETENTITIES /* Specifies that the client is not limited to vanilla's limit of only 64 ents visible at once. */ +#define FTE_QC_BASEFRAME /* Specifies that .basebone and .baseframe exist in ssqc. These fields affect all bones in the entity's model with a lower index than the .basebone field, allowing you to give separate control to the legs of a skeletal model, without affecting the torso animations, from ssqc. */ +#define FTE_QC_FILE_BINARY /* Extends FRIK_FILE with binary read+write, as well as allowing seeking. Requires pointers. */ +#define FTE_QC_CHANGELEVEL_HUB /* Adds an extra argument to changelevel which is carried over to the next map in the 'spawnspot' global. Maps will be saved+reloaded until the extra argument is omitted again, purging all saved maps. Saved games will contain a copy of each preserved map. parm1-parm64 globals can be used, giving more space to transfer more player data. */ +#define FTE_QC_CHECKCOMMAND /* Provides a way to test if a console command exists, and whether its a command/alias/cvar. Does not say anything about the expected meanings of any arguments or values. */ +#define FTE_QC_CHECKPVS +#define FTE_QC_CROSSPRODUCT +#define FTE_QC_CUSTOMSKINS /* The engine supports the use of q3 skins, as well as the use of such skin 'files' to specify rich top+bottom colours, qw skins, geomsets, or texture composition even on non-players.. */ +#define FTE_QC_DIGEST_SHA1 /* The digest_hex builtin supports 160-bit sha1 hashes. */ +#define FTE_QC_DIGEST_SHA224 /* The digest_hex builtin supports 224-bit sha2 hashes. */ +#define FTE_QC_DIGEST_SHA384 /* The digest_hex builtin supports 384-bit sha2 hashes. */ +#define FTE_QC_DIGEST_SHA512 /* The digest_hex builtin supports 512-bit sha2 hashes. */ +#define FTE_QC_FS_SEARCH_SIZEMTIME +#define FTE_QC_HARDWARECURSORS /* setcursormode exists in both csqc+menuqc, and accepts additional arguments to specify a cursor image to use when this module has focus. If the image exceeds hardware limits (or hardware cursors are unsupported), it will be emulated using regular draws - this at least still avoids conflicting cursors as only one will ever be used, even if console+menu+csqc are all overlayed. */ +#define FTE_QC_HASHTABLES /* Provides efficient string-based lookups. */ +#define FTE_QC_INFOKEY /* QuakeWorld's infokey builtin works, and reports at least name+topcolor+bottomcolor+ping(in ms)+ip(unmasked, but not always ipv4)+team(aka bottomcolor in nq). Does not require actual localinfo/serverinfo/userinfo, but they're _highly_ recommended to any engines with csqc */ +#define FTE_QC_INTCONV /* Provides string<>int conversions, including hex representations. */ +#define FTE_QC_MATCHCLIENTNAME +#define FTE_QC_MULTICAST /* QuakeWorld's multicast builtin works along with MSG_MULTICAST, but also with unicast support. */ +#define FTE_QC_PAUSED +#define FTE_QC_PERSISTENTTEMPSTRINGS /* Supersedes DP_QC_MULTIPLETEMPSTRINGS. Temp strings are garbage collected automatically, and do not expire while they're still in use. This makes strzone redundant. */ +#define FTE_QC_RAGDOLL_WIP +#define FTE_QC_SENDPACKET /* Allows the use of out-of-band udp packets to/from other hosts. Includes the SV_ParseConnectionlessPacket event. */ +#define FTE_QC_STUFFCMDFLAGS /* Variation on regular stuffcmd that gives control over how spectators/mvds should be treated. */ +#define FTE_QC_TRACETRIGGER +#define FTE_QUAKE2_CLIENT /* This engine is able to act as a quake2 client */ +#define FTE_QUAKE2_SERVER /* This engine is able to act as a quake2 server */ +#define FTE_QUAKE3_CLIENT /* This engine is able to act as a quake3 client */ +#define FTE_QUAKE3_SERVER /* This engine is able to act as a quake3 server */ +#define FTE_SOLID_BSPTRIGGER /* Allows for mappers to use shaped triggers instead of being limited to axially aligned triggers. */ +#define FTE_SOLID_LADDER /* Allows a simple trigger to remove effects of gravity (solid 20). obsolete. will prolly be removed at some point as it is not networked properly. Use FTE_ENT_SKIN_CONTENTS */ +#define FTE_SPLITSCREEN /* Client supports splitscreen, controlled via cl_splitscreen. Servers require allow_splitscreen 1 if splitscreen is to be used over the internet. Mods that use csqc will need to be aware for this to work properly. per-client networking may be problematic. */ +#define FTE_SQL /* Provides sql* builtins which can be used for sql database access */ +#define FTE_SQL_SQLITE /* SQL functionality is able to utilise sqlite databases */ +#define FTE_STRINGS /* Extra builtins (and additional behaviour) to make string manipulation easier */ +#define FTE_SV_POINTPARTICLES /* Specifies that particleeffectnum, pointparticles, and trailparticles exist in ssqc as well as csqc. particleeffectnum acts as a precache, allowing ssqc values to be networked up with csqc for use. Use in combination with FTE_PART_SCRIPT+FTE_PART_NAMESPACES to use custom effects. This extension is functionally identical to the DP version, but avoids any misplaced assumptions about the format of the client's particle descriptions. */ +#define FTE_SV_REENTER +#define FTE_TE_STANDARDEFFECTBUILTINS /* Provides builtins to replace writebytes, with a QW compatible twist. */ +#define FTE_TERRAIN_MAP /* This engine supports .hmp files, as well as terrain embedded within bsp files. */ +#define FTE_RAW_MAP /* This engine supports directly loading .map files, as well as realtime editing of the various brushes. */ +#define FTE_INFOBLOBS /* Removes the length limits on user/server/local info strings, and allows embedded nulls and other otherwise-reserved characters. This can be used to network avatar images and the like, or other binary data. */ +#define FTE_VRINPUTS /* input_weapon, input_left_*, input_right_*, input_head_* work, both in csqc (as inputs with suitable plugin/hardware support) and ssqc (available in PlayerPreThink). */ +#define KRIMZON_SV_PARSECLIENTCOMMAND /* SSQC's SV_ParseClientCommand function is able to handle client 'cmd' commands. The tokenizing parts also work in csqc. */ +#define NEH_CMD_PLAY2 +#define NEH_RESTOREGAME +#define QSG_CVARSTRING +#define QW_ENGINE +#define QWE_MVD_RECORD /* You can use the easyrecord command to record MVD demos serverside. */ +#define TEI_MD3_MODEL +#define TEI_SHOWLMP2 +#define TENEBRAE_GFX_DLIGHTS /* Allows ssqc to attach rtlights to entities with various special properties. */ +#define ZQ_MOVETYPE_FLY /* MOVETYPE_FLY works on players. */ +#define ZQ_MOVETYPE_NOCLIP /* MOVETYPE_NOCLIP works on players. */ +#define ZQ_MOVETYPE_NONE /* MOVETYPE_NONE works on players. */ +#define ZQ_VWEP +#define ZQ_QC_STRINGS /* The strings-only subset of FRIK_FILE is supported. */ + +#ifdef _ACCESSORS +accessor strbuf : float; +accessor searchhandle : float; +accessor hashtable : float; +accessor infostring : string; +accessor filestream : float; +accessor filestream : float; +#else +#define strbuf float +#define searchhandle float +#define hashtable float +#define infostring string +#define filestream float +#endif + +entity self; /* The magic me */ +#if defined(CSQC) || defined(SSQC) +entity other; /* Valid in touch functions, this is the entity that we touched. */ +entity world; /* The null entity. Hurrah. Readonly after map spawn time. */ +float time; /* The current game time. Stops when paused. */ +#endif +#ifdef CSQC +float cltime; /* A local timer that ticks relative to local time regardless of latency, packetloss, or pause. */ +#endif +#if defined(CSQC) || defined(SSQC) +float frametime; /* The time since the last physics/render/input frame. */ +#endif +#ifdef CSQC +float player_localentnum; /* This is entity number the player is seeing from/spectating, or the player themself, can change mid-map. */ +float player_localnum; /* The 0-based player index, valid for getplayerkeyvalue calls. */ +float maxclients; /* Maximum number of player slots on the server. */ +float clientcommandframe; /* This is the input-frame sequence. frames < clientcommandframe have been sent to the server. frame==clientcommandframe is still being generated and can still change. */ +float servercommandframe; /* This is the input-frame that was last acknowledged by the server. Input frames greater than this should be applied to the player's entity. */ +#endif +#if defined(QWSSQC) +entity newmis; /* A named entity that should be run soon, to reduce the effects of latency. */ +#endif +#ifdef SSQC +float force_retouch; /* If positive, causes all entities to check for triggers. */ +#endif +#if defined(CSQC) || defined(SSQC) +string mapname; /* The short name of the map. */ +#endif +#if defined(NQSSQC) +float deathmatch; +float coop; +float teamplay; +#endif +#ifdef SSQC +float serverflags; +float total_secrets; +float total_monsters; +float found_secrets; +float killed_monsters; +float parm1; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm2; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm3; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm4; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm5; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm6; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm7; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm8; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm9; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm10; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm11; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm12; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm13; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm14; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm15; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +float parm16; /* Player specific mod-defined values that are transferred from one map to the next. These are set by the qc inside calls to SetNewParms and SetChangeParms, and can then be read on a per-player basis after a call to the setspawnparms builtin. They are not otherwise valid. */ +#endif +#ifdef CSQC +float intermission; +#endif +#if defined(CSQC) || defined(SSQC) +vector v_forward; +vector v_up; +vector v_right; +#endif +#ifdef CSQC +vector view_angles; /* +x=DOWN */ +#endif +#if defined(CSQC) || defined(SSQC) +float trace_allsolid; +float trace_startsolid; +float trace_fraction; +vector trace_endpos; +vector trace_plane_normal; +float trace_plane_dist; +entity trace_ent; +float trace_inopen; +float trace_inwater; +#endif +#ifdef CSQC +float input_timelength; +vector input_angles; /* +x=DOWN */ +vector input_movevalues; +float input_buttons; +float input_impulse; +#endif +#ifdef SSQC +entity msg_entity; +void() main; /* This function is never called, and is effectively dead code. */ +void() StartFrame; /* Called at the start of each new physics frame. Player entities may think out of sequence so try not to depend upon explicit ordering too much. */ +void() PlayerPreThink; /* With Prediction(QW compat/FTE default): Called before the player's input commands are processed. +No Prediction(NQ compat): Called AFTER the player's movement intents have already been processed (ie: velocity will have already changed according to input_*, but before the actual position change. */ +void() PlayerPostThink; /* Called after the player's input commands are processed. */ +void() ClientKill; /* Called in response to 'cmd kill' (or just 'kill'). */ +void() ClientConnect; /* Called after the connecting client has finished loading and is ready to receive active entities. Note that this is NOT the first place that a client might be referred to. To determine if the client has csqc active (and kick anyone that doesn't), you can use if(infokeyf(self,INFOKEY_P_CSQCACTIVE)) {sprint(self, "CSQC is required for this server\n");dropclient(self);} */ +void() PutClientInServer; /* Enginewise, this is only ever called immediately after ClientConnect and is thus a little redundant. Modwise, this is also called for respawning a player etc. */ +void() ClientDisconnect; /* Called once a client disconnects or times out. Not guarenteed to be called on map changes. */ +void() SetNewParms; /* Called without context when a new client initially connects (before ClientConnect is even called). This function is expected to only set the parm* globals so that they can be decoded properly later. You should not rely on 'self' being set. */ +void() SetChangeParms; /* Called for each client on map changes. Should copy various entity fields to the parm* globals. */ +#endif +void end_sys_globals; +#if defined(CSQC) || defined(SSQC) +.float modelindex; /* This is the model precache index for the model that was set on the entity, instead of having to look up the model according to the .model field. Use setmodel to change it. */ +.vector absmin; /* Set by the engine when the entity is relinked (by setorigin, setsize, or setmodel). This is in world coordinates. */ +.vector absmax; /* Set by the engine when the entity is relinked (by setorigin, setsize, or setmodel). This is in world coordinates. */ +#endif +#ifdef SSQC +.float ltime; /* On MOVETYPE_PUSH entities, this is used as an alternative to the 'time' global, and .nextthink is synced to this instead of time. This allows time to effectively freeze if the entity is blocked, ensuring the think happens when the entity reaches the target point instead of randomly. */ +#endif +#ifdef CSQC +.float entnum; /* The entity number as its known on the server. */ +.float drawmask; /* Acts as a filter in the addentities call. */ +.float() predraw; /* Called by addentities after the filter and before the entity is actually drawn. Do your interpolation and animation in here. Should return one of the PREDRAW_* constants. */ +#endif +#if defined(QWSSQC) +.float lastruntime; /* This field used to be used to avoid running an entity multiple times in a single frame due to quakeworld's out-of-order thinks. It is no longer used by FTE due to precision issues, but may still be updated for compatibility reasons. */ +#endif +#if defined(CSQC) || defined(SSQC) +.float movetype; /* Describes how the entity moves. One of the MOVETYPE_ constants. */ +.float solid; /* Describes whether the entity is solid or not, and any special properties infered by that. Must be one of the SOLID_ constants */ +.vector origin; /* The current location of the entity in world space. Inline bsp entities (ie: ones placed by a mapper) will typically have a value of '0 0 0' in their neutral pose, as the geometry is offset from that. It is the reference point of the entity rather than the center of its geometry, for non-bsp models, this is often not a significant distinction. */ +.vector oldorigin; /* This is often used on players to reset the player back to where they were last frame if they somehow got stuck inside something due to fpu precision. Never change a player's oldorigin field to inside a solid, because that might cause them to become pemanently stuck. */ +.vector velocity; /* The direction and speed that the entity is moving in world space. */ +.vector angles; /* The eular angles the entity is facing in, in pitch, yaw, roll order. Due to a legacy bug, mdl/iqm/etc formats use +x=UP, bsp/spr/etc formats use +x=DOWN. */ +.vector avelocity; /* The amount the entity's angles change by per second. Note that this is direct eular angles, and thus the angular change is non-linear and often just looks buggy if you're changing more than one angle at a time. */ +#endif +#ifdef CSQC +.float pmove_flags; +#endif +#if defined(NQSSQC) +.vector punchangle; +#endif +#if defined(CSQC) || defined(SSQC) +.string classname; /* Identifies the class/type of the entity. Useful for debugging, also used for loading, but its value is not otherwise significant to the engine, this leaves the mod free to set it to whatever it wants and randomly test strings for values in whatever inefficient way it chooses fit. */ +#endif +#ifdef CSQC +.float renderflags; +#endif +#if defined(CSQC) || defined(SSQC) +.string model; /* The model name that was set via setmodel, in theory. Often, this is cleared to null to prevent the engine from being seen by clients while not changing modelindex. This behaviour allows inline models to remain solid yet be invisible. */ +.float frame; /* The current frame the entity is meant to be displayed in. In CSQC, note the lerpfrac and frame2 fields as well. if it specifies a framegroup, the framegroup will autoanimate in ssqc, but not in csqc. */ +#endif +#ifdef CSQC +.float frame1time; /* The absolute time into the animation/framegroup specified by .frame. */ +.float frame2; /* The alternative frame. Visible only when lerpfrac is set to 1. */ +.float frame2time; /* The absolute time into the animation/framegroup specified by .frame2. */ +.float lerpfrac; /* If 0, use frame1 only. If 1, use frame2 only. Mix them together for values between. */ +#endif +#if defined(CSQC) || defined(SSQC) +.float skin; /* The skin index to use. on a bsp entity, setting this to 1 will switch to the 'activated' texture instead. A negative value will be understood as a replacement contents value, so setting it to CONTENTS_WATER will make a movable pool of water. */ +.float effects; /* Lots of random flags that change random effects. See EF_* constants. */ +.vector mins; /* The minimum extent of the model (ie: the bottom-left coordinate relative to the entity's origin). Change via setsize. May also be changed by setmodel. */ +.vector maxs; /* like mins, but in the other direction. */ +.vector size; /* maxs-mins. Updated when the entity is relinked (by setorigin, setsize, setmodel) */ +.void() touch; +#endif +#ifdef SSQC +.void() use; +#endif +#if defined(CSQC) || defined(SSQC) +.void() think; +.void() blocked; +.float nextthink; /* The time at which the entity is next scheduled to fire its think event. For MOVETYPE_PUSH entities, this is relative to that entity's ltime field, for all other entities it is relative to the time gloal. */ +#endif +#ifdef SSQC +.entity groundentity; +.float health; +.float frags; +.float weapon; +.string weaponmodel; +.float weaponframe; +.float currentammo; +.float ammo_shells; +.float ammo_nails; +.float ammo_rockets; +.float ammo_cells; +.float items; +.float takedamage; +#endif +#if defined(CSQC) || defined(SSQC) +.entity chain; +#endif +#ifdef SSQC +.float deadflag; +.vector view_ofs; +.float button0; +.float button1; +.float button2; +.float impulse; +.float fixangle; /* Forces the clientside view angles to change to the value of .angles (has some lag). If set to 1/TRUE, the server will guess whether to send a delta or an explicit angle. If 2, will always send a delta (due to lag between transmission and acknowledgement, this cannot be spammed reliably). If 3, will always send an explicit angle. */ +.vector v_angle; /* The angles a player is viewing. +x is DOWN (pitch, yaw, roll) */ +#endif +#if defined(NQSSQC) +.float idealpitch; +#endif +#ifdef SSQC +.string netname; +#endif +#if defined(CSQC) || defined(SSQC) +.entity enemy; +.float flags; +.float colormap; +#endif +#ifdef SSQC +.float team; +.float max_health; +.float teleport_time; /* While active, prevents the player from using the +back command, also blocks waterjumping. */ +.float armortype; +.float armorvalue; +.float waterlevel; +.float watertype; +.float ideal_yaw; +.float yaw_speed; +.entity aiment; +.entity goalentity; +.float spawnflags; +.string target; +.string targetname; +.float dmg_take; +.float dmg_save; +.entity dmg_inflictor; +#endif +#if defined(CSQC) || defined(SSQC) +.entity owner; +#endif +#ifdef SSQC +.vector movedir; +.string message; +.float sounds; +.string noise; +.string noise1; +.string noise2; +.string noise3; +#endif +void end_sys_fields; +#ifdef MENU +float time; /* The current local time. Increases while paused. */ +#endif +#if defined(CSQC) || defined(SSQC) +float input_sequence; /* This is the client-generated input sequence number. 0 for unsequenced movements. */ +float input_servertime; /* Server's timestamp of the client's interpolation state. */ +#endif +#ifdef SSQC +float input_timelength; +vector input_angles; /* +x=DOWN */ +vector input_movevalues; +float input_buttons; +float input_impulse; +#endif +#if defined(CSQC) || defined(SSQC) +int trace_endcontents; +int trace_surfaceflags; +int trace_brush_id; +int trace_brush_faceid; +int trace_surface_id; /* 1-based. 0 if not known. */ +int trace_bone_id; /* 1-based. 0 if not known. typically needs MOVE_HITMODEL. */ +int trace_triangle_id; /* 1-based. 0 if not known. */ +#endif +#ifdef CSQC +float trace_networkentity; /* Repots which ssqc entnum was hit when a csqc traceline impacts an ssqc-based brush entity. */ +vector pmove_org; /* Reports the origin of the engineside player (after prediction). Does not work when the player is a csqc-owned entity. */ +vector pmove_vel; /* Reports the velocity of the engineside player (after prediction). Does not work when the player is a csqc-owned entity. */ +float pmove_onground; /* Reports the onground state of the engineside player (after prediction). Does not work when the player is a csqc-owned entity. */ +#endif +#if defined(CSQC) || defined(SSQC) +vector global_gravitydir = '0 0 -1'; /* The direction gravity should act in if not otherwise specified per entity. */ +int serverid; /* The unique id of this server within the server cluster. */ +#endif +#ifdef CSQC +.string message; /* Allows the csqc to read the map description from the server. */ +#endif +#ifdef SSQC +.float button3; +.float button4; +.float button5; +.float button6; +.float button7; +.float button8; +#endif +#if defined(NQSSQC) +.float buttonuse; /* For DP compat only. */ +.float buttonchat; /* For DP compat only. */ +.float cursor_active; /* For DP compat only. */ +.float button9; /* For DP compat only. */ +.float button10; /* For DP compat only. */ +.float button11; /* For DP compat only. */ +.float button12; /* For DP compat only. */ +.float button13; /* For DP compat only. */ +.float button14; /* For DP compat only. */ +.float button15; /* For DP compat only. */ +.float button16; /* For DP compat only. */ +.vector cursor_screen; /* For DP compat only. */ +.vector cursor_start; /* For DP compat only. */ +.vector cursor_impact; /* For DP compat only. */ +.entity cursor_entitynumber; /* For DP compat only. */ +.float lastruntime; /* This field used to be used to avoid running an entity multiple times in a single frame due to quakeworld's out-of-order thinks. It is no longer used by FTE due to precision issues, but may still be updated for compatibility reasons. */ +#endif +#if defined(CSQC) || defined(QWSSQC) +.vector punchangle; +#endif +#if defined(CSQC) || defined(SSQC) +.float gravity; /* Multiplier applied in addition to sv_gravity (not absolute units), to control the gravity affecting this entity specifically. */ +.float hull; /* Overrides the hull used by the entity for walkmove/movetogoal and not traceline/tracebox. */ +.entity movechain; /* This is a linked list of entities which will be moved whenever this entity moves, logically they are attached to this entity. */ +.void() chainmoved; /* Called when the entity is moved as a result of being part of another entity's .movechain */ +.void(float old, float new) contentstransition; /* This function is called when the entity moves between water and air. If specified, default splash sounds will be disabled allowing you to provide your own. */ +.float dimension_solid; /* This is the bitmask of dimensions which the entity is solid within. This is not networked, instead csqc traces impacting ssqc entities assumes the ssqc entity to have a dimension_solid of 1. */ +.float dimension_hit; /* This is the bitmask of dimensions which the entity will be blocked by. If other.dimension_solid & self.dimension_hit, our traces will impact and not proceed. If its false, the traces will NOT impact, allowing self to pass straight through. */ +.int hitcontentsmaski; /* Traces performed for this entity will impact against surfaces that match this contents mask (CONTENTBITS_* constants). */ +__deprecated("Does not support mod-specific contents.") .float dphitcontentsmask; /* Some crappy field that inefficiently requires translating to the native contents flags. Ditch the 'dp', do it properly. */ +.float scale; /* Multiplier that resizes the entity. 1 is normal sized, 2 is double sized. scale 0 is remapped to 1. In SSQC, this is limited to 1/16th precision, with a maximum just shy of 16. */ +.float fatness; /* How many QuakeUnits to push the entity's verticies along their normals by. */ +.float alpha; /* The transparency of the entity. 1 means opaque, 0.0001 means virtually invisible. 0 is remapped to 1, for compatibility. */ +.float modelflags; /* Used to override the flags set in the entity's model. Should be set according to the MF_ constants. Use effects|=EF_NOMODELFLAGS to ignore the model's flags completely. The traileffectnum field is more versatile. */ +#endif +#ifdef SSQC +.float frame1time; /* This controls the time into the framegroup/animation named by .frame, you should increment this value according to frametime or to distance moved, depending on the sort of animation you're attempting. You may wish to avoid incrementing this while lerpfrac is still changing, to avoid wasting parts of the animation. */ +#endif +#if defined(CSQC) || defined(SSQC) +.float basebone; /* The base* frame animations are equivelent to their non-base versions, except that they only affect bone numbers below the 'basebone' value. This means that the base* animation can affect the legs of a skeletal model independantly of the normal animation fields affecting the torso area. For more complex animation than this, use skeletal objects. */ +.float baseframe; /* See basebone */ +.void() customphysics; /* Called once each physics frame, overriding the entity's .movetype field and associated logic. You'll probably want to use tracebox to move it through the world. Be sure to call .think as appropriate. */ +.entity tag_entity; /* Specifies which entity this entity's origin+angles is 'attached' to. */ +.float tag_index; /* Specifies the tag or bone on the parent entity that we're attached to. If this is -1 then the entity is instead a q3-like camera portal, with the tag_entity saying the entity to display for. If tag_entity is world then this is a q3-like portal surface marker with a separate camera (with a tag_entity referring to the portal surface). */ +.float skeletonindex; /* This object serves as a container for the skeletal bone states used to override the animation data. */ +.vector colormod; /* Provides a colour tint for the entity (does not affect fullbrights). */ +.vector glowmod; /* Scaler for an entity's fullbright textures. */ +.vector gravitydir; /* Specifies the direction in which gravity acts. Must be normalised. '0 0 0' also means down. Use '0 0 1' if you want the player to be able to run on ceilings. */ +.vector(vector org, vector ang) camera_transform; /* A callback that provides portal transform information for portal surfaces attached to this entity. Also used to open up pvs in ssqc. */ +#endif +#ifdef SSQC +.float pmove_flags; +#endif +#if defined(CSQC) || defined(SSQC) +.float geomtype; +.float friction; +.float erp; +.float jointtype; +.float mass; +.float bouncefactor; +.float bouncestop; +#endif +#if defined(CSQC) || defined(QWSSQC) +.float idealpitch; +#endif +#if defined(CSQC) || defined(SSQC) +.float pitch_speed; +.float drawflags; /* Various flags that affect lighting values and scaling. Typically set to 96 in quake for proper compatibility with DP_QC_SCALE. */ +.float abslight; /* Allows overriding light levels. Use drawflags to state that this field should actually be used. */ +.vector color; /* This affects the colour of realtime lights that were enabled via the pflags field. */ +.float light_lev; /* This is the radius of an entity's light. This is not normally used by the engine, but is used for realtime lights (ones that are enabled with the pflags field). */ +.float style; /* Used by the light util to decide how an entity's light should animate. On an entity with pflags set, this also affects realtime lights. */ +.float pflags; /* Realtime lighting flags */ +#endif +#ifdef SSQC +.float maxspeed; +.entity view2; /* defines a second viewpoint, typically displayed in a corner of the screen (also punches open pvs). */ +.vector movement; /* These are the directions that the player is currently trying to move in (ie: which +forward/+moveright/+moveup etc buttons they have held), expressed relative to that player's angles. Order is forward, right, up. */ +.float vw_index; /* This acts as a second modelindex, using the same frames etc. */ +__deprecated("Cannot be recorded in MVDs, nor work properly with splitscreen. Use CSQC instead.") .entity nodrawtoclient; /* This entity will not be sent to the player named by this field. They will be invisible and not emit dlights/particles. Does not work in MVD-recorded game. */ +__deprecated("Cannot be recorded in MVDs, nor work properly with splitscreen. Use CSQC instead.") .entity drawonlytoclient; /* This entity will be sent *only* to the player named by this field. To other players they will be invisible and not emit dlights/particles. Does not work in MVD-recorded game. */ +__deprecated("Redundant. Cannot be recorded in MVDs, nor work properly with splitscreen. Use CSQC instead.") .entity viewmodelforclient; /* This entity will be sent only to the player named by this field, and this entity will be attached to the player's view as an additional weapon model. */ +__deprecated("Cannot be recorded in MVDs, nor work properly with splitscreen. Use CSQC instead.") .entity exteriormodeltoclient; /* This entity will be invisible to the player named by this field, except in mirrors or mirror-like surfaces, where it will be visible as normal. It may still cast shadows as normal, and generate lights+particles, depending on client settings. Does not affect how other players see the entity. */ +.entity clientcamera; /* Controls which entity to use for this client's camera. */ +.float glow_size; /* Some outdated particle trail thing. */ +.float glow_color; /* Some outdated particle trail thing. */ +.float glow_trail; /* Some outdated particle trail thing. */ +.float traileffectnum; /* This should be set to the result of particleeffectnum, in order to attach a custom trail effect to an entity as it moves. */ +.float emiteffectnum; /* This should be set to the result of particleeffectnum, in order to continually spawn particles in the direction that this entity faces. */ +__deprecated("Does not work with MVDs nor splitscreen.") .float dimension_see; /* This is the dimension mask (bitfield) that the client is allowed to see. Entities and events not in this dimension mask will be invisible. */ +__deprecated("Does not work with MVDs nor splitscreen.") .float dimension_seen; /* This is the dimension mask (bitfield) that the client is visible within. Clients that cannot see this dimension mask will not see this entity. */ +__deprecated("Does not work with MVDs nor splitscreen.") .float dimension_ghost; /* If this entity is visible only within these dimensions, it will become transparent, as if a ghost. */ +__deprecated("Does not work with MVDs nor splitscreen.") .float dimension_ghost_alpha; /* If this entity is subject to dimension_ghost, this is the scaler for its alpha value. If 0, 0.5 will be used instead. */ +.float(entity playerent, float changedflags) SendEntity; /* Called by the engine whenever an entity needs to be (re)sent to a client's csprogs, either because SendFlags was set or because data was lost. Must write its data to the MSG_ENTITY buffer. Will be called at the engine's leasure. */ +.float SendFlags; /* Indicates that something in the entity has been changed, and that it needs to be updated to all players that can see it. The engine will clear it at some point, with the cleared bits appearing in the 'changedflags' argument of the SendEntity method. */ +__deprecated("Use SendFlags instead.") .float Version; /* Obsolete */ +__deprecated("Doesn't support RGB player colours.") .float clientcolors; +.float viewzoom; +.float playerclass; +.float hasted; +.float light_level; /* Used by hexen2 to indicate the light level where the player is standing. */ +.float pvsflags; /* Reconfigures when the entity is visible to clients */ +.float uniquespawnid; /* Incremented by 1 whenever the entity is respawned. Persists across remove calls, for when the two-second grace period is insufficient. */ +DEP_CSQC .float() customizeentityforclient; /* Called just before an entity is sent to a client (non-csqc protocol). This gives you a chance to tailor 'self' according to what 'other' should see. */ +#endif +#ifdef CSQC +.float frame3; /* Some people just don't understand how to use framegroups... */ +.float frame3time; /* .frame3 equivelent of frame1time. */ +.float lerpfrac3; /* Weight of .frame3 - .frame's weight is automatically calculated as 1-(lerpfrac+lerpfrac3+lerpfrac4), as a result these fields should NEVER add to above 1. */ +.float frame4; +.float frame4time; /* .frame4 equivelent of frame1time. */ +.float lerpfrac4; +.float forceshader; /* Contains a shader handle used to replace all surfaces upon the entity. */ +.float baseframe2; /* See basebone */ +.float baseframe1time; /* See basebone */ +.float baseframe2time; /* See basebone */ +.float baselerpfrac; /* See basebone */ +.float bonecontrol1; /* Halflife model format bone controller. On player models, this typically affects the spine's yaw. */ +.float bonecontrol2; /* Halflife model format bone controller. On player models, this typically affects the spine's yaw. */ +.float bonecontrol3; /* Halflife model format bone controller. On player models, this typically affects the spine's yaw. */ +.float bonecontrol4; /* Halflife model format bone controller. On player models, this typically affects the spine's yaw. */ +.float bonecontrol5; /* Halflife model format bone controller. This typically affects the mouth. */ +.float subblendfrac; /* Weird animation value specific to halflife models. On player models, this typically affects the spine's pitch, or yaw, or... */ +.float subblend2frac; /* Weird animation value specific to halflife models. I've no idea what this does, probably nothing for most models. */ +.float basesubblendfrac; /* See basebone */ +.float basesubblend2frac; /* See basebone */ +#endif +void(float reqid, float responsecode, string resourcebody, int resourcebytes) URI_Get_Callback; /* Called as an eventual result of the uri_get builtin. */ +#ifdef SSQC +void() SpectatorConnect; /* Called when a spectator joins the game. */ +void() SpectatorDisconnect; /* Called when a spectator disconnects from the game. */ +void() SpectatorThink; /* Called each frame for each spectator. */ +void(string cmd) SV_ParseClientCommand; /* Provides QC with a way to intercept 'cmd foo' commands from the client. Very handy. Self will be set to the sending client, while the 'cmd' argument can be tokenize()d and each element retrieved via argv(argno). Unrecognised cmds MUST be passed on to the clientcommand builtin. */ +void(string dest, string from, string cmd, string info) SV_ParseClusterEvent; /* Part of cluster mode. Handles cross-node events that were sent via clusterevent, on behalf of the named client. */ +float(string sender, string body) SV_ParseConnectionlessPacket; /* Provides QC with a way to communicate between servers, or with client server browsers. Sender is the sender's ip. Body is the body of the message. You'll need to add your own password/etc support as required. Self is not valid. */ +void(float pauseduration) SV_PausedTic; /* For each frame that the server is paused, this function will be called to give the gamecode a chance to unpause the server again. the pauseduration argument says how long the server has been paused for (the time global is frozen and will not increment while paused). Self is not valid. */ +float(float newstatus) SV_ShouldPause; /* Called to give the qc a change to block pause/unpause requests. Return false for the pause request to be ignored. newstatus is 1 if the user is trying to pause the game. For the duration of the call, self will be set to the player who tried to pause, or to world if it was triggered by a server-side event. */ +void() SV_RunClientCommand; /* Called each time a player movement packet was received from a client. Self is set to the player entity which should be updated, while the input_* globals specify the various properties stored within the input packet. The contents of this function should be somewaht identical to the equivelent function in CSQC, or prediction misses will occur. If you're feeling lazy, you can simply call 'runstandardplayerphysics' after modifying the inputs. */ +void() SV_AddDebugPolygons; /* Called each video frame. This is the only place where ssqc is allowed to call the R_BeginPolygon/R_PolygonVertex/R_EndPolygon builtins. This is exclusively for debugging, and will break in anything but single player as it will not be called if the engine is not running both a client and a server. */ +DEP_CSQC void() SV_PlayerPhysics; /* Compatibility method to tweak player input that does not reliably work with prediction (prediction WILL break). Mods that care about prediction should use SV_RunClientCommand instead. If pr_no_playerphysics is set to 1, this function will never be called, which will either fix prediction or completely break player movement depending on whether the feature was even useful. */ +void(float fd, float entcount, float playerslots) SV_PerformSave; /* Called by the engine as part of saved games. The QC is responsible for writing any data that will be required to restore the game. Save files are not limited to just text, you can use fwrite (and later fread) for binary data. Remember to close the passed file. */ +void(float fd, float entcount, float playerslots) SV_PerformLoad; /* Called by the engine to restore a saved game that was saved via SV_PerformSave, the server will have already started the game to its inital state (for precaches+makestatic calls), so entities+globals will have their post-spawn values (you will likely want to remove most of them, you can use the two extra args as helpers for that). You can use respawn_edict to un-remove specific entities, with parseentitydata or putentityfieldstring(findentityfield(NAME), ent, value) to assign to fields by name strings. Don't expect bprints/etc to work - players are likely in a pending state. Remember to close the passed file. */ +void() RestoreGame; /* Called for each reconnecting player as part of loading a saved game. Part of NEH_RESTOREGAME. */ +void() EndFrame; /* Called after non-player entities have been run at the end of the physics frame. Player physics is performed out of order and can/will still occur between EndFrame and BeginFrame. */ +void() SetTransferParms; /* Called as an alternative to SetChangeParms when a player is transferring to another server. Part of FTE_SV_CLUSTER. */ +string(string addr, string uinfo, string features) SV_CheckRejectConnection; /* Called to give the mod a chance to ignore connection requests based upon client protocol support or other properties. Use infoget to read the uinfo and features arguments. */ +#endif +#ifdef CSQC +void(float apilevel, string enginename, float engineversion) CSQC_Init; /* Called at startup. enginename and engineversion are arbitary hints and can take any form. enginename should be consistant between revisions, but this cannot truely be relied upon. */ +void() CSQC_WorldLoaded; /* Called after the server's model+sound precaches have been executed. Gives a chance for the qc to read the entity lump from the bsp (via getentitytoken). */ +void() CSQC_Shutdown; /* Specifies that the csqc is going down. Save your persistant settings here. */ +void(float vwidth, float vheight, float notmenu) CSQC_UpdateView; /* Called every single video frame. The CSQC is responsible for rendering the entire screen. */ +void(float vwidth, float vheight, float notmenu) CSQC_UpdateViewLoading; /* Alternative to CSQC_UpdateView, called when the engine thinks there should be a loading screen. If present, will inhibit the engine's normal loading screen, deferring to qc to draw it. */ +void(vector viewsize, float scoresshown) CSQC_DrawHud; /* Part of simple csqc, called after drawing the 3d view whenever CSQC_UpdateView is not defined. */ +void(vector viewsize, float scoresshown) CSQC_DrawScores; /* Part of simple csqc, called after CSQC_DrawHud whenever CSQC_UpdateView is not defined, and when there are no menus/console active. */ +void(string msg) CSQC_Parse_StuffCmd; /* Gives the CSQC a chance to intercept stuffcmds. Use the tokenize builtin to parse the message. Unrecognised commands would normally be localcmded, but its probably better to drop unrecognised stuffcmds completely. */ +float(string msg) CSQC_Parse_CenterPrint; /* Gives the CSQC a chance to intercept centerprints. Return true if you wish the engine to otherwise ignore the centerprint. */ +float(float save, float take, vector inflictororg) CSQC_Parse_Damage; /* Called as a result of player.dmg_save or player.dmg_take being set on the server. +Return true to completely inhibit the engine's colour shift and damage rolls, allowing you to do your own thing. +You can use punch_roll += (normalize(inflictororg-player.origin)*v_right)*(take+save)*autocvar_v_kickroll; as a modifier for the roll angle should the player be hit from the side, and slowly fade it away over time. */ +void(string printmsg, float printlvl) CSQC_Parse_Print; /* Gives the CSQC a chance to intercept sprint/bprint builtin calls. CSQC should filter by the client's current msg setting and then pass the message on to the print command, or handle them itself. */ +void() CSQC_Parse_Event; /* Called when the client receives an SVC_CGAMEPACKET. The csqc should read the data or call the error builtin if it does not recognise the message. */ +float(float evtype, float scanx, float chary, float devid) CSQC_InputEvent; /* Called whenever a key is pressed, the mouse is moved, etc. evtype will be one of the IE_* constants. The other arguments vary depending on the evtype. Key presses are not guarenteed to have both scan and unichar values set at the same time. */ +__used void() CSQC_Input_Frame; /* Called just before each time clientcommandframe is updated. You can edit the input_* globals in order to apply your own player inputs within csqc, which may allow you a convienient way to pass certain info to ssqc. */ +void(string rendererdescription) CSQC_RendererRestarted; /* Called by the engine after the video was restarted. This serves to notify the CSQC that any render targets that it may have cached were purged, and will need to be regenerated. */ +float(string cmd) CSQC_ConsoleCommand; /* Called if the user uses any console command registed via registercommand. */ +float(string text, string info) CSQC_ConsoleLink; /* Called if the user clicks a ^[text\infokey\infovalue^] link. Use infoget to read/check each supported key. Return true if you wish the engine to not attempt to handle the link itself. +WARNING: link text can potentially come from other players, so be careful about what you allow to be changed. */ +void(float entnum) CSQC_Ent_Spawn; /* Clumsily defined function for compat with DP. Should call spawn, set that ent's entnum field, and return the entity inside the 'self' global which will then be used for fllowing Ent_Updates. MUST NOT PARSE ANY NETWORK DATA (which makes it kinda useless). */ +void(float isnew) CSQC_Ent_Update; /* Parses the data sent by ssqc's various SendEntity functions (must use the exact same reads as the ssqc used writes - to debug this rule more easily, you may wish to use sv_csqcdebug). 'self' provides context between frames, and self.entnum should normally report which ssqc entity . Be aware that interpolation will need to happen separately. */ +void() CSQC_Ent_Remove; +float(float entnum, float channel, string soundname, float vol, float attenuation, vector pos, float pitchmod, float flags) CSQC_Event_Sound; +float() CSQC_Parse_TempEntity; /* Please don't use this. Use CSQC_Parse_Event and multicasts instead. +The use of serverside protocol translation to handle QW vs NQ protocols mean that you're likely to end up reading slightly different data. Which is bad. +Return true to say that you fully handled the tempentity. Return false to have the client attempt to rewind the network stream and parse the message itself. */ +#endif +#if defined(CSQC) || defined(MENU) +void(string cmdtext) GameCommand; +#endif +string(string uri, string method, string postdata, __in string requestheaders, __inout string responseheaders) Cef_GeneratePage; /* Provides an entrypoint to generate pages for the CEF plugin from within QC. Headers are +-separated key/value pairs (use tokenizebyseparator). */ +#ifdef SSQC string(string uri, string method, string postdata, __in string requestheaders, __inout string responseheaders) HTTP_GeneratePage; /* Provides an entrypoint to generate pages for pages requested over http (sv_port_tcp+net_enable_http). Headers are --separated key/value pairs (use tokenizebyseparator). Return __NULL__ to let the engine handle it, an empty string for a 404, and any other text for a regular 200 response. */ -#endif -#if defined(CSQC) || defined(SSQC) -void(float prevprogs) init; /* Part of FTE_MULTIPROGS. Called as soon as a progs is loaded, called at a time when entities are not valid. This is the only time when it is safe to call addprogs without field assignment. As it is also called as part of addprogs, this also gives you a chance to hook functions in modules that are already loaded (via externget+externget). */ -void() initents; /* Part of FTE_MULTIPROGS. Called after fields have been finalized. This is the first point at which it is safe to call spawn(), and is called before any entity fields have been parsed. You can use this entrypoint to send notifications to other modules. */ -#endif -#ifdef MENU -void() m_init; -void() m_shutdown; -void(vector screensize) m_draw; /* Provides the menuqc with a chance to draw. Will be called even if the menu does not have focus, so be sure to avoid that. COMPAT: screensize is not provided in DP. */ -void(vector screensize, float opaque) m_drawloading; /* Additional drawing function to draw loading screens. If opaque is set, then this function must ensure that the entire screen is overdrawn (even if just by a black drawfill). */ -void(string rendererdescription) Menu_RendererRestarted; /* Called by the engine after the video was restarted. This serves to notify the MenuQC that any render targets that it may have cached were purged, and will need to be regenerated. */ -float(float evtype, float scanx, float chary, float devid) Menu_InputEvent; /* If present, this is called instead of m_keydown and m_keyup -Called whenever a key is pressed, the mouse is moved, etc. evtype will be one of the IE_* constants. The other arguments vary depending on the evtype. Key presses are not guarenteed to have both scan and unichar values set at the same time. */ -__deprecated("Use Menu_InputEvent") void(float scan, float chr) m_keydown; -__deprecated("Use Menu_InputEvent") void(float scan, float chr) m_keyup; -void(float wantmode) m_toggle; -float(string cmd) m_consolecommand; -float(float idx) m_gethostcachecategory; -#endif -#ifdef SSQC -float parm17, parm18, parm19, parm20, parm21, parm22, parm23, parm24, parm25, parm26, parm27, parm28, parm29, parm30, parm31, parm32; /* Additional spawn parms, following the same parmN theme. */ -float parm33, parm34, parm35, parm36, parm37, parm38, parm39, parm40, parm41, parm42, parm43, parm44, parm45, parm46, parm47, parm48; -float parm49, parm50, parm51, parm52, parm53, parm54, parm55, parm56, parm57, parm58, parm59, parm60, parm61, parm62, parm63, parm64; -string parm_string; /* Like the regular parmN globals, but preserves string contents. */ -string startspot; /* Receives the value of the second argument to changelevel from the previous map. */ -var float dimension_send; /* Used by multicast functionality. Multicasts (and related builtins that multicast internally) will only be sent to players where (player.dimension_see & dimension_send) is non-zero. */ -//var float dimension_default = 255; -/* Default dimension bitmask */ -__unused var string __fullspawndata; /* Set by the engine before calls to spawn functions, and is most easily parsed with the tokenize builtin. This allows you to handle halflife's multiple-fields-with-the-same-name (or target-specific fields). */ -#endif -#if defined(CSQC) || defined(SSQC) -__used var float physics_mode = 2; /* 0: original csqc - physics are not run -1: DP-compat. Thinks occur, but not true movetypes. -2: movetypes occur just as they do in ssqc. */ -#endif -#ifdef CSQC -float gamespeed; /* Set by the engine, this is the value of the sv_gamespeed cvar */ -float numclientseats; /* This is the number of splitscreen clients currently running on this client. */ -#endif -#if defined(CSQC) || defined(MENU) -var vector drawfontscale = '1 1 0'; /* Specifies a scaler for all text rendering. There are other ways to implement this. */ -float drawfont; /* Allows you to choose exactly which font is to be used to draw text. Fonts can be registered/allocated with the loadfont builtin. */ -const float FONT_DEFAULT = 0; -#endif -#if defined(NQSSQC) -entity newmis; /* ssqc global */ -#endif -#if defined(CSQC) || defined(QWSSQC) -float deathmatch; /* ssqc global */ -float coop; /* ssqc global */ -#endif -#if defined(QWSSQC) -float teamplay; /* ssqc global */ -#endif -#if defined(CSQC) || defined(SSQC) -int trace_endcontentsi; /* ssqc global */ -int trace_surfaceflagsi; /* ssqc global */ -string trace_surfacename; /* ssqc global */ -float cycle_wrapped; /* ssqc global */ -#endif -#ifdef CSQC -float dimension_default; /* ssqc global */ -#endif -#if defined(CSQC) || defined(SSQC) -unsigned int input_weapon; /* ssqc global */ -float input_lightlevel; /* ssqc global */ -vector input_cursor_screen; /* ssqc global */ -vector input_cursor_trace_start; /* ssqc global */ -vector input_cursor_trace_endpos; /* ssqc global */ -float input_cursor_entitynumber; /* ssqc global */ -unsigned int input_head_status; /* ssqc global */ -vector input_head_origin; /* ssqc global */ -vector input_head_angles; /* ssqc global */ -vector input_head_velocity; /* ssqc global */ -vector input_head_avelocity; /* ssqc global */ -unsigned int input_head_weapon; /* ssqc global */ -unsigned int input_left_status; /* ssqc global */ -vector input_left_origin; /* ssqc global */ -vector input_left_angles; /* ssqc global */ -vector input_left_velocity; /* ssqc global */ -vector input_left_avelocity; /* ssqc global */ -unsigned int input_left_weapon; /* ssqc global */ -unsigned int input_right_status; /* ssqc global */ -vector input_right_origin; /* ssqc global */ -vector input_right_angles; /* ssqc global */ -vector input_right_velocity; /* ssqc global */ -vector input_right_avelocity; /* ssqc global */ -unsigned int input_right_weapon; /* ssqc global */ -#endif -#ifdef SSQC -float trace_endcontentsf; /* ssqc global */ -float trace_surfaceflagsf; /* ssqc global */ -#endif -#if defined(CSQC) || defined(SSQC) -string trace_dphittexturename; /* ssqc global */ -#endif -#ifdef SSQC -float trace_dpstartcontents; /* ssqc global */ -float trace_dphitcontents; /* ssqc global */ -float trace_dphitq3surfaceflags; /* ssqc global */ -#endif -#ifdef CSQC -float(vector angles, float isdelta) CSQC_Parse_SetAngles; -void(float playernum) CSQC_PlayerInfoChanged; -void() CSQC_ServerInfoChanged; -DEP("use CSQC_Event_Sound") float(float channel, string soundname, vector pos, float vol, float attenuation, float flags) CSQC_ServerSound; -void(int entidx, string newentdata) CSQC_MapEntityEdited; -float clframetime; -float servertime; -float serverprevtime; -float serverdeltatime; -DEP("Does not support mod-specific contents.") float trace_dpstartcontents; -DEP("Does not support mod-specific contents.") float trace_dphitcontents; -DEP("Does not support mod-specific surface flags") float trace_dphitq3surfaceflags; -DEP("Does not support all mod-specific surface flags.") float trace_surfaceflagsf; -DEP("Does not support all mod-specific contents.") float trace_endcontentsf; -float intermission_time; -vector pmove_mins; -vector pmove_maxs; -float pmove_jump_held; -float pmove_waterjumptime; -float input_clienttime; -float autocvar_vid_conwidth; -float autocvar_vid_conheight; -#endif -const float TRUE = 1; -const float FALSE = 0; /* File not found... */ -const float M_PI = 3.14159; /* Mathematica Pi constant. */ -#if defined(CSQC) || defined(SSQC) -const float MOVETYPE_NONE = 0; -const float MOVETYPE_WALK = 3; -const float MOVETYPE_STEP = 4; -const float MOVETYPE_FLY = 5; -const float MOVETYPE_TOSS = 6; -const float MOVETYPE_PUSH = 7; -const float MOVETYPE_NOCLIP = 8; -const float MOVETYPE_FLYMISSILE = 9; -const float MOVETYPE_BOUNCE = 10; -const float MOVETYPE_BOUNCEMISSILE = 11; -const float MOVETYPE_FOLLOW = 12; -const float MOVETYPE_6DOF = 30; /* A glorified MOVETYPE_FLY. Players using this movetype will get some flightsim-like physics, with fully independant rotations (order-dependant transforms). */ -const float MOVETYPE_WALLWALK = 31; /* Players using this movetype will be able to orient themselves to walls, and then run up them. */ -const float MOVETYPE_PHYSICS = 32; /* Enable the use of ODE physics upon this entity. */ -const float SOLID_NOT = 0; -const float SOLID_TRIGGER = 1; -const float SOLID_BBOX = 2; -const float SOLID_SLIDEBOX = 3; -const float SOLID_BSP = 4; /* Does not collide against other SOLID_BSP entities. Normally paired with MOVETYPE_PUSH. */ -const float SOLID_CORPSE = 5; /* Non-solid to SOLID_SLIDEBOX or other SOLID_CORPSE entities. For hitscan weapons to hit corpses, change the player's .hitcontentsmaski value to include CONTENTBIT_CORPSE, perform the traceline, then revert the player's .solid value. */ -__deprecated("Obsoleted by .skin=CONTENTS_LADDER") const float SOLID_LADDER = 20; /* Obsolete and may be removed at some point. Use skin=CONTENT_LADDER and solid_bsp or solid_trigger instead. */ -const float SOLID_PORTAL = 21; /* CSG subtraction volume combined with entity transformations on impact. */ -const float SOLID_BSPTRIGGER = 22; /* For complex-shaped trigger volumes, instead of being a pure aabb. */ -const float SOLID_PHYSICS_BOX = 32; -const float SOLID_PHYSICS_SPHERE = 33; -const float SOLID_PHYSICS_CAPSULE = 34; -const float SOLID_PHYSICS_TRIMESH = 35; -const float SOLID_PHYSICS_CYLINDER = 36; -const float GEOMTYPE_NONE = -1; -const float GEOMTYPE_SOLID = 0; -const float GEOMTYPE_BOX = 1; -const float GEOMTYPE_SPHERE = 2; -const float GEOMTYPE_CAPSULE = 3; -const float GEOMTYPE_TRIMESH = 4; -const float GEOMTYPE_CYLINDER = 5; -const float GEOMTYPE_CAPSULE_X = 6; -const float GEOMTYPE_CAPSULE_Y = 7; -const float GEOMTYPE_CAPSULE_Z = 8; -const float GEOMTYPE_CYLINDER_X = 9; -const float GEOMTYPE_CYLINDER_Y = 10; -const float GEOMTYPE_CYLINDER_Z = 11; -const float JOINTTYPE_FIXED = -1; -const float JOINTTYPE_POINT = 1; -const float JOINTTYPE_HINGE = 2; -const float JOINTTYPE_SLIDER = 3; -const float JOINTTYPE_UNIVERSAL = 4; -const float JOINTTYPE_HINGE2 = 5; -#endif -#ifdef CSQC -const float GE_MAXENTS = -1; /* Valid for getentity, ignores the entity argument. Returns the maximum number of entities which may be valid, to avoid having to poll 65k when only 100 are used. */ -const float GE_ACTIVE = 0; /* Valid for getentity. Returns whether this entity is known to the client or not. */ -const float GE_ORIGIN = 1; /* Valid for getentity. Returns the interpolated .origin. */ -const float GE_FORWARD = 2; /* Valid for getentity. Returns the interpolated forward vector. */ -const float GE_RIGHT = 3; /* Valid for getentity. Returns the entity's right vector. */ -const float GE_UP = 4; /* Valid for getentity. Returns the entity's up vector. */ -const float GE_SCALE = 5; /* Valid for getentity. Returns the entity .scale. */ -const float GE_ORIGINANDVECTORS = 6; /* Valid for getentity. Returns interpolated .origin, but also sets v_forward, v_right, and v_up accordingly. Use vectoangles(v_forward,v_up) to determine the angles. */ -const float GE_ALPHA = 7; /* Valid for getentity. Returns the entity alpha. */ -const float GE_COLORMOD = 8; /* Valid for getentity. Returns the colormod vector. */ -const float GE_PANTSCOLOR = 9; /* Valid for getentity. Returns the entity's lower color (from .colormap), as a palette range value. */ -const float GE_SHIRTCOLOR = 10; /* Valid for getentity. Returns the entity's lower color (from .colormap), as a palette range value. */ -const float GE_SKIN = 11; /* Valid for getentity. Returns the entity's .skin index. */ -const float GE_MINS = 12; /* Valid for getentity. Guesses the entity's .min vector. */ -const float GE_MAXS = 13; /* Valid for getentity. Guesses the entity's .max vector. */ -const float GE_ABSMIN = 14; /* Valid for getentity. Guesses the entity's .absmin vector. */ -const float GE_ABSMAX = 15; /* Valid for getentity. Guesses the entity's .absmax vector. */ -const float GE_MODELINDEX = 200; /* Valid for getentity. Guesses the entity's .modelindex float. */ -const float GE_MODELINDEX2 = 201; /* Valid for getentity. Guesses the entity's .vw_index float. */ -const float GE_EFFECTS = 202; /* Valid for getentity. Guesses the entity's .effects float. */ -const float GE_FRAME = 203; /* Valid for getentity. Guesses the entity's .frame float. */ -const float GE_ANGLES = 204; /* Valid for getentity. Guesses the entity's .angles vector. */ -const float GE_FATNESS = 205; /* Valid for getentity. Guesses the entity's .fatness float. */ -const float GE_DRAWFLAGS = 206; /* Valid for getentity. Guesses the entity's .drawflags float. */ -const float GE_ABSLIGHT = 207; /* Valid for getentity. Guesses the entity's .abslight float. */ -const float GE_GLOWMOD = 208; /* Valid for getentity. Guesses the entity's .glowmod vector. */ -const float GE_GLOWSIZE = 209; /* Valid for getentity. Guesses the entity's .glowsize float. */ -const float GE_GLOWCOLOUR = 210; /* Valid for getentity. Guesses the entity's .glowcolor float. */ -const float GE_RTSTYLE = 211; /* Valid for getentity. Guesses the entity's .style float. */ -const float GE_RTPFLAGS = 212; /* Valid for getentity. Guesses the entity's .pflags float. */ -const float GE_RTCOLOUR = 213; /* Valid for getentity. Guesses the entity's .color vector. */ -const float GE_RTRADIUS = 214; /* Valid for getentity. Guesses the entity's .light_lev float. */ -const float GE_TAGENTITY = 215; /* Valid for getentity. Guesses the entity's .tag_entity float. */ -const float GE_TAGINDEX = 216; /* Valid for getentity. Guesses the entity's .tag_index float. */ -const float GE_GRAVITYDIR = 217; /* Valid for getentity. Guesses the entity's .gravitydir vector. */ -const float GE_TRAILEFFECTNUM = 218; /* Valid for getentity. Guesses the entity's .traileffectnum float. */ -#endif -#ifdef SSQC -const float DAMAGE_NO = 0; -const float DAMAGE_YES = 1; -const float DAMAGE_AIM = 2; -#endif -#if defined(CSQC) || defined(SSQC) -const float CONTENT_EMPTY = -1; -const float CONTENT_SOLID = -2; -const float CONTENT_WATER = -3; -const float CONTENT_SLIME = -4; -const float CONTENT_LAVA = -5; -const float CONTENT_SKY = -6; -const float CONTENT_LADDER = -16; /* If this value is assigned to a solid_bsp's .skin field, the entity will become a ladder volume. */ -const int CONTENTBIT_NONE = 0x00000000i; -const int CONTENTBIT_SOLID = 0x00000001i; -const int CONTENTBIT_LAVA = 0x00000008i; -const int CONTENTBIT_SLIME = 0x00000010i; -const int CONTENTBIT_WATER = 0x00000020i; -const int CONTENTBIT_FTELADDER = 0x00004000i; /* Content bit used for .skin=CONTENT_LADDER entities. */ -const int CONTENTBIT_PLAYERCLIP = 0x00010000i; -const int CONTENTBIT_MONSTERCLIP = 0x00020000i; -const int CONTENTBIT_BODY = 0x02000000i; /* Content bit that indicates collisions against SOLID_BBOX/SOLID_SLIDEBOX entities. */ -const int CONTENTBIT_CORPSE = 0x04000000i; /* Content bit that indicates collisions against SOLID_CORPSE entities. */ -const int CONTENTBIT_Q2LADDER = 0x20000000i; /* Content bit specific to q2bsp (conflicts with q3bsp contents so use with caution). */ -const int CONTENTBIT_SKY = 0x80000000i; /* Content bit somewhat specific to q1bsp (aliases to NODROP in q3bsp), but you should probably check surfaceflags&SURF_SKY as well for q2+q3bsp too. */ -const int CONTENTBITS_POINTSOLID = CONTENTBIT_SOLID|0x00000002i|CONTENTBIT_BODY; /* Bits that traceline would normally consider solid */ -const int CONTENTBITS_BOXSOLID = CONTENTBIT_SOLID|0x00000002i|CONTENTBIT_BODY|CONTENTBIT_PLAYERCLIP; /* Bits that tracebox would normally consider solid */ -const int CONTENTBITS_FLUID = CONTENTBIT_WATER|CONTENTBIT_SLIME|CONTENTBIT_LAVA|CONTENTBIT_SKY; -const float SPA_POSITION = 0; /* These SPA_* constants are to specify which attribute is returned by the getsurfacepointattribute builtin */ -const float SPA_S_AXIS = 1; -const float SPA_T_AXIS = 2; -const float SPA_R_AXIS = 3; /* aka: SPA_NORMAL */ -const float SPA_TEXCOORDS0 = 4; -const float SPA_LIGHTMAP0_TEXCOORDS = 5; -const float SPA_LIGHTMAP0_COLOR = 6; -const float CHAN_AUTO = 0; /* The automatic channel, play as many sounds on this channel as you want, and they'll all play, however the other channels will replace each other. */ -const float CHAN_WEAPON = 1; -const float CHAN_VOICE = 2; -const float CHAN_ITEM = 3; -const float CHAN_BODY = 4; -#endif -#if defined(QWSSQC) -const float CHANF_RELIABLE = 8; /* Only valid if the flags argument is not specified. The sound will be sent reliably, which is important if it is intended to replace looping sounds on doors etc. */ -#endif -#ifdef SSQC -const float SOUNDFLAG_RELIABLE = 1; /* The sound will be sent reliably, and without regard to phs. */ -#endif -#ifdef CSQC -const float SOUNDFLAG_ABSVOLUME = 16; /* The sample's volume is not scaled by the volume cvar. Use with caution */ -#endif -#if defined(CSQC) || defined(SSQC) -const float SOUNDFLAG_FORCELOOP = 2; /* The sound will restart once it reaches the end of the sample. */ -const float SOUNDFLAG_NOSPACIALISE = 4; /* The different audio channels are played at the same volume regardless of which way the player is facing, without needing to use 0 attenuation. */ -const float SOUNDFLAG_NOREVERB = 32; /* Disables the use of underwater/reverb effects on this sound effect. */ -const float SOUNDFLAG_FOLLOW = 64; /* The sound's origin will updated to follow the emitting entity. */ -const float SOUNDFLAG_NOREPLACE = 128; /* Sounds started with this flag will be ignored when there's already a sound playing on that same ent-channel. */ -#endif -#ifdef SSQC -const float SOUNDFLAG_UNICAST = 256; /* The sound will be sent only by the player specified by msg_entity. Spectators and related splitscreen players will also hear the sound. */ -const float SOUNDFLAG_SENDVELOCITY = 512; /* The entity's current velocity will be sent to the client, only useful if doppler is enabled. */ -#endif -#if defined(CSQC) || defined(SSQC) -const float ATTN_NONE = 0; /* Sounds with this attenuation can be heard throughout the map */ -const float ATTN_NORM = 1; /* Standard attenuation */ -const float ATTN_IDLE = 2; /* Extra attenuation so that sounds don't travel too far. */ -const float ATTN_STATIC = 3; /* Even more attenuation to avoid torches drowing out everything else throughout the map. */ -#endif -#ifdef SSQC -const float SVC_CGAMEPACKET = 83; /* Direct ssqc->csqc message. Must only be multicast. The data triggers a CSQC_Parse_Event call in the csqc for the csqc to read the contents. The server *may* insert length information for clients connected via proxies which are not able to cope with custom csqc payloads. This should only ever be used in conjunction with the MSG_MULTICAST destination. */ -#endif -#if defined(CSQC) || defined(SSQC) -const float TE_SPIKE = 0; -const float TE_SUPERSPIKE = 1; -const float TE_GUNSHOT = 2; -const float TE_EXPLOSION = 3; -const float TE_TAREXPLOSION = 4; -const float TE_LIGHTNING1 = 5; -const float TE_LIGHTNING2 = 6; -const float TE_WIZSPIKE = 7; -const float TE_KNIGHTSPIKE = 8; -const float TE_LIGHTNING3 = 9; -const float TE_LAVASPLASH = 10; -const float TE_TELEPORT = 11; -#endif -#if defined(CSQC) || defined(QWSSQC) -const float TE_BLOOD = 12; -#endif -#if defined(NQSSQC) -const float TE_EXPLOSION2 = 12; -#endif -#if defined(CSQC) || defined(QWSSQC) -const float TE_LIGHTNINGBLOOD = 13; -#endif -#if defined(NQSSQC) -const float TE_BEAM = 13; -const float MSG_BROADCAST = 0; /* The byte(s) will be unreliably sent to all players. MSG_ constants are valid arguments to the Write* builtin family. */ -const float MSG_ONE = 1; /* The byte(s) will be reliably sent to the player specified in the msg_entity global. WARNING: in quakeworld servers without network preparsing enabled, this can result in illegible server messages (due to individual reliable messages being split between multiple backbuffers/packets). NQ has larger reliable buffers which avoids this issue, but still kicks the client. */ -const float MSG_ALL = 2; /* The byte(s) will be reliably sent to all players. */ -#endif -#if defined(QWSSQC) -__deprecated("Use MSG_MULTICAST+multicast(MULTICAST_*)") const float MSG_BROADCAST; /* The byte(s) will be unreliably sent to all players. MSG_ constants are valid arguments to the Write* builtin family. */ -__deprecated("Use MSG_MULTICAST+multicast(MULTICAST_ONE_R)") const float MSG_ONE = 1; /* The byte(s) will be reliably sent to the player specified in the msg_entity global. WARNING: in quakeworld servers without network preparsing enabled, this can result in illegible server messages (due to individual reliable messages being split between multiple backbuffers/packets). NQ has larger reliable buffers which avoids this issue, but still kicks the client. */ -__deprecated("Use MSG_MULTICAST+multicast(MULTICAST_ALL)") const float MSG_ALL = 2; /* The byte(s) will be reliably sent to all players. */ -#endif -#ifdef SSQC -const float MSG_INIT = 3; /* The byte(s) will be written into the signon buffer. Clients will see these messages when they connect later. This buffer is only flushed on map changes, so spamming it _WILL_ result in overflows. */ -const float MSG_MULTICAST = 4; /* The byte(s) will be written into the multicast buffer for more selective sending. Messages sent this way will never be split across packets, and using this for csqc-only messages will not break protocol translation. */ -const float MSG_ENTITY = 5; /* The byte(s) will be written into the entity buffer. This is a special value used only inside 'SendEntity' functions. */ -const float MULTICAST_ALL = 0; /* The multicast message is unreliably sent to all players. MULTICAST_ constants are valid arguments for the multicast builtin, which ignores the specified origin when given this constant. */ -const float MULTICAST_PHS = 1; /* The multicast message is unreliably sent to only players that can potentially hear the specified origin. Its quite loose. */ -const float MULTICAST_PVS = 2; /* The multicast message is unreliably sent to only players that can potentially see the specified origin. */ -const float MULTICAST_ONE = 6; /* The multicast message is unreliably sent to the player (AND ALL TRACKING SPECTATORS) specified in the msg_entity global. The specified origin is ignored. */ -const float MULTICAST_ONE_NOSPECS = 9; /* The multicast message is unreliably sent to the player specified in the msg_entity global. The specified origin is ignored. */ -const float MULTICAST_ALL_R = 3; /* The multicast message is reliably sent to all players. The specified origin is ignored. */ -const float MULTICAST_PHS_R = 4; /* The multicast message is reliably sent to only players that can potentially hear the specified origin. Players might still not receive it if they are out of range. */ -const float MULTICAST_PVS_R = 5; /* The multicast message is reliably sent to only players that can potentially see the specified origin. Players might still not receive it if they cannot see the event. */ -const float MULTICAST_ONE_R = 7; /* The multicast message is reliably sent to the player (AND ALL TRACKING SPECTATORS) specified in the msg_entity global. The specified origin is ignored */ -const float MULTICAST_ONE_R_NOSPECS = 10; /* The multicast message is reliably sent to the player specified in the msg_entity global. The specified origin is ignored */ -#endif -#if defined(QWSSQC) -const float PRINT_LOW = 0; -const float PRINT_MEDIUM = 1; -const float PRINT_HIGH = 2; -const float PRINT_CHAT = 3; -#endif -#ifdef SSQC -const float PVSF_NORMALPVS = 0; /* Filter first by PVS, then filter this entity using tracelines if sv_cullentities is enabled. */ -const float PVSF_NOTRACECHECK = 1; /* Filter strictly by PVS. */ -const float PVSF_USEPHS = 2; /* Send if we're close enough to be able to hear this entity. */ -const float PVSF_IGNOREPVS = 3; /* Ignores pvs. This entity is visible whereever you are on the map. Updates will be sent regardless of pvs or phs */ -const float PVSF_NOREMOVE = 128; /* Once visible to a client, this entity will remain visible. This can be useful for csqc and corpses. While this flag is set, no CSQC_Remove events will be sent for the entity, but this does NOT mean that it will still receive further updates while outside of the pvs. */ -const string INFOKEY_P_IP = "ip"; /* The apparent ip address of the client. This may be a proxy's ip address. */ -const string INFOKEY_P_REALIP = "realip"; /* If sv_getrealip is set, this gives the ip as determine using that algorithm. */ -const string INFOKEY_P_CSQCACTIVE = "csqcactive"; /* Client has csqc enabled. CSQC ents etc will be sent to this player. */ -const string INFOKEY_P_SVPING = "svping"; -const string INFOKEY_P_GUID = "guid"; /* Some hash string which should be reasonably unique to this player's quake installation. */ -const string INFOKEY_P_CHALLENGE = "challenge"; -const string INFOKEY_P_USERID = "*userid"; -const string INFOKEY_P_DOWNLOADPCT = "download"; /* The client's download percentage for the current file. Additional files are not known. */ -const string INFOKEY_P_TRUSTLEVEL = "trustlevel"; -const string INFOKEY_P_PROTOCOL = "protocol"; /* The network protocol the client is using to connect to the server. */ -const string INFOKEY_P_VIP = "*VIP"; /* 1 if the player has the VIP 'penalty'. */ -const string INFOKEY_P_ISMUTED = "*ismuted"; /* 1 if the player has the 'mute' penalty and is not allowed to use the say/say_team commands. */ -const string INFOKEY_P_ISDEAF = "*isdeaf"; /* 1 if the player has the 'deaf' penalty and cannot see other people's say/say_team commands. */ -const string INFOKEY_P_ISCRIPPLED = "*ismuted"; /* 1 if the player has the cripple penalty, and their movement values are ignored (.movement is locked to 0). */ -const string INFOKEY_P_ISCUFFED = "*ismuted"; /* 1 if the player has the cuff penalty, and is unable to attack or use impulses(.button0 and .impulse fields are locked to 0). */ -const string INFOKEY_P_ISLAGGED = "*ismuted"; /* 1 if the player has the fakelag penalty and has an extra 200ms of lag. */ -#endif -#if defined(CSQC) || defined(SSQC) -const string INFOKEY_P_PING = "ping"; /* The player's ping time, in milliseconds. */ -const string INFOKEY_P_NAME = "name"; /* The player's name. */ -const string INFOKEY_P_SPECTATOR = "*spectator"; /* Whether the player is a spectator or not. */ -const string INFOKEY_P_TOPCOLOR = "topcolor"; /* The player's upper/shirt colour (palette index). */ -const string INFOKEY_P_BOTTOMCOLOR = "bottomcolor"; /* The player's lower/pants/trouser colour (palette index). */ -#endif -#ifdef CSQC -const string INFOKEY_P_TOPCOLOR_RGB = "topcolor_rgb"; /* The player's upper/shirt colour as an rgb value in a format usable with stov. */ -const string INFOKEY_P_BOTTOMCOLOR_RGB = "bottomcolor_rgb"; /* The player's lower/pants/trouser colour as an rgb value in a format usable with stov. */ -const string INFOKEY_P_MUTED = "ignored"; /* 0: we can see the result of the player's say/say_team commands. 1: we see no say/say_team messages from this player. Use the ignore command to toggle this value. */ -const string INFOKEY_P_VOIP_MUTED = "vignored"; /* 0: we can hear this player when they speak (assuming voip is generally enabled). 1: we ignore everything this player says. Use cl_voip_mute to change the values. */ -const string INFOKEY_P_ENTERTIME = "entertime"; /* Reads the timestamp at which the player entered the game, in terms of csqc's time global. */ -const string INFOKEY_P_FRAGS = "frags"; /* Reads a player's frag count. */ -const string INFOKEY_P_PACKETLOSS = "pl"; /* Reads a player's packetloss, as a percentage. */ -const string INFOKEY_P_VOIPSPEAKING = "voipspeaking"; /* Boolean value that says whether the given player is currently sending voice information. */ -const string INFOKEY_P_VOIPLOUDNESS = "voiploudness"; /* Only valid for the local player. Gives a value between 0 and 1 to indicate to the user how loud their mic is. */ -const string SERVERKEY_IP = "ip"; /* The address of the server we connected to. */ -const string SERVERKEY_SERVERNAME = "servername"; /* The hostname that was last passed to the connect command. */ -const string SERVERKEY_CONSTATE = "constate"; /* The current connection state. Will be set to one of: disconnected (menu-only mode), active (gamestate received and loaded), connecting(connecting, downloading, or precaching content, aka: loading screen). */ -const string SERVERKEY_TRANSFERRING = "transferring"; /* Set to the hostname of the server that we are attempting to connect or transfer to. */ -const string SERVERKEY_LOADSTATE = "loadstate"; /* loadstage, loading image name, current step, max steps -Stages are: 1=connecting, 2=serverside, 3=clientside -Key will be empty if we are not loading. */ -const string SERVERKEY_PAUSESTATE = "pausestate"; /* 1 if the server claimed to be paused. 0 otherwise */ -const string SERVERKEY_DLSTATE = "dlstate"; /* The progress of any current downloads. Empty string if no download is active, otherwise a tokenizable string containing this info: -files-remaining, total-size, unknown-sizes-flag, file-localname, file-remotename, file-percent, file-rate, file-received-bytes, file-total-bytes -If the current file info is omitted, then we are waiting for a download to start. */ -const string SERVERKEY_PROTOCOL = "protocol"; /* The protocol we are connected to the server with. */ -const string SERVERKEY_MAXPLAYERS = "maxplayers"; /* The number of player/spectator slots allocated on the server. */ -#endif -#ifdef SSQC -const float STUFFCMD_IGNOREINDEMO = 1; /* This stuffcmd will NOT be written to mvds/qtv. */ -const float STUFFCMD_DEMOONLY = 2; /* This stuffcmd will ONLY be written into mvds/qtv streams. */ -const float STUFFCMD_BROADCAST = 4; /* The stuffcmd will be broadcast server-wide (according to the mvd filters). */ -const float STUFFCMD_UNRELIABLE = 8; /* The stuffcmd might not arrive. It might also get there faster than ones sent over the reliable channel. */ -#endif -#if defined(CSQC) || defined(SSQC) -const float FL_FLY = 1; -const float FL_SWIM = 2; -const float FL_CLIENT = 8; -const float FL_INWATER = 16; -const float FL_MONSTER = 32; -#endif -#ifdef SSQC -const float FL_GODMODE = 64; -const float FL_NOTARGET = 128; -#endif -#if defined(CSQC) || defined(SSQC) -const float FL_ITEM = 256; -const float FL_ONGROUND = 512; -const float FL_PARTIALGROUND = 1024; -const float FL_WATERJUMP = 2048; -#endif -#if defined(NQSSQC) -const float FL_JUMPRELEASED = 4096; -#endif -#if defined(CSQC) || defined(SSQC) -const float FL_FINDABLE_NONSOLID = 16384; /* Allows this entity to be found with findradius */ -#endif -#ifdef SSQC -const float FL_LAGGEDMOVE = 65536; /* Enables anti-lag on rockets etc. */ -#endif -#if defined(CSQC) || defined(SSQC) -const float MOVE_NORMAL = 0; -const float MOVE_NOMONSTERS = 1; /* The trace will ignore all non-solid_bsp entities. */ -const float MOVE_MISSILE = 2; /* The trace will use a bbox size of +/- 15 against entities with FL_MONSTER set. */ -const float MOVE_WORLDONLY = 3; /* The trace will ignore everything but the worldmodel. This is useful for to prevent the q3bsp pvs+culling issues that come with spectator modes leaving the world . */ -const float MOVE_HITMODEL = 4; /* Traces will impact the actual mesh of the model instead of merely their bounding box. Should generally only be used for tracelines. Note that this flag is unreliable as an object can animate through projectiles. The bounding box MUST be set to completely encompass the entity or those extra areas will be non-solid (leaving a hole for things to go through). */ -const float MOVE_TRIGGERS = 16; /* This trace type will impact only triggers. It will ignore non-solid entities. */ -const float MOVE_EVERYTHING = 32; /* This type of trace will hit solids and triggers alike. Even non-solid entities. */ -#endif -#ifdef SSQC -const float MOVE_LAGGED = 64; /* Will use antilag based upon the player's latency. Traces will be performed against old positions for entities instead of their current origin. */ -#endif -#if defined(CSQC) || defined(SSQC) -const float MOVE_ENTCHAIN = 128; /* Returns a list of entities impacted via the trace_ent.chain field */ -const float MOVE_OTHERONLY = 256; /* Traces that use this trace type will collide against *only* the entity specified via the 'other' global, and will ignore all owner/solid_not/dimension etc rules, they will still adhere to contents and bsp/bbox rules though. */ -#endif -const float CVAR_TYPEFLAG_EXISTS = 1; /* Cvar name actually exists. */ -const float CVAR_TYPEFLAG_SAVED = 2; /* Cvar is flaged for archival (might need cfg_save to actually save). */ -const float CVAR_TYPEFLAG_PRIVATE = 4; /* QC is not allowed to read. */ -const float CVAR_TYPEFLAG_ENGINE = 8; /* Cvar was created by the engine itself (not user/mod created). */ -const float CVAR_TYPEFLAG_HASDESCRIPTION = 16; /* cvar_description will return something (hopefully) useful. */ -const float CVAR_TYPEFLAG_READONLY = 32; /* cvar may not be changed by qc. */ -const float RESTYPE_MODEL = 0; /* RESTYPE_* constants are used as arguments with the resourcestatus builtin. */ -const float RESTYPE_SOUND = 1; /* precache_sound */ -const float RESTYPE_PARTICLE = 2; /* particleeffectnum */ -#if defined(CSQC) || defined(MENU) -const float RESTYPE_PIC = 3; /* precache_pic. Status results are an amalgomation of the textures used by the named shader. */ -const float RESTYPE_SKIN = 4; /* setcustomskin */ -const float RESTYPE_TEXTURE = 5; /* Individual textures within shaders. These are not directly usable, but may be named as part of a skin file, or a shader. */ -#endif -const float RESSTATE_NOTKNOWN = 0; /* RESSTATE_* constants are return values from the resourcestatus builtin. The engine doesn't know about the resource if it is in this state. This means you will need to precache it. Attempting to use it anyway may result in warnings, errors, or silently succeed, depending on engine version and resource type. */ -const float RESSTATE_NOTLOADED = 1; /* The resource was precached, but has been flushed and there has not been an attempt to reload it. If you use the resource normally, chances are it'll be loaded but at the cost of a stall. */ -const float RESSTATE_LOADING = 2; /* Resources in this this state are queued for loading, and will be loaded at the engine's convienience. If you attempt to query the resource now, the engine will stall until the result is available. sounds in this state may be delayed, while models/pics/shaders may be invisible. */ -const float RESSTATE_FAILED = 3; /* Resources in this state are unusable/could not be loaded. You will get placeholders or dummy results. Queries will not stall the engine. The engine may display placeholder content. */ -const float RESSTATE_LOADED = 4; /* Resources in this state are finally usable, everything will work okay. Hurrah. Queries will not stall the engine. */ -#if defined(CSQC) || defined(SSQC) -const float EF_BRIGHTFIELD = 1; -#endif -#if defined(CSQC) || defined(NQSSQC) -const float EF_MUZZLEFLASH = 2; -#endif -#if defined(CSQC) || defined(SSQC) -const float EF_BRIGHTLIGHT = 4; -const float EF_DIMLIGHT = 8; -#endif -#if defined(QWSSQC) -const float EF_FLAG1 = 16; -const float EF_FLAG2 = 32; -#endif -#if defined(CSQC) || defined(NQSSQC) -const float EF_NODRAW = 16; /* Disables drawing of the model. Does NOT work on QW players. */ -#endif -#if defined(CSQC) || defined(SSQC) -const float EF_ADDITIVE = 32; /* The entity will be drawn with an additive blend. This is NOT supported on players in any quakeworld engine. */ -const float EF_BLUE = 64; /* A blue glow */ -const float EF_RED = 128; /* A red glow */ -const float EF_GREEN = 262144; /* A green glow */ -const float EF_FULLBRIGHT = 512; /* This entity will ignore lighting */ -const float EF_NOSHADOW = 4096; /* This entity will not cast shadows */ -const float EF_NODEPTHTEST = 8192; /* This entity will be drawn over the top of other things that are closer. */ -#endif -#ifdef SSQC -const float EF_NOMODELFLAGS = 8388608; /* Surpresses the normal flags specified in the model. */ -#endif -#if defined(CSQC) || defined(SSQC) -const float MF_ROCKET = 1; -const float MF_GRENADE = 2; -const float MF_GIB = 4; /* Regular blood trail */ -const float MF_ROTATE = 8; -const float MF_TRACER = 16; /* AKA: green scrag trail */ -const float MF_ZOMGIB = 32; /* Dark blood trail */ -const float MF_TRACER2 = 64; /* AKA: hellknight projectile trail */ -const float MF_TRACER3 = 128; /* AKA: purple vore trail */ -#endif -#ifdef SSQC -DEP_CSQC const float SL_ORG_TL = 20; /* Used with showpic etc, specifies that the x+y values are relative to the top-left of the screen */ -DEP_CSQC const float SL_ORG_TR = 21; -DEP_CSQC const float SL_ORG_BL = 22; -DEP_CSQC const float SL_ORG_BR = 23; -DEP_CSQC const float SL_ORG_MM = 24; -DEP_CSQC const float SL_ORG_TM = 25; -DEP_CSQC const float SL_ORG_BM = 26; -DEP_CSQC const float SL_ORG_ML = 27; -DEP_CSQC const float SL_ORG_MR = 28; -#endif -#if defined(CSQC) || defined(SSQC) -const float PFLAGS_NOSHADOW = 1; /* Associated RT lights attached will not cast shadows, making them significantly faster to draw. */ -const float PFLAGS_CORONA = 2; /* Enables support of coronas on the associated rtlights. */ -#endif -#ifdef SSQC -const float PFLAGS_FULLDYNAMIC = 128; /* When set in self.pflags, enables fully-customised dynamic lights. Custom rtlight information is not otherwise used. */ -#endif -const float EV_STRING = 1; -const float EV_FLOAT = 2; -const float EV_VECTOR = 3; -const float EV_ENTITY = 4; -const float EV_FIELD = 5; -const float EV_FUNCTION = 6; -const float EV_POINTER = 7; -const float EV_INTEGER = 8; -const float EV_UINT = 9; -const float EV_INT64 = 10; -const float EV_UINT64 = 11; -const float EV_DOUBLE = 12; -hashtable gamestate; /* Special hash table index for hash_add and hash_get. Entries in this table will persist over map changes (and doesn't need to be created/deleted). */ -const float HASH_REPLACE = 256; /* Used with hash_add. Attempts to remove the old value instead of adding two values for a single key. */ -const float HASH_ADD = 512; /* Used with hash_add. The new entry will be inserted in addition to the existing entry. */ -#ifdef CSQC -const float STAT_HEALTH = 0; /* Player's health. */ -const float STAT_WEAPONMODELI = 2; /* This is the modelindex of the current viewmodel (renamed from the original name 'STAT_WEAPON' due to confusions). */ -const float STAT_AMMO = 3; /* player.currentammo */ -const float STAT_ARMOR = 4; -const float STAT_WEAPONFRAME = 5; -const float STAT_SHELLS = 6; -const float STAT_NAILS = 7; -const float STAT_ROCKETS = 8; -const float STAT_CELLS = 9; -const float STAT_ACTIVEWEAPON = 10; /* player.weapon */ -const float STAT_TOTALSECRETS = 11; -const float STAT_TOTALMONSTERS = 12; -const float STAT_FOUNDSECRETS = 13; -const float STAT_KILLEDMONSTERS = 14; -const float STAT_ITEMS = 15; /* self.items | (self.items2<<23). In order to decode this stat properly, you need to use getstatbits(STAT_ITEMS,0,23) to read self.items, and getstatbits(STAT_ITEMS,23,11) to read self.items2 or getstatbits(STAT_ITEMS,28,4) to read the visible part of serverflags, whichever is applicable. */ -const float STAT_VIEWHEIGHT = 16; /* player.view_ofs_z */ -const float STAT_VIEW2 = 20; /* This stat contains the number of the entity in the server's .view2 field. */ -const float STAT_VIEWZOOM = 21; /* Scales fov and sensitiity. Part of DP_VIEWZOOM. */ -#endif -#if defined(CSQC) || defined(SSQC) -const float STAT_USER = 32; /* Custom user stats start here (lower values are reserved for engine use). */ -#endif -#if defined(CSQC) || defined(MENU) -const float PRECACHE_PIC_FROMWAD = 1; /* Attempt to load it from the legacy gfx.wad file (usually its better to just use a gfx/ prefix instead). */ -const float PRECACHE_PIC_NOCLAMP = 4; /* Texture coords for the pic will not be clamped nor padded nor atlased. */ -const float PRECACHE_PIC_DOWNLOAD = 256; /* If no image could be loaded then attempt to download one from the server. This flag can cause the function to block until completion. (Slow!) */ -const float PRECACHE_PIC_TEST = 512; /* The precache will block until the image is fully loaded, returning a null string on failure. (Slow!) */ -const float VF_MIN = 1; /* The top-left of the 3d viewport in screenspace. The VF_ values are used via the setviewprop/getviewprop builtins. */ -const float VF_MIN_X = 2; -const float VF_MIN_Y = 3; -const float VF_SIZE = 4; /* The width+height of the 3d viewport in screenspace. */ -const float VF_SIZE_X = 5; -const float VF_SIZE_Y = 6; -const float VF_VIEWPORT = 7; /* vector+vector. Two argument shortcut for VF_MIN and VF_SIZE */ -const float VF_FOV = 8; /* sets both fovx and fovy. consider using afov instead. */ -const float VF_FOV_X = 9; /* horizontal field of view. does not consider aspect at all. */ -const float VF_FOV_Y = 10; /* vertical field of view. does not consider aspect at all. */ -const float VF_ORIGIN = 11; /* The origin of the view. Not of the player. */ -const float VF_ORIGIN_X = 12; -const float VF_ORIGIN_Y = 13; -const float VF_ORIGIN_Z = 14; -const float VF_ANGLES = 15; /* The angles the view will be drawn at. Not the angle the client reports to the server. */ -const float VF_ANGLES_X = 16; -const float VF_ANGLES_Y = 17; -const float VF_ANGLES_Z = 18; -#endif -#ifdef CSQC -const float VF_DRAWWORLD = 19; /* boolean. If set to 1, the engine will draw the world and static/persistant rtlights. If 0, the world will be skipped and everything will be fullbright. */ -const float VF_DRAWENGINESBAR = 20; /* boolean. If set to 1, the sbar will be drawn, and viewsize will be honoured automatically. */ -const float VF_DRAWCROSSHAIR = 21; /* boolean. If set to 1, the engine will draw its default crosshair. */ -#endif -#if defined(CSQC) || defined(MENU) -const float VF_MINDIST = 23; /* The distance of the near clip plane from the view position. Should generally not be <=0, as this would introduce NANs. */ -const float VF_MAXDIST = 24; /* The distance of the far clip plane from the view position. If 0, will be considered infinite. */ -#endif -#ifdef CSQC -const float VF_CL_VIEWANGLES = 33; -const float VF_CL_VIEWANGLES_X = 34; -const float VF_CL_VIEWANGLES_Y = 35; -const float VF_CL_VIEWANGLES_Z = 36; -#endif -#if defined(CSQC) || defined(MENU) -const float VF_PERSPECTIVE = 200; /* 1: regular rendering. Fov specifies the angle. 0: isometric-style. Fov specifies the number of Quake Units each side of the viewport, and mindist restrictions are removed, pvs culling should be disabled. */ -#endif -#ifdef CSQC -#define VF_LPLAYER VF_ACTIVESEAT -const float VF_ACTIVESEAT = 202; /* The 'seat' number, used when running splitscreen. */ -#endif -#if defined(CSQC) || defined(MENU) -const float VF_AFOV = 203; /* Aproximate fov. Matches the 'fov' cvar. The engine handles the aspect ratio for you. */ -const float VF_SCREENVSIZE = 204; /* Provides a reliable way to retrieve the current virtual screen size (even if the screen is automatically scaled to retain aspect). */ -const float VF_SCREENPSIZE = 205; /* Provides a reliable way to retrieve the current physical screen size (cvars need vid_restart for them to take effect). */ -#endif -#ifdef CSQC -const float VF_VIEWENTITY = 206; /* Changes the RF_EXTERNALMODEL flag on entities to match the new selection, and removes entities flaged with RF_VIEWENTITY. Requires cunning use of .entnum and typically requires calling addentities(MASK_VIEWMODEL) too. */ -#endif -#if defined(CSQC) || defined(MENU) -const float VF_RT_DESTCOLOUR = 212; /* The texture name to write colour info into, this includes both 3d and 2d drawing. -Additional arguments are: format (IMGFMT_*), sizexy. -Written to by both 3d and 2d rendering. -Note that any rendertarget textures may be destroyed on video mode changes or so. Shaders can name render targets by prefixing texture names with '$rt:', or $sourcecolour. */ -const float VF_RT_DESTCOLOUR1 = 213; /* Like VF_RT_DESTCOLOUR, for multiple render targets. */ -const float VF_RT_DESTCOLOUR2 = 214; /* Like VF_RT_DESTCOLOUR, for multiple render targets. */ -const float VF_RT_DESTCOLOUR3 = 215; /* Like VF_RT_DESTCOLOUR, for multiple render targets. */ -const float VF_RT_SOURCECOLOUR = 209; /* The texture name to use with shaders that specify a $sourcecolour map. */ -const float VF_RT_DEPTH = 210; /* The texture name to use as a depth buffer. Also used for shaders that specify $sourcedepth. 1-based. Additional arguments are: format (IMGFMT_D*), sizexy. */ -const float VF_RT_RIPPLE = 211; /* The texture name to use as a ripplemap (target for shaders with 'sort ripple'). Also used for shaders that specify $ripplemap. 1-based. Additional arguments are: format, sizexy. */ -const float VF_ENVMAP = 220; /* The cubemap name to use as a fallback for $reflectcube, if a shader was unable to load one. Note that this doesn't automatically change shader permutations or anything. */ -const float VF_USERDATA = 221; /* Pointer (and byte size) to an array of vec4s. This data is then globally visible to all glsl via the w_user uniform. */ -#endif -#ifdef CSQC -const float VF_SKYROOM_CAMERA = 222; /* Controls the camera position of the skyroom (which will be drawn underneath transparent sky surfaces). This should move slightly with the real camera, but not so much that the skycamera enters walls. Requires a skyshader with a blend mode on the first pass (or no passes). */ -#endif -#if defined(CSQC) || defined(MENU) -const float VF_PROJECTIONOFFSET = 224; /* vec2 horizontal+vertical offset for the projection matrix, for weird off-centre rendering. */ -const float DRAWFLAG_NORMAL = 0; /* Args for drawpic/drawfill/beginpolygon. Not to be confused with the hexen2-compatibility feature. */ -const float DRAWFLAG_ADD = 1; /* Forces additive blending, overriding any shader settings. */ -const float DRAWFLAG_MODULATE = 2; /* Forces alpha blending, overriding any shader settings. */ -const float DRAWFLAG_2D = 4; /* For use with beginpolygon. The polygon will be drawn to the 2d screen, instead of being added to the 3d scene. */ -const float DRAWFLAG_TWOSIDED = 1024; /* For use with beginpolygon. The polygon will be two-sided without any backface culling. */ -const float DRAWFLAG_LINES = 2048; /* For use with beginpolygon. The surface verticies should be interpreted as a line loop, instead of a triangle fan. */ -const float IMGFMT_R8G8B8A8 = 1; /* Typical 32bit rgba pixel format. */ -const float IMGFMT_R16G16B16A16F = 2; /* Half-Float pixel format. Requires gl3 support. */ -const float IMGFMT_R32G32B32A32F = 3; /* Regular Float pixel format. Requires gl3 support. */ -const float IMGFMT_D16 = 4; /* 16-bit depth pixel format. Must not be used with VF_RT_DESTCOLOUR*. */ -const float IMGFMT_D24 = 5; /* 24-bit depth pixel format. Must not be used with VF_RT_DESTCOLOUR*. */ -const float IMGFMT_D32 = 6; /* 32-bit depth pixel format. Must not be used with VF_RT_DESTCOLOUR*. */ -const float IMGFMT_R8 = 7; /* Single channel red-only 8bit pixel format. */ -const float IMGFMT_R16F = 8; /* Single channel red-only Half-Float pixel format. Requires gl3 support. */ -const float IMGFMT_R32F = 9; /* Single channel red-only Float pixel format. Requires gl3 support. */ -const float IMGFMT_A2B10G10R10 = 10; /* Packed 32-bit packed 10-bit colour pixel format. Requires gl3 support. */ -const float IMGFMT_R5G6B5 = 11; /* Packed 16-bit colour pixel format. */ -const float IMGFMT_R4G4B4A4 = 12; /* Packed 16-bit colour pixel format, with alpha */ -const float IMGFMT_R8G8 = 13; /* 16-bit two-channel pixel format. */ -const float IMGFMT_R32G32B32F = 14; /* A pixel format that matches QC's vector type. */ -#endif -#ifdef CSQC -const float RF_VIEWMODEL = 1; /* Specifies that the entity is a view model, and that its origin is relative to the current view position. These entities are also subject to viewweapon bob. */ -const float RF_EXTERNALMODEL = 2; /* Specifies that this entity should be displayed in mirrors (and may still cast shadows), but will not otherwise be visible. */ -#endif -#if defined(CSQC) || defined(MENU) -const float RF_DEPTHHACK = 4; /* Hacks the depth values such that the entity uses depth values as if it were closer to the screen. This is useful when combined with viewmodels to avoid weapons poking in to walls. */ -const float RF_ADDITIVE = 8; /* Shaders from this entity will temporarily be hacked to use an additive blend mode instead of their normal blend mode. */ -#endif -#ifdef CSQC -const float RF_USEAXIS = 16; /* The entity will be oriented according to the current v_forward+v_right+v_up vector values instead of the entity's .angles field. */ -const float RF_NOSHADOW = 32; /* This entity will not cast shadows. Often useful on view models. */ -const float RF_FRAMETIMESARESTARTTIMES = 64; /* Specifies that the frame1time, frame2time field are timestamps (denoting the start of the animation) rather than time into the animation. */ -const float RF_FIRSTPERSON = 1024; /* This is basically the opposite of RF_EXTERNALMODEL. Don't draw in third-person or mirrors. */ -#endif -#if defined(CSQC) || defined(MENU) -const float IE_KEYDOWN = 0; /* Specifies that a key was pressed. Second argument is the scan code. Third argument is the unicode (printable) char value. Fourth argument denotes which keyboard(or mouse, if its a mouse 'scan' key) the event came from. Note that some systems may completely separate scan codes and unicode values, with a 0 value for the unspecified argument. */ -const float IE_KEYUP = 1; /* Specifies that a key was released. Arguments are the same as IE_KEYDOWN. On some systems, this may be fired instantly after IE_KEYDOWN was fired. */ -const float IE_MOUSEDELTA = 2; /* Specifies that a mouse was moved (touch screens and tablets typically give IE_MOUSEABS events instead, use in_windowed_mouse 0 to test code to cope with either). Second argument is the X displacement, third argument is the Y displacement. Fourth argument is which mouse or touch event triggered the event. */ -const float IE_MOUSEABS = 3; /* Specifies that a mouse cursor or touch event was moved to a specific location relative to the virtual screen space. Second argument is the new X position, third argument is the new Y position. Fourth argument is which mouse or touch event triggered the event. */ -const float IE_ACCELEROMETER = 4; -const float IE_FOCUS = 5; /* Specifies that input focus was given. parama says mouse focus, paramb says keyboard focus. If either are -1, then it is unchanged. */ -const float IE_JOYAXIS = 6; /* Specifies that what value a joystick/controller axis currently specifies. x=axis, y=value. Will be called multiple times, once for each axis of each active controller. */ -const float IE_GYROSCOPE = 7; -const float GGDI_GAMEDIR = 0; /* Used with getgamedirinfo to query the mod's public gamedir. There is often other info that cannot be expressed with just a gamedir name, resulting in dupes or other weirdness. */ -const float GGDI_DESCRIPTION = 1; /* The human-readable title of the mod. Empty when no data is known (ie: the gamedir just contains some maps). */ -const float GGDI_OVERRIDES = 2; /* A list of settings overrides. */ -const float GGDI_LOADCOMMAND = 3; /* The console command needed to actually load the mod. */ -const float GGDI_ICON = 4; /* The mod's Icon path, ready for drawpic. */ -const float GGDI_GAMEDIRLIST = 5; /* A semi-colon delimited list of gamedirs that the mod's content can be loaded through. */ -#endif -#ifdef SSQC -const float CLIENTTYPE_DISCONNECTED = 0; /* Return value from clienttype() builtin. This entity is a player slot that is currently empty. */ -const float CLIENTTYPE_REAL = 1; /* This is a real player, and not a bot. */ -const float CLIENTTYPE_BOT = 2; /* This player slot does not correlate to a real player, any messages sent to this client will be ignored. */ -const float CLIENTTYPE_NOTACLIENT = 3; /* This entity is not even a player slot. This is typically an error condition. */ -#endif -const float FILE_READ = 0; /* The file may be read via fgets to read a single line at a time. */ -const float FILE_APPEND = 1; /* Like FILE_WRITE, but writing starts at the end of the file. */ -const float FILE_WRITE = 2; /* fputs will be used to write to the file. */ -const float FILE_READNL = 4; /* Like FILE_READ, except newlines are not special. fgets reads the entire file into a tempstring. */ -const float FILE_MMAP_READ = 5; /* The file will be loaded into memory. fgets returns a pointer to the first byte (and will always return the same value for this file). Cast this to your datatype. */ -const float FILE_MMAP_RW = 6; /* Like FILE_MMAP_READ, except any changes to the data will be written back to disk once the file is closed. */ -#ifdef CSQC -const float MASK_ENGINE = 1; /* Valid as an argument for addentities. If specified, all non-csqc entities will be added to the scene. */ -const float MASK_VIEWMODEL = 2; /* Valid as an argument for addentities. If specified, the regular engine viewmodel will be added to the scene. */ -const float PREDRAW_AUTOADD = 0; /* Valid as a return value from the predraw function. Returning this will cause the engine to automatically invoke addentity(self) for you. */ -const float PREDRAW_NEXT = 1; /* Valid as a return value from the predraw function. Returning this will simply move on to the next entity without the autoadd behaviour, so can be used for particle/invisible/special entites, or entities that were explicitly drawn with addentity. */ -const float LFIELD_ORIGIN = 0; -const float LFIELD_COLOUR = 1; -const float LFIELD_RADIUS = 2; -const float LFIELD_FLAGS = 3; -const float LFIELD_STYLE = 4; -const float LFIELD_ANGLES = 5; -const float LFIELD_FOV = 6; -const float LFIELD_CORONA = 7; -const float LFIELD_CORONASCALE = 8; -const float LFIELD_CUBEMAPNAME = 9; -const float LFIELD_AMBIENTSCALE = 10; -const float LFIELD_DIFFUSESCALE = 11; -const float LFIELD_SPECULARSCALE = 12; -const float LFIELD_ROTATION = 13; -const float LFIELD_DIETIME = 14; -const float LFIELD_RGBDECAY = 15; -const float LFIELD_RADIUSDECAY = 16; -const float LFIELD_STYLESTRING = 17; -const float LFIELD_NEARCLIP = 18; -const float LFIELD_OWNER = 19; -const float LFLAG_NORMALMODE = 1; -const float LFLAG_REALTIMEMODE = 2; -const float LFLAG_LIGHTMAP = 4; -const float LFLAG_FLASHBLEND = 8; -const float LFLAG_NOSHADOWS = 256; -const float LFLAG_SHADOWMAP = 512; -const float LFLAG_CREPUSCULAR = 1024; -const float LFLAG_ORTHOSUN = 2048; -const float TEREDIT_RELOAD = 0; -const float TEREDIT_SAVE = 1; -const float TEREDIT_SETHOLE = 2; -const float TEREDIT_HEIGHT_SET = 3; -const float TEREDIT_HEIGHT_SMOOTH = 4; -const float TEREDIT_HEIGHT_SPREAD = 5; -const float TEREDIT_HEIGHT_RAISE = 6; -const float TEREDIT_HEIGHT_FLATTEN = 18; -const float TEREDIT_HEIGHT_LOWER = 7; -const float TEREDIT_TEX_KILL = 8; -const float TEREDIT_TEX_GET = 9; -const float TEREDIT_TEX_BLEND = 10; -const float TEREDIT_TEX_UNIFY = 11; -const float TEREDIT_TEX_NOISE = 12; -const float TEREDIT_TEX_BLUR = 13; -const float TEREDIT_TEX_REPLACE = 19; -const float TEREDIT_TEX_SETMASK = 25; -const float TEREDIT_WATER_SET = 14; -const float TEREDIT_MESH_ADD = 15; -const float TEREDIT_MESH_KILL = 16; -const float TEREDIT_TINT = 17; -const float TEREDIT_RESET_SECT = 20; -const float TEREDIT_RELOAD_SECT = 21; -const float TEREDIT_ENT_GET = 26; -const float TEREDIT_ENT_SET = 27; -const float TEREDIT_ENT_ADD = 28; -const float TEREDIT_ENT_COUNT = 29; -#endif -#if defined(CSQC) || defined(MENU) -const float SLIST_HOSTCACHEVIEWCOUNT = 0; -const float SLIST_HOSTCACHETOTALCOUNT = 1; -const float SLIST_MASTERQUERYCOUNT = 2; -const float SLIST_MASTERREPLYCOUNT = 3; -const float SLIST_SERVERQUERYCOUNT = 4; -const float SLIST_SERVERREPLYCOUNT = 5; -const float SLIST_SORTFIELD = 6; -const float SLIST_SORTDESCENDING = 7; -const float SLIST_TEST_CONTAINS = 0; -const float SLIST_TEST_NOTCONTAIN = 1; -const float SLIST_TEST_LESSEQUAL = 2; -const float SLIST_TEST_LESS = 3; -const float SLIST_TEST_EQUAL = 4; -const float SLIST_TEST_GREATER = 5; -const float SLIST_TEST_GREATEREQUAL = 6; -const float SLIST_TEST_NOTEQUAL = 7; -const float SLIST_TEST_STARTSWITH = 8; -const float SLIST_TEST_NOTSTARTSWITH = 9; -#endif -#ifdef MENU -float(string ext) checkextension = #1; /* - Checks if the named extension is supported by the running engine. */ - -void(string err,...) error = #2; /* - Fatal error that will trigger a crash-to-console that users will actually notice. */ - -void(string err,...) objerror = #3; /* - For some reason this has been redefined as non-fatal, and as it won't force the user to look at the console it'll generally be ignored completely so really what's the point? Other than as a convoluted way to remove(self) that is. */ - -void(string text,...) print = #4; /* Part of DP_SV_PRINT - Hello, world. Shoves junk on the console. Hopefully people will bother to read it, maybe. */ - -DEP void(string text,...) bprint = #5; -DEP void(float clientnum, string text,...) msprint = #6; -void(string text,...) cprint = #7; /* - Tries to show the given message in the centre of the screen, assuming that its not obscured by menus. Oh hey look, you're calling it in menuqc! */ - -vector(vector) normalize = #8; -float(vector) vlen = #9; -float(vector) vectoyaw = #10; -vector(vector) vectoangles = #11; -float() random = #12; -void(string,...) localcmd = #13; -float(string name) cvar = #14; -void(string name, string value) cvar_set = #15; -void(string text, ...) dprint = #16; -string(float) ftos = #17; -float(float) fabs = #18; -string(vector) vtos = #19; -string(entity) etos = #20; /* Part of DP_QC_ETOS*/ -float(string) stof = #21; /* Part of FRIK_FILE, FTE_QC_INFOKEY, FTE_STRINGS, QW_ENGINE, ZQ_QC_STRINGS*/ -entity() spawn = #22; -void(entity) remove = #23; -entity(entity start, .string field, string match) find = #24; -entity(entity start, .__variant field, __variant match) findfloat = #25; /* Part of DP_QC_FINDFLOAT*/ -entity(.string field, string match) findchain = #26; /* Part of DP_QC_FINDCHAIN*/ -entity(.__variant field, __variant match) findchainfloat = #27; /* Part of DP_QC_FINDCHAINFLOAT*/ -string(string file) precache_file = #28; /* - Attempts to download the named file from the current server, if it isn't found locally. Not very useful as menuqc is normally meant to work before joining servers too. */ - -string(string sample) precache_sound = #29; -void() coredump = #30; /* - Takes a dump, writing the qcvm's state to disk. There are normally easier ways to debug, but I suppose this one still beats print spam. */ - -void() traceon = #31; /* - Enables single-stepping. Its generally easier to just set a breakpoint. */ - -void() traceoff = #32; /* - Disables single-stepping. Which sucks if you started said singlestepping outside of qc. */ - -void(entity) eprint = #33; -float(float) rint = #34; -float(float) floor = #35; -float(float) ceil = #36; -entity(entity) nextent = #37; -float(float) sin = #38; /* Part of DP_QC_SINCOSSQRTPOW*/ -float(float) cos = #39; /* Part of DP_QC_SINCOSSQRTPOW*/ -float(float) sqrt = #40; /* Part of DP_QC_SINCOSSQRTPOW*/ -vector() randomvector = #41; -float(string name, string value, float flags) registercvar = #42; /* Part of DP_REGISTERCVAR - Creates the cvar if it didn't already exist. This presents issues for setting those cvars via startup configs of course, and autocvars are easier but I suppose they don't get any flags (which are ignored anyway, of course). */ - -float(float,...) min = #43; /* Part of DP_QC_MINMAXBOUND*/ -float(float,...) max = #44; /* Part of DP_QC_MINMAXBOUND*/ -float(float min,float value,float max) bound = #45; /* Part of DP_QC_MINMAXBOUND*/ -float(float,float) pow = #46; /* Part of DP_QC_SINCOSSQRTPOW*/ -void(entity src, entity dst) copyentity = #47; /* Part of DP_QC_COPYENTITY - Copies all entity fields from one entity into another (forgetting any that were previously set on the destination). */ - -filestream(string filename, float mode) fopen = #48; /* Part of FRIK_FILE*/ -void(filestream fhandle) fclose = #49; /* Part of FRIK_FILE*/ -string(filestream fhandle) fgets = #50; /* Part of FRIK_FILE*/ -void(filestream fhandle, string s) fputs = #51; /* Part of FRIK_FILE*/ -float(string) strlen = #52; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ -string(string, optional string, optional string, optional string, optional string, optional string, optional string, optional string) strcat = #53; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ -string(string s, float start, float length) substring = #54; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ -vector(string) stov = #55; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ -FTEDEP("Redundant") string(string) strzone = #56; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS - Exists in FTE for compat only, no different from strcat. */ - -FTEDEP("Redundant") void(string) strunzone = #57; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS - Exists in FTE for compat only, does nothing. */ - -float(string) tokenize = #58; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND - Splits up the given string into its different components (what constitutes a token separator is not well defined and has been hacked about with over the years so have fun with that), returning the number of tokens that were found. Call argv(0 through ret-1) to retrieve each individual token. Take care to not use this recursively. */ - -string(float) argv = #59; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND - Returns one of the tokens found via tokenize (and equivelent builtins). */ - -float() isserver = #60; /* - Returns true if the local engine is running a server, and thus cvars and localcmds are shared with said server. */ - -float() clientcount = #61; /* - Returns the maximum number of players on the server. Useless if its a remote server, so its a kinda useless builtin really. */ - -float() clientstate = #62; /* - Tells you whether the client is actually connected to anything. 0 for a dedicated server (but dedicated servers don't normally run menuqc anyway), 2 if connecting or connected to a server (but not necessarily spawned+active), 1 for sitting around idle without trying to connect to anything yet. */ - -void(string map) changelevel = #64; /* - Not really any different from a localcmd, but with proper string escapes. */ - -void(string sample, optional float channel, optional float volume) localsound = #65; /* - Plays a sound, locally. precaching is optional, but recommended. */ - -vector() getmousepos = #66; /* - Obsolete. Return values depend upon the current cursor mode. Implement Menu_InputEvent instead, so you can handle deltas as-is or absolutes if that's all the OS can provide. */ - -float(optional float timetype) gettime = #67; -void(string s) loadfromdata = #68; /* - Reads a set of entities from the given string. This string should have the same format as a .ent file or a saved game. Entities will be spawned as required. If you need to see the entities that were created, you should use parseentitydata instead. */ - -void(string s) loadfromfile = #69; /* - Reads a set of entities from the named file. This file should have the same format as a .ent file or a saved game. Entities will be spawned as required. If you need to see the entities that were created, you should use parseentitydata instead. */ - -float(float val, float m) mod = #70; -string(string name) cvar_string = #71; /* Part of DP_QC_CVAR_STRING - Returns the value of a cvar, as a string. */ - -FTEDEP("Call 'error' instead") void() crash = #72; /* - Demonstrates that no program is bug free. */ - -void() stackdump = #73; /* - Prints out the QC's stack, for console-based error reports. */ - -searchhandle(string pattern, enumflags:float{SB_CASEINSENSITIVE=1<<0,SB_FULLPACKAGEPATH=1<<1,SB_ALLOWDUPES=1<<2,SB_FORCESEARCH=1<<3,SB_MULTISEARCH=1<<4,SB_NAMESORT=1<<5} flags, float quiet, optional string package) search_begin = #74; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE*/ -void(searchhandle handle) search_end = #75; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE*/ -float(searchhandle handle) search_getsize = #76; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE*/ -string(searchhandle handle, float num) search_getfilename = #77; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE*/ -float(entity) etof = #79; -entity(float) ftoe = #80; -float(string) validstring = #81; /* - Returns true if str isn't null. In case 'if [not](str)' was configured to test for empty instead of null. */ - -DEP float(string str) altstr_count = #82; /* - Reports how many single-quotes there were in the string, divided by 2. */ - -DEP string(string str) altstr_prepare = #83; /* - Adds markup to escape only single-quotes. Does not add any. */ - -DEP string(string str, float num) altstr_get = #84; /* - Gets the Nth single-quoted token in the input. */ - -DEP string(string str, float num, string setval) altstr_set = #85; /* - Changes the Nth single-quoted token. The setval argument must not contain any single-quotes (use altstr_prepare to ensure this). */ - -entity(entity start, .float field, float match) findflags = #87; /* Part of DP_QC_FINDFLAGS*/ -entity(.float field, float match) findchainflags = #88; /* Part of DP_QC_FINDCHAINFLAGS*/ -string(string name) cvar_defstring = #89; /* Part of DP_QC_CVAR_DEFSTRING*/ -void(entity ent, string mname) setmodel = #90; /* - Menuqc-specific version. */ - -void(string mname) precache_model = #91; /* - Menuqc-specific version. */ - -void(entity ent, vector neworg) setorigin = #92; /* - Menuqc-specific version. */ - -#endif -#if defined(CSQC) || defined(SSQC) -void(vector vang) makevectors = #1; /* - Takes an angle vector (pitch,yaw,roll) (+x=DOWN). Writes its results into v_forward, v_right, v_up vectors. */ - -void(entity e, vector o) setorigin = #2; /* - Changes e's origin to be equal to o. Also relinks collision state (as well as setting absmin+absmax), which is required after changing .solid */ - -void(entity e, string m) setmodel = #3; /* - Looks up m in the model precache list, and sets both e.model and e.modelindex to match. BSP models will set e.mins and e.maxs accordingly, other models depend upon the value of sv_gameplayfix_setmodelrealbox - for compatibility you should always call setsize after all pickups or non-bsp models. Also relinks collision state. */ - -void(entity e, vector min, vector max) setsize = #4; /* - Sets the e's mins and maxs fields. Also relinks collision state, which sets absmin and absmax too. */ - -void() breakpoint = #6; /* - Trigger a debugging event. FTE will break into the qc debugger. Other engines may crash with a debug execption. */ - -float() random = #7; /* - Returns a random value between 0 and 1. Be warned, this builtin can return 1 in most engines, which can break arrays. */ - -void(entity e, float chan, string samp, float vol, float atten, optional float speedpct, optional float flags, optional float timeofs) sound = #8; /* - Starts a sound centered upon the given entity. - chan is the entity sound channel to use, channel 0 will allow you to mix many samples at once, others will replace the old sample - 'samp' must have been precached first - if specified, 'speedpct' should normally be around 100 (or =0), 200 for double speed or 50 for half speed. - If flags is specified, the reliable flag in the channels argument is used for additional channels. Flags should be made from SOUNDFLAG_* constants - timeofs should be negative in order to provide a delay before the sound actually starts. */ - -vector(vector v) normalize = #9; /* - Shorten or lengthen a direction vector such that it is only one quake unit long. */ - -void(string e) error = #10; /* - Ends the game with an easily readable error message. */ - -void(string e) objerror = #11; /* - Displays a non-fatal easily readable error message concerning the self entity, including a field dump. self will be removed! */ - -float(vector v) vlen = #12; /* - Returns the square root of the dotproduct of a vector with itself. Or in other words the length of a distance vector, in quake units. */ - -float(vector v, optional entity reference) vectoyaw = #13; /* - Given a direction vector, returns the yaw angle in which that direction vector points. If an entity is passed, the yaw angle will be relative to that entity's gravity direction. */ - -entity() spawn = #14; /* - Adds a brand new entity into the world! Hurrah, you're now a parent! */ - -void(entity e) remove = #15; /* - Destroys the given entity and clears some limited fields (including model, modelindex, solid, classname). Any references to the entity following the call are an error. After half a second the entity will be reused, in the interim you can unfortunatly still read its fields to see if the reference is no longer valid. */ - -#endif -void(entity e) removeinstant = #0:removeinstant; /* - Same thing as the regular remove builtin, but bypasses the half-second rule. The entity slot may be reused instantly. Be CERTAIN that you have no lingering references, because if they're followed they will end up poking an entirely different type of entity! So only use this where you're sure its safe. */ - -#if defined(CSQC) || defined(SSQC) -void(vector v1, vector v2, float flags, entity ent) traceline = #16; /* - Traces a thin line through the world from v1 towards v2. - Will not collide with ent, ent.owner, or any entity who's owner field refers to ent. - The passed entity will also be used to determine whether to use a capsule trace, the contents that the trace should impact, and a couple of other extra fields that define the trace. - There are no side effects beyond the trace_* globals being written. - flags&MOVE_NOMONSTERS will not impact on non-bsp entities. - flags&MOVE_MISSILE will impact with increased size. - flags&MOVE_HITMODEL will impact upon model meshes, instead of their bounding boxes. - flags&MOVE_TRIGGERS will also stop on triggers - flags&MOVE_EVERYTHING will stop if it hits anything, even non-solid entities. - flags&MOVE_LAGGED will backdate entity positions for the purposes of this builtin according to the indicated player ent's latency, to provide lag compensation. */ - -#endif -#ifdef SSQC -entity() checkclient = #17; /* - Returns one of the player entities. The returned player will change periodically. */ - -#endif -#if defined(CSQC) || defined(SSQC) -entity(entity start, .string fld, string match) find = #18; /* - Scan for the next entity with a given field set to the given 'match' value. start should be either world, or the previous entity that was found. Returns world on failure/if there are no more. - If you have many many entities then you may find that hashtables will give more performance (but requires extra upkeep). */ - -#endif -entity*(.__variant fld, __variant match, int type=EV_STRING, __out int count) find_list = #0:find_list; /* - Scan for the next entity with a given field set to the given 'match' value. start should be either world, or the previous entity that was found. Returns world on failure/if there are no more. - If you have many many entities then you may find that hashtables will give more performance (but requires extra upkeep). */ - -#if defined(CSQC) || defined(SSQC) -string(string s) precache_sound = #19; /* - Precaches a sound, making it known to clients and loading it from disk. This builtin (strongly) should be called during spawn functions. This builtin must be called for the sound before the sound builtin is called, or it might not even be heard. */ - -string(string s) precache_model = #20; /* - Precaches a model, making it known to clients and loading it from disk if it has a .bsp extension. This builtin (strongly) should be called during spawn functions. This must be called for each model name before setmodel may use that model name. - Modelindicies precached in SSQC will always be positive. CSQC precaches will be negative if they are not also on the server. */ - -#endif -#ifdef SSQC -void(entity client, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7) stuffcmd = #21; /* - Sends a console command (or cvar) to the client, where it will be executed. Different clients support different commands. Do NOT forget the final \n. - This builtin is generally considered evil. */ - -void(entity client, float flags, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6) stuffcmdflags = #0:stuffcmdflags; /* Part of FTE_QC_STUFFCMDFLAGS - Sends a console command (or cvar) to the client, where it will be executed. Different clients support different commands. Do NOT forget the final \n. - This (just as evil) variant allows specifying some flags too. See the STUFFCMD_* constants. */ - -#endif -#if defined(CSQC) || defined(SSQC) -entity(vector org, float rad, optional .entity chainfield) findradius = #22; /* - Finds all entities within a distance of the 'org' specified. One entity is returned directly, while other entities are returned via that entity's .chain field. Use findradius_list for an updated alternative without reenterancy issues. */ - -entity*(vector org, float rad, __out int foundcount, int sort=0) findradius_list = #0:findradius_list; /* - Finds all entities linked with a bbox within a distance of the 'org' specified, returning the list as a temp-array (world signifies the end). Unlike findradius, sv_gameplayfix_blowupfallenzombies is ignored (use FL_FINDABLE_NONSOLID instead), while sv_gameplayfix_findradiusdistancetobox and dpcompat_findradiusarealinks are force-enabled. The resulting buffer will automatically be cleaned up by the engine and does not need to be freed. */ - -#endif -#if defined(NQSSQC) -void(string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7, optional string s8) bprint = #23; /* - NQ: Concatenates all arguments, and prints the messsage on the console of all connected clients. */ - -#endif -#if defined(QWSSQC) -void(float msglvl, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7) bprint = #23; /* - QW: Concatenates all string arguments, and prints the messsage on the console of only all clients who's 'msg' infokey is set lower or equal to the supplied 'msglvl' argument. */ - -#endif -#if defined(NQSSQC) -void(entity client, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7) sprint = #24; /* - NQ: Concatenates all string arguments, and prints the messsage on the named client's console */ - -#endif -#if defined(QWSSQC) -void(entity client, float msglvl, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6) sprint = #24; /* - QW: Concatenates all string arguments, and prints the messsage on the named client's console, but only if that client's 'msg' infokey is set lower or equal to the supplied 'msglvl' argument. */ - -#endif -#if defined(CSQC) || defined(NQSSQC) -void(string s, ...) dprint = #25; /* - NQ: Prints the given message on the server's console, but only if the developer cvar is set. Arguments will be concatenated into a single message. */ - -#endif -#if defined(CSQC) || defined(QWSSQC) -void(string s, ...) dprint = #25; /* - QW: Unconditionally prints the given message on the server's console. Arguments will be concatenated into a single message. */ - -#endif -#if defined(CSQC) || defined(SSQC) -string(float val) ftos = #26; /* - Returns a tempstring containing a representation of the given float. Precision depends upon engine. */ - -string(vector val) vtos = #27; /* - Returns a tempstring containing a representation of the given vector. Precision depends upon engine. */ - -void() coredump = #28; /* - Writes out a coredump. This contains stack, globals, and field info for all ents. This can be handy for debugging. */ - -void() traceon = #29; /* - Enables tracing. This may be spammy, slow, and stuff. Set debugger 1 in order to use fte's qc debugger. */ - -void() traceoff = #30; /* - Disables tracing again. */ - -void(entity e) eprint = #31; /* - Debugging builtin that prints all fields of the given entity to the console. */ - -float(float yaw, float dist, optional float settraceglobals) walkmove = #32; /* - Attempt to walk the entity at a given angle for a given distance. - if settraceglobals is set, the trace_* globals will be set, showing the results of the movement. - This function will trigger touch events. */ - -float() droptofloor = #34; /* - Instantly moves the entity downwards until it hits the ground. If the entity is in solid or would need to drop more than 'pr_droptofloorunits' quake units, its position will be considered invalid and the builtin will abort, returning FALSE, otherwise TRUE. */ - -void(float lightstyle, string stylestring, optional vector rgb) lightstyle = #35; /* - Specifies an auto-animating string that specifies the light intensity for entities using that lightstyle. - a is off, z is fully lit. Should be lower case only. - rgb will recolour all lights using that lightstyle. */ - -float(float) rint = #36; /* - Rounds the given float up or down to the closest integeral value. X.5 rounds away from 0 */ - -float(float) floor = #37; /* - Rounds the given float downwards, even when negative. */ - -float(float) ceil = #38; /* - Rounds the given float upwards, even when negative. */ - -float(entity ent) checkbottom = #40; /* - Expensive checks to ensure that the entity is actually sitting on something solid, returns true if it is. */ - -float(vector pos) pointcontents = #41; /* - Checks the given point to see what is there. Returns one of the CONTENTS_* constants. Just because a point is empty does not mean that the player can stand there due to the size of the player - use tracebox for such tests. */ - -__uint(vector pos, optional float worldonly=1) pointcontentsmask = #0:pointcontentsmask; /* - Checks the given point to see what is there. Returns a mask of the CONTENTBIT_* constants. Just because a point is empty does not mean that the player can stand there due to the size of the player - use tracebox for such tests. */ - -float(float) fabs = #43; /* - Removes the sign of the float, making it positive if it is negative. */ - -#endif -#ifdef SSQC -vector(entity player, float missilespeed) aim = #44; /* - Returns a tweaked copy of the v_forward vector (must be set! ie: makevectors(player.v_angle) ). This is important for keyboard users (that don't want to have to look up/down the whole time), as well as joystick users (who's aim is otherwise annoyingly imprecise). Only the upwards component of the result will differ from the value of v_forward. The builtin will select the enemy closest to the crosshair within the angle of acos(sv_aim). */ - -#endif -#if defined(CSQC) || defined(SSQC) -float(string) cvar = #45; /* - Returns the numeric value of the named cvar */ - -void(string, ...) localcmd = #46; /* - Adds the string to the console command queue. Commands will not be executed immediately, but rather at the start of the following frame. */ - -entity(entity) nextent = #47; /* - Returns the following entity. Skips over removed entities. Returns world when passed the last valid entity. */ - -void(vector pos, vector dir, float colour, float count) particle = #48; /* - Spawn 'count' particles around 'pos' moving in the direction 'dir', with a palette colour index between 'colour' and 'colour+8'. */ - -#define ChangeYaw changeyaw -void() changeyaw = #49; /* - Changes the self.angles_y field towards self.ideal_yaw by up to self.yaw_speed. */ - -vector(vector fwd, optional vector up) vectoangles = #51; /* - Returns the angles (+x=UP) required to orient an entity to look in the given direction. The 'up' argument is required if you wish to set a roll angle, otherwise it will be limited to just monster-style turning. */ - -#endif -#ifdef SSQC -void(float to, float val) WriteByte = #52; /* - Writes a single byte into a network message buffer. Typically you will find a more correct alternative to writing arbitary data. 'to' should be one of the MSG_* constants. MSG_ONE must have msg_entity set first. */ - -void(float to, float val) WriteChar = #53; /* - Writes a signed value between -128 and 127. */ - -void(float to, float val) WriteShort = #54; /* - Writes a signed value between -32768 and 32767. As an exception, values up to 65535 will not trigger warnings (but readshort will read the result as negative!) */ - -void(float to, float val) WriteLong = #55; /* - Writes a signed 32bit integer. Note that the input argument being of float type limits the resulting integer to a mere 24 consecutive bits of validity. Use WriteInt if you want to write an entire 32bit int without data loss. */ - -void(float to, float val) WriteCoord = #56; /* - Writes a single value suitable for a map coordinate axis. The precision is not strictly specified but is assumed to be of at least 13.3 fixed-point precision (ie: +/-4k with 1/8th precision). */ - -void(float to, float val) WriteAngle = #57; /* - Writes a single value suitable for an angle axis. The precision is not strictly specified but is assumed to be 8bit, giving 256 notches instead of the assumed 360 range passed in. */ - -void(float to, string val) WriteString = #58; /* - Writes a variable-length null terminated string. There are length limits. The codepage is not translated, so be sure that client+server agree on whether utf-8 is being used or not (or just stick to ascii+markup). */ - -void(float to, entity val) WriteEntity = #59; /* - Writes the index of the specified entity (the network data size is not specified). This can be read clientside using the readentitynum builtin, with caveats. */ - -#endif -#if defined(CSQC) || defined(SSQC) -float(float angle) sin = #60; /* Part of DP_QC_SINCOSSQRTPOW - Forgive me father, for I have trigonometry homework. */ - -float(float angle) cos = #61; /* Part of DP_QC_SINCOSSQRTPOW*/ -float(float value) sqrt = #62; /* Part of DP_QC_SINCOSSQRTPOW*/ -#endif -#ifdef SSQC -float(float a, float n) modulo = #0:modulo; -#endif -#if defined(CSQC) || defined(SSQC) -void(entity ent) changepitch = #63; /* Part of DP_QC_CHANGEPITCH*/ -void(entity ent, entity ignore) tracetoss = #64; -string(entity ent) etos = #65; /* Part of DP_QC_ETOS*/ -void(float step) movetogoal = #67; /* - Runs lots and lots of fancy logic in order to try to step the entity the specified distance towards its goalentity. */ - -string(string s) precache_file = #68; /* - This builtin does nothing. It was used only as a hint for pak generation. */ - -void(entity e) makestatic = #69; /* - Sends a copy of the entity's renderable fields to all clients, and REMOVES the entity, preventing further changes. This means it will be unmutable and non-solid. */ - -#endif -#ifdef SSQC -void(string mapname, optional string newmapstartspot) changelevel = #70; /* - Attempts to change the map to the named map. If 'newmapstartspot' is specified, the state of the current map will be preserved, and the argument will be passed to the next map in the 'startspot' global, and the next map will be loaded from archived state if it was previously visited. If not specified, all archived map states will be purged. */ - -#endif -#if defined(CSQC) || defined(SSQC) -void(string cvarname, string valuetoset) cvar_set = #72; /* - Instantly sets a cvar to the given string value. Warning: the resulting string includes apostrophies surrounding the result. You may wish to use sprintf instead. */ - -#endif -#ifdef SSQC -void(entity ent, string text, optional string text2, optional string text3, optional string text4, optional string text5, optional string text6, optional string text7) centerprint = #73; -#endif -#if defined(CSQC) || defined(SSQC) -void (vector pos, string samp, float vol, float atten) ambientsound = #74; -string(string str) precache_model2 = #75; -string(string str) precache_sound2 = #76; -string(string str) precache_file2 = #77; -#endif -#ifdef SSQC -void(entity player) setspawnparms = #78; -float() ex_finaleFinished = #0:ex_finaleFinished; /* - Behaviour is undocumented. */ - -void(entity client, string sample) ex_localsound = #0:ex_localsound; /* - Behaviour is undocumented. */ - -void(entity ent, string text, optional string s0, optional string s1, optional string s2, optional string s3, optional string s4, optional string s5) ex_centerprint = #0:ex_centerprint; /* - Remaster: Sends the strings to the client, which will order according to {#}. Also substitutes localised strings for $NAME strings. */ - -void(string s, optional string s0, optional string s1, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6) ex_bprint = #0:ex_bprint; /* - Remaster: Sends the strings to all clients, which will order them according to {#}. Also substitutes localised strings for $NAME strings. */ - -void(entity client, string s, optional string s0, optional string s1, optional string s2, optional string s3, optional string s4, optional string s5) ex_sprint = #0:ex_sprint; /* - Remaster: Sends the strings to the client, which will order according to {#}. Also substitutes localised strings for $NAME strings. */ - -float(entity playerEnt) ex_CheckPlayerEXFlags = #0:ex_CheckPlayerEXFlags; /* - Behaviour is undocumented. */ - -void(entity killer, entity killee) logfrag = #79; /* Part of QW_ENGINE*/ -#endif -#if defined(CSQC) || defined(SSQC) -string(entity e, string key) infokey = #80; /* Part of FTE_QC_INFOKEY, QW_ENGINE - If e is world, returns the field 'key' from either the serverinfo or the localinfo. If e is a player, returns the value of 'key' from the player's userinfo string. There are a few special exceptions, like 'ip' which is not technically part of the userinfo. */ - -#endif -#ifdef SSQC -float(entity e, string key) infokeyf = #0:infokeyf; /* - Identical to regular infokey, except returns a float. */ - -int(entity e, string key, optional void *outbuf, int outbufsize) infokey_blob = #0:infokey_blob; /* - Retrieves a user's blob size, and optionally writes it to the specified buffer. */ - -#endif -#if defined(CSQC) || defined(SSQC) -float(string) stof = #81; /* Part of FRIK_FILE, FTE_QC_INFOKEY, FTE_STRINGS, QW_ENGINE, ZQ_QC_STRINGS*/ -#endif -#ifdef SSQC -#define unicast(pl,reli) do{msg_entity = pl; multicast('0 0 0', reli?MULITCAST_ONE_R:MULTICAST_ONE);}while(0) -void(vector where, float set) multicast = #82; /* Part of EXT_CSQC, FTE_QC_MULTICAST - Once the MSG_MULTICAST network message buffer has been filled with data, this builtin is used to dispatch it to the given target, filtering by pvs for reduced network bandwidth. */ - -DEP void(entity to, string str) redirectcmd = #101; /* Part of ??MVDSV_BUILTINS - Executes a single console command, and sends the text generated by it to the specified player. The command will be executed at the end of the frame once QC is no longer running - you may wish to pre/postfix it with 'echo'. */ - -#endif -#if defined(CSQC) || defined(SSQC) -string(float style, optional __out vector rgb) getlightstyle = #0:getlightstyle; /* - Obtains the light style string for the given style. */ - -vector(float style) getlightstylergb = #0:getlightstylergb; /* - Obtains the current rgb value of the specified light style. In csqc, this is correct with regard to the current frame, while ssqc gives no guarentees about time and ignores client cvars. Note: use getlight if you want the actual light value at a point. */ - -#endif -#ifdef SSQC -void(float style, float val, optional vector rgb) lightstylestatic = #5; /* - Sets the lightstyle to an explicit numerical level. From Hexen2. */ - -#endif -#if defined(CSQC) || defined(SSQC) -void(vector start, vector mins, vector maxs, vector end, float nomonsters, entity ent) tracebox = #90; /* Part of DP_QC_TRACEBOX - Exactly like traceline, but a box instead of a uselessly thin point. Acceptable sizes are limited by bsp format, q1bsp has strict acceptable size values. */ - -vector() randomvec = #91; /* Part of DP_QC_RANDOMVEC - Returns a vector with random values. Each axis is independantly a value between -1 and 1 inclusive. */ - -vector(vector org) getlight = #92; /* Part of DP_QC_GETLIGHT*/ -float(string cvarname, string defaultvalue) registercvar = #93; /* Part of DP_REGISTERCVAR - Creates a new cvar on the fly. If it does not already exist, it will be given the specified value. If it does exist, this is a no-op. - This builtin has the limitation that it does not apply to configs or commandlines. Such configs will need to use the set or seta command causing this builtin to be a noop. - In engines that support it, you will generally find the autocvar feature easier and more efficient to use. */ - -float(float a, float b, ...) min = #94; /* Part of DP_QC_MINMAXBOUND - Returns the lowest value of its arguments. */ - -float(float a, float b, ...) max = #95; /* Part of DP_QC_MINMAXBOUND - Returns the highest value of its arguments. */ - -float(float minimum, float val, float maximum) bound = #96; /* Part of DP_QC_MINMAXBOUND - Returns val, unless minimum is higher, or maximum is less. */ - -float(float value, float exp) pow = #97; /* Part of DP_QC_SINCOSSQRTPOW*/ -#endif -float(float v, optional float base) logarithm = #0:logarithm; /* - Determines the logarithm of the input value according to the specified base. This can be used to calculate how much something was shifted by. */ - -#if defined(CSQC) || defined(SSQC) -#define findentity findfloat -entity(entity start, .__variant fld, __variant match) findfloat = #98; /* Part of DP_QC_FINDFLOAT - Equivelent to the find builtin, but instead of comparing strings contents, this builtin compares the raw values. This builtin requires multiple calls in order to scan all entities - set start to the previous call's return value. - world is returned when there are no more entities. */ - -float(string extname) checkextension = #99; /* - Checks for an extension by its name (eg: checkextension("FRIK_FILE") says that its okay to go ahead and use strcat). - Use cvar("pr_checkextension") to see if this builtin exists. */ - -#endif -float(__variant funcref) checkbuiltin = #0:checkbuiltin; /* - Checks to see if the specified builtin is supported/mapped. This is intended as a way to check for #0 functions, allowing for simple single-builtin functions. Warning, if two different engines map different builtins to the same number, then this function will not tell you which will be called, only that it won't crash (the exception being #0, which are remapped as available). */ - -#ifdef SSQC -float(string builtinname) builtin_find = #100; /* - Looks to see if the named builtin is valid, and returns the builtin number it exists at. */ - -#endif -#if defined(CSQC) || defined(SSQC) -float(float value) anglemod = #102; -float(float newangle, float oldangle) anglesub = #0:anglesub; /* - Returns newangle-oldangle, except returning the shortest route around a circle so yields a result between -180 and +180. */ - -#endif -#ifdef SSQC -DEP_CSQC void(string slot, string picname, float x, float y, float zone, optional entity player) showpic = #104; /* Part of TEI_SHOWLMP2*/ -DEP_CSQC void(string slot, optional entity player) hidepic = #105; /* Part of TEI_SHOWLMP2*/ -DEP_CSQC void(string slot, float x, float y, float zone, optional entity player) movepic = #106; /* Part of TEI_SHOWLMP2*/ -DEP_CSQC void(string slot, string picname, optional entity player) changepic = #107; /* Part of TEI_SHOWLMP2*/ -#endif -#if defined(CSQC) || defined(SSQC) -filestream(string filename, float mode, optional float mmapminsize) fopen = #110; /* Part of FRIK_FILE - Opens a file, typically prefixed with "data/", for either read or write access. */ - -void(filestream fhandle) fclose = #111; /* Part of FRIK_FILE*/ -string(filestream fhandle) fgets = #112; /* Part of FRIK_FILE - Reads a single line out of the file. The new line character is not returned as part of the string. Returns the null string on EOF (use if not(string) to easily test for this, which distinguishes it from the empty string which is returned if the line being read is blank */ - -void(filestream fhandle, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7) fputs = #113; /* Part of FRIK_FILE - Writes the given string(s) into the file. For compatibility with fgets, you should ensure that the string is terminated with a \n - this will not otherwise be done for you. It is up to the engine whether dos or unix line endings are actually written. */ - -#endif -int(filestream fhandle, void *ptr, int size) fread = #0:fread; /* Part of FTE_QC_FILE_BINARY - Reads binary data out of the file. Returns truncated lengths if the read exceeds the length of the file. */ - -int(filestream fhandle, void *ptr, int size) fwrite = #0:fwrite; /* Part of FTE_QC_FILE_BINARY - Writes binary data out of the file. */ - -#define ftell fseek //c compat -int(filestream fhandle, optional int newoffset) fseek = #0:fseek; /* Part of FTE_QC_FILE_BINARY - Changes the current position of the file, if specified. Returns prior position, in bytes. */ - -int(filestream fhandle, optional int newsize) fsize = #0:fsize; /* Part of FTE_QC_FILE_BINARY - Reports the total size of the file, in bytes. Can also be used to truncate/extend the file */ - -#if defined(CSQC) || defined(SSQC) -float(string s) strlen = #114; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ -string(string s1, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7, optional string s8) strcat = #115; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ -string(string s, float start, float length) substring = #116; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ -vector(string s) stov = #117; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ -FTEDEP("Redundant") string(string s, ...) strzone = #118; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS - Create a semi-permanent copy of a string that only becomes invalid once strunzone is called on the string (instead of when the engine assumes your string has left scope). This builtin has become redundant in FTEQW due to the FTE_QC_PERSISTENTTEMPSTRINGS extension and is now functionally identical to strcat for compatibility with old engines+mods. */ - -FTEDEP("Redundant") void(string s) strunzone = #119; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS - Destroys a string that was allocated by strunzone. Further references to the string MAY crash the game. In FTE, this function became redundant and now does nothing. */ - -#endif -void*(int bytes) createbuffer = #0:createbuffer; /* - Returns a temporary buffer that can be written to / read from. The buffer will be garbage collected and thus cannot be explicitly freed. Tempstrings and buffer references must not be stored into the buffer as the garbage collector will not scan these. */ - -#ifdef SSQC -void(string cvar, float val) cvar_setf = #176; -#endif -#if defined(CSQC) || defined(SSQC) -void(string soundname, optional float channel, optional float volume) localsound = #177; /* - Plays a sound... locally... probably best not to call this from ssqc. Also disables reverb. */ - -float(string modelname, optional float queryonly) getmodelindex = #200; /* - Acts as an alternative to precache_model(foo);setmodel(bar, foo); return bar.modelindex; - If queryonly is set and the model was not previously precached, the builtin will return 0 without needlessly precaching the model. */ - -float(string soundname, optional float queryonly) getsoundindex = #0:getsoundindex; /* - Provides a way to query if a sound is already precached or not. The return value can also be checked for <=255 to see if it'll work over any network protocol. The sound index can also be used for writebyte hacks, but this is discouraged - use SOUNDFLAG_UNICAST instead. */ - -__variant(float prnum, string funcname, ...) externcall = #201; /* Part of FTE_MULTIPROGS - Directly call a function in a different/same progs by its name. - prnum=0 is the 'default' or 'main' progs. - prnum=-1 means current progs. - prnum=-2 will scan through the active progs and will use the first it finds. */ - -float(string progsname) addprogs = #202; /* Part of FTE_MULTIPROGS - Loads an additional .dat file into the current qcvm. The returned handle can be used with any of the externcall/externset/externvalue builtins. - There are cvars that allow progs to be loaded automatically. */ - -__variant(float prnum, string varname) externvalue = #203; /* Part of FTE_MULTIPROGS - Reads a global in the named progs by the name of that global. - prnum=0 is the 'default' or 'main' progs. - prnum=-1 means current progs. - prnum=-2 will scan through the active progs and will use the first it finds. */ - -void(float prnum, __variant newval, string varname) externset = #204; /* Part of FTE_MULTIPROGS - Sets a global in the named progs by name. - prnum=0 is the 'default' or 'main' progs. - prnum=-1 means current progs. - prnum=-2 will scan through the active progs and will use the first it finds. */ - -void(entity portal, float state) openportal = #207; /* - Opens or closes the portals associated with a door or some such on q2 or q3 maps. On Q2BSPs, the entity should be the 'func_areaportal' entity - its style field will say which portal to open. On Q3BSPs, the entity is the door itself, the portal will be determined by the two areas found from a preceding setorigin call. */ - -#endif -#ifdef SSQC -float(float attributes, string effectname, ...) RegisterTempEnt = #208; /* Part of FTE_PEXT_CUSTOMTENTS*/ -void(float type, vector pos, ...) CustomTempEnt = #209; /* Part of FTE_PEXT_CUSTOMTENTS*/ -float(optional float sleeptime) fork = #210; /* Part of FTE_MULTITHREADED - When called, this builtin simply returns. Twice. - The current 'thread' will return instantly with a return value of 0. The new 'thread' will return after sleeptime seconds with a return value of 1. See documentation for the 'sleep' builtin for limitations/requirements concerning the new thread. Note that QC should probably call abort in the new thread, as otherwise the function will return to the calling qc function twice also. */ - -#endif -void(optional __variant ret) abort = #211; /* Part of FTE_MULTITHREADED - QC execution is aborted. Parent QC functions on the stack will be skipped, effectively this forces all QC functions to 'return ret' until execution returns to the engine. If ret is ommited, it is assumed to be 0. */ - -#ifdef SSQC -void(float sleeptime) sleep = #212; /* Part of FTE_MULTITHREADED - Suspends the current QC execution thread for 'sleeptime' seconds. - Other QC functions can and will be executed in the interim, including changing globals and field state (but not simultaneously). - The self and other globals will be restored when the thread wakes up (or set to world if they were removed since the thread started sleeping). Locals will be preserved, but will not be protected from remove calls. - If the engine is expecting the QC to return a value (even in the parent/root function), the value 0 shall be used instead of waiting for the qc to resume. */ - -void(entity player, string key, string value) forceinfokey = #213; /* Part of FTE_FORCEINFOKEY - Directly changes a user's info without pinging off the client. Also allows explicitly setting * keys, including *spectator. Does not affect the user's config or other servers. */ - -void(entity player, string key, void *data, int size) forceinfokeyblob = #0:forceinfokeyblob; /* Part of FTE_INFOBLOBS - Directly changes a user's info without pinging off the client. Also allows explicitly setting * keys, including *spectator. Does not affect the user's config or other servers. */ - -#endif -#if defined(CSQC) || defined(SSQC) -void(vector org, vector dmin, vector dmax, float colour, float effect, float count) particle2 = #215; /* Part of FTE_HEXEN2*/ -void(vector org, vector box, float colour, float effect, float count) particle3 = #216; /* Part of FTE_HEXEN2*/ -void(vector org, float radius, float colour, float effect, float count) particle4 = #217; /* Part of FTE_HEXEN2*/ -float(float number, float quantity) bitshift = #218; /* Part of EXT_BITSHIFT*/ -void(vector pos) te_lightningblood = #219; /* Part of FTE_TE_STANDARDEFFECTBUILTINS*/ -#endif -float(string s1, string sub, optional float startidx) strstrofs = #221; /* Part of FTE_STRINGS - Returns the 0-based offset of sub within the s1 string, or -1 if sub is not in s1. - If startidx is set, this builtin will ignore matches before that 0-based offset. */ - -float(string str, float index) str2chr = #222; /* Part of FTE_STRINGS - Retrieves the character value at offset 'index'. */ - -string(float chr, ...) chr2str = #223; /* Part of FTE_STRINGS - The input floats are considered character values, and are concatenated. */ - -string(float ccase, float redalpha, float redchars, string str, ...) strconv = #224; /* Part of FTE_STRINGS - Converts quake chars in the input string amongst different representations. - ccase specifies the new case for letters. - 0: not changed. - 1: forced to lower case. - 2: forced to upper case. - redalpha and redchars switch between colour ranges. - 0: no change. - 1: Forced white. - 2: Forced red. - 3: Forced gold(low) (numbers only). - 4: Forced gold (high) (numbers only). - 5+6: Forced to white and red alternately. - You should not use this builtin in combination with UTF-8. */ - -string(float pad, string str1, ...) strpad = #225; /* Part of FTE_STRINGS - Pads the string with spaces, to ensure its a specific length (so long as a fixed-width font is used, anyway). If pad is negative, the spaces are added on the left. If positive the padding is on the right. */ - -infostring(infostring old, string key, string value) infoadd = #226; /* Part of FTE_STRINGS - Returns a new tempstring infostring with the named value changed (or added if it was previously unspecified). Key and value may not contain the \ character. */ - -string(infostring info, string key) infoget = #227; /* Part of FTE_STRINGS - Reads a named value from an infostring. The returned value is a tempstring */ - -#define strcmp strncmp -float(string s1, string s2, optional float len, optional float s1ofs, optional float s2ofs) strncmp = #228; /* Part of FTE_STRINGS - Compares up to 'len' chars in the two strings. s1ofs allows you to treat s2 as a substring to compare against, or should be 0. - Returns 0 if the two strings are equal, a negative value if s1 appears numerically lower, and positive if s1 appears numerically higher. */ - -float(string s1, string s2) strcasecmp = #229; /* Part of FTE_STRINGS - Compares the two strings without case sensitivity. - Returns 0 if they are equal. The sign of the return value may be significant, but should not be depended upon. */ - -float(string s1, string s2, float len, optional float s1ofs, optional float s2ofs) strncasecmp = #230; /* Part of FTE_STRINGS - Compares up to 'len' chars in the two strings without case sensitivity. s1ofs allows you to treat s2 as a substring to compare against, or should be 0. - Returns 0 if they are equal. The sign of the return value may be significant, but should not be depended upon. */ - -string(string s) strtrim = #0:strtrim; /* - Trims the whitespace from the start+end of the string. */ - -#if defined(CSQC) || defined(SSQC) -__deprecated("Use strftime.") void() calltimeofday = #231; /* Part of FTE_CALLTIMEOFDAY - Asks the engine to instantly call the qc's 'timeofday' function, before returning. For compatibility with mvdsv. - timeofday should have the prototype: void(float secs, float mins, float hour, float day, float mon, float year, string strvalue) - The strftime builtin is more versatile and less weird. */ - -#endif -#ifdef SSQC -void(float num, float type, .__variant fld) clientstat = #232; /* Part of EXT_CSQC - Specifies what data to use in order to send various stats, in a client-specific way. - 'num' should be a value between 32 and 127, other values are reserved. - 'type' must be set to one of the EV_* constants, one of EV_FLOAT, EV_STRING, EV_INTEGER, EV_ENTITY. - fld must be a reference to the field used, each player will be sent only their own copy of these fields. */ - -void(float num, float type, string name) globalstat = #233; /* - Specifies what data to use in order to send various stats, in a non-client-specific way. num and type are as in clientstat, name however, is the name of the global to read in the form of a string (pass "foo"). */ - -void(float num, float type, __variant *address) pointerstat = #0:pointerstat; /* - Specifies what data to use in order to send various stats, in a non-client-specific way. num and type are as in clientstat, address however, is the address of the variable you would like to use (pass &foo). */ - -void(entity ent, vector sendflags, entity unicastplayer) setsendneeded = #0:setsendneeded; /* - Flags the entity as needing to be resent. This builtin allows for more bits than supported by the SendEntity field, as well as allows flagging sends to specific players. */ - -float(entity player) isbackbuffered = #234; /* Part of FTE_ISBACKBUFFERED - Returns if the given player's network buffer will take multiple network frames in order to clear. If this builtin returns non-zero, you should delay or reduce the amount of reliable (and also unreliable) data that you are sending to that client. */ - -#endif -#if defined(CSQC) || defined(SSQC) -void(vector angle) rotatevectorsbyangle = #235; /* - rotates the v_forward,v_right,v_up matrix by the specified angles. */ - -void(vector fwd, vector right, vector up) rotatevectorsbyvectors = #236; -float(float mdlindex, string skinname) skinforname = #237; -#endif -#if defined(CSQC) || defined(MENU) -float(string shadername, optional string defaultshader, ...) shaderforname = #238; /* Part of FTE_FORCESHADER - Caches the named shader and returns a handle to it. - If the shader could not be loaded from disk (missing file or ruleset_allow_shaders 0), it will be created from the 'defaultshader' string if specified, or a 'skin shader' default will be used. - defaultshader if not empty should include the outer {} that you would ordinarily find in a shader. */ - -#endif -#ifdef CSQC -void(string shadername, string replacement, float timeoffset) remapshader = #0:remapshader; /* - All surfaces drawn with the specified shader will instead be drawn using the specified replacement shader. Shaders can be remapped to something else later by using the same source shadername. This is mostly useful for worldmodel surfaces (eg showing which team is currently winning). Entities should generally use setcustomskin or forceshader instead. Remaps will be forgotten on vid_reload, but can be reapplied via CSQC_RendererRestarted. */ - -#endif -#if defined(CSQC) || defined(SSQC) -void(vector org, optional float count) te_bloodqw = #239; /* Part of FTE_TE_STANDARDEFFECTBUILTINS*/ -#endif -#ifdef SSQC -void(entity ent) te_muzzleflash = #0:te_muzzleflash; -#endif -#if defined(CSQC) || defined(SSQC) -float(vector viewpos, entity entity) checkpvs = #240; /* Part of FTE_QC_CHECKPVS*/ -#endif -#ifdef SSQC -entity(string match, optional float matchnum) matchclientname = #241; /* Part of FTE_QC_MATCHCLIENTNAME*/ -#endif -float(string destaddress, string content) sendpacket = #242; /* Part of FTE_QC_SENDPACKET - Sends a UDP packet to the specified destination. Note that the payload will be prefixed with four 255 bytes as a sort of security feature. */ - -#ifdef CSQC -vector(entity ent, float tagnum) rotatevectorsbytag = #244; -#endif -#if defined(CSQC) || defined(SSQC) -float(float dividend, float divisor) mod = #245; -#endif -#ifdef SSQC -float(optional string host, optional string user, optional string pass, optional string defaultdb, optional string driver) sqlconnect = #250; /* Part of FTE_SQL*/ -void(float serveridx) sqldisconnect = #251; /* Part of FTE_SQL*/ -float(float serveridx, void(float serveridx, float queryidx, float rows, float columns, float eof, float firstrow) callback, float querytype, string query) sqlopenquery = #252; /* Part of FTE_SQL*/ -void(float serveridx, float queryidx) sqlclosequery = #253; /* Part of FTE_SQL*/ -string(float serveridx, float queryidx, float row, float column) sqlreadfield = #254; /* Part of FTE_SQL*/ -string(float serveridx, optional float queryidx) sqlerror = #255; /* Part of FTE_SQL*/ -string(float serveridx, string data) sqlescape = #256; /* Part of FTE_SQL*/ -string(float serveridx) sqlversion = #257; /* Part of FTE_SQL*/ -float(float serveridx, float queryidx, float row, float column) sqlreadfloat = #258; /* Part of FTE_SQL*/ -int(float serveridx, float queryidx, float row, float column, __variant *ptr, int maxsize) sqlreadblob = #0:sqlreadblob; -string(float serveridx, __variant *ptr, int maxsize) sqlescapeblob = #0:sqlescapeblob; -#endif -typedef struct json_s *json_t; -accessor jsonnode : json_t; -jsonnode(string) json_parse = #0:json_parse; /* - Parses the given JSON string. */ - -void(jsonnode) json_free = #0:json_free; /* - Frees a json tree and all of its children. Must only be called on the root node. */ - -enum json_type_e : int -{ - JSON_TYPE_STRING, - JSON_TYPE_NUMBER, - JSON_TYPE_OBJECT, - JSON_TYPE_ARRAY, - JSON_TYPE_TRUE, - JSON_TYPE_FALSE, - JSON_TYPE_NULL -}; -json_type_e(jsonnode node) json_get_value_type = #0:json_get_value_type; /* - Get type of a JSON value. */ - -int(jsonnode node) json_get_integer = #0:json_get_integer; /* - Get an integer from a json node. */ - -float(jsonnode node) json_get_float = #0:json_get_float; /* - Get a float from a json node. */ - -string(jsonnode node) json_get_string = #0:json_get_string; /* - Get a string from a value. Returns a null string if its not a string type. */ - -jsonnode(jsonnode node, string) json_find_object_child = #0:json_find_object_child; /* - Find a child of a json object by name. Returns NULL if the handle couldn't be found. */ - -int(jsonnode node) json_get_length = #0:json_get_length; /* - Get the length of a json array or object. Returns 0 if its not an array. */ - -jsonnode(jsonnode node, int childindex) json_get_child_at_index = #0:json_get_child_at_index; /* - Get the nth child of a json array or object. Returns NULL if the index is out of range. */ - -string(jsonnode node) json_get_name = #0:json_get_name; /* - Gets the object's name (useful if you're using json_get_child_at_index to walk an object's children for whatever reason). */ - -string(string javascript) js_run_script = #0:js_run_script; /* - Runs the provided javascript snippet. This builtin functions only in emscripten builds, returning a null string on other systems (or if the script evaluates to null). */ - -#if defined(CSQC) || defined(SSQC) -int(string) stoi = #259; /* Part of FTE_QC_INTCONV - Converts the given string into a true integer. Base 8, 10, or 16 is determined based upon the format of the string. */ - -string(int) itos = #260; /* Part of FTE_QC_INTCONV - Converts the passed true integer into a base10 string. */ - -int(string) stoh = #261; /* Part of FTE_QC_INTCONV - Reads a base-16 string (with or without 0x prefix) as an integer. Bugs out if given a base 8 or base 10 string. :P */ - -string(int) htos = #262; /* Part of FTE_QC_INTCONV - Formats an integer as a base16 string, with leading 0s and no prefix. Always returns 8 characters. */ - -#endif -int(float) ftoi = #0:ftoi; /* Part of FTE_QC_INTCONV - Converts the given float into a true integer without depending on extended qcvm instructions. */ - -float(int, optional float shift, float mask=24) itof = #0:itof; /* Part of FTE_QC_INTCONV - Converts the given true integer into a float without depending on extended qcvm instructions. If shift and mask are specified then only specific parts of the integer will be cast to float. */ - -#if defined(CSQC) || defined(SSQC) -float(float modlindex, optional float useabstransforms) skel_create = #263; /* Part of FTE_CSQC_SKELETONOBJECTS - Allocates a new uninitiaised skeletal object, with enough bone info to animate the given model. - eg: self.skeletonobject = skel_create(self.modelindex); */ - -float(float skel, entity ent, float modelindex, float retainfrac, float firstbone, float lastbone, optional float addfrac) skel_build = #264; /* Part of FTE_CSQC_SKELETONOBJECTS - Animation data (according to the entity's frame info) is pulled from the specified model and blended into the specified skeletal object. - If retainfrac is set to 0 on the first call and 1 on the others, you can blend multiple animations together according to the addfrac value. The final weight should be 1. Other values will result in scaling and/or other weirdness. You can use firstbone and lastbone to update only part of the skeletal object, to allow legs to animate separately from torso, use 0 for both arguments to specify all, as bones are 1-based. */ - -typedef struct -{ - int sourcemodelindex; /*frame data will be imported from this model, bones must be compatible*/ - int reserved; - int firstbone; - int lastbone; - float prescale; /*0 destroys existing data, 1 retains it*/ - float scale[4]; /*you'll need to do lerpfrac manually*/ - int animation[4]; - float animationtime[4]; - /*halflife models*/ - float subblend[2]; - float controllers[5]; -} skelblend_t; -float(float skel, int numblends, skelblend_t *weights, int structsize) skel_build_ptr = #0:skel_build_ptr; /* - Like skel_build, but slightly simpler. */ - -float(float skel) skel_get_numbones = #265; /* Part of FTE_CSQC_SKELETONOBJECTS - Retrives the number of bones in the model. The valid range is 1<=bone<=numbones. */ - -string(float skel, float bonenum) skel_get_bonename = #266; /* Part of FTE_CSQC_SKELETONOBJECTS - Retrieves the name of the specified bone. Mostly only for debugging. */ - -float(float skel, float bonenum) skel_get_boneparent = #267; /* Part of FTE_CSQC_SKELETONOBJECTS - Retrieves which bone this bone's position is relative to. Bone 0 refers to the entity's position rather than an actual bone */ - -float(float skel, string tagname) skel_find_bone = #268; /* Part of FTE_CSQC_SKELETONOBJECTS - Finds a bone by its name, from the model that was used to create the skeletal object. */ - -vector(float skel, float bonenum) skel_get_bonerel = #269; /* Part of FTE_CSQC_SKELETONOBJECTS - Gets the bone position and orientation relative to the bone's parent. Return value is the offset, and v_forward, v_right, v_up contain the orientation. */ - -vector(float skel, float bonenum) skel_get_boneabs = #270; /* Part of FTE_CSQC_SKELETONOBJECTS - Gets the bone position and orientation relative to the entity. Return value is the offset, and v_forward, v_right, v_up contain the orientation. - Use gettaginfo for world coord+orientation. */ - -void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_set_bone = #271; /* Part of FTE_CSQC_SKELETONOBJECTS - Sets a bone position relative to its parent. If the orientation arguments are not specified, v_forward+v_right+v_up are used instead. */ - -void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_premul_bone = #272; /* Part of FTE_CSQC_SKELETONOBJECTS - Transforms a single bone by a matrix. You can use makevectors to generate a rotation matrix from an angle. */ - -void(float skel, float startbone, float endbone, vector org, optional vector fwd, optional vector right, optional vector up) skel_premul_bones = #273; /* Part of FTE_CSQC_SKELETONOBJECTS - Transforms an entire consecutive range of bones by a matrix. You can use makevectors to generate a rotation matrix from an angle, but you'll probably want to divide the angle by the number of bones. */ - -void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_postmul_bone = #0:skel_postmul_bone; /* - Transforms a single bone by a matrix. You can use makevectors to generate a rotation matrix from an angle. */ - -void(float skeldst, float skelsrc, float startbone, float entbone) skel_copybones = #274; /* Part of FTE_CSQC_SKELETONOBJECTS - Copy bone data from one skeleton directly into another. */ - -void(float skel) skel_delete = #275; /* Part of FTE_CSQC_SKELETONOBJECTS - Deletes a skeletal object. The actual delete is delayed, allowing the skeletal object to be deleted in an entity's predraw function yet still be valid by the time the addentity+renderscene builtins need it. Also uninstanciates any ragdoll currently in effect on the skeletal object. */ - -float(float modidx, string framename) frameforname = #276; /* Part of FTE_CSQC_SKELETONOBJECTS - Looks up a framegroup from a model by name, avoiding the need for hardcoding. Returns -1 on error. */ - -float(float modidx, float framenum) frameduration = #277; /* Part of FTE_CSQC_SKELETONOBJECTS - Retrieves the duration (in seconds) of the specified framegroup. */ - -float(float modidx, int actionid) frameforaction = #0:frameforaction; /* - Returns a random frame/animation for the specified mod-defined action, or -1 if no animations have the specified action. */ - -void(float modidx, float framenum, __inout float basetime, float targettime, void(float timestamp, int code, string data) callback) processmodelevents = #0:processmodelevents; /* Part of FTE_GFX_MODELEVENTS - Calls a callback for each event that has been reached. Basetime is set to targettime. */ - -float(float modidx, float framenum, __inout float basetime, float targettime, __out int code, __out string data) getnextmodelevent = #0:getnextmodelevent; /* Part of FTE_GFX_MODELEVENTS - Reports the next event within a model's animation. Returns a boolean if an event was found between basetime and targettime. Writes to basetime,code,data arguments (if an event was found, basetime is set to the event's time, otherwise to targettime). - WARNING: this builtin cannot deal with multiple events with the same timestamp (only the first will be reported). */ - -float(float modidx, float framenum, int eventidx, __out float timestamp, __out int code, __out string data) getmodeleventidx = #0:getmodeleventidx; /* Part of FTE_GFX_MODELEVENTS - Reports an indexed event within a model's animation. Writes to timestamp,code,data arguments on success. Returns false if the animation/event/model was out of range/invalid. Does not consider looping animations (retry from index 0 if it fails and you know that its a looping animation). This builtin is more annoying to use than getnextmodelevent, but can be made to deal with multiple events with the exact same timestamp. */ - -#endif -#define dotproduct(v1,v2) ((vector)(v1)*(vector)(v2)) -vector(vector v1, vector v2) crossproduct = #0:crossproduct; /* Part of FTE_QC_CROSSPRODUCT - Small helper function to calculate the crossproduct of two vectors. */ - -#if defined(CSQC) || defined(SSQC) -float(entity pusher, vector move, vector amove) pushmove = #0:pushmove; -__variant(float action, optional vector pos, optional float radius, optional float quant, ...) terrain_edit = #278; /* Part of FTE_TERRAIN_MAP - Realtime terrain editing. Actions are the TEREDIT_ constants. */ - -typedef struct -{ - string shadername; - vector planenormal; - float planedist; - vector sdir; - float sbias; - vector tdir; - float tbias; -} brushface_t; -int(float modelidx, int brushid, brushface_t *out_faces, int maxfaces, int *out_contents) brush_get = #0:brush_get; /* Part of FTE_RAW_MAP - Queries a brush's information. You must pre-allocate the face array for the builtin to write to. Return value is the number of faces retrieved, 0 on error. */ - -int(float modelidx, brushface_t *in_faces, int numfaces, int contents, optional int brushid) brush_create = #0:brush_create; /* Part of FTE_RAW_MAP - Inserts a new brush into the model. Return value is the new brush's id. */ - -void(float modelidx, int brushid) brush_delete = #0:brush_delete; /* Part of FTE_RAW_MAP - Destroys the specified brush. */ - -float(float modelid, int brushid, int faceid, float selectedstate) brush_selected = #0:brush_selected; /* Part of FTE_RAW_MAP - Allows you to easily set transient visual properties of a brush. returns old value. selectedstate=-1 changes nothing (called for its return value). */ - -int(float modelid, int brushid, int faceid, vector *points, int maxpoints) brush_getfacepoints = #0:brush_getfacepoints; /* Part of FTE_RAW_MAP - Returns the list of verticies surrounding the given face. If face is 0, returns the center of the brush (if space for 1 point) or the mins+maxs (if space for 2 points). */ - -int(int faceid, brushface_t *in_faces, int numfaces, vector *points, int maxpoints) brush_calcfacepoints = #0:brush_calcfacepoints; /* Part of FTE_RAW_MAP - Determines the points of the specified face, if the specified brush were to actually be created. */ - -int(float modelid, vector *planes, float *dists, int numplanes, int *out_brushes, int *out_faces, int maxresults) brush_findinvolume = #0:brush_findinvolume; /* Part of FTE_RAW_MAP - Allows you to easily obtain a list of brushes+faces within the given bounding region. If out_faces is not null, the same brush might be listed twice. */ - -typedef struct -{ - string shadername; - int contents; - int cpwidth; - int cpheight; - int tesswidth; - int tessheight; - vector texinfo;/*scalex,y,rot*/ -} patchinfo_t; -typedef struct -{ - vector xyz; - vector rgb; float a; - float s, t; -} patchvert_t; -#define patch_delete(modelidx,patchidx) brush_delete(modelidx,patchidx) -int(float modelidx, int patchid, patchvert_t *out_controlverts, int maxcp, patchinfo_t *out_info) patch_getcp = #0:patch_getcp; /* - Queries a patch's information. You must pre-allocate the face array for the builtin to write to. Return value is the total number of control verts that were retrieved, 0 on error. */ - -int(float modelidx, int patchid, patchvert_t *out_verts, int maxverts, __out patchinfo_t out_info) patch_getmesh = #0:patch_getmesh; /* - Queries a patch's information. You must pre-allocate the face array for the builtin to write to. Return value is the total number of control verts that were retrieved, 0 on error. */ - -int(float modelidx, int oldpatchid, patchvert_t *in_controlverts, patchinfo_t in_info) patch_create = #0:patch_create; /* - Inserts a new patch into the model. Return value is the new patch's id. */ - -typedef struct -{ - vector dest; - int linkflags; - float radius; -} nodeslist_t; -void(entity ent, vector dest, int denylinkflags, void(entity ent, vector dest, int numnodes, nodeslist_t *nodelist) callback) route_calculate = #0:route_calculate; /* - Begin calculating a route. The callback function will be called once the route has finished being calculated. The route must be memfreed once it is no longer needed. The route must be followed in reverse order (ie: the first node that must be reached is at index numnodes-1). If no route is available then the callback will be called with no nodes. */ - -void(optional entity ent, optional vector neworigin) touchtriggers = #279; /* - Triggers a touch events between self and every SOLID_TRIGGER entity that it is in contact with. This should typically just be the triggers touch functions. Also optionally updates the origin of the moved entity. */ - -#endif -#ifdef SSQC -void(float buf, float fl) WriteFloat = #280; /* - Writes a full 32bit float without any data conversions at all, for full precision. */ - -void(float buf, __double dbl) WriteDouble = #0:WriteDouble; /* - Writes a full 64bit double-precision float without any data conversions at all, for excessive precision. */ - -void(float buf, int fl) WriteInt = #0:WriteInt; /* - Writes all 4 bytes of a 32bit integer without truncating to a float first before converting back to an int (unlike WriteLong does, but otherwise equivelent). */ - -void(float buf, __int64 fl) WriteInt64 = #0:WriteInt64; /* - Writes all 8 bytes of a 64bit integer. This uses variable-length coding and will send only a single byte for any value between -64 and 63. */ - -void(float buf, __uint64 fl) WriteUInt64 = #0:WriteUInt64; /* - Writes all 8 bytes of a 64bit unsigned integer. Values between 0-127 will be sent in a single byte. */ - -#endif -#if defined(CSQC) || defined(SSQC) -float(entity skelent, string dollcmd, float animskel) skel_ragupdate = #281; /* Part of FTE_QC_RAGDOLL_WIP - Updates the skeletal object attached to the entity according to its origin and other properties. - if animskel is non-zero, the ragdoll will animate towards the bone state in the animskel skeletal object, otherwise they will pick up the model's base pose which may not give nice results. - If dollcmd is not set, the ragdoll will update (this should be done each frame). - If the doll is updated without having a valid doll, the model's default .doll will be instanciated. - commands: - doll foo.doll : sets up the entity to use the named doll file - dollstring TEXT : uses the doll file directly embedded within qc, with that extra prefix. - cleardoll : uninstanciates the doll without destroying the skeletal object. - animate 0.5 : specifies the strength of the ragdoll as a whole - animatebody somebody 0.5 : specifies the strength of the ragdoll on a specific body (0 will disable ragdoll animations on that body). - enablejoint somejoint 1 : enables (or disables) a joint. Disabling joints will allow the doll to shatter. */ - -float*(float skel) skel_mmap = #282; /* Part of FTE_QC_RAGDOLL_WIP - Map the bones in VM memory. They can then be accessed via pointers. Each bone is 12 floats, the four vectors interleaved (sadly). */ - -void(entity ent, float bonenum, vector org, optional vector angorfwd, optional vector right, optional vector up) skel_set_bone_world = #283; /* Part of FTE_QC_RAGDOLL_WIP - Sets the world position of a bone within the given entity's attached skeletal object. The world position is dependant upon the owning entity's position. If no orientation argument is specified, v_forward+v_right+v_up are used for the orientation instead. If 1 is specified, it is understood as angles. If 3 are specified, they are the forawrd/right/up vectors to use. */ - -string(float modidx, float framenum) frametoname = #284; -string(float modidx, float skin) skintoname = #285; -float(float resourcetype, float tryload, string resourcename) resourcestatus = #286; /* - resourcetype must be one of the RESTYPE_ constants. Returns one of the RESSTATE_ constants. Tryload 0 is a query only. Tryload 1 will attempt to reload the content if it was flushed. */ - -#endif -hashtable(float tabsize, optional float defaulttype) hash_createtab = #287; /* Part of FTE_QC_HASHTABLES - Creates a hash table object. - The tabsize argument is a performance hint and should generally be set to something similar to the number of entries expected, typically a power of two assumption. Too high simply wastes memory, too low results in extra string compares but no actual bugs. - defaulttype must be one of the EV_* values, if specified. - The hash table with index 0 is a game-persistant table and will NEVER be returned by this builtin (except as an error return). */ - -void(hashtable table) hash_destroytab = #288; /* Part of FTE_QC_HASHTABLES - Destroys a hash table object. */ - -void(hashtable table, string name, __variant value, optional float typeandflags) hash_add = #289; /* Part of FTE_QC_HASHTABLES - Adds the given key with the given value to the table. - If flags&HASH_REPLACE, the old value will be removed, otherwise if flags&HASH_ADD then a duplicate entry will be added with a second value (can be obtained via hash_get's index argument). - The type argument describes how the value should be stored in saved games, as well as providing constraints with the hash_get function. While you can claim that all variables are just vectors, being more precise can result in less issues with tempstrings or saved games - be sure to be explicit with EV_STRING where appropriate because tempstrings may be reclaimed before the get (especially with saved games or table 0). */ - -__variant(hashtable table, string name, optional __variant deflt, optional float requiretype, optional float index) hash_get = #290; /* Part of FTE_QC_HASHTABLES - Looks up the specified key name in the hash table. Returns deflt if the key was not found. - If requiretype is specified then the function will only consider entries of the matching type (allowing you to store both flags+strings under a single name without getting confused). - If index is specified then the function will ignore the first N entries with the same key (applicable only with entries added using HASH_ADD, not HASH_REPLACE), allowing you to store multiple entries. Keep querying higher indexes starting from 0 until it returns the deflt value. - You will usually need to cast the result of this function to a real datatype. */ - -__variant(hashtable table, string name) hash_delete = #291; /* Part of FTE_QC_HASHTABLES - removes the named key. returns the value of the object that was destroyed, or 0 on error. */ - -string(hashtable table, float idx) hash_getkey = #292; /* Part of FTE_QC_HASHTABLES - gets some random key name. add+delete can change return values of this, so don't blindly increment the key index if you're removing all. */ - -float(string name) checkcommand = #294; /* Part of FTE_QC_CHECKCOMMAND - Checks to see if the supplied name is a valid command, cvar, or alias. Returns 0 if it does not exist. */ - -string(string s) argescape = #295; /* - Marks up a string so that it can be reliably tokenized as a single argument later. */ - -#ifdef SSQC -void(string dest, string from, string cmd, string info) clusterevent = #0:clusterevent; /* - Only functions in mapcluster mode. Sends an event to whichever server the named player is on. The destination server can then dispatch the event to the client or handle it itself via the SV_ParseClusterEvent entrypoint. If dest is empty, the event is broadcast to ALL servers. If the named player can't be found, the event will be returned to this server with the cmd prefixed with 'error:'. */ - -string(entity player, optional string newnode) clustertransfer = #0:clustertransfer; /* - Only functions in mapcluster mode. Initiate transfer of the player to a different node. Can take some time. If dest is specified, returns null on error. Otherwise returns the current/new target node (or null if not transferring). */ - -#endif -#if defined(CSQC) || defined(SSQC) -float(float mdlidx) modelframecount = #0:modelframecount; /* - Retrieves the number of frames in the specified model. */ - -#endif -#if defined(CSQC) || defined(MENU) -void() clearscene = #300; /* - Forgets all rentities, polygons, and temporary dlights. Resets all view properties to their default values. */ - -#endif -#ifdef CSQC -void(float mask) addentities = #301; /* - Walks through all entities effectively doing this: - if (ent.drawmask&mask){ if (!ent.predaw()) addentity(ent); } - If mask&MASK_DELTA, non-csqc entities, particles, and related effects will also be added to the rentity list. - If mask&MASK_STDVIEWMODEL then the default view model will also be added. */ - -#endif -#if defined(CSQC) || defined(MENU) -void(entity ent) addentity = #302; /* - Copies the entity fields into a new rentity for later rendering via addscene. */ - -void(entity ent, vector lightdir, vector lightavg, vector lightrange, int reserved1=0,void*reserved2=0) addentity_lighting = #0:addentity_lighting; /* - Copies the entity fields into a new rentity for later rendering via addscene, but with explicit lighting info. */ - -#endif -#ifdef CSQC -void(entity ent) removeentity = #0:removeentity; /* - Undoes all addentities added to the scene from the given entity, without removing ALL entities (useful for splitscreen/etc, readd modified versions as desired). */ - -typedef float vec2[2]; -typedef float vec3[3]; -typedef float vec4[4]; -typedef struct trisoup_simple_vert_s {vec3 xyz;vec2 st;vec4 rgba;} trisoup_simple_vert_t; -void(string texturename, int flags, struct trisoup_simple_vert_s *verts, int *indexes, int numindexes) addtrisoup_simple = #0:addtrisoup_simple; /* - Adds the specified trisoup into the scene as additional geometry. This permits caching geometry to reduce builtin spam. Indexes are a triangle list (so eg quads will need 6 indicies to form two triangles). NOTE: this is not going to be a speedup over polygons if you're still generating lots of new data every frame. */ - -#endif -#if defined(CSQC) || defined(MENU) -#define setviewprop setproperty -float(float property, ...) setproperty = #303; /* - Allows you to override default view properties like viewport, fov, and whether the engine hud will be drawn. Different VF_ values have slightly different arguments, some are vectors, some floats. */ - -void() renderscene = #304; /* - Draws all entities, polygons, and particles on the rentity list (which were added via addentities or addentity), using the various view properties set via setproperty. There is no ordering dependancy. - The scene must generally be cleared again before more entities are added, as entities will persist even over to the next frame. - You may call this builtin multiple times per frame, but should only be called from CSQC_UpdateView. */ - -#endif -#ifdef CSQC -float(vector org, float radius, vector lightcolours, optional float style, optional string cubemapname, optional float pflags) dynamiclight_add = #305; /* - Adds a temporary dlight, ready to be drawn via addscene. Cubemap orientation will be read from v_forward/v_right/v_up. */ - -#endif -void(string texturename, optional float flags, optional float is2d) R_BeginPolygon = #306; /* - Specifies the shader to use for the following polygons, along with optional flags. - If is2d, the polygon will be drawn as soon as the EndPolygon call is made, rather than waiting for renderscene. This allows complex 2d effects. */ - -void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307; /* - Specifies a polygon vertex with its various properties. */ - -void() R_EndPolygon = #308; /* - Ends the current polygon. At least 3 verticies must have been specified. You do not need to call beginpolygon again if you wish to draw another polygon with the same shader. */ - -#ifdef CSQC -void(float radius, vector texcoordbias) R_EndPolygonRibbon = #0:R_EndPolygonRibbon; /* - Ends the current primitive and duplicates each vertex sideways into a ribbon. The texcoordbias will be added to each duplicated vertex allowing for regular 2d textures. At least 2 verticies must have been specified. You do not need to call beginpolygon again if you wish to draw another polygon with the same shader. */ - -#endif -#if defined(CSQC) || defined(MENU) -#define getviewprop getproperty -__variant(float property) getproperty = #309; /* - Retrieve a currently-set (typically view) property, allowing you to read the current viewport or other things. Due to cheat protection, certain values may be unretrievable. */ - -#endif -#ifdef CSQC -vector (vector v) unproject = #310; /* - Transform a 2d screen-space point (with depth) into a 3d world-space point, according the various origin+angle+fov etc settings set via setproperty. */ - -vector (vector v) project = #311; /* - Transform a 3d world-space point into a 2d screen-space point, according the various origin+angle+fov etc settings set via setproperty. */ - -#endif -#if defined(CSQC) || defined(MENU) -float(vector pos, vector size, float alignflags, string text) drawtextfield = #0:drawtextfield; /* - Draws a multi-line block of text, including word wrapping and alignment. alignflags bits are RTLB, typically 3. Returns the total number of lines. */ - -#endif -#ifdef CSQC -void(float width, vector pos1, vector pos2, vector rgb, float alpha, optional float drawflag) drawline = #315; /* - Draws a 2d line between the two 2d points. */ - -float(string name) iscachedpic = #316; /* - Checks to see if the image is currently loaded. Engines might lie, or cache between maps. */ - -string(string name, optional float flags) precache_pic = #317; /* - Forces the engine to load the named image. Flags are a bitmask of the PRECACHE_PIC_* flags. */ - -#endif -#if defined(CSQC) || defined(MENU) -void(string imagename, int width, int height, void *pixeldata, optional int datasize, optional int format) r_uploadimage = #0:r_uploadimage; /* Part of FTE_CSQC_RAWIMAGES - Updates a texture with the specified rgba data (uploading it to the gpu). Will be created if needed. If datasize is specified then the image is decoded (eg .ktx or .dds data) instead of being raw R8G8B8A data. You'll typically want shaderforname to also generate a shader to use the texture. */ - -int*(string filename, __out int width, __out int height, __out int format) r_readimage = #0:r_readimage; /* Part of FTE_CSQC_RAWIMAGES - Reads and decodes an image from disk, providing raw R8G8B8A8 pixel data. Should not be used for dds or ktx etc formats. Returns __NULL__ if the image could not be read for any reason. Use memfree to free the data once you're done with it. */ - -#endif -#ifdef CSQC -#define draw_getimagesize drawgetimagesize -vector(string picname) drawgetimagesize = #318; /* - Returns the dimensions of the named image. Images specified with .lmp should give the original .lmp's dimensions even if texture replacements use a different resolution. WARNING: this function may be slow if used without or directly after its initial precache_pic. */ - -void(string name) freepic = #319; /* - Tells the engine that the image is no longer needed. The image will appear to be new the next time its needed. */ - -string(string modelname, int frame, float frametime) spriteframe = #0:spriteframe; /* - Obtains a suitable shader name to draw a sprite's shader via drawpic/R_BeginPolygon/etc, instead of needing to create a scene. */ - -float(vector position, float character, vector size='8 8', vector rgb='1 1 1', float alpha=1, optional float drawflag=0) drawcharacter = #320; /* - Draw the given quake character at the given position. - If flag&4, the function will consider the char to be a unicode char instead (or display as a ? if outside the 32-127 range). - size should normally be something like '8 8 0'. - rgb should normally be '1 1 1' - alpha normally 1. - Software engines may assume the named defaults. - Note that ALL text may be rescaled on the X axis due to variable width fonts. The X axis may even be ignored completely. */ - -float(vector position, string text, vector size, vector rgb, float alpha, optional float drawflag) drawrawstring = #321; /* - Draws the specified string without using any markup at all, even in engines that support it. - If UTF-8 is globally enabled in the engine, then that encoding is used (without additional markup), otherwise it is raw quake chars. - Software engines may assume a size of '8 8 0', rgb='1 1 1', alpha=1, flag&3=0, but it is not an error to draw out of the screen. */ - -float(vector position, string pic, vector size, vector rgb='1 1 1', float alpha=1, optional float drawflag=0) drawpic = #322; /* - Draws an shader within the given 2d screen box. Software engines may omit support for rgb+alpha, but must support rescaling, and must clip to the screen without crashing. */ - -float(vector position, vector size, vector rgb, float alpha, optional float drawflag) drawfill = #323; /* - Draws a solid block over the given 2d box, with given colour, alpha, and blend mode (specified via flags). - flags&3=0 simple blend. - flags&3=1 additive blend */ - -void(float x, float y, float width, float height) drawsetcliparea = #324; /* - Specifies a 2d clipping region (aka: scissor test). 2d draw calls will all be clipped to this 2d box, the area outside will not be modified by any 2d draw call (even 2d polygons). */ - -void(void) drawresetcliparea = #325; /* - Reverts the scissor/clip area to the whole screen. */ - -float(vector position, string text, vector size='8 8', vector rgb='1 1 1', float alpha=1, float drawflag=0) drawstring = #326; /* - Draws a string, interpreting markup and recolouring as appropriate. */ - -float(string text, float usecolours, vector fontsize='8 8') stringwidth = #327; /* - Calculates the width of the screen in virtual pixels. If usecolours is 1, markup that does not affect the string width will be ignored. Will always be decoded as UTF-8 if UTF-8 is globally enabled. - If the char size is not specified, '8 8 0' will be assumed. */ - -void(vector pos, vector sz, string pic, vector srcpos, vector srcsz, vector rgb, float alpha, optional float drawflag) drawsubpic = #328; /* - Draws a rescaled subsection of an image to the screen. */ - -#endif -#if defined(CSQC) || defined(MENU) -void(vector pivot, vector mins, vector maxs, string pic, vector rgb, float alpha, float angle) drawrotpic = #0:drawrotpic; /* - Draws an image rotating at the pivot. To rotate in the center, use mins+maxs of half the size with mins negated. Angle is in degrees. */ - -void(vector pivot, vector mins, vector maxs, string pic, vector txmin, vector txsize, vector rgb, vector alphaandangles) drawrotsubpic = #0:drawrotsubpic; /* - Overcomplicated draw function for over complicated people. Positions follow drawrotpic, while texture coords follow drawsubpic. Due to argument count limitations in builtins, the alpha value and angles are combined into separate fields of a vector (tip: use fteqcc's [alpha, angle] feature. */ - -#endif -#ifdef CSQC -#define getstati_punf(stnum) (float)(__variant)getstati(stnum) -int(float stnum) getstati = #330; /* - Retrieves the full precision of a stat registered as EV_INTEGER. */ - -#define getstatbits getstatf -float(float stnum, optional float firstbit, optional float bitcount) getstatf = #331; /* - Retrieves the numerical value of the given EV_FLOAT stat. If firstbit and bitcount are specified, then this builtin acts as getstati combined with itof, and which should be used for STAT_ITEMS (but not other stats). */ - -string(float stnum) getstats = #332; /* - Retrieves the value of the given EV_STRING stat, as a tempstring. - Older engines may use 4 consecutive integer stats, with a limit of 15 chars (yes, really. 15.), but FTE Quake uses a separate namespace for string stats and has a much higher length limit. */ - -__variant(float playernum, float statnum, float stattype) getplayerstat = #0:getplayerstat; /* - Retrieves a specific player's stat, matching the type specified on the server. This builtin is primarily intended for mvd playback where ALL players are known. Return value matches the specified EV_ stattype. For EV_ENTITY, world will be returned if the entity is not in the pvs, use type-punning with EV_INTEGER to get the entity number if you just want to see if its set. STAT_ITEMS should be queried as an EV_INTEGER on account of runes and items2 being packed into the upper bits. */ - -void(entity e, float mdlindex) setmodelindex = #333; /* - Sets a model by precache index instead of by name. Otherwise identical to setmodel. */ - -#endif -#if defined(CSQC) || defined(SSQC) -string(float mdlindex) modelnameforindex = #334; /* - Retrieves the name of the model based upon a precache index. This can be used to reduce csqc network traffic by enabling model matching (with getmodelindex). */ - -string(float sndindex) soundnameforindex = #0:soundnameforindex; /* - Retrieves the name of the sound based upon a precache index. This can be used to reduce csqc network traffic by enabling sound matching (with getsoundindex). */ - -float(string effectname) particleeffectnum = #335; /* Part of DP_ENT_TRAILEFFECTNUM, FTE_SV_POINTPARTICLES - Precaches the named particle effect. If your effect name is of the form 'foo.bar' then particles/foo.cfg will be loaded by the client if foo.bar was not already defined. - Different engines will have different particle systems, this specifies the QC API only. */ - -void(float effectnum, entity ent, vector start, vector end) trailparticles = #336; /* Part of FTE_SV_POINTPARTICLES - Draws the given effect between the two named points. If ent is not world, distances will be cached in the entity in order to avoid framerate dependancies. The entity is not otherwise used. */ - -void(float effectnum, vector origin, optional vector dir, optional float count) pointparticles = #337; /* Part of FTE_SV_POINTPARTICLES - Spawn a load of particles from the given effect at the given point traveling or aiming along the direction specified. The number of particles are scaled by the count argument. - For regular particles, the dir vector is multiplied by the 'veladd' property (while orgadd will push the particles along it). Decals will use it as a hint to align to the correct surface. In both cases, it should normally be a unit vector, but other lengths will still work. If it has length 0 then FTE will assume downwards. */ - -#endif -#ifdef CSQC -void(string s, ...) cprint = #338; /* - Print into the center of the screen just as ssqc's centerprint would appear. */ - -#endif -#if defined(CSQC) || defined(SSQC) -void(string s, ...) print = #339; /* Part of DP_SV_PRINT - Unconditionally print on the local system's console, even in ssqc (doesn't care about the value of the developer cvar). */ - -#endif -#ifdef CSQC -string(float keynum) keynumtostring = #340; /* - Returns a hunam-readable name for the given keycode, as a tempstring. */ - -#endif -#ifdef MENU -DEP string(float keynum) keynumtostring_csqc = #340; /* - Returns a hunam-readable name for the given keycode, as a tempstring. */ - -#endif -#ifdef CSQC -float(string keyname) stringtokeynum = #341; /* - Looks up the key name in the same way that the bind command would, returning the keycode for that key. */ - -#endif -#ifdef MENU -DEP float(string keyname) stringtokeynum_csqc = #341; /* - Looks up the key name in the same way that the bind command would, returning the keycode for that key. */ - -#endif -#if defined(CSQC) || defined(MENU) -string(float keynum) getkeybind = #342; /* - Returns the current binding for the given key (returning only the command executed when no modifiers are pressed). */ - -void(float usecursor, optional string cursorimage, optional vector hotspot, optional float scale) setcursormode = #343; /* - Pass TRUE if you want the engine to release the mouse cursor (absolute input events + touchscreen mode). Pass FALSE if you want the engine to grab the cursor (relative input events + standard looking). If the image name is specified, the engine will use that image for a cursor (use an empty string to clear it again), in a way that will not conflict with the console. Images specified this way will be hardware accelerated, if supported by the platform/port. */ - -float(float effective) getcursormode = #0:getcursormode; /* - Reports the cursor mode this module previously attempted to use. If 'effective' is true, reports the cursor mode currently active (if was overriden by a different module which has precidence, for instance, or if there is only a touchscreen and no mouse). */ - -#endif -#ifdef CSQC -vector() getmousepos = #344; /* - Nasty convoluted DP extension. Typically returns deltas instead of positions. Use CSQC_InputEvent instead for such things in csqc mods. */ - -#endif -#if defined(CSQC) || defined(MENU) -void(vector newpos) setmousepos = #0:setmousepos; /* - Warps the mouse cursor to the given location. Should normally only be done following setcursormode(TRUE,...). The warp MAY be visible through *_InputEvent, but normally be seen as an IE_ABSMOUSE event anyway. Not all systems support cursor warping (or even cursors), so this is a hint only and you should not depend upon it. */ - -#endif -#ifdef CSQC -float(float inputsequencenum) getinputstate = #345; /* - Looks up an input frame from the log, setting the input_* globals accordingly. - The sequence number range used for prediction should normally be servercommandframe < sequence <= clientcommandframe. - The sequence equal to clientcommandframe will change between input frames. */ - -void(float sens) setsensitivityscaler = #346; /* - Temporarily scales the player's mouse sensitivity based upon something like zoom, avoiding potential cvar saving and thus corruption. */ - -#endif -#if defined(CSQC) || defined(SSQC) -void(entity ent) runstandardplayerphysics = #347; /* - Perform the engine's standard player movement prediction upon the given entity using the input_* globals to describe movement. */ - -#endif -#ifdef CSQC -string(float playernum, string keyname) getplayerkeyvalue = #348; /* - Look up a player's userinfo, to discover things like their name, topcolor, bottomcolor, skin, team, *ver. - Also includes scoreboard info like frags, ping, pl, userid, entertime, as well as voipspeaking and voiploudness. */ - -float(float playernum, string keyname, optional float assumevalue) getplayerkeyfloat = #0:getplayerkeyfloat; /* - Cheaper version of getplayerkeyvalue that avoids the need for so many tempstrings. */ - -int(float playernum, string keyname, optional void *outptr, int size) getplayerkeyblob = #0:getplayerkeyblob; /* Part of FTE_INFOBLOBS - Obtains a copy of the full data blob. Will write up to size bytes but return the full size. Does not null terminate (but memalloc(ret+1) will, if you want to cast the buffer to a string), and the blob may contain embedded nulls. Ignores all special keys, returning only what is actually there. */ - -#endif -#if defined(CSQC) || defined(MENU) -void(float seat, string keyname, string newvalue) setlocaluserinfo = #0:setlocaluserinfo; /* - Change a userinfo key for the specified local player seat, equivelent to the setinfo console command. The server will normally forward the setting to other clients. */ - -string(float seat, string keyname) getlocaluserinfo = #0:getlocaluserinfo; /* - Reads a local userinfo key for the specified local player seat. This is not quite the same as getplayerkeyvalue, due to latency and possible serverside filtering. */ - -void(float seat, string keyname, void *outptr, int size) setlocaluserinfoblob = #0:setlocaluserinfoblob; /* Part of FTE_INFOBLOBS - Sets the userinfo key to a blob that may contain nulls etc. Keys with a leading underscore will be visible to only the server (for user-specific binary settings). */ - -int(float seat, string keyname, void *outptr, int maxsize) getlocaluserinfoblob = #0:getlocaluserinfoblob; /* Part of FTE_INFOBLOBS - Obtains a copy of the full data blob. Will write up to size bytes but return the full size. Does not null terminate (but memalloc(ret+1) will, if you want to cast the buffer to a string), and the blob may contain embedded nulls. Ignores all special keys, returning only what is actually there. */ - -#endif -#ifdef SSQC -int(string keyname, optional void *outptr, int size) getlocalinfo = #0:getlocalinfo; /* - Obtains a copy of a data blob (with spaces) from the server's private localinfo. Will write up to size bytes and return the actual size. Does not null terminate (but memalloc(ret+1) will, if you want to cast the buffer to a string), and the blob may contain embedded nulls. Ignores all special keys, returning only what is actually there. */ - -void(string keyname, optional void *outptr, int size) setlocalinfo = #0:setlocalinfo; /* - Changes the server's private localinfo. This data will be available for the following map, and will *usually* reload with saved games. */ - -#endif -#if defined(CSQC) || defined(MENU) -float() isdemo = #349; /* - Returns if the client is currently playing a demo or not. Returns 2 when playing an mvd (where other player's stats can be queried, or the pov can be changed freely). */ - -#endif -#ifdef CSQC -float() isserver = #350; /* - Returns non-zero whenever the local console can directly affect the server (ie: listen servers or single-player). Compat note: DP returns 0 for single-player. */ - -void(vector origin, vector forward, vector right, vector up, optional float reverbtype) SetListener = #351; /* - Sets the position of the view, as far as the audio subsystem is concerned. This should be called once per CSQC_UpdateView as it will otherwise revert to default. For reverbtype, see setup_reverb or treat as 'underwater'. */ - -typedef struct { - float flDensity; - float flDiffusion; - float flGain; - float flGainHF; - float flGainLF; - float flDecayTime; - float flDecayHFRatio; - float flDecayLFRatio; - float flReflectionsGain; - float flReflectionsDelay; - vector flReflectionsPan; - float flLateReverbGain; - float flLateReverbDelay; - vector flLateReverbPan; - float flEchoTime; - float flEchoDepth; - float flModulationTime; - float flModulationDepth; - float flAirAbsorptionGainHF; - float flHFReference; - float flLFReference; - float flRoomRolloffFactor; - int iDecayHFLimit; -} reverbinfo_t; -void(float reverbslot, reverbinfo_t *reverbinfo, int sizeofreverinfo_t) setup_reverb = #0:setup_reverb; /* Part of FTE_CSQC_REVERB - Reconfigures a reverb slot for weird effects. Slot 0 is reserved for no effects. Slot 1 is reserved for underwater effects. Reserved slots will be reinitialised on snd_restart, but can otherwise be changed. These reverb slots can be activated with SetListener. Note that reverb will currently only work when using OpenAL. */ - -#endif -void(string cmdname) registercommand = #352; /* - Register the given console command, for easy console use. - Console commands that are later used will invoke CSQC_ConsoleCommand/m_consolecommand/ConsoleCmd according to module. */ - -float(entity ent) wasfreed = #353; /* - Quickly check to see if the entity is currently free. This function is only valid during the half-second non-reuse window, after that it may give bad results. Try one second to make it more robust. */ - -#if defined(CSQC) || defined(SSQC) -string(string key) serverkey = #354; /* - Look up a key in the server's public serverinfo string. If the key contains binary data then it will be truncated at the first null. */ - -float(string key, optional float assumevalue) serverkeyfloat = #0:serverkeyfloat; /* - Version of serverkey that returns the value as a float (which avoids tempstrings). */ - -int(string key, optional void *ptr, int maxsize) serverkeyblob = #0:serverkeyblob; /* Part of FTE_INFOBLOBS - Version of serverkey that returns data as a blob (ie: binary data that may contain nulls). Returns the full blob size, even if truncated (pass maxsize=0 to query required storage). */ - -#endif -#ifdef SSQC -void(string key, void *ptr, optional int size) setserverkey = #0:setserverkey; /* - Changes the server's serverinfo. */ - -#endif -#ifdef CSQC -string(optional string resetstring) getentitytoken = #355; /* - Grab the next token in the map's entity lump. - If resetstring is not specified, the next token will be returned with no other sideeffects. - If empty, will reset from the map before returning the first token, probably {. - If not empty, will tokenize from that string instead. - Always returns tempstrings. */ - -#endif -#if defined(CSQC) || defined(MENU) -float(string s) findfont = #356; /* Part of DP_GFX_FONTS - Looks up a named font slot. Matches the actual font name as a last resort. */ - -float(string fontname, string fontmaps, string sizes, float slot, optional float fix_scale, optional float fix_voffset) loadfont = #357; /* Part of DP_GFX_FONTS - too convoluted for me to even try to explain correct usage. Try drawfont = loadfont("", "cour", "16", -1, 0, 0); to switch to the courier font (optimised for 16 virtual pixels high) ('cour' requires mscorefonts installed in linux). Additionally you can add "outline=1" as an extra token in the sizes string, to have more readable outlined fonts. */ - -#endif -#ifdef CSQC -void(string evname, string evargs, ...) sendevent = #359; /* - Invoke CSEv_evname_evargs in ssqc. evargs must be a string of initials refering to the types of the arguments to pass. v=vector, e=entity(.entnum field is sent), f=float, i=int. 6 arguments max - you can get more if you pack your floats into vectors. */ - -float() readbyte = #360; /* - Reads an unsigned 8-bit value, pair with WriteByte. */ - -float() readchar = #361; /* - Reads a signed 8-bit value. Paired with WriteChar. */ - -float() readshort = #362; /* - Reads a signed 16-bit value. Paired with WriteShort. */ - -float() readlong = #363; /* - Reads a signed 32-bit value. Paired with WriteLong or WriteInt. */ - -float() readcoord = #364; /* - Reads a value matching the unspecified precision written ONLY by WriteCoord. */ - -float() readangle = #365; /* - Reads a value matching the unspecified precision written ONLY by WriteAngle. */ - -string() readstring = #366; /* - Reads a null-terminated string. */ - -float() readfloat = #367; /* - Reads a float without any truncation nor conversions. Data MUST have originally been written with WriteFloat. */ - -__double() readdouble = #0:readdouble; /* - Reads a double-precision float without any truncation nor conversions. Data MUST have originally been written with WriteDouble. */ - -int() readint = #0:readint; /* - Reads a 32bit int without any conversions to float, otherwise interchangable with readlong. */ - -__int64() readint64 = #0:readint64; /* - Reads a 64bit signed int. Paired with WriteInt64. */ - -__uint64() readuint64 = #0:readuint64; /* - Reads a 64bit unsigned int. Paired with WriteUInt64. */ - -float() readentitynum = #368; /* - Reads the serverside index of an entity, paired with WriteEntity. There may be nothing else known about the entity yet, so the result typically needs to be saved as-is and re-looked up each frame. This can be done via getentity(NUM, GE_*) for non-csqc ents, or findentity(world,entnum,NUM) - both of which can fail due to latency. */ - -float(string modelname, float(float isnew) updatecallback, float flags) deltalisten = #371; /* - Specifies a per-modelindex callback to listen for engine-networking entity updates. Such entities are automatically interpolated by the engine (unless flags specifies not to). - The various standard entity fields will be overwritten each frame before the updatecallback function is called. */ - -float(vector org, float radius, vector rgb) dynamiclight_spawnstatic = #0:dynamiclight_spawnstatic; /* - Creates a static persistent light at the given position with the specified colour. Additional properties must be set via dynamiclight_set. */ - -__variant(float lno, float fld) dynamiclight_get = #372; /* - Retrieves a property from the given dynamic/rt light. Return type depends upon the light field requested. */ - -void(float lno, float fld, __variant value) dynamiclight_set = #373; /* - Changes a property on the given dynamic/rt light. Value type depends upon the light field to be changed. */ - -string(float efnum, float body) particleeffectquery = #374; /* - Retrieves either the name or the body of the effect with the given number. The effect body is regenerated from internal state, and can be changed before being reapplied via the localcmd builtin. */ - -void(string shadername, vector origin, vector up, vector side, vector rgb, float alpha) adddecal = #375; /* - Adds a temporary clipped decal shader to the scene, centered at the given point with given orientation. Will be drawn by the next renderscene call, and freed by the next clearscene call. */ - -#endif -#if defined(CSQC) || defined(MENU) -void(entity e, string skinfilename, optional string skindata) setcustomskin = #376; /* Part of FTE_QC_CUSTOMSKINS - Sets an entity's skin overrides to a new skin object. Releases the entities old skin (refcounted). */ - -#endif -#ifdef CSQC -float(string skinfilename, optional string skindata) loadcustomskin = #377; /* Part of FTE_QC_CUSTOMSKINS - Creates a new skin object and returns it. These are custom per-entity surface->shader lookups. The skinfilename/data should be in .skin format: - surfacename,shadername - makes the named surface use the named shader (legacy format for compat with q3) - replace "surfacename" "shadername" - non-legacy equivalent. - qwskin "foo" - use an unmodified quakeworld player skin (including crop+repalette rules) - q1lower 0xff0000 - specify an override for the entity's lower colour, in this case to red - q1upper 0x0000ff - specify an override for the entity's lower colour, in this case to blue - compose "surfacename" "shader" "imagename@x,y:w,h$s,t,s2,t2?r,g,b,a" - compose a skin texture from multiple images. - The texture is determined to be sufficient to hold the first named image, additional images can be named as extra tokens on the same line. - Use a + at the end of the line to continue reading image tokens from the next line also, the named shader must use 'map $diffuse' to read the composed texture (compatible with the defaultskin shader). Must be matched with a releasecustomskin call later, and is pointless without applycustomskin. */ - -void(entity e, float skinobj) applycustomskin = #378; /* Part of FTE_QC_CUSTOMSKINS - Updates the entity's custom skin (refcounted). */ - -void(float skinobj) releasecustomskin = #379; /* Part of FTE_QC_CUSTOMSKINS - Lets the engine know that the skin will no longer be needed. Thanks to refcounting any ents with the skin already applied will retain their skin until later changed. It is valid to destroy a skin just after applying it to an ent in the same function that it was created in, as the skin will only be destroyed once its refcount rops to 0. */ - -void(float devid, float amp_low, float amp_high, float duration) gp_rumble = #0:gp_rumble; /* - Sends a single rumble event to the game-pad specified in devid. Every time you call this, the previous effect is cancelled out. */ - -void(float devid, float left, float right, float duration) gp_rumbletriggers = #0:gp_rumbletriggers; /* - Makes the analog triggers rumble of the specified game-pad, like gp_rumble() one call cancels out the previous one on the device. */ - -void(float devid, vector color) gp_setledcolor = #0:gp_setledcolor; /* - Updates the game-pad LED color. */ - -void(float devid, /*const*/ void *data, int size) gp_settriggerfx = #0:gp_settriggerfx; /* - Sends a specific effect packet to the controller. On the PlayStation 5's DualSense that can adjust the tension on the analog triggers. */ - -#endif -__variant*(int size) memalloc = #384; /* Part of FTE_MEMALLOC - Allocate an arbitary block of memory */ - -void(__variant *ptr) memfree = #385; /* Part of FTE_MEMALLOC - Frees a block of memory that was allocated with memfree */ - -void(__variant *dst, __variant *src, int size) memcpy = #386; /* Part of FTE_MEMALLOC - Copys memory from one location to another */ - -void(__variant *dst, int val, int size) memfill8 = #387; /* Part of FTE_MEMALLOC - Sets an entire block of memory to a specified value. Pretty much always 0. */ - -__variant(__variant *dst, float ofs) memgetval = #388; /* - Looks up the 32bit value stored at a pointer-with-offset. */ - -void(__variant *dst, float ofs, __variant val) memsetval = #389; /* - Changes the 32bit value stored at the specified pointer-with-offset. */ - -__variant*(__variant *base, float ofs) memptradd = #390; /* - Perform some pointer maths. Woo. */ - -float(string s) memstrsize = #0:memstrsize; /* - strlen, except ignores utf-8 */ - -#if defined(CSQC) || defined(MENU) -string(string conname, string field, optional string newvalue) con_getset = #391; /* Part of FTE_CSQC_ALTCONSOLES - Reads or sets a property from a console object. The old value is returned. Iterrate through consoles with the 'next' field. Valid properties: title, name, next, unseen, markup, forceutf8, close, clear, hidden, linecount */ - -void(string conname, string messagefmt, ...) con_printf = #392; /* Part of FTE_CSQC_ALTCONSOLES - Prints onto a named console. */ - -void(string conname, vector pos, vector size, float fontsize) con_draw = #393; /* Part of FTE_CSQC_ALTCONSOLES - Draws the named console. */ - -float(string conname, float inevtype, float parama, float paramb, float paramc) con_input = #394; /* Part of FTE_CSQC_ALTCONSOLES - Forwards input events to the named console. Mouse updates should be absolute only. */ - -void(string newcaption) setwindowcaption = #0:setwindowcaption; /* Part of FTE_CSQC_WINDOWCAPTION - Replaces the title of the game window, as seen when task switching or just running in windowed mode. */ - -float() cvars_haveunsaved = #0:cvars_haveunsaved; /* - Returns true if any archived cvar has an unsaved value. */ - -#endif -float(entity e, float nowreadonly) entityprotection = #0:entityprotection; /* - Changes the protection on the specified entity to protect it from further edits from QC. The return value is the previous setting. Note that this can be used to unprotect the world, but doing so long term is not advised as you will no longer be able to detect invalid entity references. Also, world is not networked, so results might not be seen by clients (or in other words, world.avelocity_y=64 is a bad idea). */ - -#ifdef CSQC -string(vector pos) getlocationname = #0:getlocationname; /* - Looks up the specified position in the current map's .loc file and reports the nearest marked name. */ - -#endif -#ifdef MENU -void(int cliptype) clipboard_get = #0:clipboard_get; /* - Attempts to query the system clipboard. Any pasted text will be returned via Menu_InputEvent */ - -#endif -#if defined(CSQC) || defined(MENU) -void(int cliptype, string text) clipboard_set = #0:clipboard_set; /* - Changes the system clipboard to the specified text. */ - -#endif -#ifdef SSQC -entity(float entnum, optional __out float wasspawned) respawnedict = #0:respawnedict; /* - Acts like edict_num returning a specific entity number, but also marks it as spawned. If it was previously spawned then all of its prior field data will be LOST (you may wish to use wasfreed(edict_num(idx)) to check. */ - -#endif -#if defined(CSQC) || defined(SSQC) -entity(entity from, optional entity to) copyentity = #400; /* Part of DP_QC_COPYENTITY - Copies all fields from one entity to another. */ - -#endif -#ifdef SSQC -__deprecated("No RGB support.") void(entity ent, float colours) setcolor = #401; /* Part of DP_SV_SETCOLOR - Changes a player's colours. The bits 0-3 are the lower/trouser colour, bits 4-7 are the upper/shirt colours. */ - -#endif -#if defined(CSQC) || defined(SSQC) -entity(.string field, string match, optional .entity chainfield) findchain = #402; /* Part of DP_QC_FINDCHAIN*/ -entity(.float fld, float match, optional .entity chainfield) findchainfloat = #403; /* Part of DP_QC_FINDCHAINFLOAT*/ -void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404; /* Part of DP_SV_EFFECT - Spawns a self-animating sprite */ - -void(vector org, vector dir, float count) te_blood = #405; /* Part of DP_TE_BLOOD*/ -void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406; /* Part of _DP_TE_BLOODSHOWER*/ -void(vector org, vector color) te_explosionrgb = #407; /* Part of DP_TE_EXPLOSIONRGB*/ -void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408; /* Part of DP_TE_PARTICLECUBE*/ -void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409; /* Part of DP_TE_PARTICLERAIN*/ -void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410; /* Part of DP_TE_PARTICLESNOW*/ -void(vector org, vector vel, float howmany) te_spark = #411; /* Part of DP_TE_SPARK*/ -void(vector org) te_gunshotquad = #412; /* Part of _DP_TE_QUADEFFECTS1*/ -void(vector org) te_spikequad = #413; /* Part of _DP_TE_QUADEFFECTS1*/ -void(vector org) te_superspikequad = #414; /* Part of _DP_TE_QUADEFFECTS1*/ -void(vector org) te_explosionquad = #415; /* Part of _DP_TE_QUADEFFECTS1*/ -void(vector org) te_smallflash = #416; /* Part of DP_TE_SMALLFLASH*/ -void(vector org, float radius, float lifetime, vector color) te_customflash = #417; /* Part of DP_TE_CUSTOMFLASH*/ -void(vector org, optional float count) te_gunshot = #418; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ -void(vector org) te_spike = #419; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ -void(vector org) te_superspike = #420; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ -void(vector org) te_explosion = #421; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ -void(vector org) te_tarexplosion = #422; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ -void(vector org) te_wizspike = #423; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ -void(vector org) te_knightspike = #424; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ -void(vector org) te_lavasplash = #425; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ -void(vector org) te_teleport = #426; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ -void(vector org, float color, float colorlength) te_explosion2 = #427; /* Part of DP_TE_STANDARDEFFECTBUILTINS*/ -void(entity own, vector start, vector end) te_lightning1 = #428; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ -void(entity own, vector start, vector end) te_lightning2 = #429; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ -void(entity own, vector start, vector end) te_lightning3 = #430; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ -void(entity own, vector start, vector end) te_beam = #431; /* Part of DP_TE_STANDARDEFFECTBUILTINS*/ -void(vector dir) vectorvectors = #432; /* Part of DP_QC_VECTORVECTORS*/ -void(vector org) te_plasmaburn = #433; /* Part of _DP_TE_PLASMABURN*/ -float(entity e, float s) getsurfacenumpoints = #434; /* Part of DP_QC_GETSURFACE*/ -vector(entity e, float s, float n) getsurfacepoint = #435; /* Part of DP_QC_GETSURFACE*/ -vector(entity e, float s) getsurfacenormal = #436; /* Part of DP_QC_GETSURFACE*/ -string(entity e, float s) getsurfacetexture = #437; /* Part of DP_QC_GETSURFACE*/ -float(entity e, vector p) getsurfacenearpoint = #438; /* Part of DP_QC_GETSURFACE*/ -vector(entity e, float s, vector p) getsurfaceclippedpoint = #439; /* Part of DP_QC_GETSURFACE*/ -#endif -#ifdef MENU -strbuf() buf_create = #440; /* Part of DP_QC_STRINGBUFFERS*/ -void(strbuf bufhandle) buf_del = #441; /* Part of DP_QC_STRINGBUFFERS*/ -float(strbuf bufhandle) buf_getsize = #442; /* Part of DP_QC_STRINGBUFFERS*/ -void(strbuf bufhandle_from, float bufhandle_to) buf_copy = #443; /* Part of DP_QC_STRINGBUFFERS*/ -void(strbuf bufhandle, float sortprefixlen, float backward) buf_sort = #444; /* Part of DP_QC_STRINGBUFFERS*/ -string(strbuf bufhandle, string glue) buf_implode = #445; /* Part of DP_QC_STRINGBUFFERS*/ -string(strbuf bufhandle, float string_index) bufstr_get = #446; /* Part of DP_QC_STRINGBUFFERS*/ -void(strbuf bufhandle, float string_index, string str) bufstr_set = #447; /* Part of DP_QC_STRINGBUFFERS*/ -float(strbuf bufhandle, string str, float ordered) bufstr_add = #448; /* Part of DP_QC_STRINGBUFFERS*/ -void(strbuf bufhandle, float string_index) bufstr_free = #449; /* Part of DP_QC_STRINGBUFFERS*/ -float(string name) iscachedpic = #451; -string(string name, optional float flags) precache_pic = #452; -float(vector position, float character, vector scale, vector rgb, float alpha, optional float flag) drawcharacter = #454; -float(vector position, string text, vector scale, vector rgb, float alpha, optional float flag) drawrawstring = #455; -float(vector position, string pic, vector size, vector rgb, float alpha, optional float flag) drawpic = #456; -float(vector position, vector size, vector rgb, float alpha, optional float flag) drawfill = #457; -void(float x, float y, float width, float height) drawsetcliparea = #458; -void(void) drawresetcliparea = #459; -vector(string picname) drawgetimagesize = #460; -void(float width, vector pos1, vector pos2) drawline = #466; -float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring = #467; -float(string text, float usecolours, vector fontsize='8 8') stringwidth = #468; -void(vector pos, vector sz, string pic, vector srcpos, vector srcsz, vector rgb, float alpha, float flag) drawsubpic = #469; -#endif -#ifdef SSQC -void(entity e, string s) clientcommand = #440; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND*/ -#endif -#if defined(CSQC) || defined(SSQC) -float(string s) tokenize = #441; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND*/ -string(float n) argv = #442; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND*/ -void(entity e, entity tagentity, string tagname) setattachment = #443; /* Part of DP_GFX_QUAKE3MODELTAGS*/ -searchhandle(string pattern, enumflags:float{SB_CASEINSENSITIVE=1<<0,SB_FULLPACKAGEPATH=1<<1,SB_ALLOWDUPES=1<<2,SB_FORCESEARCH=1<<3,SB_MULTISEARCH=1<<4,SB_NAMESORT=1<<5} flags, float quiet, optional string filterpackage) search_begin = #444; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE - initiate a filesystem scan based upon filenames. Be sure to call search_end on the returned handle. SB_FULLPACKAGEPATH interprets the filterpackage arg as a full package path to avoid gamedir ambiguity, equivelent to whichpack's WP_FULLPACKAGEPATH flag. SB_ALLOWDUPES allows returning multiple entries with the same name (but different package, useful with search_fopen). SB_FORCESEARCH requires use of the filterpackage and SB_FULLPACKAGEPATH flag, initiating searches from gamedirs/packages which are not currently active. */ - -void(searchhandle handle) search_end = #445; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE*/ -float(searchhandle handle) search_getsize = #446; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE - Retrieves the number of files that were found. */ - -string(searchhandle handle, float num) search_getfilename = #447; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE - Retrieves name of one of the files that was found by the initial search. */ - -#endif -float(searchhandle handle, float num) search_getfilesize = #0:search_getfilesize; /* Part of FTE_QC_FS_SEARCH_SIZEMTIME - Retrieves the size of one of the files that was found by the initial search. */ - -string(searchhandle handle, float num) search_getfilemtime = #0:search_getfilemtime; /* Part of FTE_QC_FS_SEARCH_SIZEMTIME - Retrieves modification time of one of the files. */ - -string(searchhandle handle, float num) search_getpackagename = #0:search_getpackagename; /* - Retrieves the name of the package containing the file. Search with SB_FULLPACKAGEPATH to see gamedir/package info */ - -filestream(searchhandle handle, float num) search_fopen = #0:search_fopen; /* - Opens the file directly, without getting confused about entries from other packages. Read access only. */ - -#if defined(CSQC) || defined(SSQC) -string(string cvarname) cvar_string = #448; /* Part of DP_QC_CVAR_STRING*/ -entity(entity start, .float fld, float match) findflags = #449; /* Part of DP_QC_FINDFLAGS*/ -entity(.float fld, float match, optional .entity chainfield) findchainflags = #450; /* Part of DP_QC_FINDCHAINFLAGS*/ -float(entity ent, string tagname) gettagindex = #451; /* Part of DP_QC_GETTAGINFO*/ -vector(entity ent, float tagindex) gettaginfo = #452; /* Part of DP_QC_GETTAGINFO - Obtains the current worldspace position+orientation of the bone or tag from the given entity. The return value is the world coord, v_forward, v_right, v_up are also set according to the bone/tag's orientation. */ - -#endif -#ifdef SSQC -void(entity player) dropclient = #453; /* Part of DP_SV_DROPCLIENT*/ -entity() spawnclient = #454; /* Part of DP_SV_BOTCLIENT*/ -float(entity client) clienttype = #455; /* Part of DP_SV_BOTCLIENT*/ -void(float target, string str) WriteUnterminatedString = #456; /* Part of DP_SV_WRITEUNTERMINATEDSTRING*/ -#endif -#if defined(CSQC) || defined(SSQC) -void(vector org, vector vel, float howmany) te_flamejet = #457; /* Part of _DP_TE_FLAMEJET*/ -entity(float entnum) edict_num = #459; /* Part of DP_QC_EDICT_NUM*/ -strbuf() buf_create = #460; /* Part of DP_QC_STRINGBUFFERS*/ -void(strbuf bufhandle) buf_del = #461; /* Part of DP_QC_STRINGBUFFERS*/ -float(strbuf bufhandle) buf_getsize = #462; /* Part of DP_QC_STRINGBUFFERS*/ -void(strbuf bufhandle_from, strbuf bufhandle_to) buf_copy = #463; /* Part of DP_QC_STRINGBUFFERS*/ -void(strbuf bufhandle, float sortprefixlen, float backward) buf_sort = #464; /* Part of DP_QC_STRINGBUFFERS*/ -string(strbuf bufhandle, string glue) buf_implode = #465; /* Part of DP_QC_STRINGBUFFERS*/ -string(strbuf bufhandle, float string_index) bufstr_get = #466; /* Part of DP_QC_STRINGBUFFERS*/ -void(strbuf bufhandle, float string_index, string str) bufstr_set = #467; /* Part of DP_QC_STRINGBUFFERS*/ -float(strbuf bufhandle, string str, float ordered) bufstr_add = #468; /* Part of DP_QC_STRINGBUFFERS*/ -void(strbuf bufhandle, float string_index) bufstr_free = #469; /* Part of DP_QC_STRINGBUFFERS*/ -#endif -float(float s) asin = #471; /* Part of DP_QC_ASINACOSATANATAN2TAN*/ -float(float c) acos = #472; /* Part of DP_QC_ASINACOSATANATAN2TAN*/ -float(float t) atan = #473; /* Part of DP_QC_ASINACOSATANATAN2TAN*/ -float(float c, float s) atan2 = #474; /* Part of DP_QC_ASINACOSATANATAN2TAN*/ -float(float a) tan = #475; /* Part of DP_QC_ASINACOSATANATAN2TAN - Forgive me father, for I have a sunbed and I'm not afraid to use it. */ - -float(string s) strlennocol = #476; /* Part of DP_QC_STRINGCOLORFUNCTIONS - Returns the number of characters in the string after any colour codes or other markup has been parsed. */ - -string(string s) strdecolorize = #477; /* Part of DP_QC_STRINGCOLORFUNCTIONS - Flattens any markup/colours, removing them from the string. */ - -string(float uselocaltime, string format, ...) strftime = #478; /* Part of DP_QC_STRFTIME*/ -float(string s, string separator1, ...) tokenizebyseparator = #479; /* Part of DP_QC_TOKENIZEBYSEPARATOR - Splits up the string using only the specified delimiters/separators. Multiple delimiters can be given, they are each considered equivelent (though should start with the longest if you want to do weird subseparator stuff). - The resulting tokens can be queried via argv (and argv_start|end_index builtins, if you want to determine which of the separators was present between two tokens). - Note that while an input string containing JUST a separator will return 2, a string with no delimiter will return 1, while (in FTE) an empty string will ALWAYS return 0. */ - -string(string s) strtolower = #480; /* Part of DP_QC_STRING_CASE_FUNCTIONS*/ -string(string s) strtoupper = #481; /* Part of DP_QC_STRING_CASE_FUNCTIONS*/ -#if defined(CSQC) || defined(SSQC) -string(string s) cvar_defstring = #482; /* Part of DP_QC_CVAR_DEFSTRING*/ -void(vector origin, string sample, float volume, float attenuation) pointsound = #483; /* Part of DP_SV_POINTSOUND*/ -#endif -string(string search, string replace, string subject) strreplace = #484; /* Part of DP_QC_STRREPLACE*/ -string(string search, string replace, string subject) strireplace = #485; /* Part of DP_QC_STRREPLACE*/ -#if defined(CSQC) || defined(SSQC) -vector(entity e, float s, float n, float a) getsurfacepointattribute = #486; /* Part of DP_QC_GETSURFACEPOINTATTRIBUTE*/ -#endif -#if defined(CSQC) || defined(MENU) -float(string name, optional string initialURI) gecko_create = #487; /* Part of DP_GECKO_SUPPORT - Create a new 'browser tab' shader with the specified name that can then be drawn via drawpic (shader should not already exist - including from map/model textures or disk). In order to function correctly, this builtin depends upon external plugins being available. Use gecko_navigate to navigate it to a page of your choosing. */ - -void(string name) gecko_destroy = #488; /* Part of DP_GECKO_SUPPORT - Destroy a shader. */ - -void(string name, string URI) gecko_navigate = #489; /* Part of DP_GECKO_SUPPORT - Sends a command to the media decoder attached to the specified shader. In the case of a browser decoder, this changes the url that the browser displays. 'cmd:[un]focus' will tell the decoder that it has focus. */ - -float(string name, float key, float eventtype, optional float charcode) gecko_keyevent = #490; /* Part of DP_GECKO_SUPPORT - Send a key event to a media decoder. This applies only to interactive decoders like browsers. */ - -void(string name, float x, float y) gecko_mousemove = #491; /* Part of DP_GECKO_SUPPORT - Sets a media decoder shader's mouse position. Values should be 0-1. */ - -void(string name, float w, float h) gecko_resize = #492; /* Part of DP_GECKO_SUPPORT - Request to resize a media decoder. */ - -vector(string name) gecko_get_texture_extent = #493; /* Part of DP_GECKO_SUPPORT - Retrieves a media decoder current image pixel sizes. */ - -string(string shadname, string propname) gecko_getproperty = #0:gecko_getproperty; /* - Queries the media decoder (especially browser ones) for decoder-specific properties. The cef plugin recognises url, title, status. */ - -#endif -#ifdef CSQC -float(string file, string id) cin_open = #0:cin_open; -void(string id) cin_close = #0:cin_close; -void(string id, float newstate) cin_setstate = #0:cin_setstate; -float(string id) cin_getstate = #0:cin_getstate; -void(string file) cin_restart = #0:cin_restart; -#endif -__deprecated("Use digest_hex") float(float caseinsensitive, string s, ...) crc16 = #494; /* Part of DP_QC_CRC16*/ -float(string name) cvar_type = #495; /* Part of DP_QC_CVAR_TYPE*/ -float() numentityfields = #496; /* Part of DP_QC_ENTITYDATA - Gives the number of named entity fields. Note that this is not the size of an entity, but rather just the number of unique names (ie: vectors use 4 names rather than 3). */ - -float(string fieldname) findentityfield = #0:findentityfield; /* - Find a field index by name. */ - -typedef .__variant field_t; -field_t(float fieldnum) entityfieldref = #0:entityfieldref; /* - Returns a field value that can be directly used to read entity fields. Be sure to validate the type with entityfieldtype before using. */ - -string(float fieldnum) entityfieldname = #497; /* Part of DP_QC_ENTITYDATA - Retrieves the name of the given entity field. */ - -float(float fieldnum) entityfieldtype = #498; /* Part of DP_QC_ENTITYDATA - Provides information about the type of the field specified by the field num. Returns one of the EV_ values. */ - -string(float fieldnum, entity ent) getentityfieldstring = #499; /* Part of DP_QC_ENTITYDATA*/ -float(float fieldnum, entity ent, string s) putentityfieldstring = #500; /* Part of DP_QC_ENTITYDATA*/ -#ifdef SSQC -void(float to, string s, float sz) WritePicture = #501; /* Part of DP_SV_WRITEPICTURE - Encodes the named image across the network as-is adhering to some size limit. In FTE, this simply writes the string and is equivelent to writestring and sz is ignored. WritePicture should be paired with ReadPicture in csqc. */ - -#endif -#ifdef CSQC -string() ReadPicture = #501; /* - Reads a picture that was written by ReadPicture, and returns a name that can be used in drawpic and other 2d drawing functions. In FTE, this acts as a readstring-with-downloadcheck - the image will appear normally once it has been downloaded, but its size may be incorrect until then. */ - -void(float effectindex, entity own, vector org_from, vector org_to, vector dir_from, vector dir_to, float countmultiplier, optional float flags) boxparticles = #502; -#endif -string(string filename, optional enumflags:float{WP_REFERENCEPACKAGE,WP_FULLPACKAGEPATH} flags) whichpack = #503; /* Part of DP_QC_WHICHPACK - Returns the pak file name that contains the file specified. progs/player.mdl will generally return something like 'pak0.pak'. If WP_REFERENCE, clients will automatically be told that the returned package should be pre-downloaded and used, even if allow_download_refpackages is not set. */ - -#ifdef CSQC -__variant(float entnum, float fieldnum) getentity = #504; /* - Looks up fields from non-csqc-visible entities. The entity will need to be within the player's pvs. fieldnum should be one of the GE_ constants. */ - -#endif -string(string in) uri_escape = #510; /* Part of DP_QC_URI_ESCAPE - Uses percent-encoding to encode any bytes in the input string which are not ascii alphanumeric, period, hyphen, or underscore. All other bytes will expand to eg '%20' for a single space char. This encoding scheme is compatible with http and other uris. */ - -string(string in) uri_unescape = #511; /* Part of DP_QC_URI_ESCAPE - Undo any percent-encoding in the input string, hopefully resulting in the same original sequence of bytes (and thus chars too). */ - -float(entity ent) num_for_edict = #512; -#define uri_post uri_get -float(string uril, float id, optional string postmimetype, optional string postdata) uri_get = #513; /* Part of DP_QC_URI_GET, DP_QC_URI_POST - uri_get() gets content from an URL and calls a callback "uri_get_callback" with it set as string; an unique ID of the transfer is returned - returns 1 on success, and then calls the callback with the ID, 0 or the HTTP status code, and the received data in a string - For a POST request, you will typically want the postmimetype set to application/x-www-form-urlencoded. - For a GET request, omit the mime+data entirely. - Consult your webserver/php/etc documentation for best-practise. */ - -float(string str) tokenize_console = #514; /* - Tokenize a string exactly as the console's tokenizer would do so. The regular tokenize builtin became bastardized for convienient string parsing, which resulted in a large disparity that can be exploited to bypass checks implemented in a naive SV_ParseClientCommand function, therefore you can use this builtin to make sure it exactly matches. */ - -float(float idx) argv_start_index = #515; /* - Returns the character index that the tokenized arg started at. */ - -float(float idx) argv_end_index = #516; /* - Returns the character index that the tokenized arg stopped at. */ - -void(strbuf strbuf, string pattern, string antipattern) buf_cvarlist = #517; -string(string cvarname) cvar_description = #518; /* - Retrieves the description of a cvar, which might be useful for tooltips or help files. This may still not be useful. */ - -#if defined(CSQC) || defined(SSQC) -float(optional float timetype) gettime = #519; -#endif -#ifdef CSQC -DEP string(float keynum) keynumtostring_omgwtf = #520; -__deprecated("Does not support modifiers") string(string command, optional float bindmap) findkeysforcommand = #521; /* - Returns a list of keycodes that perform the given console command in a format that can only be parsed via tokenize (NOT tokenize_console). This only and always returns two values - if only one key is actually bound, -1 will be returned. The bindmap argument is listed for compatibility with dp-specific defs, but is ignored in FTE. */ - -#endif -#if defined(CSQC) || defined(MENU) -string(string command, optional float bindmap) findkeysforcommandex = #0:findkeysforcommandex; /* - Returns a list of key bindings in keyname format instead of keynums. Use tokenize to parse. This list may contain modifiers. May return large numbers of keys. */ - -#endif -#if defined(CSQC) || defined(SSQC) -void(string s) loadfromdata = #529; /* - Reads a set of entities from the given string. This string should have the same format as a .ent file or a saved game. Entities will be spawned as required. If you need to see the entities that were created, you should use parseentitydata instead. */ - -void(string s) loadfromfile = #530; /* - Reads a set of entities from the named file. This file should have the same format as a .ent file or a saved game. Entities will be spawned as required. If you need to see the entities that were created, you should use parseentitydata instead. */ - -void(float pause) setpause = #531; /* - Sets whether the server should or should not be paused. This does not affect auto-paused things like when the console is down. */ - -#endif -#ifdef SSQC -float(string mname) precache_vwep_model = #532; /* Part of ZQ_VWEP*/ -#endif -float(float v, optional float base) log = #532; /* - Determines the logarithm of the input value according to the specified base. This can be used to calculate how much something was shifted by. */ - -#ifdef CSQC -float(entity e, float channel, string newsample, float volume, float attenuation, float pitchpct, float flags, float timeoffset) soundupdate = #0:soundupdate; /* - Changes the properties of the current sound being played on the given entity channel. newsample may be empty, and will be ignored in this case. timeoffset is relative to the current position (subtract the result of getsoundtime for absolute positions). Negative volume can be used to stop the sound. Return value is a fractional value based upon the number of audio devices that could be updated - test against TRUE rather than non-zero. */ - -float(entity e, float channel) getsoundtime = #533; /* - Returns the current playback time of the sample on the given entity's channel. Beware CHAN_AUTO (in csqc, channels are not limited by network protocol). */ - -float(entity e, float channel) getchannellevel = #0:getchannellevel; /* - Reports how load the sound's sample is at its current offset. */ - -#endif -#if defined(CSQC) || defined(MENU) -float(string sample) soundlength = #534; /* - Provides a way to query the duration of a sound sample, allowing you to set up a timer to chain samples. */ - -#endif -float(string filename, strbuf bufhandle) buf_loadfile = #535; /* - Appends the named file into a string buffer (which must have been created in advance). The return value merely says whether the file was readable. */ - -float(filestream filehandle, strbuf bufhandle, optional float startpos, optional float numstrings) buf_writefile = #536; /* - Writes the contents of a string buffer onto the end of the supplied filehandle (you must have already used fopen). Additional optional arguments permit you to constrain the writes to a subsection of the stringbuffer. */ - -float(float bufhandle, string match, float matchrule, float startpos, float step) bufstr_find = #537; /* - Looks for the first occurence of the specified string in the buffer, returning its index or -1 on failure. */ - -#ifdef SSQC -float(optional float forcestate) physics_supported = #0:physics_supported; /* - Queries whether rigid body physics is enabled or not. CSQC and SSQC may report different values. If the force argument is specified then the engine will try to activate or release physics (returning the new state, which may fail if plugins or dlls are missing). Note that restarting the physics engine is likely to result in hitches when collision trees get generated. The state may change if a plugin is disabled mid-map. */ - -#endif -#if defined(CSQC) || defined(SSQC) -void(entity e, float physics_enabled) physics_enable = #540; /* - Enable or disable the physics attached to a MOVETYPE_PHYSICS entity. Entities which have been disabled in this way will stop taking so much cpu time. */ - -void(entity e, vector force, vector relative_ofs) physics_addforce = #541; /* - Apply some impulse directional force upon a MOVETYPE_PHYSICS entity. */ - -void(entity e, vector torque) physics_addtorque = #542; /* - Apply some impulse rotational force upon a MOVETYPE_PHYSICS entity. */ - -#endif -#ifdef MENU -void(float dest) setkeydest = #601; -float() getkeydest = #602; -#endif -#if defined(CSQC) || defined(MENU) -void(float trg) setmousetarget = #603; -float() getmousetarget = #604; -#endif -void(.../*, string funcname*/) callfunction = #605; /* - Invokes the named function. The function name is always passed as the last parameter and must always be present. The others are passed to the named function as-is */ - -void(filestream fh, entity e) writetofile = #606; /* - Writes an entity's fields to the named frik_file file handle. */ - -float(string s) isfunction = #607; /* - Returns true if the named function exists and can be called with the callfunction builtin. */ - -#if defined(CSQC) || defined(MENU) -vector(float vidmode, optional float forfullscreen) getresolution = #608; /* - Supposed to query the driver for supported video modes. FTE does not query drivers in this way, nor would it trust drivers anyway. */ - -#endif -#ifdef CSQC -DEP string(float keynum) keynumtostring_menu = #609; -#endif -#ifdef MENU -string(float keynum) keynumtostring = #609; /* - Converts a qscancode key number into a mostly-human-readable name, matching the bind command. */ - -string(string command, optional float bindmap) findkeysforcommand = #610; -#endif -#if defined(CSQC) || defined(MENU) -float(float type) gethostcachevalue = #611; /* Part of FTE_CSQC_SERVERBROWSER*/ -string(float type, float hostnr) gethostcachestring = #612; /* Part of FTE_CSQC_SERVERBROWSER*/ -#endif -float(entity e, string s, optional float offset) parseentitydata = #613; /* - Reads a single entity's fields into an already-spawned entity. s should contain field pairs like in a saved game: {"foo1" "bar" "foo2" "5"}. Returns <=0 on failure, otherwise returns the offset in the string that was read to. */ - -string(entity e) generateentitydata = #0:generateentitydata; /* - Dumps the entities fields into a string which can later be parsed with parseentitydata. */ - -#ifdef MENU -float(string key) stringtokeynum = #614; /* - Returns the qscancode of a key from its name. Names are identical to the bind command. ctrl/shift/alt modifiers are ignored. */ - -#endif -#ifdef CSQC -float(string key) stringtokeynum_menu = #614; -#endif -#if defined(CSQC) || defined(MENU) -void() resethostcachemasks = #615; /* Part of FTE_CSQC_SERVERBROWSER*/ -void(float mask, float fld, string str, float op) sethostcachemaskstring = #616; /* Part of FTE_CSQC_SERVERBROWSER*/ -void(float mask, float fld, float num, float op) sethostcachemasknumber = #617; /* Part of FTE_CSQC_SERVERBROWSER*/ -void() resorthostcache = #618; /* Part of FTE_CSQC_SERVERBROWSER*/ -void(float fld, float descending) sethostcachesort = #619; /* Part of FTE_CSQC_SERVERBROWSER*/ -void(optional float dopurge) refreshhostcache = #620; /* Part of FTE_CSQC_SERVERBROWSER*/ -float(float fld, float hostnr) gethostcachenumber = #621; /* Part of FTE_CSQC_SERVERBROWSER*/ -float(string key) gethostcacheindexforkey = #622; /* Part of FTE_CSQC_SERVERBROWSER*/ -void(string key) addwantedhostcachekey = #623; /* Part of FTE_CSQC_SERVERBROWSER*/ -string() getextresponse = #624; /* Part of FTE_CSQC_SERVERBROWSER*/ -#endif -string(string dnsname, optional float defport) netaddress_resolve = #625; -#if defined(CSQC) || defined(MENU) -string(float n, float prop) getgamedirinfo = #626; /* - Queries properties about an indexed gamedir (or -1 for the current gamedir). Returns null strings when out of bounds. Use the GDDI_* constants for the prop arg. */ - -string(int n, int prop) getpackagemanagerinfo = #0:getpackagemanagerinfo; /* - Queries information about a package from the engine's package manager subsystem. Actions can be taken via the pkg console command. */ - -#endif -string(string fmt, ...) sprintf = #627; /* Part of DP_QC_SPRINTF - 'prints' to a formatted temp-string. Mostly acts as in C, however %d assumes floats (fteqcc has arg checking. Use it.). - type conversions: l=arg is an int, h=arg is a float, and will work as a prefix for any float or int representation. - float representations: d=decimal, e,E=exponent-notation, f,F=floating-point notation, g,G=terse float, c=char code, x,X=hex - other representations: i=int, s=string, S=quoted and marked-up string, v=vector, p=pointer - so %ld will accept an int arg, while %hi will expect a float arg. - entities, fields, and functions will generally need to be printed as ints with %i. */ - -#if defined(CSQC) || defined(SSQC) -float(entity e, float s) getsurfacenumtriangles = #628; -vector(entity e, float s, float n) getsurfacetriangle = #629; -#endif -#if defined(CSQC) || defined(MENU) -float(float key, string bind, optional float bindmap, optional float modifier) setkeybind = #630; -vector() getbindmaps = #631; -float(vector bm) setbindmaps = #632; -#endif -string(string digest, string data, ...) digest_hex = #639; -string(string digest, void *data, int length) digest_ptr = #0:digest_ptr; /* - Calculates the digest of a single contiguous block of memory (including nulls) using the specified hash function. */ - -float(string src, string dst) fcopy = #650; /* - Equivelent to fopen+fread+fwrite+fclose from QC (ie: reads from $gamedir/data/ or $gamedir, but always writes to $gamedir/data/ ) */ - -float(string src, string dst) frename = #651; /* - Renames the file, returning 0 on success. Both paths are relative to the data/ subdir. */ - -float(string fname) fremove = #652; /* - Deletes the named file - path is relative to data/ subdir, like fopen's FILE_WRITE. Returns 0 on success. */ - -float(string fname) fexists = #653; /* - Returns true if it exists inside the default writable path. Use whichpack for greater portability. */ - -float(string path) rmtree = #654; /* - Dangerous, but sandboxed to data/ */ - -#if defined(CSQC) || defined(MENU) -const float K_TAB = 9; -const float K_ENTER = 13; -const float K_ESCAPE = 27; -const float K_SPACE = 32; -const float K_BACKSPACE = 127; -const float K_UPARROW = 128; -const float K_DOWNARROW = 129; -const float K_LEFTARROW = 130; -const float K_RIGHTARROW = 131; -const float K_LALT = 132; -const float K_RALT = -280; -const float K_LCTRL = 133; -const float K_RCTRL = -281; -const float K_LSHIFT = 134; -const float K_RSHIFT = -282; -const float K_F1 = 135; -const float K_F2 = 136; -const float K_F3 = 137; -const float K_F4 = 138; -const float K_F5 = 139; -const float K_F6 = 140; -const float K_F7 = 141; -const float K_F8 = 142; -const float K_F9 = 143; -const float K_F10 = 144; -const float K_F11 = 145; -const float K_F12 = 146; -const float K_INS = 147; -const float K_DEL = 148; -const float K_PGDN = 149; -const float K_PGUP = 150; -const float K_HOME = 151; -const float K_END = 152; -const float K_KP_HOME = 164; -const float K_KP_UPARROW = 165; -const float K_KP_PGUP = 166; -const float K_KP_LEFTARROW = 161; -const float K_KP_5 = 162; -const float K_KP_RIGHTARROW = 163; -const float K_KP_END = 158; -const float K_KP_DOWNARROW = 159; -const float K_KP_PGDN = 160; -const float K_KP_ENTER = 172; -const float K_KP_INS = 157; -const float K_KP_DEL = 167; -const float K_KP_SLASH = 168; -const float K_KP_MINUS = 170; -const float K_KP_PLUS = 171; -const float K_KP_NUMLOCK = 154; -const float K_KP_STAR = 169; -const float K_KP_EQUALS = 173; -const float K_MOUSE1 = 512; -const float K_MOUSE2 = 513; -const float K_MOUSE3 = 514; -const float K_MOUSE4 = 517; -const float K_MOUSE5 = 518; -const float K_MOUSE6 = 519; -const float K_MOUSE7 = 520; -const float K_MOUSE8 = 521; -const float K_MOUSE9 = 522; -const float K_MOUSE10 = 523; -const float K_MWHEELUP = 515; -const float K_MWHEELDOWN = 516; -const float K_LWIN = -274; -const float K_RWIN = -275; -const float K_APP = -276; -const float K_SEARCH = -277; -const float K_POWER = -130; -const float K_VOLUP = -278; -const float K_VOLDOWN = -279; -const float K_JOY1 = 768; -const float K_JOY2 = 769; -const float K_JOY3 = 770; -const float K_JOY4 = 771; -const float K_JOY5 = 772; -const float K_JOY6 = 773; -const float K_JOY7 = 774; -const float K_JOY8 = 775; -const float K_JOY9 = 776; -const float K_JOY10 = 777; -const float K_JOY11 = 778; -const float K_JOY12 = 779; -const float K_JOY13 = 780; -const float K_JOY14 = 781; -const float K_JOY15 = 782; -const float K_JOY16 = 783; -const float K_JOY17 = 784; -const float K_JOY18 = 785; -const float K_JOY19 = 786; -const float K_JOY20 = 787; -const float K_JOY21 = 788; -const float K_JOY22 = 789; -const float K_JOY23 = 790; -const float K_JOY24 = 791; -const float K_JOY25 = 792; -const float K_JOY26 = 793; -const float K_JOY27 = 794; -const float K_JOY28 = 795; -const float K_JOY29 = 796; -const float K_JOY30 = 797; -const float K_JOY31 = 798; -const float K_JOY32 = 799; -const float K_AUX1 = 800; -const float K_AUX2 = 801; -const float K_AUX3 = 802; -const float K_AUX4 = 803; -const float K_AUX5 = 804; -const float K_AUX6 = 805; -const float K_AUX7 = 806; -const float K_AUX8 = 807; -const float K_AUX9 = 808; -const float K_AUX10 = 809; -const float K_AUX11 = 810; -const float K_AUX12 = 811; -const float K_AUX13 = 812; -const float K_AUX14 = 813; -const float K_AUX15 = 814; -const float K_AUX16 = 815; -const float K_PAUSE = 153; -const float K_PRINTSCREEN = 174; -const float K_CAPSLOCK = 155; -const float K_SCROLLLOCK = 156; -const float K_SEMICOLON = 59; -const float K_PLUS = 43; -const float K_MINUS = 45; -const float K_APOSTROPHE = 39; -const float K_QUOTES = 34; -const float K_TILDE = 126; -const float K_BACKQUOTE = 96; -const float K_BACKSLASH = 92; -const float K_GP_A = 826; -const float K_GP_B = 827; -const float K_GP_X = 828; -const float K_GP_Y = 829; -const float K_GP_LSHOULDER = 824; -const float K_GP_RSHOULDER = 825; -const float K_GP_LTRIGGER = 830; -const float K_GP_RTRIGGER = 831; -const float K_GP_BACK = 821; -const float K_GP_START = 820; -const float K_GP_LTHUMB = 822; -const float K_GP_RTHUMB = 823; -const float K_GP_DPAD_UP = 816; -const float K_GP_DPAD_DOWN = 817; -const float K_GP_DPAD_LEFT = 818; -const float K_GP_DPAD_RIGHT = 819; -const float K_GP_GUIDE = -238; -const float K_GP_SHARE = -248; -const float K_GP_PADDLE1 = -249; -const float K_GP_PADDLE2 = -250; -const float K_GP_PADDLE3 = -251; -const float K_GP_PADDLE4 = -252; -const float K_GP_TOUCHPAD = -253; -const float K_GP_UNKNOWN = -264; -const float K_GP_LTHUMB_UP = 832; -const float K_GP_LTHUMB_DOWN = 833; -const float K_GP_LTHUMB_LEFT = 834; -const float K_GP_LTHUMB_RIGHT = 835; -const float K_GP_RTHUMB_UP = 836; -const float K_GP_RTHUMB_DOWN = 837; -const float K_GP_RTHUMB_LEFT = 838; -const float K_GP_RTHUMB_RIGHT = 839; -#endif -#ifdef _ACCESSORS -accessor strbuf : float -{ - inline get float asfloat[float idx] = {return stof(bufstr_get(this, idx));}; - inline set float asfloat[float idx] = {bufstr_set(this, idx, ftos(value));}; - get string[float] = bufstr_get; - set string[float] = bufstr_set; - get float length = buf_getsize; -}; -accessor searchhandle : float -{ - get string[float] = search_getfilename; - get float length = search_getsize; -}; -accessor hashtable : float -{ - inline get vector v[string key] = {return hash_get(this, key, '0 0 0', EV_VECTOR);}; - inline set vector v[string key] = {hash_add(this, key, value, HASH_REPLACE|EV_VECTOR);}; - inline get string s[string key] = {return hash_get(this, key, "", EV_STRING);}; - inline set string s[string key] = {hash_add(this, key, value, HASH_REPLACE|EV_STRING);}; - inline get float f[string key] = {return hash_get(this, key, 0.0, EV_FLOAT);}; - inline set float f[string key] = {hash_add(this, key, value, HASH_REPLACE|EV_FLOAT);}; - inline get __variant[string key] = {return hash_get(this, key, __NULL__);}; - inline set __variant[string key] = {hash_add(this, key, value, HASH_REPLACE);}; -}; -accessor infostring : string -{ - get string[string] = infoget; - inline set& string[string fld] = {this = infoadd(this, fld, value);}; -}; -accessor filestream : float -{ - get string = fgets; - inline set string = {fputs(this,value);}; -}; -#endif -accessor jsonnode : json_t -{ - inline get json_type_e type = json_get_value_type; - inline get string s = json_get_string; - inline get float f = json_get_float; - inline get __int i = json_get_integer; - inline get __int length = json_get_length; - inline get jsonnode a[__int key] = json_get_child_at_index; - inline get jsonnode[string key] = json_find_object_child; - inline get string name = json_get_name; -}; -#undef DEP_CSQC -#undef FTEDEP -#undef DEP -#pragma noref 0 - -typedef enum -{ - false, - true -} bool; +-separated key/value pairs (use tokenizebyseparator). Return __NULL__ to let the engine handle it, an empty string for a 404, and any other text for a regular 200 response. */ +#endif +#if defined(CSQC) || defined(SSQC) +void(float prevprogs) init; /* Part of FTE_MULTIPROGS. Called as soon as a progs is loaded, called at a time when entities are not valid. This is the only time when it is safe to call addprogs without field assignment. As it is also called as part of addprogs, this also gives you a chance to hook functions in modules that are already loaded (via externget+externget). */ +void() initents; /* Part of FTE_MULTIPROGS. Called after fields have been finalized. This is the first point at which it is safe to call spawn(), and is called before any entity fields have been parsed. You can use this entrypoint to send notifications to other modules. */ +#endif +#ifdef MENU +void() m_init; +void() m_shutdown; +void(vector screensize) m_draw; /* Provides the menuqc with a chance to draw. Will be called even if the menu does not have focus, so be sure to avoid that. COMPAT: screensize is not provided in DP. */ +void(vector screensize, float opaque) m_drawloading; /* Additional drawing function to draw loading screens. If opaque is set, then this function must ensure that the entire screen is overdrawn (even if just by a black drawfill). */ +void(string rendererdescription) Menu_RendererRestarted; /* Called by the engine after the video was restarted. This serves to notify the MenuQC that any render targets that it may have cached were purged, and will need to be regenerated. */ +float(float evtype, float scanx, float chary, float devid) Menu_InputEvent; /* If present, this is called instead of m_keydown and m_keyup +Called whenever a key is pressed, the mouse is moved, etc. evtype will be one of the IE_* constants. The other arguments vary depending on the evtype. Key presses are not guarenteed to have both scan and unichar values set at the same time. */ +__deprecated("Use Menu_InputEvent") void(float scan, float chr) m_keydown; +__deprecated("Use Menu_InputEvent") void(float scan, float chr) m_keyup; +void(float wantmode) m_toggle; +float(string cmd) m_consolecommand; +float(float idx) m_gethostcachecategory; +#endif +#ifdef SSQC +float parm17, parm18, parm19, parm20, parm21, parm22, parm23, parm24, parm25, parm26, parm27, parm28, parm29, parm30, parm31, parm32; /* Additional spawn parms, following the same parmN theme. */ +float parm33, parm34, parm35, parm36, parm37, parm38, parm39, parm40, parm41, parm42, parm43, parm44, parm45, parm46, parm47, parm48; +float parm49, parm50, parm51, parm52, parm53, parm54, parm55, parm56, parm57, parm58, parm59, parm60, parm61, parm62, parm63, parm64; +string parm_string; /* Like the regular parmN globals, but preserves string contents. */ +string startspot; /* Receives the value of the second argument to changelevel from the previous map. */ +var float dimension_send; /* Used by multicast functionality. Multicasts (and related builtins that multicast internally) will only be sent to players where (player.dimension_see & dimension_send) is non-zero. */ +//var float dimension_default = 255; +/* Default dimension bitmask */ +__unused var string __fullspawndata; /* Set by the engine before calls to spawn functions, and is most easily parsed with the tokenize builtin. This allows you to handle halflife's multiple-fields-with-the-same-name (or target-specific fields). */ +#endif +#if defined(CSQC) || defined(SSQC) +__used var float physics_mode = 2; /* 0: original csqc - physics are not run +1: DP-compat. Thinks occur, but not true movetypes. +2: movetypes occur just as they do in ssqc. */ +#endif +#ifdef CSQC +float gamespeed; /* Set by the engine, this is the value of the sv_gamespeed cvar */ +float numclientseats; /* This is the number of splitscreen clients currently running on this client. */ +#endif +#if defined(CSQC) || defined(MENU) +var vector drawfontscale = '1 1 0'; /* Specifies a scaler for all text rendering. There are other ways to implement this. */ +float drawfont; /* Allows you to choose exactly which font is to be used to draw text. Fonts can be registered/allocated with the loadfont builtin. */ +const float FONT_DEFAULT = 0; +#endif +#if defined(NQSSQC) +entity newmis; /* ssqc global */ +#endif +#if defined(CSQC) || defined(QWSSQC) +float deathmatch; /* ssqc global */ +float coop; /* ssqc global */ +#endif +#if defined(QWSSQC) +float teamplay; /* ssqc global */ +#endif +#if defined(CSQC) || defined(SSQC) +int trace_endcontentsi; /* ssqc global */ +int trace_surfaceflagsi; /* ssqc global */ +string trace_surfacename; /* ssqc global */ +float cycle_wrapped; /* ssqc global */ +#endif +#ifdef CSQC +float dimension_default; /* ssqc global */ +#endif +#if defined(CSQC) || defined(SSQC) +unsigned int input_weapon; /* ssqc global */ +float input_lightlevel; /* ssqc global */ +vector input_cursor_screen; /* ssqc global */ +vector input_cursor_trace_start; /* ssqc global */ +vector input_cursor_trace_endpos; /* ssqc global */ +float input_cursor_entitynumber; /* ssqc global */ +unsigned int input_head_status; /* ssqc global */ +vector input_head_origin; /* ssqc global */ +vector input_head_angles; /* ssqc global */ +vector input_head_velocity; /* ssqc global */ +vector input_head_avelocity; /* ssqc global */ +unsigned int input_head_weapon; /* ssqc global */ +unsigned int input_left_status; /* ssqc global */ +vector input_left_origin; /* ssqc global */ +vector input_left_angles; /* ssqc global */ +vector input_left_velocity; /* ssqc global */ +vector input_left_avelocity; /* ssqc global */ +unsigned int input_left_weapon; /* ssqc global */ +unsigned int input_right_status; /* ssqc global */ +vector input_right_origin; /* ssqc global */ +vector input_right_angles; /* ssqc global */ +vector input_right_velocity; /* ssqc global */ +vector input_right_avelocity; /* ssqc global */ +unsigned int input_right_weapon; /* ssqc global */ +#endif +#ifdef SSQC +float trace_endcontentsf; /* ssqc global */ +float trace_surfaceflagsf; /* ssqc global */ +#endif +#if defined(CSQC) || defined(SSQC) +string trace_dphittexturename; /* ssqc global */ +#endif +#ifdef SSQC +float trace_dpstartcontents; /* ssqc global */ +float trace_dphitcontents; /* ssqc global */ +float trace_dphitq3surfaceflags; /* ssqc global */ +#endif +#ifdef CSQC +float(vector angles, float isdelta) CSQC_Parse_SetAngles; +void(float playernum) CSQC_PlayerInfoChanged; +void() CSQC_ServerInfoChanged; +DEP("use CSQC_Event_Sound") float(float channel, string soundname, vector pos, float vol, float attenuation, float flags) CSQC_ServerSound; +void(int entidx, string newentdata) CSQC_MapEntityEdited; +float clframetime; +float servertime; +float serverprevtime; +float serverdeltatime; +DEP("Does not support mod-specific contents.") float trace_dpstartcontents; +DEP("Does not support mod-specific contents.") float trace_dphitcontents; +DEP("Does not support mod-specific surface flags") float trace_dphitq3surfaceflags; +DEP("Does not support all mod-specific surface flags.") float trace_surfaceflagsf; +DEP("Does not support all mod-specific contents.") float trace_endcontentsf; +float intermission_time; +vector pmove_mins; +vector pmove_maxs; +float pmove_jump_held; +float pmove_waterjumptime; +float input_clienttime; +float autocvar_vid_conwidth; +float autocvar_vid_conheight; +#endif +const float TRUE = 1; +const float FALSE = 0; /* File not found... */ +const float M_PI = 3.14159; /* Mathematica Pi constant. */ +#if defined(CSQC) || defined(SSQC) +const float MOVETYPE_NONE = 0; +const float MOVETYPE_WALK = 3; +const float MOVETYPE_STEP = 4; +const float MOVETYPE_FLY = 5; +const float MOVETYPE_TOSS = 6; +const float MOVETYPE_PUSH = 7; +const float MOVETYPE_NOCLIP = 8; +const float MOVETYPE_FLYMISSILE = 9; +const float MOVETYPE_BOUNCE = 10; +const float MOVETYPE_BOUNCEMISSILE = 11; +const float MOVETYPE_FOLLOW = 12; +const float MOVETYPE_6DOF = 30; /* A glorified MOVETYPE_FLY. Players using this movetype will get some flightsim-like physics, with fully independant rotations (order-dependant transforms). */ +const float MOVETYPE_WALLWALK = 31; /* Players using this movetype will be able to orient themselves to walls, and then run up them. */ +const float MOVETYPE_PHYSICS = 32; /* Enable the use of ODE physics upon this entity. */ +const float SOLID_NOT = 0; +const float SOLID_TRIGGER = 1; +const float SOLID_BBOX = 2; +const float SOLID_SLIDEBOX = 3; +const float SOLID_BSP = 4; /* Does not collide against other SOLID_BSP entities. Normally paired with MOVETYPE_PUSH. */ +const float SOLID_CORPSE = 5; /* Non-solid to SOLID_SLIDEBOX or other SOLID_CORPSE entities. For hitscan weapons to hit corpses, change the player's .hitcontentsmaski value to include CONTENTBIT_CORPSE, perform the traceline, then revert the player's .solid value. */ +__deprecated("Obsoleted by .skin=CONTENTS_LADDER") const float SOLID_LADDER = 20; /* Obsolete and may be removed at some point. Use skin=CONTENT_LADDER and solid_bsp or solid_trigger instead. */ +const float SOLID_PORTAL = 21; /* CSG subtraction volume combined with entity transformations on impact. */ +const float SOLID_BSPTRIGGER = 22; /* For complex-shaped trigger volumes, instead of being a pure aabb. */ +const float SOLID_PHYSICS_BOX = 32; +const float SOLID_PHYSICS_SPHERE = 33; +const float SOLID_PHYSICS_CAPSULE = 34; +const float SOLID_PHYSICS_TRIMESH = 35; +const float SOLID_PHYSICS_CYLINDER = 36; +const float GEOMTYPE_NONE = -1; +const float GEOMTYPE_SOLID = 0; +const float GEOMTYPE_BOX = 1; +const float GEOMTYPE_SPHERE = 2; +const float GEOMTYPE_CAPSULE = 3; +const float GEOMTYPE_TRIMESH = 4; +const float GEOMTYPE_CYLINDER = 5; +const float GEOMTYPE_CAPSULE_X = 6; +const float GEOMTYPE_CAPSULE_Y = 7; +const float GEOMTYPE_CAPSULE_Z = 8; +const float GEOMTYPE_CYLINDER_X = 9; +const float GEOMTYPE_CYLINDER_Y = 10; +const float GEOMTYPE_CYLINDER_Z = 11; +const float JOINTTYPE_FIXED = -1; +const float JOINTTYPE_POINT = 1; +const float JOINTTYPE_HINGE = 2; +const float JOINTTYPE_SLIDER = 3; +const float JOINTTYPE_UNIVERSAL = 4; +const float JOINTTYPE_HINGE2 = 5; +#endif +#ifdef CSQC +const float GE_MAXENTS = -1; /* Valid for getentity, ignores the entity argument. Returns the maximum number of entities which may be valid, to avoid having to poll 65k when only 100 are used. */ +const float GE_ACTIVE = 0; /* Valid for getentity. Returns whether this entity is known to the client or not. */ +const float GE_ORIGIN = 1; /* Valid for getentity. Returns the interpolated .origin. */ +const float GE_FORWARD = 2; /* Valid for getentity. Returns the interpolated forward vector. */ +const float GE_RIGHT = 3; /* Valid for getentity. Returns the entity's right vector. */ +const float GE_UP = 4; /* Valid for getentity. Returns the entity's up vector. */ +const float GE_SCALE = 5; /* Valid for getentity. Returns the entity .scale. */ +const float GE_ORIGINANDVECTORS = 6; /* Valid for getentity. Returns interpolated .origin, but also sets v_forward, v_right, and v_up accordingly. Use vectoangles(v_forward,v_up) to determine the angles. */ +const float GE_ALPHA = 7; /* Valid for getentity. Returns the entity alpha. */ +const float GE_COLORMOD = 8; /* Valid for getentity. Returns the colormod vector. */ +const float GE_PANTSCOLOR = 9; /* Valid for getentity. Returns the entity's lower color (from .colormap), as a palette range value. */ +const float GE_SHIRTCOLOR = 10; /* Valid for getentity. Returns the entity's lower color (from .colormap), as a palette range value. */ +const float GE_SKIN = 11; /* Valid for getentity. Returns the entity's .skin index. */ +const float GE_MINS = 12; /* Valid for getentity. Guesses the entity's .min vector. */ +const float GE_MAXS = 13; /* Valid for getentity. Guesses the entity's .max vector. */ +const float GE_ABSMIN = 14; /* Valid for getentity. Guesses the entity's .absmin vector. */ +const float GE_ABSMAX = 15; /* Valid for getentity. Guesses the entity's .absmax vector. */ +const float GE_MODELINDEX = 200; /* Valid for getentity. Guesses the entity's .modelindex float. */ +const float GE_MODELINDEX2 = 201; /* Valid for getentity. Guesses the entity's .vw_index float. */ +const float GE_EFFECTS = 202; /* Valid for getentity. Guesses the entity's .effects float. */ +const float GE_FRAME = 203; /* Valid for getentity. Guesses the entity's .frame float. */ +const float GE_ANGLES = 204; /* Valid for getentity. Guesses the entity's .angles vector. */ +const float GE_FATNESS = 205; /* Valid for getentity. Guesses the entity's .fatness float. */ +const float GE_DRAWFLAGS = 206; /* Valid for getentity. Guesses the entity's .drawflags float. */ +const float GE_ABSLIGHT = 207; /* Valid for getentity. Guesses the entity's .abslight float. */ +const float GE_GLOWMOD = 208; /* Valid for getentity. Guesses the entity's .glowmod vector. */ +const float GE_GLOWSIZE = 209; /* Valid for getentity. Guesses the entity's .glowsize float. */ +const float GE_GLOWCOLOUR = 210; /* Valid for getentity. Guesses the entity's .glowcolor float. */ +const float GE_RTSTYLE = 211; /* Valid for getentity. Guesses the entity's .style float. */ +const float GE_RTPFLAGS = 212; /* Valid for getentity. Guesses the entity's .pflags float. */ +const float GE_RTCOLOUR = 213; /* Valid for getentity. Guesses the entity's .color vector. */ +const float GE_RTRADIUS = 214; /* Valid for getentity. Guesses the entity's .light_lev float. */ +const float GE_TAGENTITY = 215; /* Valid for getentity. Guesses the entity's .tag_entity float. */ +const float GE_TAGINDEX = 216; /* Valid for getentity. Guesses the entity's .tag_index float. */ +const float GE_GRAVITYDIR = 217; /* Valid for getentity. Guesses the entity's .gravitydir vector. */ +const float GE_TRAILEFFECTNUM = 218; /* Valid for getentity. Guesses the entity's .traileffectnum float. */ +#endif +#ifdef SSQC +const float DAMAGE_NO = 0; +const float DAMAGE_YES = 1; +const float DAMAGE_AIM = 2; +#endif +#if defined(CSQC) || defined(SSQC) +const float CONTENT_EMPTY = -1; +const float CONTENT_SOLID = -2; +const float CONTENT_WATER = -3; +const float CONTENT_SLIME = -4; +const float CONTENT_LAVA = -5; +const float CONTENT_SKY = -6; +const float CONTENT_LADDER = -16; /* If this value is assigned to a solid_bsp's .skin field, the entity will become a ladder volume. */ +const int CONTENTBIT_NONE = 0x00000000i; +const int CONTENTBIT_SOLID = 0x00000001i; +const int CONTENTBIT_LAVA = 0x00000008i; +const int CONTENTBIT_SLIME = 0x00000010i; +const int CONTENTBIT_WATER = 0x00000020i; +const int CONTENTBIT_FTELADDER = 0x00004000i; /* Content bit used for .skin=CONTENT_LADDER entities. */ +const int CONTENTBIT_PLAYERCLIP = 0x00010000i; +const int CONTENTBIT_MONSTERCLIP = 0x00020000i; +const int CONTENTBIT_BODY = 0x02000000i; /* Content bit that indicates collisions against SOLID_BBOX/SOLID_SLIDEBOX entities. */ +const int CONTENTBIT_CORPSE = 0x04000000i; /* Content bit that indicates collisions against SOLID_CORPSE entities. */ +const int CONTENTBIT_Q2LADDER = 0x20000000i; /* Content bit specific to q2bsp (conflicts with q3bsp contents so use with caution). */ +const int CONTENTBIT_SKY = 0x80000000i; /* Content bit somewhat specific to q1bsp (aliases to NODROP in q3bsp), but you should probably check surfaceflags&SURF_SKY as well for q2+q3bsp too. */ +const int CONTENTBITS_POINTSOLID = CONTENTBIT_SOLID|0x00000002i|CONTENTBIT_BODY; /* Bits that traceline would normally consider solid */ +const int CONTENTBITS_BOXSOLID = CONTENTBIT_SOLID|0x00000002i|CONTENTBIT_BODY|CONTENTBIT_PLAYERCLIP; /* Bits that tracebox would normally consider solid */ +const int CONTENTBITS_FLUID = CONTENTBIT_WATER|CONTENTBIT_SLIME|CONTENTBIT_LAVA|CONTENTBIT_SKY; +const float SPA_POSITION = 0; /* These SPA_* constants are to specify which attribute is returned by the getsurfacepointattribute builtin */ +const float SPA_S_AXIS = 1; +const float SPA_T_AXIS = 2; +const float SPA_R_AXIS = 3; /* aka: SPA_NORMAL */ +const float SPA_TEXCOORDS0 = 4; +const float SPA_LIGHTMAP0_TEXCOORDS = 5; +const float SPA_LIGHTMAP0_COLOR = 6; +const float CHAN_AUTO = 0; /* The automatic channel, play as many sounds on this channel as you want, and they'll all play, however the other channels will replace each other. */ +const float CHAN_WEAPON = 1; +const float CHAN_VOICE = 2; +const float CHAN_ITEM = 3; +const float CHAN_BODY = 4; +#endif +#if defined(QWSSQC) +const float CHANF_RELIABLE = 8; /* Only valid if the flags argument is not specified. The sound will be sent reliably, which is important if it is intended to replace looping sounds on doors etc. */ +#endif +#ifdef SSQC +const float SOUNDFLAG_RELIABLE = 1; /* The sound will be sent reliably, and without regard to phs. */ +#endif +#ifdef CSQC +const float SOUNDFLAG_ABSVOLUME = 16; /* The sample's volume is not scaled by the volume cvar. Use with caution */ +#endif +#if defined(CSQC) || defined(SSQC) +const float SOUNDFLAG_FORCELOOP = 2; /* The sound will restart once it reaches the end of the sample. */ +const float SOUNDFLAG_NOSPACIALISE = 4; /* The different audio channels are played at the same volume regardless of which way the player is facing, without needing to use 0 attenuation. */ +const float SOUNDFLAG_NOREVERB = 32; /* Disables the use of underwater/reverb effects on this sound effect. */ +const float SOUNDFLAG_FOLLOW = 64; /* The sound's origin will updated to follow the emitting entity. */ +const float SOUNDFLAG_NOREPLACE = 128; /* Sounds started with this flag will be ignored when there's already a sound playing on that same ent-channel. */ +#endif +#ifdef SSQC +const float SOUNDFLAG_UNICAST = 256; /* The sound will be sent only by the player specified by msg_entity. Spectators and related splitscreen players will also hear the sound. */ +const float SOUNDFLAG_SENDVELOCITY = 512; /* The entity's current velocity will be sent to the client, only useful if doppler is enabled. */ +#endif +#if defined(CSQC) || defined(SSQC) +const float ATTN_NONE = 0; /* Sounds with this attenuation can be heard throughout the map */ +const float ATTN_NORM = 1; /* Standard attenuation */ +const float ATTN_IDLE = 2; /* Extra attenuation so that sounds don't travel too far. */ +const float ATTN_STATIC = 3; /* Even more attenuation to avoid torches drowing out everything else throughout the map. */ +#endif +#ifdef SSQC +const float SVC_CGAMEPACKET = 83; /* Direct ssqc->csqc message. Must only be multicast. The data triggers a CSQC_Parse_Event call in the csqc for the csqc to read the contents. The server *may* insert length information for clients connected via proxies which are not able to cope with custom csqc payloads. This should only ever be used in conjunction with the MSG_MULTICAST destination. */ +#endif +#if defined(CSQC) || defined(SSQC) +const float TE_SPIKE = 0; +const float TE_SUPERSPIKE = 1; +const float TE_GUNSHOT = 2; +const float TE_EXPLOSION = 3; +const float TE_TAREXPLOSION = 4; +const float TE_LIGHTNING1 = 5; +const float TE_LIGHTNING2 = 6; +const float TE_WIZSPIKE = 7; +const float TE_KNIGHTSPIKE = 8; +const float TE_LIGHTNING3 = 9; +const float TE_LAVASPLASH = 10; +const float TE_TELEPORT = 11; +#endif +#if defined(CSQC) || defined(QWSSQC) +const float TE_BLOOD = 12; +#endif +#if defined(NQSSQC) +const float TE_EXPLOSION2 = 12; +#endif +#if defined(CSQC) || defined(QWSSQC) +const float TE_LIGHTNINGBLOOD = 13; +#endif +#if defined(NQSSQC) +const float TE_BEAM = 13; +const float MSG_BROADCAST = 0; /* The byte(s) will be unreliably sent to all players. MSG_ constants are valid arguments to the Write* builtin family. */ +const float MSG_ONE = 1; /* The byte(s) will be reliably sent to the player specified in the msg_entity global. WARNING: in quakeworld servers without network preparsing enabled, this can result in illegible server messages (due to individual reliable messages being split between multiple backbuffers/packets). NQ has larger reliable buffers which avoids this issue, but still kicks the client. */ +const float MSG_ALL = 2; /* The byte(s) will be reliably sent to all players. */ +#endif +#if defined(QWSSQC) +__deprecated("Use MSG_MULTICAST+multicast(MULTICAST_*)") const float MSG_BROADCAST; /* The byte(s) will be unreliably sent to all players. MSG_ constants are valid arguments to the Write* builtin family. */ +__deprecated("Use MSG_MULTICAST+multicast(MULTICAST_ONE_R)") const float MSG_ONE = 1; /* The byte(s) will be reliably sent to the player specified in the msg_entity global. WARNING: in quakeworld servers without network preparsing enabled, this can result in illegible server messages (due to individual reliable messages being split between multiple backbuffers/packets). NQ has larger reliable buffers which avoids this issue, but still kicks the client. */ +__deprecated("Use MSG_MULTICAST+multicast(MULTICAST_ALL)") const float MSG_ALL = 2; /* The byte(s) will be reliably sent to all players. */ +#endif +#ifdef SSQC +const float MSG_INIT = 3; /* The byte(s) will be written into the signon buffer. Clients will see these messages when they connect later. This buffer is only flushed on map changes, so spamming it _WILL_ result in overflows. */ +const float MSG_MULTICAST = 4; /* The byte(s) will be written into the multicast buffer for more selective sending. Messages sent this way will never be split across packets, and using this for csqc-only messages will not break protocol translation. */ +const float MSG_ENTITY = 5; /* The byte(s) will be written into the entity buffer. This is a special value used only inside 'SendEntity' functions. */ +const float MULTICAST_ALL = 0; /* The multicast message is unreliably sent to all players. MULTICAST_ constants are valid arguments for the multicast builtin, which ignores the specified origin when given this constant. */ +const float MULTICAST_PHS = 1; /* The multicast message is unreliably sent to only players that can potentially hear the specified origin. Its quite loose. */ +const float MULTICAST_PVS = 2; /* The multicast message is unreliably sent to only players that can potentially see the specified origin. */ +const float MULTICAST_ONE = 6; /* The multicast message is unreliably sent to the player (AND ALL TRACKING SPECTATORS) specified in the msg_entity global. The specified origin is ignored. */ +const float MULTICAST_ONE_NOSPECS = 9; /* The multicast message is unreliably sent to the player specified in the msg_entity global. The specified origin is ignored. */ +const float MULTICAST_ALL_R = 3; /* The multicast message is reliably sent to all players. The specified origin is ignored. */ +const float MULTICAST_PHS_R = 4; /* The multicast message is reliably sent to only players that can potentially hear the specified origin. Players might still not receive it if they are out of range. */ +const float MULTICAST_PVS_R = 5; /* The multicast message is reliably sent to only players that can potentially see the specified origin. Players might still not receive it if they cannot see the event. */ +const float MULTICAST_ONE_R = 7; /* The multicast message is reliably sent to the player (AND ALL TRACKING SPECTATORS) specified in the msg_entity global. The specified origin is ignored */ +const float MULTICAST_ONE_R_NOSPECS = 10; /* The multicast message is reliably sent to the player specified in the msg_entity global. The specified origin is ignored */ +#endif +#if defined(QWSSQC) +const float PRINT_LOW = 0; +const float PRINT_MEDIUM = 1; +const float PRINT_HIGH = 2; +const float PRINT_CHAT = 3; +#endif +#ifdef SSQC +const float PVSF_NORMALPVS = 0; /* Filter first by PVS, then filter this entity using tracelines if sv_cullentities is enabled. */ +const float PVSF_NOTRACECHECK = 1; /* Filter strictly by PVS. */ +const float PVSF_USEPHS = 2; /* Send if we're close enough to be able to hear this entity. */ +const float PVSF_IGNOREPVS = 3; /* Ignores pvs. This entity is visible whereever you are on the map. Updates will be sent regardless of pvs or phs */ +const float PVSF_NOREMOVE = 128; /* Once visible to a client, this entity will remain visible. This can be useful for csqc and corpses. While this flag is set, no CSQC_Remove events will be sent for the entity, but this does NOT mean that it will still receive further updates while outside of the pvs. */ +const string INFOKEY_P_IP = "ip"; /* The apparent ip address of the client. This may be a proxy's ip address. */ +const string INFOKEY_P_REALIP = "realip"; /* If sv_getrealip is set, this gives the ip as determine using that algorithm. */ +const string INFOKEY_P_CSQCACTIVE = "csqcactive"; /* Client has csqc enabled. CSQC ents etc will be sent to this player. */ +const string INFOKEY_P_SVPING = "svping"; +const string INFOKEY_P_GUID = "guid"; /* Some hash string which should be reasonably unique to this player's quake installation. */ +const string INFOKEY_P_CHALLENGE = "challenge"; +const string INFOKEY_P_USERID = "*userid"; +const string INFOKEY_P_DOWNLOADPCT = "download"; /* The client's download percentage for the current file. Additional files are not known. */ +const string INFOKEY_P_TRUSTLEVEL = "trustlevel"; +const string INFOKEY_P_PROTOCOL = "protocol"; /* The network protocol the client is using to connect to the server. */ +const string INFOKEY_P_VIP = "*VIP"; /* 1 if the player has the VIP 'penalty'. */ +const string INFOKEY_P_ISMUTED = "*ismuted"; /* 1 if the player has the 'mute' penalty and is not allowed to use the say/say_team commands. */ +const string INFOKEY_P_ISDEAF = "*isdeaf"; /* 1 if the player has the 'deaf' penalty and cannot see other people's say/say_team commands. */ +const string INFOKEY_P_ISCRIPPLED = "*ismuted"; /* 1 if the player has the cripple penalty, and their movement values are ignored (.movement is locked to 0). */ +const string INFOKEY_P_ISCUFFED = "*ismuted"; /* 1 if the player has the cuff penalty, and is unable to attack or use impulses(.button0 and .impulse fields are locked to 0). */ +const string INFOKEY_P_ISLAGGED = "*ismuted"; /* 1 if the player has the fakelag penalty and has an extra 200ms of lag. */ +#endif +#if defined(CSQC) || defined(SSQC) +const string INFOKEY_P_PING = "ping"; /* The player's ping time, in milliseconds. */ +const string INFOKEY_P_NAME = "name"; /* The player's name. */ +const string INFOKEY_P_SPECTATOR = "*spectator"; /* Whether the player is a spectator or not. */ +const string INFOKEY_P_TOPCOLOR = "topcolor"; /* The player's upper/shirt colour (palette index). */ +const string INFOKEY_P_BOTTOMCOLOR = "bottomcolor"; /* The player's lower/pants/trouser colour (palette index). */ +#endif +#ifdef CSQC +const string INFOKEY_P_TOPCOLOR_RGB = "topcolor_rgb"; /* The player's upper/shirt colour as an rgb value in a format usable with stov. */ +const string INFOKEY_P_BOTTOMCOLOR_RGB = "bottomcolor_rgb"; /* The player's lower/pants/trouser colour as an rgb value in a format usable with stov. */ +const string INFOKEY_P_MUTED = "ignored"; /* 0: we can see the result of the player's say/say_team commands. 1: we see no say/say_team messages from this player. Use the ignore command to toggle this value. */ +const string INFOKEY_P_VOIP_MUTED = "vignored"; /* 0: we can hear this player when they speak (assuming voip is generally enabled). 1: we ignore everything this player says. Use cl_voip_mute to change the values. */ +const string INFOKEY_P_ENTERTIME = "entertime"; /* Reads the timestamp at which the player entered the game, in terms of csqc's time global. */ +const string INFOKEY_P_FRAGS = "frags"; /* Reads a player's frag count. */ +const string INFOKEY_P_PACKETLOSS = "pl"; /* Reads a player's packetloss, as a percentage. */ +const string INFOKEY_P_VOIPSPEAKING = "voipspeaking"; /* Boolean value that says whether the given player is currently sending voice information. */ +const string INFOKEY_P_VOIPLOUDNESS = "voiploudness"; /* Only valid for the local player. Gives a value between 0 and 1 to indicate to the user how loud their mic is. */ +const string SERVERKEY_IP = "ip"; /* The address of the server we connected to. */ +const string SERVERKEY_SERVERNAME = "servername"; /* The hostname that was last passed to the connect command. */ +const string SERVERKEY_CONSTATE = "constate"; /* The current connection state. Will be set to one of: disconnected (menu-only mode), active (gamestate received and loaded), connecting(connecting, downloading, or precaching content, aka: loading screen). */ +const string SERVERKEY_TRANSFERRING = "transferring"; /* Set to the hostname of the server that we are attempting to connect or transfer to. */ +const string SERVERKEY_LOADSTATE = "loadstate"; /* loadstage, loading image name, current step, max steps +Stages are: 1=connecting, 2=serverside, 3=clientside +Key will be empty if we are not loading. */ +const string SERVERKEY_PAUSESTATE = "pausestate"; /* 1 if the server claimed to be paused. 0 otherwise */ +const string SERVERKEY_DLSTATE = "dlstate"; /* The progress of any current downloads. Empty string if no download is active, otherwise a tokenizable string containing this info: +files-remaining, total-size, unknown-sizes-flag, file-localname, file-remotename, file-percent, file-rate, file-received-bytes, file-total-bytes +If the current file info is omitted, then we are waiting for a download to start. */ +const string SERVERKEY_PROTOCOL = "protocol"; /* The protocol we are connected to the server with. */ +const string SERVERKEY_MAXPLAYERS = "maxplayers"; /* The number of player/spectator slots allocated on the server. */ +#endif +#ifdef SSQC +const float STUFFCMD_IGNOREINDEMO = 1; /* This stuffcmd will NOT be written to mvds/qtv. */ +const float STUFFCMD_DEMOONLY = 2; /* This stuffcmd will ONLY be written into mvds/qtv streams. */ +const float STUFFCMD_BROADCAST = 4; /* The stuffcmd will be broadcast server-wide (according to the mvd filters). */ +const float STUFFCMD_UNRELIABLE = 8; /* The stuffcmd might not arrive. It might also get there faster than ones sent over the reliable channel. */ +#endif +#if defined(CSQC) || defined(SSQC) +const float FL_FLY = 1; +const float FL_SWIM = 2; +const float FL_CLIENT = 8; +const float FL_INWATER = 16; +const float FL_MONSTER = 32; +#endif +#ifdef SSQC +const float FL_GODMODE = 64; +const float FL_NOTARGET = 128; +#endif +#if defined(CSQC) || defined(SSQC) +const float FL_ITEM = 256; +const float FL_ONGROUND = 512; +const float FL_PARTIALGROUND = 1024; +const float FL_WATERJUMP = 2048; +#endif +#if defined(NQSSQC) +const float FL_JUMPRELEASED = 4096; +#endif +#if defined(CSQC) || defined(SSQC) +const float FL_FINDABLE_NONSOLID = 16384; /* Allows this entity to be found with findradius */ +#endif +#ifdef SSQC +const float FL_LAGGEDMOVE = 65536; /* Enables anti-lag on rockets etc. */ +#endif +#if defined(CSQC) || defined(SSQC) +const float MOVE_NORMAL = 0; +const float MOVE_NOMONSTERS = 1; /* The trace will ignore all non-solid_bsp entities. */ +const float MOVE_MISSILE = 2; /* The trace will use a bbox size of +/- 15 against entities with FL_MONSTER set. */ +const float MOVE_WORLDONLY = 3; /* The trace will ignore everything but the worldmodel. This is useful for to prevent the q3bsp pvs+culling issues that come with spectator modes leaving the world . */ +const float MOVE_HITMODEL = 4; /* Traces will impact the actual mesh of the model instead of merely their bounding box. Should generally only be used for tracelines. Note that this flag is unreliable as an object can animate through projectiles. The bounding box MUST be set to completely encompass the entity or those extra areas will be non-solid (leaving a hole for things to go through). */ +const float MOVE_TRIGGERS = 16; /* This trace type will impact only triggers. It will ignore non-solid entities. */ +const float MOVE_EVERYTHING = 32; /* This type of trace will hit solids and triggers alike. Even non-solid entities. */ +#endif +#ifdef SSQC +const float MOVE_LAGGED = 64; /* Will use antilag based upon the player's latency. Traces will be performed against old positions for entities instead of their current origin. */ +#endif +#if defined(CSQC) || defined(SSQC) +const float MOVE_ENTCHAIN = 128; /* Returns a list of entities impacted via the trace_ent.chain field */ +const float MOVE_OTHERONLY = 256; /* Traces that use this trace type will collide against *only* the entity specified via the 'other' global, and will ignore all owner/solid_not/dimension etc rules, they will still adhere to contents and bsp/bbox rules though. */ +#endif +const float CVAR_TYPEFLAG_EXISTS = 1; /* Cvar name actually exists. */ +const float CVAR_TYPEFLAG_SAVED = 2; /* Cvar is flaged for archival (might need cfg_save to actually save). */ +const float CVAR_TYPEFLAG_PRIVATE = 4; /* QC is not allowed to read. */ +const float CVAR_TYPEFLAG_ENGINE = 8; /* Cvar was created by the engine itself (not user/mod created). */ +const float CVAR_TYPEFLAG_HASDESCRIPTION = 16; /* cvar_description will return something (hopefully) useful. */ +const float CVAR_TYPEFLAG_READONLY = 32; /* cvar may not be changed by qc. */ +const float RESTYPE_MODEL = 0; /* RESTYPE_* constants are used as arguments with the resourcestatus builtin. */ +const float RESTYPE_SOUND = 1; /* precache_sound */ +const float RESTYPE_PARTICLE = 2; /* particleeffectnum */ +#if defined(CSQC) || defined(MENU) +const float RESTYPE_PIC = 3; /* precache_pic. Status results are an amalgomation of the textures used by the named shader. */ +const float RESTYPE_SKIN = 4; /* setcustomskin */ +const float RESTYPE_TEXTURE = 5; /* Individual textures within shaders. These are not directly usable, but may be named as part of a skin file, or a shader. */ +#endif +const float RESSTATE_NOTKNOWN = 0; /* RESSTATE_* constants are return values from the resourcestatus builtin. The engine doesn't know about the resource if it is in this state. This means you will need to precache it. Attempting to use it anyway may result in warnings, errors, or silently succeed, depending on engine version and resource type. */ +const float RESSTATE_NOTLOADED = 1; /* The resource was precached, but has been flushed and there has not been an attempt to reload it. If you use the resource normally, chances are it'll be loaded but at the cost of a stall. */ +const float RESSTATE_LOADING = 2; /* Resources in this this state are queued for loading, and will be loaded at the engine's convienience. If you attempt to query the resource now, the engine will stall until the result is available. sounds in this state may be delayed, while models/pics/shaders may be invisible. */ +const float RESSTATE_FAILED = 3; /* Resources in this state are unusable/could not be loaded. You will get placeholders or dummy results. Queries will not stall the engine. The engine may display placeholder content. */ +const float RESSTATE_LOADED = 4; /* Resources in this state are finally usable, everything will work okay. Hurrah. Queries will not stall the engine. */ +#if defined(CSQC) || defined(SSQC) +const float EF_BRIGHTFIELD = 1; +#endif +#if defined(CSQC) || defined(NQSSQC) +const float EF_MUZZLEFLASH = 2; +#endif +#if defined(CSQC) || defined(SSQC) +const float EF_BRIGHTLIGHT = 4; +const float EF_DIMLIGHT = 8; +#endif +#if defined(QWSSQC) +const float EF_FLAG1 = 16; +const float EF_FLAG2 = 32; +#endif +#if defined(CSQC) || defined(NQSSQC) +const float EF_NODRAW = 16; /* Disables drawing of the model. Does NOT work on QW players. */ +#endif +#if defined(CSQC) || defined(SSQC) +const float EF_ADDITIVE = 32; /* The entity will be drawn with an additive blend. This is NOT supported on players in any quakeworld engine. */ +const float EF_BLUE = 64; /* A blue glow */ +const float EF_RED = 128; /* A red glow */ +const float EF_GREEN = 262144; /* A green glow */ +const float EF_FULLBRIGHT = 512; /* This entity will ignore lighting */ +const float EF_NOSHADOW = 4096; /* This entity will not cast shadows */ +const float EF_NODEPTHTEST = 8192; /* This entity will be drawn over the top of other things that are closer. */ +#endif +#ifdef SSQC +const float EF_NOMODELFLAGS = 8388608; /* Surpresses the normal flags specified in the model. */ +#endif +#if defined(CSQC) || defined(SSQC) +const float MF_ROCKET = 1; +const float MF_GRENADE = 2; +const float MF_GIB = 4; /* Regular blood trail */ +const float MF_ROTATE = 8; +const float MF_TRACER = 16; /* AKA: green scrag trail */ +const float MF_ZOMGIB = 32; /* Dark blood trail */ +const float MF_TRACER2 = 64; /* AKA: hellknight projectile trail */ +const float MF_TRACER3 = 128; /* AKA: purple vore trail */ +#endif +#ifdef SSQC +DEP_CSQC const float SL_ORG_TL = 20; /* Used with showpic etc, specifies that the x+y values are relative to the top-left of the screen */ +DEP_CSQC const float SL_ORG_TR = 21; +DEP_CSQC const float SL_ORG_BL = 22; +DEP_CSQC const float SL_ORG_BR = 23; +DEP_CSQC const float SL_ORG_MM = 24; +DEP_CSQC const float SL_ORG_TM = 25; +DEP_CSQC const float SL_ORG_BM = 26; +DEP_CSQC const float SL_ORG_ML = 27; +DEP_CSQC const float SL_ORG_MR = 28; +#endif +#if defined(CSQC) || defined(SSQC) +const float PFLAGS_NOSHADOW = 1; /* Associated RT lights attached will not cast shadows, making them significantly faster to draw. */ +const float PFLAGS_CORONA = 2; /* Enables support of coronas on the associated rtlights. */ +#endif +#ifdef SSQC +const float PFLAGS_FULLDYNAMIC = 128; /* When set in self.pflags, enables fully-customised dynamic lights. Custom rtlight information is not otherwise used. */ +#endif +const float EV_STRING = 1; +const float EV_FLOAT = 2; +const float EV_VECTOR = 3; +const float EV_ENTITY = 4; +const float EV_FIELD = 5; +const float EV_FUNCTION = 6; +const float EV_POINTER = 7; +const float EV_INTEGER = 8; +const float EV_UINT = 9; +const float EV_INT64 = 10; +const float EV_UINT64 = 11; +const float EV_DOUBLE = 12; +hashtable gamestate; /* Special hash table index for hash_add and hash_get. Entries in this table will persist over map changes (and doesn't need to be created/deleted). */ +const float HASH_REPLACE = 256; /* Used with hash_add. Attempts to remove the old value instead of adding two values for a single key. */ +const float HASH_ADD = 512; /* Used with hash_add. The new entry will be inserted in addition to the existing entry. */ +#ifdef CSQC +const float STAT_HEALTH = 0; /* Player's health. */ +const float STAT_WEAPONMODELI = 2; /* This is the modelindex of the current viewmodel (renamed from the original name 'STAT_WEAPON' due to confusions). */ +const float STAT_AMMO = 3; /* player.currentammo */ +const float STAT_ARMOR = 4; +const float STAT_WEAPONFRAME = 5; +const float STAT_SHELLS = 6; +const float STAT_NAILS = 7; +const float STAT_ROCKETS = 8; +const float STAT_CELLS = 9; +const float STAT_ACTIVEWEAPON = 10; /* player.weapon */ +const float STAT_TOTALSECRETS = 11; +const float STAT_TOTALMONSTERS = 12; +const float STAT_FOUNDSECRETS = 13; +const float STAT_KILLEDMONSTERS = 14; +const float STAT_ITEMS = 15; /* self.items | (self.items2<<23). In order to decode this stat properly, you need to use getstatbits(STAT_ITEMS,0,23) to read self.items, and getstatbits(STAT_ITEMS,23,11) to read self.items2 or getstatbits(STAT_ITEMS,28,4) to read the visible part of serverflags, whichever is applicable. */ +const float STAT_VIEWHEIGHT = 16; /* player.view_ofs_z */ +const float STAT_VIEW2 = 20; /* This stat contains the number of the entity in the server's .view2 field. */ +const float STAT_VIEWZOOM = 21; /* Scales fov and sensitiity. Part of DP_VIEWZOOM. */ +#endif +#if defined(CSQC) || defined(SSQC) +const float STAT_USER = 32; /* Custom user stats start here (lower values are reserved for engine use). */ +#endif +#if defined(CSQC) || defined(MENU) +const float PRECACHE_PIC_FROMWAD = 1; /* Attempt to load it from the legacy gfx.wad file (usually its better to just use a gfx/ prefix instead). */ +const float PRECACHE_PIC_NOCLAMP = 4; /* Texture coords for the pic will not be clamped nor padded nor atlased. */ +const float PRECACHE_PIC_DOWNLOAD = 256; /* If no image could be loaded then attempt to download one from the server. This flag can cause the function to block until completion. (Slow!) */ +const float PRECACHE_PIC_TEST = 512; /* The precache will block until the image is fully loaded, returning a null string on failure. (Slow!) */ +const float VF_MIN = 1; /* The top-left of the 3d viewport in screenspace. The VF_ values are used via the setviewprop/getviewprop builtins. */ +const float VF_MIN_X = 2; +const float VF_MIN_Y = 3; +const float VF_SIZE = 4; /* The width+height of the 3d viewport in screenspace. */ +const float VF_SIZE_X = 5; +const float VF_SIZE_Y = 6; +const float VF_VIEWPORT = 7; /* vector+vector. Two argument shortcut for VF_MIN and VF_SIZE */ +const float VF_FOV = 8; /* sets both fovx and fovy. consider using afov instead. */ +const float VF_FOV_X = 9; /* horizontal field of view. does not consider aspect at all. */ +const float VF_FOV_Y = 10; /* vertical field of view. does not consider aspect at all. */ +const float VF_ORIGIN = 11; /* The origin of the view. Not of the player. */ +const float VF_ORIGIN_X = 12; +const float VF_ORIGIN_Y = 13; +const float VF_ORIGIN_Z = 14; +const float VF_ANGLES = 15; /* The angles the view will be drawn at. Not the angle the client reports to the server. */ +const float VF_ANGLES_X = 16; +const float VF_ANGLES_Y = 17; +const float VF_ANGLES_Z = 18; +#endif +#ifdef CSQC +const float VF_DRAWWORLD = 19; /* boolean. If set to 1, the engine will draw the world and static/persistant rtlights. If 0, the world will be skipped and everything will be fullbright. */ +const float VF_DRAWENGINESBAR = 20; /* boolean. If set to 1, the sbar will be drawn, and viewsize will be honoured automatically. */ +const float VF_DRAWCROSSHAIR = 21; /* boolean. If set to 1, the engine will draw its default crosshair. */ +#endif +#if defined(CSQC) || defined(MENU) +const float VF_MINDIST = 23; /* The distance of the near clip plane from the view position. Should generally not be <=0, as this would introduce NANs. */ +const float VF_MAXDIST = 24; /* The distance of the far clip plane from the view position. If 0, will be considered infinite. */ +#endif +#ifdef CSQC +const float VF_CL_VIEWANGLES = 33; +const float VF_CL_VIEWANGLES_X = 34; +const float VF_CL_VIEWANGLES_Y = 35; +const float VF_CL_VIEWANGLES_Z = 36; +#endif +#if defined(CSQC) || defined(MENU) +const float VF_PERSPECTIVE = 200; /* 1: regular rendering. Fov specifies the angle. 0: isometric-style. Fov specifies the number of Quake Units each side of the viewport, and mindist restrictions are removed, pvs culling should be disabled. */ +#endif +#ifdef CSQC +#define VF_LPLAYER VF_ACTIVESEAT +const float VF_ACTIVESEAT = 202; /* The 'seat' number, used when running splitscreen. */ +#endif +#if defined(CSQC) || defined(MENU) +const float VF_AFOV = 203; /* Aproximate fov. Matches the 'fov' cvar. The engine handles the aspect ratio for you. */ +const float VF_SCREENVSIZE = 204; /* Provides a reliable way to retrieve the current virtual screen size (even if the screen is automatically scaled to retain aspect). */ +const float VF_SCREENPSIZE = 205; /* Provides a reliable way to retrieve the current physical screen size (cvars need vid_restart for them to take effect). */ +#endif +#ifdef CSQC +const float VF_VIEWENTITY = 206; /* Changes the RF_EXTERNALMODEL flag on entities to match the new selection, and removes entities flaged with RF_VIEWENTITY. Requires cunning use of .entnum and typically requires calling addentities(MASK_VIEWMODEL) too. */ +#endif +#if defined(CSQC) || defined(MENU) +const float VF_RT_DESTCOLOUR = 212; /* The texture name to write colour info into, this includes both 3d and 2d drawing. +Additional arguments are: format (IMGFMT_*), sizexy. +Written to by both 3d and 2d rendering. +Note that any rendertarget textures may be destroyed on video mode changes or so. Shaders can name render targets by prefixing texture names with '$rt:', or $sourcecolour. */ +const float VF_RT_DESTCOLOUR1 = 213; /* Like VF_RT_DESTCOLOUR, for multiple render targets. */ +const float VF_RT_DESTCOLOUR2 = 214; /* Like VF_RT_DESTCOLOUR, for multiple render targets. */ +const float VF_RT_DESTCOLOUR3 = 215; /* Like VF_RT_DESTCOLOUR, for multiple render targets. */ +const float VF_RT_SOURCECOLOUR = 209; /* The texture name to use with shaders that specify a $sourcecolour map. */ +const float VF_RT_DEPTH = 210; /* The texture name to use as a depth buffer. Also used for shaders that specify $sourcedepth. 1-based. Additional arguments are: format (IMGFMT_D*), sizexy. */ +const float VF_RT_RIPPLE = 211; /* The texture name to use as a ripplemap (target for shaders with 'sort ripple'). Also used for shaders that specify $ripplemap. 1-based. Additional arguments are: format, sizexy. */ +const float VF_ENVMAP = 220; /* The cubemap name to use as a fallback for $reflectcube, if a shader was unable to load one. Note that this doesn't automatically change shader permutations or anything. */ +const float VF_USERDATA = 221; /* Pointer (and byte size) to an array of vec4s. This data is then globally visible to all glsl via the w_user uniform. */ +#endif +#ifdef CSQC +const float VF_SKYROOM_CAMERA = 222; /* Controls the camera position of the skyroom (which will be drawn underneath transparent sky surfaces). This should move slightly with the real camera, but not so much that the skycamera enters walls. Requires a skyshader with a blend mode on the first pass (or no passes). */ +#endif +#if defined(CSQC) || defined(MENU) +const float VF_PROJECTIONOFFSET = 224; /* vec2 horizontal+vertical offset for the projection matrix, for weird off-centre rendering. */ +const float DRAWFLAG_NORMAL = 0; /* Args for drawpic/drawfill/beginpolygon. Not to be confused with the hexen2-compatibility feature. */ +const float DRAWFLAG_ADD = 1; /* Forces additive blending, overriding any shader settings. */ +const float DRAWFLAG_MODULATE = 2; /* Forces alpha blending, overriding any shader settings. */ +const float DRAWFLAG_2D = 4; /* For use with beginpolygon. The polygon will be drawn to the 2d screen, instead of being added to the 3d scene. */ +const float DRAWFLAG_TWOSIDED = 1024; /* For use with beginpolygon. The polygon will be two-sided without any backface culling. */ +const float DRAWFLAG_LINES = 2048; /* For use with beginpolygon. The surface verticies should be interpreted as a line loop, instead of a triangle fan. */ +const float IMGFMT_R8G8B8A8 = 1; /* Typical 32bit rgba pixel format. */ +const float IMGFMT_R16G16B16A16F = 2; /* Half-Float pixel format. Requires gl3 support. */ +const float IMGFMT_R32G32B32A32F = 3; /* Regular Float pixel format. Requires gl3 support. */ +const float IMGFMT_D16 = 4; /* 16-bit depth pixel format. Must not be used with VF_RT_DESTCOLOUR*. */ +const float IMGFMT_D24 = 5; /* 24-bit depth pixel format. Must not be used with VF_RT_DESTCOLOUR*. */ +const float IMGFMT_D32 = 6; /* 32-bit depth pixel format. Must not be used with VF_RT_DESTCOLOUR*. */ +const float IMGFMT_R8 = 7; /* Single channel red-only 8bit pixel format. */ +const float IMGFMT_R16F = 8; /* Single channel red-only Half-Float pixel format. Requires gl3 support. */ +const float IMGFMT_R32F = 9; /* Single channel red-only Float pixel format. Requires gl3 support. */ +const float IMGFMT_A2B10G10R10 = 10; /* Packed 32-bit packed 10-bit colour pixel format. Requires gl3 support. */ +const float IMGFMT_R5G6B5 = 11; /* Packed 16-bit colour pixel format. */ +const float IMGFMT_R4G4B4A4 = 12; /* Packed 16-bit colour pixel format, with alpha */ +const float IMGFMT_R8G8 = 13; /* 16-bit two-channel pixel format. */ +const float IMGFMT_R32G32B32F = 14; /* A pixel format that matches QC's vector type. */ +#endif +#ifdef CSQC +const float RF_VIEWMODEL = 1; /* Specifies that the entity is a view model, and that its origin is relative to the current view position. These entities are also subject to viewweapon bob. */ +const float RF_EXTERNALMODEL = 2; /* Specifies that this entity should be displayed in mirrors (and may still cast shadows), but will not otherwise be visible. */ +#endif +#if defined(CSQC) || defined(MENU) +const float RF_DEPTHHACK = 4; /* Hacks the depth values such that the entity uses depth values as if it were closer to the screen. This is useful when combined with viewmodels to avoid weapons poking in to walls. */ +const float RF_ADDITIVE = 8; /* Shaders from this entity will temporarily be hacked to use an additive blend mode instead of their normal blend mode. */ +#endif +#ifdef CSQC +const float RF_USEAXIS = 16; /* The entity will be oriented according to the current v_forward+v_right+v_up vector values instead of the entity's .angles field. */ +const float RF_NOSHADOW = 32; /* This entity will not cast shadows. Often useful on view models. */ +const float RF_FRAMETIMESARESTARTTIMES = 64; /* Specifies that the frame1time, frame2time field are timestamps (denoting the start of the animation) rather than time into the animation. */ +const float RF_FIRSTPERSON = 1024; /* This is basically the opposite of RF_EXTERNALMODEL. Don't draw in third-person or mirrors. */ +#endif +#if defined(CSQC) || defined(MENU) +const float IE_KEYDOWN = 0; /* Specifies that a key was pressed. Second argument is the scan code. Third argument is the unicode (printable) char value. Fourth argument denotes which keyboard(or mouse, if its a mouse 'scan' key) the event came from. Note that some systems may completely separate scan codes and unicode values, with a 0 value for the unspecified argument. */ +const float IE_KEYUP = 1; /* Specifies that a key was released. Arguments are the same as IE_KEYDOWN. On some systems, this may be fired instantly after IE_KEYDOWN was fired. */ +const float IE_MOUSEDELTA = 2; /* Specifies that a mouse was moved (touch screens and tablets typically give IE_MOUSEABS events instead, use in_windowed_mouse 0 to test code to cope with either). Second argument is the X displacement, third argument is the Y displacement. Fourth argument is which mouse or touch event triggered the event. */ +const float IE_MOUSEABS = 3; /* Specifies that a mouse cursor or touch event was moved to a specific location relative to the virtual screen space. Second argument is the new X position, third argument is the new Y position. Fourth argument is which mouse or touch event triggered the event. */ +const float IE_ACCELEROMETER = 4; +const float IE_FOCUS = 5; /* Specifies that input focus was given. parama says mouse focus, paramb says keyboard focus. If either are -1, then it is unchanged. */ +const float IE_JOYAXIS = 6; /* Specifies that what value a joystick/controller axis currently specifies. x=axis, y=value. Will be called multiple times, once for each axis of each active controller. */ +const float IE_GYROSCOPE = 7; +const float GGDI_GAMEDIR = 0; /* Used with getgamedirinfo to query the mod's public gamedir. There is often other info that cannot be expressed with just a gamedir name, resulting in dupes or other weirdness. */ +const float GGDI_DESCRIPTION = 1; /* The human-readable title of the mod. Empty when no data is known (ie: the gamedir just contains some maps). */ +const float GGDI_OVERRIDES = 2; /* A list of settings overrides. */ +const float GGDI_LOADCOMMAND = 3; /* The console command needed to actually load the mod. */ +const float GGDI_ICON = 4; /* The mod's Icon path, ready for drawpic. */ +const float GGDI_GAMEDIRLIST = 5; /* A semi-colon delimited list of gamedirs that the mod's content can be loaded through. */ +#endif +#ifdef SSQC +const float CLIENTTYPE_DISCONNECTED = 0; /* Return value from clienttype() builtin. This entity is a player slot that is currently empty. */ +const float CLIENTTYPE_REAL = 1; /* This is a real player, and not a bot. */ +const float CLIENTTYPE_BOT = 2; /* This player slot does not correlate to a real player, any messages sent to this client will be ignored. */ +const float CLIENTTYPE_NOTACLIENT = 3; /* This entity is not even a player slot. This is typically an error condition. */ +#endif +const float FILE_READ = 0; /* The file may be read via fgets to read a single line at a time. */ +const float FILE_APPEND = 1; /* Like FILE_WRITE, but writing starts at the end of the file. */ +const float FILE_WRITE = 2; /* fputs will be used to write to the file. */ +const float FILE_READNL = 4; /* Like FILE_READ, except newlines are not special. fgets reads the entire file into a tempstring. */ +const float FILE_MMAP_READ = 5; /* The file will be loaded into memory. fgets returns a pointer to the first byte (and will always return the same value for this file). Cast this to your datatype. */ +const float FILE_MMAP_RW = 6; /* Like FILE_MMAP_READ, except any changes to the data will be written back to disk once the file is closed. */ +#ifdef CSQC +const float MASK_ENGINE = 1; /* Valid as an argument for addentities. If specified, all non-csqc entities will be added to the scene. */ +const float MASK_VIEWMODEL = 2; /* Valid as an argument for addentities. If specified, the regular engine viewmodel will be added to the scene. */ +const float PREDRAW_AUTOADD = 0; /* Valid as a return value from the predraw function. Returning this will cause the engine to automatically invoke addentity(self) for you. */ +const float PREDRAW_NEXT = 1; /* Valid as a return value from the predraw function. Returning this will simply move on to the next entity without the autoadd behaviour, so can be used for particle/invisible/special entites, or entities that were explicitly drawn with addentity. */ +const float LFIELD_ORIGIN = 0; +const float LFIELD_COLOUR = 1; +const float LFIELD_RADIUS = 2; +const float LFIELD_FLAGS = 3; +const float LFIELD_STYLE = 4; +const float LFIELD_ANGLES = 5; +const float LFIELD_FOV = 6; +const float LFIELD_CORONA = 7; +const float LFIELD_CORONASCALE = 8; +const float LFIELD_CUBEMAPNAME = 9; +const float LFIELD_AMBIENTSCALE = 10; +const float LFIELD_DIFFUSESCALE = 11; +const float LFIELD_SPECULARSCALE = 12; +const float LFIELD_ROTATION = 13; +const float LFIELD_DIETIME = 14; +const float LFIELD_RGBDECAY = 15; +const float LFIELD_RADIUSDECAY = 16; +const float LFIELD_STYLESTRING = 17; +const float LFIELD_NEARCLIP = 18; +const float LFIELD_OWNER = 19; +const float LFLAG_NORMALMODE = 1; +const float LFLAG_REALTIMEMODE = 2; +const float LFLAG_LIGHTMAP = 4; +const float LFLAG_FLASHBLEND = 8; +const float LFLAG_NOSHADOWS = 256; +const float LFLAG_SHADOWMAP = 512; +const float LFLAG_CREPUSCULAR = 1024; +const float LFLAG_ORTHOSUN = 2048; +const float TEREDIT_RELOAD = 0; +const float TEREDIT_SAVE = 1; +const float TEREDIT_SETHOLE = 2; +const float TEREDIT_HEIGHT_SET = 3; +const float TEREDIT_HEIGHT_SMOOTH = 4; +const float TEREDIT_HEIGHT_SPREAD = 5; +const float TEREDIT_HEIGHT_RAISE = 6; +const float TEREDIT_HEIGHT_FLATTEN = 18; +const float TEREDIT_HEIGHT_LOWER = 7; +const float TEREDIT_TEX_KILL = 8; +const float TEREDIT_TEX_GET = 9; +const float TEREDIT_TEX_BLEND = 10; +const float TEREDIT_TEX_UNIFY = 11; +const float TEREDIT_TEX_NOISE = 12; +const float TEREDIT_TEX_BLUR = 13; +const float TEREDIT_TEX_REPLACE = 19; +const float TEREDIT_TEX_SETMASK = 25; +const float TEREDIT_WATER_SET = 14; +const float TEREDIT_MESH_ADD = 15; +const float TEREDIT_MESH_KILL = 16; +const float TEREDIT_TINT = 17; +const float TEREDIT_RESET_SECT = 20; +const float TEREDIT_RELOAD_SECT = 21; +const float TEREDIT_ENT_GET = 26; +const float TEREDIT_ENT_SET = 27; +const float TEREDIT_ENT_ADD = 28; +const float TEREDIT_ENT_COUNT = 29; +#endif +#if defined(CSQC) || defined(MENU) +const float SLIST_HOSTCACHEVIEWCOUNT = 0; +const float SLIST_HOSTCACHETOTALCOUNT = 1; +const float SLIST_MASTERQUERYCOUNT = 2; +const float SLIST_MASTERREPLYCOUNT = 3; +const float SLIST_SERVERQUERYCOUNT = 4; +const float SLIST_SERVERREPLYCOUNT = 5; +const float SLIST_SORTFIELD = 6; +const float SLIST_SORTDESCENDING = 7; +const float SLIST_TEST_CONTAINS = 0; +const float SLIST_TEST_NOTCONTAIN = 1; +const float SLIST_TEST_LESSEQUAL = 2; +const float SLIST_TEST_LESS = 3; +const float SLIST_TEST_EQUAL = 4; +const float SLIST_TEST_GREATER = 5; +const float SLIST_TEST_GREATEREQUAL = 6; +const float SLIST_TEST_NOTEQUAL = 7; +const float SLIST_TEST_STARTSWITH = 8; +const float SLIST_TEST_NOTSTARTSWITH = 9; +#endif +#ifdef MENU +float(string ext) checkextension = #1; /* + Checks if the named extension is supported by the running engine. */ + +void(string err,...) error = #2; /* + Fatal error that will trigger a crash-to-console that users will actually notice. */ + +void(string err,...) objerror = #3; /* + For some reason this has been redefined as non-fatal, and as it won't force the user to look at the console it'll generally be ignored completely so really what's the point? Other than as a convoluted way to remove(self) that is. */ + +void(string text,...) print = #4; /* Part of DP_SV_PRINT + Hello, world. Shoves junk on the console. Hopefully people will bother to read it, maybe. */ + +DEP void(string text,...) bprint = #5; +DEP void(float clientnum, string text,...) msprint = #6; +void(string text,...) cprint = #7; /* + Tries to show the given message in the centre of the screen, assuming that its not obscured by menus. Oh hey look, you're calling it in menuqc! */ + +vector(vector) normalize = #8; +float(vector) vlen = #9; +float(vector) vectoyaw = #10; +vector(vector) vectoangles = #11; +float() random = #12; +void(string,...) localcmd = #13; +float(string name) cvar = #14; +void(string name, string value) cvar_set = #15; +void(string text, ...) dprint = #16; +string(float) ftos = #17; +float(float) fabs = #18; +string(vector) vtos = #19; +string(entity) etos = #20; /* Part of DP_QC_ETOS*/ +float(string) stof = #21; /* Part of FRIK_FILE, FTE_QC_INFOKEY, FTE_STRINGS, QW_ENGINE, ZQ_QC_STRINGS*/ +entity() spawn = #22; +void(entity) remove = #23; +entity(entity start, .string field, string match) find = #24; +entity(entity start, .__variant field, __variant match) findfloat = #25; /* Part of DP_QC_FINDFLOAT*/ +entity(.string field, string match) findchain = #26; /* Part of DP_QC_FINDCHAIN*/ +entity(.__variant field, __variant match) findchainfloat = #27; /* Part of DP_QC_FINDCHAINFLOAT*/ +string(string file) precache_file = #28; /* + Attempts to download the named file from the current server, if it isn't found locally. Not very useful as menuqc is normally meant to work before joining servers too. */ + +string(string sample) precache_sound = #29; +void() coredump = #30; /* + Takes a dump, writing the qcvm's state to disk. There are normally easier ways to debug, but I suppose this one still beats print spam. */ + +void() traceon = #31; /* + Enables single-stepping. Its generally easier to just set a breakpoint. */ + +void() traceoff = #32; /* + Disables single-stepping. Which sucks if you started said singlestepping outside of qc. */ + +void(entity) eprint = #33; +float(float) rint = #34; +float(float) floor = #35; +float(float) ceil = #36; +entity(entity) nextent = #37; +float(float) sin = #38; /* Part of DP_QC_SINCOSSQRTPOW*/ +float(float) cos = #39; /* Part of DP_QC_SINCOSSQRTPOW*/ +float(float) sqrt = #40; /* Part of DP_QC_SINCOSSQRTPOW*/ +vector() randomvector = #41; +float(string name, string value, float flags) registercvar = #42; /* Part of DP_REGISTERCVAR + Creates the cvar if it didn't already exist. This presents issues for setting those cvars via startup configs of course, and autocvars are easier but I suppose they don't get any flags (which are ignored anyway, of course). */ + +float(float,...) min = #43; /* Part of DP_QC_MINMAXBOUND*/ +float(float,...) max = #44; /* Part of DP_QC_MINMAXBOUND*/ +float(float min,float value,float max) bound = #45; /* Part of DP_QC_MINMAXBOUND*/ +float(float,float) pow = #46; /* Part of DP_QC_SINCOSSQRTPOW*/ +void(entity src, entity dst) copyentity = #47; /* Part of DP_QC_COPYENTITY + Copies all entity fields from one entity into another (forgetting any that were previously set on the destination). */ + +filestream(string filename, float mode) fopen = #48; /* Part of FRIK_FILE*/ +void(filestream fhandle) fclose = #49; /* Part of FRIK_FILE*/ +string(filestream fhandle) fgets = #50; /* Part of FRIK_FILE*/ +void(filestream fhandle, string s) fputs = #51; /* Part of FRIK_FILE*/ +float(string) strlen = #52; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ +string(string, optional string, optional string, optional string, optional string, optional string, optional string, optional string) strcat = #53; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ +string(string s, float start, float length) substring = #54; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ +vector(string) stov = #55; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ +FTEDEP("Redundant") string(string) strzone = #56; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS + Exists in FTE for compat only, no different from strcat. */ + +FTEDEP("Redundant") void(string) strunzone = #57; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS + Exists in FTE for compat only, does nothing. */ + +float(string) tokenize = #58; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND + Splits up the given string into its different components (what constitutes a token separator is not well defined and has been hacked about with over the years so have fun with that), returning the number of tokens that were found. Call argv(0 through ret-1) to retrieve each individual token. Take care to not use this recursively. */ + +string(float) argv = #59; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND + Returns one of the tokens found via tokenize (and equivelent builtins). */ + +float() isserver = #60; /* + Returns true if the local engine is running a server, and thus cvars and localcmds are shared with said server. */ + +float() clientcount = #61; /* + Returns the maximum number of players on the server. Useless if its a remote server, so its a kinda useless builtin really. */ + +float() clientstate = #62; /* + Tells you whether the client is actually connected to anything. 0 for a dedicated server (but dedicated servers don't normally run menuqc anyway), 2 if connecting or connected to a server (but not necessarily spawned+active), 1 for sitting around idle without trying to connect to anything yet. */ + +void(string map) changelevel = #64; /* + Not really any different from a localcmd, but with proper string escapes. */ + +void(string sample, optional float channel, optional float volume) localsound = #65; /* + Plays a sound, locally. precaching is optional, but recommended. */ + +vector() getmousepos = #66; /* + Obsolete. Return values depend upon the current cursor mode. Implement Menu_InputEvent instead, so you can handle deltas as-is or absolutes if that's all the OS can provide. */ + +float(optional float timetype) gettime = #67; +void(string s) loadfromdata = #68; /* + Reads a set of entities from the given string. This string should have the same format as a .ent file or a saved game. Entities will be spawned as required. If you need to see the entities that were created, you should use parseentitydata instead. */ + +void(string s) loadfromfile = #69; /* + Reads a set of entities from the named file. This file should have the same format as a .ent file or a saved game. Entities will be spawned as required. If you need to see the entities that were created, you should use parseentitydata instead. */ + +float(float val, float m) mod = #70; +string(string name) cvar_string = #71; /* Part of DP_QC_CVAR_STRING + Returns the value of a cvar, as a string. */ + +FTEDEP("Call 'error' instead") void() crash = #72; /* + Demonstrates that no program is bug free. */ + +void() stackdump = #73; /* + Prints out the QC's stack, for console-based error reports. */ + +searchhandle(string pattern, enumflags:float{SB_CASEINSENSITIVE=1<<0,SB_FULLPACKAGEPATH=1<<1,SB_ALLOWDUPES=1<<2,SB_FORCESEARCH=1<<3,SB_MULTISEARCH=1<<4,SB_NAMESORT=1<<5} flags, float quiet, optional string package) search_begin = #74; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE*/ +void(searchhandle handle) search_end = #75; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE*/ +float(searchhandle handle) search_getsize = #76; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE*/ +string(searchhandle handle, float num) search_getfilename = #77; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE*/ +float(entity) etof = #79; +entity(float) ftoe = #80; +float(string) validstring = #81; /* + Returns true if str isn't null. In case 'if [not](str)' was configured to test for empty instead of null. */ + +DEP float(string str) altstr_count = #82; /* + Reports how many single-quotes there were in the string, divided by 2. */ + +DEP string(string str) altstr_prepare = #83; /* + Adds markup to escape only single-quotes. Does not add any. */ + +DEP string(string str, float num) altstr_get = #84; /* + Gets the Nth single-quoted token in the input. */ + +DEP string(string str, float num, string setval) altstr_set = #85; /* + Changes the Nth single-quoted token. The setval argument must not contain any single-quotes (use altstr_prepare to ensure this). */ + +entity(entity start, .float field, float match) findflags = #87; /* Part of DP_QC_FINDFLAGS*/ +entity(.float field, float match) findchainflags = #88; /* Part of DP_QC_FINDCHAINFLAGS*/ +string(string name) cvar_defstring = #89; /* Part of DP_QC_CVAR_DEFSTRING*/ +void(entity ent, string mname) setmodel = #90; /* + Menuqc-specific version. */ + +void(string mname) precache_model = #91; /* + Menuqc-specific version. */ + +void(entity ent, vector neworg) setorigin = #92; /* + Menuqc-specific version. */ + +#endif +#if defined(CSQC) || defined(SSQC) +void(vector vang) makevectors = #1; /* + Takes an angle vector (pitch,yaw,roll) (+x=DOWN). Writes its results into v_forward, v_right, v_up vectors. */ + +void(entity e, vector o) setorigin = #2; /* + Changes e's origin to be equal to o. Also relinks collision state (as well as setting absmin+absmax), which is required after changing .solid */ + +void(entity e, string m) setmodel = #3; /* + Looks up m in the model precache list, and sets both e.model and e.modelindex to match. BSP models will set e.mins and e.maxs accordingly, other models depend upon the value of sv_gameplayfix_setmodelrealbox - for compatibility you should always call setsize after all pickups or non-bsp models. Also relinks collision state. */ + +void(entity e, vector min, vector max) setsize = #4; /* + Sets the e's mins and maxs fields. Also relinks collision state, which sets absmin and absmax too. */ + +void() breakpoint = #6; /* + Trigger a debugging event. FTE will break into the qc debugger. Other engines may crash with a debug execption. */ + +float() random = #7; /* + Returns a random value between 0 and 1. Be warned, this builtin can return 1 in most engines, which can break arrays. */ + +void(entity e, float chan, string samp, float vol, float atten, optional float speedpct, optional float flags, optional float timeofs) sound = #8; /* + Starts a sound centered upon the given entity. + chan is the entity sound channel to use, channel 0 will allow you to mix many samples at once, others will replace the old sample + 'samp' must have been precached first + if specified, 'speedpct' should normally be around 100 (or =0), 200 for double speed or 50 for half speed. + If flags is specified, the reliable flag in the channels argument is used for additional channels. Flags should be made from SOUNDFLAG_* constants + timeofs should be negative in order to provide a delay before the sound actually starts. */ + +vector(vector v) normalize = #9; /* + Shorten or lengthen a direction vector such that it is only one quake unit long. */ + +void(string e) error = #10; /* + Ends the game with an easily readable error message. */ + +void(string e) objerror = #11; /* + Displays a non-fatal easily readable error message concerning the self entity, including a field dump. self will be removed! */ + +float(vector v) vlen = #12; /* + Returns the square root of the dotproduct of a vector with itself. Or in other words the length of a distance vector, in quake units. */ + +float(vector v, optional entity reference) vectoyaw = #13; /* + Given a direction vector, returns the yaw angle in which that direction vector points. If an entity is passed, the yaw angle will be relative to that entity's gravity direction. */ + +entity() spawn = #14; /* + Adds a brand new entity into the world! Hurrah, you're now a parent! */ + +void(entity e) remove = #15; /* + Destroys the given entity and clears some limited fields (including model, modelindex, solid, classname). Any references to the entity following the call are an error. After half a second the entity will be reused, in the interim you can unfortunatly still read its fields to see if the reference is no longer valid. */ + +#endif +void(entity e) removeinstant = #0:removeinstant; /* + Same thing as the regular remove builtin, but bypasses the half-second rule. The entity slot may be reused instantly. Be CERTAIN that you have no lingering references, because if they're followed they will end up poking an entirely different type of entity! So only use this where you're sure its safe. */ + +#if defined(CSQC) || defined(SSQC) +void(vector v1, vector v2, float flags, entity ent) traceline = #16; /* + Traces a thin line through the world from v1 towards v2. + Will not collide with ent, ent.owner, or any entity who's owner field refers to ent. + The passed entity will also be used to determine whether to use a capsule trace, the contents that the trace should impact, and a couple of other extra fields that define the trace. + There are no side effects beyond the trace_* globals being written. + flags&MOVE_NOMONSTERS will not impact on non-bsp entities. + flags&MOVE_MISSILE will impact with increased size. + flags&MOVE_HITMODEL will impact upon model meshes, instead of their bounding boxes. + flags&MOVE_TRIGGERS will also stop on triggers + flags&MOVE_EVERYTHING will stop if it hits anything, even non-solid entities. + flags&MOVE_LAGGED will backdate entity positions for the purposes of this builtin according to the indicated player ent's latency, to provide lag compensation. */ + +#endif +#ifdef SSQC +entity() checkclient = #17; /* + Returns one of the player entities. The returned player will change periodically. */ + +#endif +#if defined(CSQC) || defined(SSQC) +entity(entity start, .string fld, string match) find = #18; /* + Scan for the next entity with a given field set to the given 'match' value. start should be either world, or the previous entity that was found. Returns world on failure/if there are no more. + If you have many many entities then you may find that hashtables will give more performance (but requires extra upkeep). */ + +#endif +entity*(.__variant fld, __variant match, int type=EV_STRING, __out int count) find_list = #0:find_list; /* + Scan for the next entity with a given field set to the given 'match' value. start should be either world, or the previous entity that was found. Returns world on failure/if there are no more. + If you have many many entities then you may find that hashtables will give more performance (but requires extra upkeep). */ + +#if defined(CSQC) || defined(SSQC) +string(string s) precache_sound = #19; /* + Precaches a sound, making it known to clients and loading it from disk. This builtin (strongly) should be called during spawn functions. This builtin must be called for the sound before the sound builtin is called, or it might not even be heard. */ + +string(string s) precache_model = #20; /* + Precaches a model, making it known to clients and loading it from disk if it has a .bsp extension. This builtin (strongly) should be called during spawn functions. This must be called for each model name before setmodel may use that model name. + Modelindicies precached in SSQC will always be positive. CSQC precaches will be negative if they are not also on the server. */ + +#endif +#ifdef SSQC +void(entity client, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7) stuffcmd = #21; /* + Sends a console command (or cvar) to the client, where it will be executed. Different clients support different commands. Do NOT forget the final \n. + This builtin is generally considered evil. */ + +void(entity client, float flags, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6) stuffcmdflags = #0:stuffcmdflags; /* Part of FTE_QC_STUFFCMDFLAGS + Sends a console command (or cvar) to the client, where it will be executed. Different clients support different commands. Do NOT forget the final \n. + This (just as evil) variant allows specifying some flags too. See the STUFFCMD_* constants. */ + +#endif +#if defined(CSQC) || defined(SSQC) +entity(vector org, float rad, optional .entity chainfield) findradius = #22; /* + Finds all entities within a distance of the 'org' specified. One entity is returned directly, while other entities are returned via that entity's .chain field. Use findradius_list for an updated alternative without reenterancy issues. */ + +entity*(vector org, float rad, __out int foundcount, int sort=0) findradius_list = #0:findradius_list; /* + Finds all entities linked with a bbox within a distance of the 'org' specified, returning the list as a temp-array (world signifies the end). Unlike findradius, sv_gameplayfix_blowupfallenzombies is ignored (use FL_FINDABLE_NONSOLID instead), while sv_gameplayfix_findradiusdistancetobox and dpcompat_findradiusarealinks are force-enabled. The resulting buffer will automatically be cleaned up by the engine and does not need to be freed. */ + +#endif +#if defined(NQSSQC) +void(string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7, optional string s8) bprint = #23; /* + NQ: Concatenates all arguments, and prints the messsage on the console of all connected clients. */ + +#endif +#if defined(QWSSQC) +void(float msglvl, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7) bprint = #23; /* + QW: Concatenates all string arguments, and prints the messsage on the console of only all clients who's 'msg' infokey is set lower or equal to the supplied 'msglvl' argument. */ + +#endif +#if defined(NQSSQC) +void(entity client, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7) sprint = #24; /* + NQ: Concatenates all string arguments, and prints the messsage on the named client's console */ + +#endif +#if defined(QWSSQC) +void(entity client, float msglvl, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6) sprint = #24; /* + QW: Concatenates all string arguments, and prints the messsage on the named client's console, but only if that client's 'msg' infokey is set lower or equal to the supplied 'msglvl' argument. */ + +#endif +#if defined(CSQC) || defined(NQSSQC) +void(string s, ...) dprint = #25; /* + NQ: Prints the given message on the server's console, but only if the developer cvar is set. Arguments will be concatenated into a single message. */ + +#endif +#if defined(CSQC) || defined(QWSSQC) +void(string s, ...) dprint = #25; /* + QW: Unconditionally prints the given message on the server's console. Arguments will be concatenated into a single message. */ + +#endif +#if defined(CSQC) || defined(SSQC) +string(float val) ftos = #26; /* + Returns a tempstring containing a representation of the given float. Precision depends upon engine. */ + +string(vector val) vtos = #27; /* + Returns a tempstring containing a representation of the given vector. Precision depends upon engine. */ + +void() coredump = #28; /* + Writes out a coredump. This contains stack, globals, and field info for all ents. This can be handy for debugging. */ + +void() traceon = #29; /* + Enables tracing. This may be spammy, slow, and stuff. Set debugger 1 in order to use fte's qc debugger. */ + +void() traceoff = #30; /* + Disables tracing again. */ + +void(entity e) eprint = #31; /* + Debugging builtin that prints all fields of the given entity to the console. */ + +float(float yaw, float dist, optional float settraceglobals) walkmove = #32; /* + Attempt to walk the entity at a given angle for a given distance. + if settraceglobals is set, the trace_* globals will be set, showing the results of the movement. + This function will trigger touch events. */ + +float() droptofloor = #34; /* + Instantly moves the entity downwards until it hits the ground. If the entity is in solid or would need to drop more than 'pr_droptofloorunits' quake units, its position will be considered invalid and the builtin will abort, returning FALSE, otherwise TRUE. */ + +void(float lightstyle, string stylestring, optional vector rgb) lightstyle = #35; /* + Specifies an auto-animating string that specifies the light intensity for entities using that lightstyle. + a is off, z is fully lit. Should be lower case only. + rgb will recolour all lights using that lightstyle. */ + +float(float) rint = #36; /* + Rounds the given float up or down to the closest integeral value. X.5 rounds away from 0 */ + +float(float) floor = #37; /* + Rounds the given float downwards, even when negative. */ + +float(float) ceil = #38; /* + Rounds the given float upwards, even when negative. */ + +float(entity ent) checkbottom = #40; /* + Expensive checks to ensure that the entity is actually sitting on something solid, returns true if it is. */ + +float(vector pos) pointcontents = #41; /* + Checks the given point to see what is there. Returns one of the CONTENTS_* constants. Just because a point is empty does not mean that the player can stand there due to the size of the player - use tracebox for such tests. */ + +__uint(vector pos, optional float worldonly=1) pointcontentsmask = #0:pointcontentsmask; /* + Checks the given point to see what is there. Returns a mask of the CONTENTBIT_* constants. Just because a point is empty does not mean that the player can stand there due to the size of the player - use tracebox for such tests. */ + +float(float) fabs = #43; /* + Removes the sign of the float, making it positive if it is negative. */ + +#endif +#ifdef SSQC +vector(entity player, float missilespeed) aim = #44; /* + Returns a tweaked copy of the v_forward vector (must be set! ie: makevectors(player.v_angle) ). This is important for keyboard users (that don't want to have to look up/down the whole time), as well as joystick users (who's aim is otherwise annoyingly imprecise). Only the upwards component of the result will differ from the value of v_forward. The builtin will select the enemy closest to the crosshair within the angle of acos(sv_aim). */ + +#endif +#if defined(CSQC) || defined(SSQC) +float(string) cvar = #45; /* + Returns the numeric value of the named cvar */ + +void(string, ...) localcmd = #46; /* + Adds the string to the console command queue. Commands will not be executed immediately, but rather at the start of the following frame. */ + +entity(entity) nextent = #47; /* + Returns the following entity. Skips over removed entities. Returns world when passed the last valid entity. */ + +void(vector pos, vector dir, float colour, float count) particle = #48; /* + Spawn 'count' particles around 'pos' moving in the direction 'dir', with a palette colour index between 'colour' and 'colour+8'. */ + +#define ChangeYaw changeyaw +void() changeyaw = #49; /* + Changes the self.angles_y field towards self.ideal_yaw by up to self.yaw_speed. */ + +vector(vector fwd, optional vector up) vectoangles = #51; /* + Returns the angles (+x=UP) required to orient an entity to look in the given direction. The 'up' argument is required if you wish to set a roll angle, otherwise it will be limited to just monster-style turning. */ + +#endif +#ifdef SSQC +void(float to, float val) WriteByte = #52; /* + Writes a single byte into a network message buffer. Typically you will find a more correct alternative to writing arbitary data. 'to' should be one of the MSG_* constants. MSG_ONE must have msg_entity set first. */ + +void(float to, float val) WriteChar = #53; /* + Writes a signed value between -128 and 127. */ + +void(float to, float val) WriteShort = #54; /* + Writes a signed value between -32768 and 32767. As an exception, values up to 65535 will not trigger warnings (but readshort will read the result as negative!) */ + +void(float to, float val) WriteLong = #55; /* + Writes a signed 32bit integer. Note that the input argument being of float type limits the resulting integer to a mere 24 consecutive bits of validity. Use WriteInt if you want to write an entire 32bit int without data loss. */ + +void(float to, float val) WriteCoord = #56; /* + Writes a single value suitable for a map coordinate axis. The precision is not strictly specified but is assumed to be of at least 13.3 fixed-point precision (ie: +/-4k with 1/8th precision). */ + +void(float to, float val) WriteAngle = #57; /* + Writes a single value suitable for an angle axis. The precision is not strictly specified but is assumed to be 8bit, giving 256 notches instead of the assumed 360 range passed in. */ + +void(float to, string val) WriteString = #58; /* + Writes a variable-length null terminated string. There are length limits. The codepage is not translated, so be sure that client+server agree on whether utf-8 is being used or not (or just stick to ascii+markup). */ + +void(float to, entity val) WriteEntity = #59; /* + Writes the index of the specified entity (the network data size is not specified). This can be read clientside using the readentitynum builtin, with caveats. */ + +#endif +#if defined(CSQC) || defined(SSQC) +float(float angle) sin = #60; /* Part of DP_QC_SINCOSSQRTPOW + Forgive me father, for I have trigonometry homework. */ + +float(float angle) cos = #61; /* Part of DP_QC_SINCOSSQRTPOW*/ +float(float value) sqrt = #62; /* Part of DP_QC_SINCOSSQRTPOW*/ +#endif +#ifdef SSQC +float(float a, float n) modulo = #0:modulo; +#endif +#if defined(CSQC) || defined(SSQC) +void(entity ent) changepitch = #63; /* Part of DP_QC_CHANGEPITCH*/ +void(entity ent, entity ignore) tracetoss = #64; +string(entity ent) etos = #65; /* Part of DP_QC_ETOS*/ +void(float step) movetogoal = #67; /* + Runs lots and lots of fancy logic in order to try to step the entity the specified distance towards its goalentity. */ + +string(string s) precache_file = #68; /* + This builtin does nothing. It was used only as a hint for pak generation. */ + +void(entity e) makestatic = #69; /* + Sends a copy of the entity's renderable fields to all clients, and REMOVES the entity, preventing further changes. This means it will be unmutable and non-solid. */ + +#endif +#ifdef SSQC +void(string mapname, optional string newmapstartspot) changelevel = #70; /* + Attempts to change the map to the named map. If 'newmapstartspot' is specified, the state of the current map will be preserved, and the argument will be passed to the next map in the 'startspot' global, and the next map will be loaded from archived state if it was previously visited. If not specified, all archived map states will be purged. */ + +#endif +#if defined(CSQC) || defined(SSQC) +void(string cvarname, string valuetoset) cvar_set = #72; /* + Instantly sets a cvar to the given string value. Warning: the resulting string includes apostrophies surrounding the result. You may wish to use sprintf instead. */ + +#endif +#ifdef SSQC +void(entity ent, string text, optional string text2, optional string text3, optional string text4, optional string text5, optional string text6, optional string text7) centerprint = #73; +#endif +#if defined(CSQC) || defined(SSQC) +void (vector pos, string samp, float vol, float atten) ambientsound = #74; +string(string str) precache_model2 = #75; +string(string str) precache_sound2 = #76; +string(string str) precache_file2 = #77; +#endif +#ifdef SSQC +void(entity player) setspawnparms = #78; +float() ex_finaleFinished = #0:ex_finaleFinished; /* + Behaviour is undocumented. */ + +void(entity client, string sample) ex_localsound = #0:ex_localsound; /* + Behaviour is undocumented. */ + +void(entity ent, string text, optional string s0, optional string s1, optional string s2, optional string s3, optional string s4, optional string s5) ex_centerprint = #0:ex_centerprint; /* + Remaster: Sends the strings to the client, which will order according to {#}. Also substitutes localised strings for $NAME strings. */ + +void(string s, optional string s0, optional string s1, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6) ex_bprint = #0:ex_bprint; /* + Remaster: Sends the strings to all clients, which will order them according to {#}. Also substitutes localised strings for $NAME strings. */ + +void(entity client, string s, optional string s0, optional string s1, optional string s2, optional string s3, optional string s4, optional string s5) ex_sprint = #0:ex_sprint; /* + Remaster: Sends the strings to the client, which will order according to {#}. Also substitutes localised strings for $NAME strings. */ + +float(entity playerEnt) ex_CheckPlayerEXFlags = #0:ex_CheckPlayerEXFlags; /* + Behaviour is undocumented. */ + +void(entity killer, entity killee) logfrag = #79; /* Part of QW_ENGINE*/ +#endif +#if defined(CSQC) || defined(SSQC) +string(entity e, string key) infokey = #80; /* Part of FTE_QC_INFOKEY, QW_ENGINE + If e is world, returns the field 'key' from either the serverinfo or the localinfo. If e is a player, returns the value of 'key' from the player's userinfo string. There are a few special exceptions, like 'ip' which is not technically part of the userinfo. */ + +#endif +#ifdef SSQC +float(entity e, string key) infokeyf = #0:infokeyf; /* + Identical to regular infokey, except returns a float. */ + +int(entity e, string key, optional void *outbuf, int outbufsize) infokey_blob = #0:infokey_blob; /* + Retrieves a user's blob size, and optionally writes it to the specified buffer. */ + +#endif +#if defined(CSQC) || defined(SSQC) +float(string) stof = #81; /* Part of FRIK_FILE, FTE_QC_INFOKEY, FTE_STRINGS, QW_ENGINE, ZQ_QC_STRINGS*/ +#endif +#ifdef SSQC +#define unicast(pl,reli) do{msg_entity = pl; multicast('0 0 0', reli?MULITCAST_ONE_R:MULTICAST_ONE);}while(0) +void(vector where, float set) multicast = #82; /* Part of EXT_CSQC, FTE_QC_MULTICAST + Once the MSG_MULTICAST network message buffer has been filled with data, this builtin is used to dispatch it to the given target, filtering by pvs for reduced network bandwidth. */ + +DEP void(entity to, string str) redirectcmd = #101; /* Part of ??MVDSV_BUILTINS + Executes a single console command, and sends the text generated by it to the specified player. The command will be executed at the end of the frame once QC is no longer running - you may wish to pre/postfix it with 'echo'. */ + +#endif +#if defined(CSQC) || defined(SSQC) +string(float style, optional __out vector rgb) getlightstyle = #0:getlightstyle; /* + Obtains the light style string for the given style. */ + +vector(float style) getlightstylergb = #0:getlightstylergb; /* + Obtains the current rgb value of the specified light style. In csqc, this is correct with regard to the current frame, while ssqc gives no guarentees about time and ignores client cvars. Note: use getlight if you want the actual light value at a point. */ + +#endif +#ifdef SSQC +void(float style, float val, optional vector rgb) lightstylestatic = #5; /* + Sets the lightstyle to an explicit numerical level. From Hexen2. */ + +#endif +#if defined(CSQC) || defined(SSQC) +void(vector start, vector mins, vector maxs, vector end, float nomonsters, entity ent) tracebox = #90; /* Part of DP_QC_TRACEBOX + Exactly like traceline, but a box instead of a uselessly thin point. Acceptable sizes are limited by bsp format, q1bsp has strict acceptable size values. */ + +vector() randomvec = #91; /* Part of DP_QC_RANDOMVEC + Returns a vector with random values. Each axis is independantly a value between -1 and 1 inclusive. */ + +vector(vector org) getlight = #92; /* Part of DP_QC_GETLIGHT*/ +float(string cvarname, string defaultvalue) registercvar = #93; /* Part of DP_REGISTERCVAR + Creates a new cvar on the fly. If it does not already exist, it will be given the specified value. If it does exist, this is a no-op. + This builtin has the limitation that it does not apply to configs or commandlines. Such configs will need to use the set or seta command causing this builtin to be a noop. + In engines that support it, you will generally find the autocvar feature easier and more efficient to use. */ + +float(float a, float b, ...) min = #94; /* Part of DP_QC_MINMAXBOUND + Returns the lowest value of its arguments. */ + +float(float a, float b, ...) max = #95; /* Part of DP_QC_MINMAXBOUND + Returns the highest value of its arguments. */ + +float(float minimum, float val, float maximum) bound = #96; /* Part of DP_QC_MINMAXBOUND + Returns val, unless minimum is higher, or maximum is less. */ + +float(float value, float exp) pow = #97; /* Part of DP_QC_SINCOSSQRTPOW*/ +#endif +float(float v, optional float base) logarithm = #0:logarithm; /* + Determines the logarithm of the input value according to the specified base. This can be used to calculate how much something was shifted by. */ + +#if defined(CSQC) || defined(SSQC) +#define findentity findfloat +entity(entity start, .__variant fld, __variant match) findfloat = #98; /* Part of DP_QC_FINDFLOAT + Equivelent to the find builtin, but instead of comparing strings contents, this builtin compares the raw values. This builtin requires multiple calls in order to scan all entities - set start to the previous call's return value. + world is returned when there are no more entities. */ + +float(string extname) checkextension = #99; /* + Checks for an extension by its name (eg: checkextension("FRIK_FILE") says that its okay to go ahead and use strcat). + Use cvar("pr_checkextension") to see if this builtin exists. */ + +#endif +float(__variant funcref) checkbuiltin = #0:checkbuiltin; /* + Checks to see if the specified builtin is supported/mapped. This is intended as a way to check for #0 functions, allowing for simple single-builtin functions. Warning, if two different engines map different builtins to the same number, then this function will not tell you which will be called, only that it won't crash (the exception being #0, which are remapped as available). */ + +#ifdef SSQC +float(string builtinname) builtin_find = #100; /* + Looks to see if the named builtin is valid, and returns the builtin number it exists at. */ + +#endif +#if defined(CSQC) || defined(SSQC) +float(float value) anglemod = #102; +float(float newangle, float oldangle) anglesub = #0:anglesub; /* + Returns newangle-oldangle, except returning the shortest route around a circle so yields a result between -180 and +180. */ + +#endif +#ifdef SSQC +DEP_CSQC void(string slot, string picname, float x, float y, float zone, optional entity player) showpic = #104; /* Part of TEI_SHOWLMP2*/ +DEP_CSQC void(string slot, optional entity player) hidepic = #105; /* Part of TEI_SHOWLMP2*/ +DEP_CSQC void(string slot, float x, float y, float zone, optional entity player) movepic = #106; /* Part of TEI_SHOWLMP2*/ +DEP_CSQC void(string slot, string picname, optional entity player) changepic = #107; /* Part of TEI_SHOWLMP2*/ +#endif +#if defined(CSQC) || defined(SSQC) +filestream(string filename, float mode, optional float mmapminsize) fopen = #110; /* Part of FRIK_FILE + Opens a file, typically prefixed with "data/", for either read or write access. */ + +void(filestream fhandle) fclose = #111; /* Part of FRIK_FILE*/ +string(filestream fhandle) fgets = #112; /* Part of FRIK_FILE + Reads a single line out of the file. The new line character is not returned as part of the string. Returns the null string on EOF (use if not(string) to easily test for this, which distinguishes it from the empty string which is returned if the line being read is blank */ + +void(filestream fhandle, string s, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7) fputs = #113; /* Part of FRIK_FILE + Writes the given string(s) into the file. For compatibility with fgets, you should ensure that the string is terminated with a \n - this will not otherwise be done for you. It is up to the engine whether dos or unix line endings are actually written. */ + +#endif +int(filestream fhandle, void *ptr, int size) fread = #0:fread; /* Part of FTE_QC_FILE_BINARY + Reads binary data out of the file. Returns truncated lengths if the read exceeds the length of the file. */ + +int(filestream fhandle, void *ptr, int size) fwrite = #0:fwrite; /* Part of FTE_QC_FILE_BINARY + Writes binary data out of the file. */ + +#define ftell fseek //c compat +int(filestream fhandle, optional int newoffset) fseek = #0:fseek; /* Part of FTE_QC_FILE_BINARY + Changes the current position of the file, if specified. Returns prior position, in bytes. */ + +int(filestream fhandle, optional int newsize) fsize = #0:fsize; /* Part of FTE_QC_FILE_BINARY + Reports the total size of the file, in bytes. Can also be used to truncate/extend the file */ + +#if defined(CSQC) || defined(SSQC) +float(string s) strlen = #114; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ +string(string s1, optional string s2, optional string s3, optional string s4, optional string s5, optional string s6, optional string s7, optional string s8) strcat = #115; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ +string(string s, float start, float length) substring = #116; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ +vector(string s) stov = #117; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS*/ +FTEDEP("Redundant") string(string s, ...) strzone = #118; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS + Create a semi-permanent copy of a string that only becomes invalid once strunzone is called on the string (instead of when the engine assumes your string has left scope). This builtin has become redundant in FTEQW due to the FTE_QC_PERSISTENTTEMPSTRINGS extension and is now functionally identical to strcat for compatibility with old engines+mods. */ + +FTEDEP("Redundant") void(string s) strunzone = #119; /* Part of FRIK_FILE, FTE_STRINGS, ZQ_QC_STRINGS + Destroys a string that was allocated by strunzone. Further references to the string MAY crash the game. In FTE, this function became redundant and now does nothing. */ + +#endif +void*(int bytes) createbuffer = #0:createbuffer; /* + Returns a temporary buffer that can be written to / read from. The buffer will be garbage collected and thus cannot be explicitly freed. Tempstrings and buffer references must not be stored into the buffer as the garbage collector will not scan these. */ + +#ifdef SSQC +void(string cvar, float val) cvar_setf = #176; +#endif +#if defined(CSQC) || defined(SSQC) +void(string soundname, optional float channel, optional float volume) localsound = #177; /* + Plays a sound... locally... probably best not to call this from ssqc. Also disables reverb. */ + +float(string modelname, optional float queryonly) getmodelindex = #200; /* + Acts as an alternative to precache_model(foo);setmodel(bar, foo); return bar.modelindex; + If queryonly is set and the model was not previously precached, the builtin will return 0 without needlessly precaching the model. */ + +float(string soundname, optional float queryonly) getsoundindex = #0:getsoundindex; /* + Provides a way to query if a sound is already precached or not. The return value can also be checked for <=255 to see if it'll work over any network protocol. The sound index can also be used for writebyte hacks, but this is discouraged - use SOUNDFLAG_UNICAST instead. */ + +__variant(float prnum, string funcname, ...) externcall = #201; /* Part of FTE_MULTIPROGS + Directly call a function in a different/same progs by its name. + prnum=0 is the 'default' or 'main' progs. + prnum=-1 means current progs. + prnum=-2 will scan through the active progs and will use the first it finds. */ + +float(string progsname) addprogs = #202; /* Part of FTE_MULTIPROGS + Loads an additional .dat file into the current qcvm. The returned handle can be used with any of the externcall/externset/externvalue builtins. + There are cvars that allow progs to be loaded automatically. */ + +__variant(float prnum, string varname) externvalue = #203; /* Part of FTE_MULTIPROGS + Reads a global in the named progs by the name of that global. + prnum=0 is the 'default' or 'main' progs. + prnum=-1 means current progs. + prnum=-2 will scan through the active progs and will use the first it finds. */ + +void(float prnum, __variant newval, string varname) externset = #204; /* Part of FTE_MULTIPROGS + Sets a global in the named progs by name. + prnum=0 is the 'default' or 'main' progs. + prnum=-1 means current progs. + prnum=-2 will scan through the active progs and will use the first it finds. */ + +void(entity portal, float state) openportal = #207; /* + Opens or closes the portals associated with a door or some such on q2 or q3 maps. On Q2BSPs, the entity should be the 'func_areaportal' entity - its style field will say which portal to open. On Q3BSPs, the entity is the door itself, the portal will be determined by the two areas found from a preceding setorigin call. */ + +#endif +#ifdef SSQC +float(float attributes, string effectname, ...) RegisterTempEnt = #208; /* Part of FTE_PEXT_CUSTOMTENTS*/ +void(float type, vector pos, ...) CustomTempEnt = #209; /* Part of FTE_PEXT_CUSTOMTENTS*/ +float(optional float sleeptime) fork = #210; /* Part of FTE_MULTITHREADED + When called, this builtin simply returns. Twice. + The current 'thread' will return instantly with a return value of 0. The new 'thread' will return after sleeptime seconds with a return value of 1. See documentation for the 'sleep' builtin for limitations/requirements concerning the new thread. Note that QC should probably call abort in the new thread, as otherwise the function will return to the calling qc function twice also. */ + +#endif +void(optional __variant ret) abort = #211; /* Part of FTE_MULTITHREADED + QC execution is aborted. Parent QC functions on the stack will be skipped, effectively this forces all QC functions to 'return ret' until execution returns to the engine. If ret is ommited, it is assumed to be 0. */ + +#ifdef SSQC +void(float sleeptime) sleep = #212; /* Part of FTE_MULTITHREADED + Suspends the current QC execution thread for 'sleeptime' seconds. + Other QC functions can and will be executed in the interim, including changing globals and field state (but not simultaneously). + The self and other globals will be restored when the thread wakes up (or set to world if they were removed since the thread started sleeping). Locals will be preserved, but will not be protected from remove calls. + If the engine is expecting the QC to return a value (even in the parent/root function), the value 0 shall be used instead of waiting for the qc to resume. */ + +void(entity player, string key, string value) forceinfokey = #213; /* Part of FTE_FORCEINFOKEY + Directly changes a user's info without pinging off the client. Also allows explicitly setting * keys, including *spectator. Does not affect the user's config or other servers. */ + +void(entity player, string key, void *data, int size) forceinfokeyblob = #0:forceinfokeyblob; /* Part of FTE_INFOBLOBS + Directly changes a user's info without pinging off the client. Also allows explicitly setting * keys, including *spectator. Does not affect the user's config or other servers. */ + +#endif +#if defined(CSQC) || defined(SSQC) +void(vector org, vector dmin, vector dmax, float colour, float effect, float count) particle2 = #215; /* Part of FTE_HEXEN2*/ +void(vector org, vector box, float colour, float effect, float count) particle3 = #216; /* Part of FTE_HEXEN2*/ +void(vector org, float radius, float colour, float effect, float count) particle4 = #217; /* Part of FTE_HEXEN2*/ +float(float number, float quantity) bitshift = #218; /* Part of EXT_BITSHIFT*/ +void(vector pos) te_lightningblood = #219; /* Part of FTE_TE_STANDARDEFFECTBUILTINS*/ +#endif +float(string s1, string sub, optional float startidx) strstrofs = #221; /* Part of FTE_STRINGS + Returns the 0-based offset of sub within the s1 string, or -1 if sub is not in s1. + If startidx is set, this builtin will ignore matches before that 0-based offset. */ + +float(string str, float index) str2chr = #222; /* Part of FTE_STRINGS + Retrieves the character value at offset 'index'. */ + +string(float chr, ...) chr2str = #223; /* Part of FTE_STRINGS + The input floats are considered character values, and are concatenated. */ + +string(float ccase, float redalpha, float redchars, string str, ...) strconv = #224; /* Part of FTE_STRINGS + Converts quake chars in the input string amongst different representations. + ccase specifies the new case for letters. + 0: not changed. + 1: forced to lower case. + 2: forced to upper case. + redalpha and redchars switch between colour ranges. + 0: no change. + 1: Forced white. + 2: Forced red. + 3: Forced gold(low) (numbers only). + 4: Forced gold (high) (numbers only). + 5+6: Forced to white and red alternately. + You should not use this builtin in combination with UTF-8. */ + +string(float pad, string str1, ...) strpad = #225; /* Part of FTE_STRINGS + Pads the string with spaces, to ensure its a specific length (so long as a fixed-width font is used, anyway). If pad is negative, the spaces are added on the left. If positive the padding is on the right. */ + +infostring(infostring old, string key, string value) infoadd = #226; /* Part of FTE_STRINGS + Returns a new tempstring infostring with the named value changed (or added if it was previously unspecified). Key and value may not contain the \ character. */ + +string(infostring info, string key) infoget = #227; /* Part of FTE_STRINGS + Reads a named value from an infostring. The returned value is a tempstring */ + +#define strcmp strncmp +float(string s1, string s2, optional float len, optional float s1ofs, optional float s2ofs) strncmp = #228; /* Part of FTE_STRINGS + Compares up to 'len' chars in the two strings. s1ofs allows you to treat s2 as a substring to compare against, or should be 0. + Returns 0 if the two strings are equal, a negative value if s1 appears numerically lower, and positive if s1 appears numerically higher. */ + +float(string s1, string s2) strcasecmp = #229; /* Part of FTE_STRINGS + Compares the two strings without case sensitivity. + Returns 0 if they are equal. The sign of the return value may be significant, but should not be depended upon. */ + +float(string s1, string s2, float len, optional float s1ofs, optional float s2ofs) strncasecmp = #230; /* Part of FTE_STRINGS + Compares up to 'len' chars in the two strings without case sensitivity. s1ofs allows you to treat s2 as a substring to compare against, or should be 0. + Returns 0 if they are equal. The sign of the return value may be significant, but should not be depended upon. */ + +string(string s) strtrim = #0:strtrim; /* + Trims the whitespace from the start+end of the string. */ + +#if defined(CSQC) || defined(SSQC) +__deprecated("Use strftime.") void() calltimeofday = #231; /* Part of FTE_CALLTIMEOFDAY + Asks the engine to instantly call the qc's 'timeofday' function, before returning. For compatibility with mvdsv. + timeofday should have the prototype: void(float secs, float mins, float hour, float day, float mon, float year, string strvalue) + The strftime builtin is more versatile and less weird. */ + +#endif +#ifdef SSQC +void(float num, float type, .__variant fld) clientstat = #232; /* Part of EXT_CSQC + Specifies what data to use in order to send various stats, in a client-specific way. + 'num' should be a value between 32 and 127, other values are reserved. + 'type' must be set to one of the EV_* constants, one of EV_FLOAT, EV_STRING, EV_INTEGER, EV_ENTITY. + fld must be a reference to the field used, each player will be sent only their own copy of these fields. */ + +void(float num, float type, string name) globalstat = #233; /* + Specifies what data to use in order to send various stats, in a non-client-specific way. num and type are as in clientstat, name however, is the name of the global to read in the form of a string (pass "foo"). */ + +void(float num, float type, __variant *address) pointerstat = #0:pointerstat; /* + Specifies what data to use in order to send various stats, in a non-client-specific way. num and type are as in clientstat, address however, is the address of the variable you would like to use (pass &foo). */ + +void(entity ent, vector sendflags, entity unicastplayer) setsendneeded = #0:setsendneeded; /* + Flags the entity as needing to be resent. This builtin allows for more bits than supported by the SendEntity field, as well as allows flagging sends to specific players. */ + +float(entity player) isbackbuffered = #234; /* Part of FTE_ISBACKBUFFERED + Returns if the given player's network buffer will take multiple network frames in order to clear. If this builtin returns non-zero, you should delay or reduce the amount of reliable (and also unreliable) data that you are sending to that client. */ + +#endif +#if defined(CSQC) || defined(SSQC) +void(vector angle) rotatevectorsbyangle = #235; /* + rotates the v_forward,v_right,v_up matrix by the specified angles. */ + +void(vector fwd, vector right, vector up) rotatevectorsbyvectors = #236; +float(float mdlindex, string skinname) skinforname = #237; +#endif +#if defined(CSQC) || defined(MENU) +float(string shadername, optional string defaultshader, ...) shaderforname = #238; /* Part of FTE_FORCESHADER + Caches the named shader and returns a handle to it. + If the shader could not be loaded from disk (missing file or ruleset_allow_shaders 0), it will be created from the 'defaultshader' string if specified, or a 'skin shader' default will be used. + defaultshader if not empty should include the outer {} that you would ordinarily find in a shader. */ + +#endif +#ifdef CSQC +void(string shadername, string replacement, float timeoffset) remapshader = #0:remapshader; /* + All surfaces drawn with the specified shader will instead be drawn using the specified replacement shader. Shaders can be remapped to something else later by using the same source shadername. This is mostly useful for worldmodel surfaces (eg showing which team is currently winning). Entities should generally use setcustomskin or forceshader instead. Remaps will be forgotten on vid_reload, but can be reapplied via CSQC_RendererRestarted. */ + +#endif +#if defined(CSQC) || defined(SSQC) +void(vector org, optional float count) te_bloodqw = #239; /* Part of FTE_TE_STANDARDEFFECTBUILTINS*/ +#endif +#ifdef SSQC +void(entity ent) te_muzzleflash = #0:te_muzzleflash; +#endif +#if defined(CSQC) || defined(SSQC) +float(vector viewpos, entity entity) checkpvs = #240; /* Part of FTE_QC_CHECKPVS*/ +#endif +#ifdef SSQC +entity(string match, optional float matchnum) matchclientname = #241; /* Part of FTE_QC_MATCHCLIENTNAME*/ +#endif +float(string destaddress, string content) sendpacket = #242; /* Part of FTE_QC_SENDPACKET + Sends a UDP packet to the specified destination. Note that the payload will be prefixed with four 255 bytes as a sort of security feature. */ + +#ifdef CSQC +vector(entity ent, float tagnum) rotatevectorsbytag = #244; +#endif +#if defined(CSQC) || defined(SSQC) +float(float dividend, float divisor) mod = #245; +#endif +#ifdef SSQC +float(optional string host, optional string user, optional string pass, optional string defaultdb, optional string driver) sqlconnect = #250; /* Part of FTE_SQL*/ +void(float serveridx) sqldisconnect = #251; /* Part of FTE_SQL*/ +float(float serveridx, void(float serveridx, float queryidx, float rows, float columns, float eof, float firstrow) callback, float querytype, string query) sqlopenquery = #252; /* Part of FTE_SQL*/ +void(float serveridx, float queryidx) sqlclosequery = #253; /* Part of FTE_SQL*/ +string(float serveridx, float queryidx, float row, float column) sqlreadfield = #254; /* Part of FTE_SQL*/ +string(float serveridx, optional float queryidx) sqlerror = #255; /* Part of FTE_SQL*/ +string(float serveridx, string data) sqlescape = #256; /* Part of FTE_SQL*/ +string(float serveridx) sqlversion = #257; /* Part of FTE_SQL*/ +float(float serveridx, float queryidx, float row, float column) sqlreadfloat = #258; /* Part of FTE_SQL*/ +int(float serveridx, float queryidx, float row, float column, __variant *ptr, int maxsize) sqlreadblob = #0:sqlreadblob; +string(float serveridx, __variant *ptr, int maxsize) sqlescapeblob = #0:sqlescapeblob; +#endif +typedef struct json_s *json_t; +accessor jsonnode : json_t; +jsonnode(string) json_parse = #0:json_parse; /* + Parses the given JSON string. */ + +void(jsonnode) json_free = #0:json_free; /* + Frees a json tree and all of its children. Must only be called on the root node. */ + +enum json_type_e : int +{ + JSON_TYPE_STRING, + JSON_TYPE_NUMBER, + JSON_TYPE_OBJECT, + JSON_TYPE_ARRAY, + JSON_TYPE_TRUE, + JSON_TYPE_FALSE, + JSON_TYPE_NULL +}; +json_type_e(jsonnode node) json_get_value_type = #0:json_get_value_type; /* + Get type of a JSON value. */ + +int(jsonnode node) json_get_integer = #0:json_get_integer; /* + Get an integer from a json node. */ + +float(jsonnode node) json_get_float = #0:json_get_float; /* + Get a float from a json node. */ + +string(jsonnode node) json_get_string = #0:json_get_string; /* + Get a string from a value. Returns a null string if its not a string type. */ + +jsonnode(jsonnode node, string) json_find_object_child = #0:json_find_object_child; /* + Find a child of a json object by name. Returns NULL if the handle couldn't be found. */ + +int(jsonnode node) json_get_length = #0:json_get_length; /* + Get the length of a json array or object. Returns 0 if its not an array. */ + +jsonnode(jsonnode node, int childindex) json_get_child_at_index = #0:json_get_child_at_index; /* + Get the nth child of a json array or object. Returns NULL if the index is out of range. */ + +string(jsonnode node) json_get_name = #0:json_get_name; /* + Gets the object's name (useful if you're using json_get_child_at_index to walk an object's children for whatever reason). */ + +string(string javascript) js_run_script = #0:js_run_script; /* + Runs the provided javascript snippet. This builtin functions only in emscripten builds, returning a null string on other systems (or if the script evaluates to null). */ + +#if defined(CSQC) || defined(SSQC) +int(string) stoi = #259; /* Part of FTE_QC_INTCONV + Converts the given string into a true integer. Base 8, 10, or 16 is determined based upon the format of the string. */ + +string(int) itos = #260; /* Part of FTE_QC_INTCONV + Converts the passed true integer into a base10 string. */ + +int(string) stoh = #261; /* Part of FTE_QC_INTCONV + Reads a base-16 string (with or without 0x prefix) as an integer. Bugs out if given a base 8 or base 10 string. :P */ + +string(int) htos = #262; /* Part of FTE_QC_INTCONV + Formats an integer as a base16 string, with leading 0s and no prefix. Always returns 8 characters. */ + +#endif +int(float) ftoi = #0:ftoi; /* Part of FTE_QC_INTCONV + Converts the given float into a true integer without depending on extended qcvm instructions. */ + +float(int, optional float shift, float mask=24) itof = #0:itof; /* Part of FTE_QC_INTCONV + Converts the given true integer into a float without depending on extended qcvm instructions. If shift and mask are specified then only specific parts of the integer will be cast to float. */ + +#if defined(CSQC) || defined(SSQC) +float(float modlindex, optional float useabstransforms) skel_create = #263; /* Part of FTE_CSQC_SKELETONOBJECTS + Allocates a new uninitiaised skeletal object, with enough bone info to animate the given model. + eg: self.skeletonobject = skel_create(self.modelindex); */ + +float(float skel, entity ent, float modelindex, float retainfrac, float firstbone, float lastbone, optional float addfrac) skel_build = #264; /* Part of FTE_CSQC_SKELETONOBJECTS + Animation data (according to the entity's frame info) is pulled from the specified model and blended into the specified skeletal object. + If retainfrac is set to 0 on the first call and 1 on the others, you can blend multiple animations together according to the addfrac value. The final weight should be 1. Other values will result in scaling and/or other weirdness. You can use firstbone and lastbone to update only part of the skeletal object, to allow legs to animate separately from torso, use 0 for both arguments to specify all, as bones are 1-based. */ + +typedef struct +{ + int sourcemodelindex; /*frame data will be imported from this model, bones must be compatible*/ + int reserved; + int firstbone; + int lastbone; + float prescale; /*0 destroys existing data, 1 retains it*/ + float scale[4]; /*you'll need to do lerpfrac manually*/ + int animation[4]; + float animationtime[4]; + /*halflife models*/ + float subblend[2]; + float controllers[5]; +} skelblend_t; +float(float skel, int numblends, skelblend_t *weights, int structsize) skel_build_ptr = #0:skel_build_ptr; /* + Like skel_build, but slightly simpler. */ + +float(float skel) skel_get_numbones = #265; /* Part of FTE_CSQC_SKELETONOBJECTS + Retrives the number of bones in the model. The valid range is 1<=bone<=numbones. */ + +string(float skel, float bonenum) skel_get_bonename = #266; /* Part of FTE_CSQC_SKELETONOBJECTS + Retrieves the name of the specified bone. Mostly only for debugging. */ + +float(float skel, float bonenum) skel_get_boneparent = #267; /* Part of FTE_CSQC_SKELETONOBJECTS + Retrieves which bone this bone's position is relative to. Bone 0 refers to the entity's position rather than an actual bone */ + +float(float skel, string tagname) skel_find_bone = #268; /* Part of FTE_CSQC_SKELETONOBJECTS + Finds a bone by its name, from the model that was used to create the skeletal object. */ + +vector(float skel, float bonenum) skel_get_bonerel = #269; /* Part of FTE_CSQC_SKELETONOBJECTS + Gets the bone position and orientation relative to the bone's parent. Return value is the offset, and v_forward, v_right, v_up contain the orientation. */ + +vector(float skel, float bonenum) skel_get_boneabs = #270; /* Part of FTE_CSQC_SKELETONOBJECTS + Gets the bone position and orientation relative to the entity. Return value is the offset, and v_forward, v_right, v_up contain the orientation. + Use gettaginfo for world coord+orientation. */ + +void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_set_bone = #271; /* Part of FTE_CSQC_SKELETONOBJECTS + Sets a bone position relative to its parent. If the orientation arguments are not specified, v_forward+v_right+v_up are used instead. */ + +void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_premul_bone = #272; /* Part of FTE_CSQC_SKELETONOBJECTS + Transforms a single bone by a matrix. You can use makevectors to generate a rotation matrix from an angle. */ + +void(float skel, float startbone, float endbone, vector org, optional vector fwd, optional vector right, optional vector up) skel_premul_bones = #273; /* Part of FTE_CSQC_SKELETONOBJECTS + Transforms an entire consecutive range of bones by a matrix. You can use makevectors to generate a rotation matrix from an angle, but you'll probably want to divide the angle by the number of bones. */ + +void(float skel, float bonenum, vector org, optional vector fwd, optional vector right, optional vector up) skel_postmul_bone = #0:skel_postmul_bone; /* + Transforms a single bone by a matrix. You can use makevectors to generate a rotation matrix from an angle. */ + +void(float skeldst, float skelsrc, float startbone, float entbone) skel_copybones = #274; /* Part of FTE_CSQC_SKELETONOBJECTS + Copy bone data from one skeleton directly into another. */ + +void(float skel) skel_delete = #275; /* Part of FTE_CSQC_SKELETONOBJECTS + Deletes a skeletal object. The actual delete is delayed, allowing the skeletal object to be deleted in an entity's predraw function yet still be valid by the time the addentity+renderscene builtins need it. Also uninstanciates any ragdoll currently in effect on the skeletal object. */ + +float(float modidx, string framename) frameforname = #276; /* Part of FTE_CSQC_SKELETONOBJECTS + Looks up a framegroup from a model by name, avoiding the need for hardcoding. Returns -1 on error. */ + +float(float modidx, float framenum) frameduration = #277; /* Part of FTE_CSQC_SKELETONOBJECTS + Retrieves the duration (in seconds) of the specified framegroup. */ + +float(float modidx, int actionid) frameforaction = #0:frameforaction; /* + Returns a random frame/animation for the specified mod-defined action, or -1 if no animations have the specified action. */ + +void(float modidx, float framenum, __inout float basetime, float targettime, void(float timestamp, int code, string data) callback) processmodelevents = #0:processmodelevents; /* Part of FTE_GFX_MODELEVENTS + Calls a callback for each event that has been reached. Basetime is set to targettime. */ + +float(float modidx, float framenum, __inout float basetime, float targettime, __out int code, __out string data) getnextmodelevent = #0:getnextmodelevent; /* Part of FTE_GFX_MODELEVENTS + Reports the next event within a model's animation. Returns a boolean if an event was found between basetime and targettime. Writes to basetime,code,data arguments (if an event was found, basetime is set to the event's time, otherwise to targettime). + WARNING: this builtin cannot deal with multiple events with the same timestamp (only the first will be reported). */ + +float(float modidx, float framenum, int eventidx, __out float timestamp, __out int code, __out string data) getmodeleventidx = #0:getmodeleventidx; /* Part of FTE_GFX_MODELEVENTS + Reports an indexed event within a model's animation. Writes to timestamp,code,data arguments on success. Returns false if the animation/event/model was out of range/invalid. Does not consider looping animations (retry from index 0 if it fails and you know that its a looping animation). This builtin is more annoying to use than getnextmodelevent, but can be made to deal with multiple events with the exact same timestamp. */ + +#endif +#define dotproduct(v1,v2) ((vector)(v1)*(vector)(v2)) +vector(vector v1, vector v2) crossproduct = #0:crossproduct; /* Part of FTE_QC_CROSSPRODUCT + Small helper function to calculate the crossproduct of two vectors. */ + +#if defined(CSQC) || defined(SSQC) +float(entity pusher, vector move, vector amove) pushmove = #0:pushmove; +__variant(float action, optional vector pos, optional float radius, optional float quant, ...) terrain_edit = #278; /* Part of FTE_TERRAIN_MAP + Realtime terrain editing. Actions are the TEREDIT_ constants. */ + +typedef struct +{ + string shadername; + vector planenormal; + float planedist; + vector sdir; + float sbias; + vector tdir; + float tbias; +} brushface_t; +int(float modelidx, int brushid, brushface_t *out_faces, int maxfaces, int *out_contents) brush_get = #0:brush_get; /* Part of FTE_RAW_MAP + Queries a brush's information. You must pre-allocate the face array for the builtin to write to. Return value is the number of faces retrieved, 0 on error. */ + +int(float modelidx, brushface_t *in_faces, int numfaces, int contents, optional int brushid) brush_create = #0:brush_create; /* Part of FTE_RAW_MAP + Inserts a new brush into the model. Return value is the new brush's id. */ + +void(float modelidx, int brushid) brush_delete = #0:brush_delete; /* Part of FTE_RAW_MAP + Destroys the specified brush. */ + +float(float modelid, int brushid, int faceid, float selectedstate) brush_selected = #0:brush_selected; /* Part of FTE_RAW_MAP + Allows you to easily set transient visual properties of a brush. returns old value. selectedstate=-1 changes nothing (called for its return value). */ + +int(float modelid, int brushid, int faceid, vector *points, int maxpoints) brush_getfacepoints = #0:brush_getfacepoints; /* Part of FTE_RAW_MAP + Returns the list of verticies surrounding the given face. If face is 0, returns the center of the brush (if space for 1 point) or the mins+maxs (if space for 2 points). */ + +int(int faceid, brushface_t *in_faces, int numfaces, vector *points, int maxpoints) brush_calcfacepoints = #0:brush_calcfacepoints; /* Part of FTE_RAW_MAP + Determines the points of the specified face, if the specified brush were to actually be created. */ + +int(float modelid, vector *planes, float *dists, int numplanes, int *out_brushes, int *out_faces, int maxresults) brush_findinvolume = #0:brush_findinvolume; /* Part of FTE_RAW_MAP + Allows you to easily obtain a list of brushes+faces within the given bounding region. If out_faces is not null, the same brush might be listed twice. */ + +typedef struct +{ + string shadername; + int contents; + int cpwidth; + int cpheight; + int tesswidth; + int tessheight; + vector texinfo;/*scalex,y,rot*/ +} patchinfo_t; +typedef struct +{ + vector xyz; + vector rgb; float a; + float s, t; +} patchvert_t; +#define patch_delete(modelidx,patchidx) brush_delete(modelidx,patchidx) +int(float modelidx, int patchid, patchvert_t *out_controlverts, int maxcp, patchinfo_t *out_info) patch_getcp = #0:patch_getcp; /* + Queries a patch's information. You must pre-allocate the face array for the builtin to write to. Return value is the total number of control verts that were retrieved, 0 on error. */ + +int(float modelidx, int patchid, patchvert_t *out_verts, int maxverts, __out patchinfo_t out_info) patch_getmesh = #0:patch_getmesh; /* + Queries a patch's information. You must pre-allocate the face array for the builtin to write to. Return value is the total number of control verts that were retrieved, 0 on error. */ + +int(float modelidx, int oldpatchid, patchvert_t *in_controlverts, patchinfo_t in_info) patch_create = #0:patch_create; /* + Inserts a new patch into the model. Return value is the new patch's id. */ + +typedef struct +{ + vector dest; + int linkflags; + float radius; +} nodeslist_t; +void(entity ent, vector dest, int denylinkflags, void(entity ent, vector dest, int numnodes, nodeslist_t *nodelist) callback) route_calculate = #0:route_calculate; /* + Begin calculating a route. The callback function will be called once the route has finished being calculated. The route must be memfreed once it is no longer needed. The route must be followed in reverse order (ie: the first node that must be reached is at index numnodes-1). If no route is available then the callback will be called with no nodes. */ + +void(optional entity ent, optional vector neworigin) touchtriggers = #279; /* + Triggers a touch events between self and every SOLID_TRIGGER entity that it is in contact with. This should typically just be the triggers touch functions. Also optionally updates the origin of the moved entity. */ + +#endif +#ifdef SSQC +void(float buf, float fl) WriteFloat = #280; /* + Writes a full 32bit float without any data conversions at all, for full precision. */ + +void(float buf, __double dbl) WriteDouble = #0:WriteDouble; /* + Writes a full 64bit double-precision float without any data conversions at all, for excessive precision. */ + +void(float buf, int fl) WriteInt = #0:WriteInt; /* + Writes all 4 bytes of a 32bit integer without truncating to a float first before converting back to an int (unlike WriteLong does, but otherwise equivelent). */ + +void(float buf, __int64 fl) WriteInt64 = #0:WriteInt64; /* + Writes all 8 bytes of a 64bit integer. This uses variable-length coding and will send only a single byte for any value between -64 and 63. */ + +void(float buf, __uint64 fl) WriteUInt64 = #0:WriteUInt64; /* + Writes all 8 bytes of a 64bit unsigned integer. Values between 0-127 will be sent in a single byte. */ + +#endif +#if defined(CSQC) || defined(SSQC) +float(entity skelent, string dollcmd, float animskel) skel_ragupdate = #281; /* Part of FTE_QC_RAGDOLL_WIP + Updates the skeletal object attached to the entity according to its origin and other properties. + if animskel is non-zero, the ragdoll will animate towards the bone state in the animskel skeletal object, otherwise they will pick up the model's base pose which may not give nice results. + If dollcmd is not set, the ragdoll will update (this should be done each frame). + If the doll is updated without having a valid doll, the model's default .doll will be instanciated. + commands: + doll foo.doll : sets up the entity to use the named doll file + dollstring TEXT : uses the doll file directly embedded within qc, with that extra prefix. + cleardoll : uninstanciates the doll without destroying the skeletal object. + animate 0.5 : specifies the strength of the ragdoll as a whole + animatebody somebody 0.5 : specifies the strength of the ragdoll on a specific body (0 will disable ragdoll animations on that body). + enablejoint somejoint 1 : enables (or disables) a joint. Disabling joints will allow the doll to shatter. */ + +float*(float skel) skel_mmap = #282; /* Part of FTE_QC_RAGDOLL_WIP + Map the bones in VM memory. They can then be accessed via pointers. Each bone is 12 floats, the four vectors interleaved (sadly). */ + +void(entity ent, float bonenum, vector org, optional vector angorfwd, optional vector right, optional vector up) skel_set_bone_world = #283; /* Part of FTE_QC_RAGDOLL_WIP + Sets the world position of a bone within the given entity's attached skeletal object. The world position is dependant upon the owning entity's position. If no orientation argument is specified, v_forward+v_right+v_up are used for the orientation instead. If 1 is specified, it is understood as angles. If 3 are specified, they are the forawrd/right/up vectors to use. */ + +string(float modidx, float framenum) frametoname = #284; +string(float modidx, float skin) skintoname = #285; +float(float resourcetype, float tryload, string resourcename) resourcestatus = #286; /* + resourcetype must be one of the RESTYPE_ constants. Returns one of the RESSTATE_ constants. Tryload 0 is a query only. Tryload 1 will attempt to reload the content if it was flushed. */ + +#endif +hashtable(float tabsize, optional float defaulttype) hash_createtab = #287; /* Part of FTE_QC_HASHTABLES + Creates a hash table object. + The tabsize argument is a performance hint and should generally be set to something similar to the number of entries expected, typically a power of two assumption. Too high simply wastes memory, too low results in extra string compares but no actual bugs. + defaulttype must be one of the EV_* values, if specified. + The hash table with index 0 is a game-persistant table and will NEVER be returned by this builtin (except as an error return). */ + +void(hashtable table) hash_destroytab = #288; /* Part of FTE_QC_HASHTABLES + Destroys a hash table object. */ + +void(hashtable table, string name, __variant value, optional float typeandflags) hash_add = #289; /* Part of FTE_QC_HASHTABLES + Adds the given key with the given value to the table. + If flags&HASH_REPLACE, the old value will be removed, otherwise if flags&HASH_ADD then a duplicate entry will be added with a second value (can be obtained via hash_get's index argument). + The type argument describes how the value should be stored in saved games, as well as providing constraints with the hash_get function. While you can claim that all variables are just vectors, being more precise can result in less issues with tempstrings or saved games - be sure to be explicit with EV_STRING where appropriate because tempstrings may be reclaimed before the get (especially with saved games or table 0). */ + +__variant(hashtable table, string name, optional __variant deflt, optional float requiretype, optional float index) hash_get = #290; /* Part of FTE_QC_HASHTABLES + Looks up the specified key name in the hash table. Returns deflt if the key was not found. + If requiretype is specified then the function will only consider entries of the matching type (allowing you to store both flags+strings under a single name without getting confused). + If index is specified then the function will ignore the first N entries with the same key (applicable only with entries added using HASH_ADD, not HASH_REPLACE), allowing you to store multiple entries. Keep querying higher indexes starting from 0 until it returns the deflt value. + You will usually need to cast the result of this function to a real datatype. */ + +__variant(hashtable table, string name) hash_delete = #291; /* Part of FTE_QC_HASHTABLES + removes the named key. returns the value of the object that was destroyed, or 0 on error. */ + +string(hashtable table, float idx) hash_getkey = #292; /* Part of FTE_QC_HASHTABLES + gets some random key name. add+delete can change return values of this, so don't blindly increment the key index if you're removing all. */ + +float(string name) checkcommand = #294; /* Part of FTE_QC_CHECKCOMMAND + Checks to see if the supplied name is a valid command, cvar, or alias. Returns 0 if it does not exist. */ + +string(string s) argescape = #295; /* + Marks up a string so that it can be reliably tokenized as a single argument later. */ + +#ifdef SSQC +void(string dest, string from, string cmd, string info) clusterevent = #0:clusterevent; /* + Only functions in mapcluster mode. Sends an event to whichever server the named player is on. The destination server can then dispatch the event to the client or handle it itself via the SV_ParseClusterEvent entrypoint. If dest is empty, the event is broadcast to ALL servers. If the named player can't be found, the event will be returned to this server with the cmd prefixed with 'error:'. */ + +string(entity player, optional string newnode) clustertransfer = #0:clustertransfer; /* + Only functions in mapcluster mode. Initiate transfer of the player to a different node. Can take some time. If dest is specified, returns null on error. Otherwise returns the current/new target node (or null if not transferring). */ + +#endif +#if defined(CSQC) || defined(SSQC) || defined(MENU) +float(float mdlidx) modelframecount = #0:modelframecount; /* + Retrieves the number of frames in the specified model. */ + +#endif +#if defined(CSQC) || defined(MENU) +void() clearscene = #300; /* + Forgets all rentities, polygons, and temporary dlights. Resets all view properties to their default values. */ + +#endif +#ifdef CSQC +void(float mask) addentities = #301; /* + Walks through all entities effectively doing this: + if (ent.drawmask&mask){ if (!ent.predaw()) addentity(ent); } + If mask&MASK_DELTA, non-csqc entities, particles, and related effects will also be added to the rentity list. + If mask&MASK_STDVIEWMODEL then the default view model will also be added. */ + +#endif +#if defined(CSQC) || defined(MENU) +void(entity ent) addentity = #302; /* + Copies the entity fields into a new rentity for later rendering via addscene. */ + +void(entity ent, vector lightdir, vector lightavg, vector lightrange, int reserved1=0,void*reserved2=0) addentity_lighting = #0:addentity_lighting; /* + Copies the entity fields into a new rentity for later rendering via addscene, but with explicit lighting info. */ + +#endif +#ifdef CSQC +void(entity ent) removeentity = #0:removeentity; /* + Undoes all addentities added to the scene from the given entity, without removing ALL entities (useful for splitscreen/etc, readd modified versions as desired). */ + +typedef float vec2[2]; +typedef float vec3[3]; +typedef float vec4[4]; +typedef struct trisoup_simple_vert_s {vec3 xyz;vec2 st;vec4 rgba;} trisoup_simple_vert_t; +void(string texturename, int flags, struct trisoup_simple_vert_s *verts, int *indexes, int numindexes) addtrisoup_simple = #0:addtrisoup_simple; /* + Adds the specified trisoup into the scene as additional geometry. This permits caching geometry to reduce builtin spam. Indexes are a triangle list (so eg quads will need 6 indicies to form two triangles). NOTE: this is not going to be a speedup over polygons if you're still generating lots of new data every frame. */ + +#endif +#if defined(CSQC) || defined(MENU) +#define setviewprop setproperty +float(float property, ...) setproperty = #303; /* + Allows you to override default view properties like viewport, fov, and whether the engine hud will be drawn. Different VF_ values have slightly different arguments, some are vectors, some floats. */ + +void() renderscene = #304; /* + Draws all entities, polygons, and particles on the rentity list (which were added via addentities or addentity), using the various view properties set via setproperty. There is no ordering dependancy. + The scene must generally be cleared again before more entities are added, as entities will persist even over to the next frame. + You may call this builtin multiple times per frame, but should only be called from CSQC_UpdateView. */ + +#endif +#ifdef CSQC +float(vector org, float radius, vector lightcolours, optional float style, optional string cubemapname, optional float pflags) dynamiclight_add = #305; /* + Adds a temporary dlight, ready to be drawn via addscene. Cubemap orientation will be read from v_forward/v_right/v_up. */ + +#endif +void(string texturename, optional float flags, optional float is2d) R_BeginPolygon = #306; /* + Specifies the shader to use for the following polygons, along with optional flags. + If is2d, the polygon will be drawn as soon as the EndPolygon call is made, rather than waiting for renderscene. This allows complex 2d effects. */ + +void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307; /* + Specifies a polygon vertex with its various properties. */ + +void() R_EndPolygon = #308; /* + Ends the current polygon. At least 3 verticies must have been specified. You do not need to call beginpolygon again if you wish to draw another polygon with the same shader. */ + +#ifdef CSQC +void(float radius, vector texcoordbias) R_EndPolygonRibbon = #0:R_EndPolygonRibbon; /* + Ends the current primitive and duplicates each vertex sideways into a ribbon. The texcoordbias will be added to each duplicated vertex allowing for regular 2d textures. At least 2 verticies must have been specified. You do not need to call beginpolygon again if you wish to draw another polygon with the same shader. */ + +#endif +#if defined(CSQC) || defined(MENU) +#define getviewprop getproperty +__variant(float property) getproperty = #309; /* + Retrieve a currently-set (typically view) property, allowing you to read the current viewport or other things. Due to cheat protection, certain values may be unretrievable. */ + +#endif +#ifdef CSQC +vector (vector v) unproject = #310; /* + Transform a 2d screen-space point (with depth) into a 3d world-space point, according the various origin+angle+fov etc settings set via setproperty. */ + +vector (vector v) project = #311; /* + Transform a 3d world-space point into a 2d screen-space point, according the various origin+angle+fov etc settings set via setproperty. */ + +#endif +#if defined(CSQC) || defined(MENU) +float(vector pos, vector size, float alignflags, string text) drawtextfield = #0:drawtextfield; /* + Draws a multi-line block of text, including word wrapping and alignment. alignflags bits are RTLB, typically 3. Returns the total number of lines. */ + +#endif +#ifdef CSQC +void(float width, vector pos1, vector pos2, vector rgb, float alpha, optional float drawflag) drawline = #315; /* + Draws a 2d line between the two 2d points. */ + +float(string name) iscachedpic = #316; /* + Checks to see if the image is currently loaded. Engines might lie, or cache between maps. */ + +string(string name, optional float flags) precache_pic = #317; /* + Forces the engine to load the named image. Flags are a bitmask of the PRECACHE_PIC_* flags. */ + +#endif +#if defined(CSQC) || defined(MENU) +void(string imagename, int width, int height, void *pixeldata, optional int datasize, optional int format) r_uploadimage = #0:r_uploadimage; /* Part of FTE_CSQC_RAWIMAGES + Updates a texture with the specified rgba data (uploading it to the gpu). Will be created if needed. If datasize is specified then the image is decoded (eg .ktx or .dds data) instead of being raw R8G8B8A data. You'll typically want shaderforname to also generate a shader to use the texture. */ + +int*(string filename, __out int width, __out int height, __out int format) r_readimage = #0:r_readimage; /* Part of FTE_CSQC_RAWIMAGES + Reads and decodes an image from disk, providing raw R8G8B8A8 pixel data. Should not be used for dds or ktx etc formats. Returns __NULL__ if the image could not be read for any reason. Use memfree to free the data once you're done with it. */ + +#endif +#ifdef CSQC +#define draw_getimagesize drawgetimagesize +vector(string picname) drawgetimagesize = #318; /* + Returns the dimensions of the named image. Images specified with .lmp should give the original .lmp's dimensions even if texture replacements use a different resolution. WARNING: this function may be slow if used without or directly after its initial precache_pic. */ + +void(string name) freepic = #319; /* + Tells the engine that the image is no longer needed. The image will appear to be new the next time its needed. */ + +string(string modelname, int frame, float frametime) spriteframe = #0:spriteframe; /* + Obtains a suitable shader name to draw a sprite's shader via drawpic/R_BeginPolygon/etc, instead of needing to create a scene. */ + +float(vector position, float character, vector size='8 8', vector rgb='1 1 1', float alpha=1, optional float drawflag=0) drawcharacter = #320; /* + Draw the given quake character at the given position. + If flag&4, the function will consider the char to be a unicode char instead (or display as a ? if outside the 32-127 range). + size should normally be something like '8 8 0'. + rgb should normally be '1 1 1' + alpha normally 1. + Software engines may assume the named defaults. + Note that ALL text may be rescaled on the X axis due to variable width fonts. The X axis may even be ignored completely. */ + +float(vector position, string text, vector size, vector rgb, float alpha, optional float drawflag) drawrawstring = #321; /* + Draws the specified string without using any markup at all, even in engines that support it. + If UTF-8 is globally enabled in the engine, then that encoding is used (without additional markup), otherwise it is raw quake chars. + Software engines may assume a size of '8 8 0', rgb='1 1 1', alpha=1, flag&3=0, but it is not an error to draw out of the screen. */ + +float(vector position, string pic, vector size, vector rgb='1 1 1', float alpha=1, optional float drawflag=0) drawpic = #322; /* + Draws an shader within the given 2d screen box. Software engines may omit support for rgb+alpha, but must support rescaling, and must clip to the screen without crashing. */ + +float(vector position, vector size, vector rgb, float alpha, optional float drawflag) drawfill = #323; /* + Draws a solid block over the given 2d box, with given colour, alpha, and blend mode (specified via flags). + flags&3=0 simple blend. + flags&3=1 additive blend */ + +void(float x, float y, float width, float height) drawsetcliparea = #324; /* + Specifies a 2d clipping region (aka: scissor test). 2d draw calls will all be clipped to this 2d box, the area outside will not be modified by any 2d draw call (even 2d polygons). */ + +void(void) drawresetcliparea = #325; /* + Reverts the scissor/clip area to the whole screen. */ + +float(vector position, string text, vector size='8 8', vector rgb='1 1 1', float alpha=1, float drawflag=0) drawstring = #326; /* + Draws a string, interpreting markup and recolouring as appropriate. */ + +float(string text, float usecolours, vector fontsize='8 8') stringwidth = #327; /* + Calculates the width of the screen in virtual pixels. If usecolours is 1, markup that does not affect the string width will be ignored. Will always be decoded as UTF-8 if UTF-8 is globally enabled. + If the char size is not specified, '8 8 0' will be assumed. */ + +void(vector pos, vector sz, string pic, vector srcpos, vector srcsz, vector rgb, float alpha, optional float drawflag) drawsubpic = #328; /* + Draws a rescaled subsection of an image to the screen. */ + +#endif +#if defined(CSQC) || defined(MENU) +void(vector pivot, vector mins, vector maxs, string pic, vector rgb, float alpha, float angle) drawrotpic = #0:drawrotpic; /* + Draws an image rotating at the pivot. To rotate in the center, use mins+maxs of half the size with mins negated. Angle is in degrees. */ + +void(vector pivot, vector mins, vector maxs, string pic, vector txmin, vector txsize, vector rgb, vector alphaandangles) drawrotsubpic = #0:drawrotsubpic; /* + Overcomplicated draw function for over complicated people. Positions follow drawrotpic, while texture coords follow drawsubpic. Due to argument count limitations in builtins, the alpha value and angles are combined into separate fields of a vector (tip: use fteqcc's [alpha, angle] feature. */ + +#endif +#ifdef CSQC +#define getstati_punf(stnum) (float)(__variant)getstati(stnum) +int(float stnum) getstati = #330; /* + Retrieves the full precision of a stat registered as EV_INTEGER. */ + +#define getstatbits getstatf +float(float stnum, optional float firstbit, optional float bitcount) getstatf = #331; /* + Retrieves the numerical value of the given EV_FLOAT stat. If firstbit and bitcount are specified, then this builtin acts as getstati combined with itof, and which should be used for STAT_ITEMS (but not other stats). */ + +string(float stnum) getstats = #332; /* + Retrieves the value of the given EV_STRING stat, as a tempstring. + Older engines may use 4 consecutive integer stats, with a limit of 15 chars (yes, really. 15.), but FTE Quake uses a separate namespace for string stats and has a much higher length limit. */ + +__variant(float playernum, float statnum, float stattype) getplayerstat = #0:getplayerstat; /* + Retrieves a specific player's stat, matching the type specified on the server. This builtin is primarily intended for mvd playback where ALL players are known. Return value matches the specified EV_ stattype. For EV_ENTITY, world will be returned if the entity is not in the pvs, use type-punning with EV_INTEGER to get the entity number if you just want to see if its set. STAT_ITEMS should be queried as an EV_INTEGER on account of runes and items2 being packed into the upper bits. */ + +void(entity e, float mdlindex) setmodelindex = #333; /* + Sets a model by precache index instead of by name. Otherwise identical to setmodel. */ + +#endif +#if defined(CSQC) || defined(SSQC) +string(float mdlindex) modelnameforindex = #334; /* + Retrieves the name of the model based upon a precache index. This can be used to reduce csqc network traffic by enabling model matching (with getmodelindex). */ + +string(float sndindex) soundnameforindex = #0:soundnameforindex; /* + Retrieves the name of the sound based upon a precache index. This can be used to reduce csqc network traffic by enabling sound matching (with getsoundindex). */ + +float(string effectname) particleeffectnum = #335; /* Part of DP_ENT_TRAILEFFECTNUM, FTE_SV_POINTPARTICLES + Precaches the named particle effect. If your effect name is of the form 'foo.bar' then particles/foo.cfg will be loaded by the client if foo.bar was not already defined. + Different engines will have different particle systems, this specifies the QC API only. */ + +void(float effectnum, entity ent, vector start, vector end) trailparticles = #336; /* Part of FTE_SV_POINTPARTICLES + Draws the given effect between the two named points. If ent is not world, distances will be cached in the entity in order to avoid framerate dependancies. The entity is not otherwise used. */ + +void(float effectnum, vector origin, optional vector dir, optional float count) pointparticles = #337; /* Part of FTE_SV_POINTPARTICLES + Spawn a load of particles from the given effect at the given point traveling or aiming along the direction specified. The number of particles are scaled by the count argument. + For regular particles, the dir vector is multiplied by the 'veladd' property (while orgadd will push the particles along it). Decals will use it as a hint to align to the correct surface. In both cases, it should normally be a unit vector, but other lengths will still work. If it has length 0 then FTE will assume downwards. */ + +#endif +#ifdef CSQC +void(string s, ...) cprint = #338; /* + Print into the center of the screen just as ssqc's centerprint would appear. */ + +#endif +#if defined(CSQC) || defined(SSQC) +void(string s, ...) print = #339; /* Part of DP_SV_PRINT + Unconditionally print on the local system's console, even in ssqc (doesn't care about the value of the developer cvar). */ + +#endif +#ifdef CSQC +string(float keynum) keynumtostring = #340; /* + Returns a hunam-readable name for the given keycode, as a tempstring. */ + +#endif +#ifdef MENU +DEP string(float keynum) keynumtostring_csqc = #340; /* + Returns a hunam-readable name for the given keycode, as a tempstring. */ + +#endif +#ifdef CSQC +float(string keyname) stringtokeynum = #341; /* + Looks up the key name in the same way that the bind command would, returning the keycode for that key. */ + +#endif +#ifdef MENU +DEP float(string keyname) stringtokeynum_csqc = #341; /* + Looks up the key name in the same way that the bind command would, returning the keycode for that key. */ + +#endif +#if defined(CSQC) || defined(MENU) +string(float keynum) getkeybind = #342; /* + Returns the current binding for the given key (returning only the command executed when no modifiers are pressed). */ + +void(float usecursor, optional string cursorimage, optional vector hotspot, optional float scale) setcursormode = #343; /* + Pass TRUE if you want the engine to release the mouse cursor (absolute input events + touchscreen mode). Pass FALSE if you want the engine to grab the cursor (relative input events + standard looking). If the image name is specified, the engine will use that image for a cursor (use an empty string to clear it again), in a way that will not conflict with the console. Images specified this way will be hardware accelerated, if supported by the platform/port. */ + +float(float effective) getcursormode = #0:getcursormode; /* + Reports the cursor mode this module previously attempted to use. If 'effective' is true, reports the cursor mode currently active (if was overriden by a different module which has precidence, for instance, or if there is only a touchscreen and no mouse). */ + +#endif +#ifdef CSQC +vector() getmousepos = #344; /* + Nasty convoluted DP extension. Typically returns deltas instead of positions. Use CSQC_InputEvent instead for such things in csqc mods. */ + +#endif +#if defined(CSQC) || defined(MENU) +void(vector newpos) setmousepos = #0:setmousepos; /* + Warps the mouse cursor to the given location. Should normally only be done following setcursormode(TRUE,...). The warp MAY be visible through *_InputEvent, but normally be seen as an IE_ABSMOUSE event anyway. Not all systems support cursor warping (or even cursors), so this is a hint only and you should not depend upon it. */ + +#endif +#ifdef CSQC +float(float inputsequencenum) getinputstate = #345; /* + Looks up an input frame from the log, setting the input_* globals accordingly. + The sequence number range used for prediction should normally be servercommandframe < sequence <= clientcommandframe. + The sequence equal to clientcommandframe will change between input frames. */ + +void(float sens) setsensitivityscaler = #346; /* + Temporarily scales the player's mouse sensitivity based upon something like zoom, avoiding potential cvar saving and thus corruption. */ + +#endif +#if defined(CSQC) || defined(SSQC) +void(entity ent) runstandardplayerphysics = #347; /* + Perform the engine's standard player movement prediction upon the given entity using the input_* globals to describe movement. */ + +#endif +#ifdef CSQC +string(float playernum, string keyname) getplayerkeyvalue = #348; /* + Look up a player's userinfo, to discover things like their name, topcolor, bottomcolor, skin, team, *ver. + Also includes scoreboard info like frags, ping, pl, userid, entertime, as well as voipspeaking and voiploudness. */ + +float(float playernum, string keyname, optional float assumevalue) getplayerkeyfloat = #0:getplayerkeyfloat; /* + Cheaper version of getplayerkeyvalue that avoids the need for so many tempstrings. */ + +int(float playernum, string keyname, optional void *outptr, int size) getplayerkeyblob = #0:getplayerkeyblob; /* Part of FTE_INFOBLOBS + Obtains a copy of the full data blob. Will write up to size bytes but return the full size. Does not null terminate (but memalloc(ret+1) will, if you want to cast the buffer to a string), and the blob may contain embedded nulls. Ignores all special keys, returning only what is actually there. */ + +#endif +#if defined(CSQC) || defined(MENU) +void(float seat, string keyname, string newvalue) setlocaluserinfo = #0:setlocaluserinfo; /* + Change a userinfo key for the specified local player seat, equivelent to the setinfo console command. The server will normally forward the setting to other clients. */ + +string(float seat, string keyname) getlocaluserinfo = #0:getlocaluserinfo; /* + Reads a local userinfo key for the specified local player seat. This is not quite the same as getplayerkeyvalue, due to latency and possible serverside filtering. */ + +void(float seat, string keyname, void *outptr, int size) setlocaluserinfoblob = #0:setlocaluserinfoblob; /* Part of FTE_INFOBLOBS + Sets the userinfo key to a blob that may contain nulls etc. Keys with a leading underscore will be visible to only the server (for user-specific binary settings). */ + +int(float seat, string keyname, void *outptr, int maxsize) getlocaluserinfoblob = #0:getlocaluserinfoblob; /* Part of FTE_INFOBLOBS + Obtains a copy of the full data blob. Will write up to size bytes but return the full size. Does not null terminate (but memalloc(ret+1) will, if you want to cast the buffer to a string), and the blob may contain embedded nulls. Ignores all special keys, returning only what is actually there. */ + +#endif +#ifdef SSQC +int(string keyname, optional void *outptr, int size) getlocalinfo = #0:getlocalinfo; /* + Obtains a copy of a data blob (with spaces) from the server's private localinfo. Will write up to size bytes and return the actual size. Does not null terminate (but memalloc(ret+1) will, if you want to cast the buffer to a string), and the blob may contain embedded nulls. Ignores all special keys, returning only what is actually there. */ + +void(string keyname, optional void *outptr, int size) setlocalinfo = #0:setlocalinfo; /* + Changes the server's private localinfo. This data will be available for the following map, and will *usually* reload with saved games. */ + +#endif +#if defined(CSQC) || defined(MENU) +float() isdemo = #349; /* + Returns if the client is currently playing a demo or not. Returns 2 when playing an mvd (where other player's stats can be queried, or the pov can be changed freely). */ + +#endif +#ifdef CSQC +float() isserver = #350; /* + Returns non-zero whenever the local console can directly affect the server (ie: listen servers or single-player). Compat note: DP returns 0 for single-player. */ + +void(vector origin, vector forward, vector right, vector up, optional float reverbtype) SetListener = #351; /* + Sets the position of the view, as far as the audio subsystem is concerned. This should be called once per CSQC_UpdateView as it will otherwise revert to default. For reverbtype, see setup_reverb or treat as 'underwater'. */ + +typedef struct { + float flDensity; + float flDiffusion; + float flGain; + float flGainHF; + float flGainLF; + float flDecayTime; + float flDecayHFRatio; + float flDecayLFRatio; + float flReflectionsGain; + float flReflectionsDelay; + vector flReflectionsPan; + float flLateReverbGain; + float flLateReverbDelay; + vector flLateReverbPan; + float flEchoTime; + float flEchoDepth; + float flModulationTime; + float flModulationDepth; + float flAirAbsorptionGainHF; + float flHFReference; + float flLFReference; + float flRoomRolloffFactor; + int iDecayHFLimit; +} reverbinfo_t; +void(float reverbslot, reverbinfo_t *reverbinfo, int sizeofreverinfo_t) setup_reverb = #0:setup_reverb; /* Part of FTE_CSQC_REVERB + Reconfigures a reverb slot for weird effects. Slot 0 is reserved for no effects. Slot 1 is reserved for underwater effects. Reserved slots will be reinitialised on snd_restart, but can otherwise be changed. These reverb slots can be activated with SetListener. Note that reverb will currently only work when using OpenAL. */ + +#endif +void(string cmdname) registercommand = #352; /* + Register the given console command, for easy console use. + Console commands that are later used will invoke CSQC_ConsoleCommand/m_consolecommand/ConsoleCmd according to module. */ + +float(entity ent) wasfreed = #353; /* + Quickly check to see if the entity is currently free. This function is only valid during the half-second non-reuse window, after that it may give bad results. Try one second to make it more robust. */ + +#if defined(CSQC) || defined(SSQC) +string(string key) serverkey = #354; /* + Look up a key in the server's public serverinfo string. If the key contains binary data then it will be truncated at the first null. */ + +float(string key, optional float assumevalue) serverkeyfloat = #0:serverkeyfloat; /* + Version of serverkey that returns the value as a float (which avoids tempstrings). */ + +int(string key, optional void *ptr, int maxsize) serverkeyblob = #0:serverkeyblob; /* Part of FTE_INFOBLOBS + Version of serverkey that returns data as a blob (ie: binary data that may contain nulls). Returns the full blob size, even if truncated (pass maxsize=0 to query required storage). */ + +#endif +#ifdef SSQC +void(string key, void *ptr, optional int size) setserverkey = #0:setserverkey; /* + Changes the server's serverinfo. */ + +#endif +#ifdef CSQC +string(optional string resetstring) getentitytoken = #355; /* + Grab the next token in the map's entity lump. + If resetstring is not specified, the next token will be returned with no other sideeffects. + If empty, will reset from the map before returning the first token, probably {. + If not empty, will tokenize from that string instead. + Always returns tempstrings. */ + +#endif +#if defined(CSQC) || defined(MENU) +float(string s) findfont = #356; /* Part of DP_GFX_FONTS + Looks up a named font slot. Matches the actual font name as a last resort. */ + +float(string fontname, string fontmaps, string sizes, float slot, optional float fix_scale, optional float fix_voffset) loadfont = #357; /* Part of DP_GFX_FONTS + too convoluted for me to even try to explain correct usage. Try drawfont = loadfont("", "cour", "16", -1, 0, 0); to switch to the courier font (optimised for 16 virtual pixels high) ('cour' requires mscorefonts installed in linux). Additionally you can add "outline=1" as an extra token in the sizes string, to have more readable outlined fonts. */ + +#endif +#ifdef CSQC +void(string evname, string evargs, ...) sendevent = #359; /* + Invoke CSEv_evname_evargs in ssqc. evargs must be a string of initials refering to the types of the arguments to pass. v=vector, e=entity(.entnum field is sent), f=float, i=int. 6 arguments max - you can get more if you pack your floats into vectors. */ + +float() readbyte = #360; /* + Reads an unsigned 8-bit value, pair with WriteByte. */ + +float() readchar = #361; /* + Reads a signed 8-bit value. Paired with WriteChar. */ + +float() readshort = #362; /* + Reads a signed 16-bit value. Paired with WriteShort. */ + +float() readlong = #363; /* + Reads a signed 32-bit value. Paired with WriteLong or WriteInt. */ + +float() readcoord = #364; /* + Reads a value matching the unspecified precision written ONLY by WriteCoord. */ + +float() readangle = #365; /* + Reads a value matching the unspecified precision written ONLY by WriteAngle. */ + +string() readstring = #366; /* + Reads a null-terminated string. */ + +float() readfloat = #367; /* + Reads a float without any truncation nor conversions. Data MUST have originally been written with WriteFloat. */ + +__double() readdouble = #0:readdouble; /* + Reads a double-precision float without any truncation nor conversions. Data MUST have originally been written with WriteDouble. */ + +int() readint = #0:readint; /* + Reads a 32bit int without any conversions to float, otherwise interchangable with readlong. */ + +__int64() readint64 = #0:readint64; /* + Reads a 64bit signed int. Paired with WriteInt64. */ + +__uint64() readuint64 = #0:readuint64; /* + Reads a 64bit unsigned int. Paired with WriteUInt64. */ + +float() readentitynum = #368; /* + Reads the serverside index of an entity, paired with WriteEntity. There may be nothing else known about the entity yet, so the result typically needs to be saved as-is and re-looked up each frame. This can be done via getentity(NUM, GE_*) for non-csqc ents, or findentity(world,entnum,NUM) - both of which can fail due to latency. */ + +float(string modelname, float(float isnew) updatecallback, float flags) deltalisten = #371; /* + Specifies a per-modelindex callback to listen for engine-networking entity updates. Such entities are automatically interpolated by the engine (unless flags specifies not to). + The various standard entity fields will be overwritten each frame before the updatecallback function is called. */ + +float(vector org, float radius, vector rgb) dynamiclight_spawnstatic = #0:dynamiclight_spawnstatic; /* + Creates a static persistent light at the given position with the specified colour. Additional properties must be set via dynamiclight_set. */ + +__variant(float lno, float fld) dynamiclight_get = #372; /* + Retrieves a property from the given dynamic/rt light. Return type depends upon the light field requested. */ + +void(float lno, float fld, __variant value) dynamiclight_set = #373; /* + Changes a property on the given dynamic/rt light. Value type depends upon the light field to be changed. */ + +string(float efnum, float body) particleeffectquery = #374; /* + Retrieves either the name or the body of the effect with the given number. The effect body is regenerated from internal state, and can be changed before being reapplied via the localcmd builtin. */ + +void(string shadername, vector origin, vector up, vector side, vector rgb, float alpha) adddecal = #375; /* + Adds a temporary clipped decal shader to the scene, centered at the given point with given orientation. Will be drawn by the next renderscene call, and freed by the next clearscene call. */ + +#endif +#if defined(CSQC) || defined(MENU) +void(entity e, string skinfilename, optional string skindata) setcustomskin = #376; /* Part of FTE_QC_CUSTOMSKINS + Sets an entity's skin overrides to a new skin object. Releases the entities old skin (refcounted). */ + +#endif +#ifdef CSQC +float(string skinfilename, optional string skindata) loadcustomskin = #377; /* Part of FTE_QC_CUSTOMSKINS + Creates a new skin object and returns it. These are custom per-entity surface->shader lookups. The skinfilename/data should be in .skin format: + surfacename,shadername - makes the named surface use the named shader (legacy format for compat with q3) + replace "surfacename" "shadername" - non-legacy equivalent. + qwskin "foo" - use an unmodified quakeworld player skin (including crop+repalette rules) + q1lower 0xff0000 - specify an override for the entity's lower colour, in this case to red + q1upper 0x0000ff - specify an override for the entity's lower colour, in this case to blue + compose "surfacename" "shader" "imagename@x,y:w,h$s,t,s2,t2?r,g,b,a" - compose a skin texture from multiple images. + The texture is determined to be sufficient to hold the first named image, additional images can be named as extra tokens on the same line. + Use a + at the end of the line to continue reading image tokens from the next line also, the named shader must use 'map $diffuse' to read the composed texture (compatible with the defaultskin shader). Must be matched with a releasecustomskin call later, and is pointless without applycustomskin. */ + +void(entity e, float skinobj) applycustomskin = #378; /* Part of FTE_QC_CUSTOMSKINS + Updates the entity's custom skin (refcounted). */ + +void(float skinobj) releasecustomskin = #379; /* Part of FTE_QC_CUSTOMSKINS + Lets the engine know that the skin will no longer be needed. Thanks to refcounting any ents with the skin already applied will retain their skin until later changed. It is valid to destroy a skin just after applying it to an ent in the same function that it was created in, as the skin will only be destroyed once its refcount rops to 0. */ + +void(float devid, float amp_low, float amp_high, float duration) gp_rumble = #0:gp_rumble; /* + Sends a single rumble event to the game-pad specified in devid. Every time you call this, the previous effect is cancelled out. */ + +void(float devid, float left, float right, float duration) gp_rumbletriggers = #0:gp_rumbletriggers; /* + Makes the analog triggers rumble of the specified game-pad, like gp_rumble() one call cancels out the previous one on the device. */ + +void(float devid, vector color) gp_setledcolor = #0:gp_setledcolor; /* + Updates the game-pad LED color. */ + +void(float devid, /*const*/ void *data, int size) gp_settriggerfx = #0:gp_settriggerfx; /* + Sends a specific effect packet to the controller. On the PlayStation 5's DualSense that can adjust the tension on the analog triggers. */ + +#endif +__variant*(int size) memalloc = #384; /* Part of FTE_MEMALLOC + Allocate an arbitary block of memory */ + +void(__variant *ptr) memfree = #385; /* Part of FTE_MEMALLOC + Frees a block of memory that was allocated with memfree */ + +void(__variant *dst, __variant *src, int size) memcpy = #386; /* Part of FTE_MEMALLOC + Copys memory from one location to another */ + +void(__variant *dst, int val, int size) memfill8 = #387; /* Part of FTE_MEMALLOC + Sets an entire block of memory to a specified value. Pretty much always 0. */ + +__variant(__variant *dst, float ofs) memgetval = #388; /* + Looks up the 32bit value stored at a pointer-with-offset. */ + +void(__variant *dst, float ofs, __variant val) memsetval = #389; /* + Changes the 32bit value stored at the specified pointer-with-offset. */ + +__variant*(__variant *base, float ofs) memptradd = #390; /* + Perform some pointer maths. Woo. */ + +float(string s) memstrsize = #0:memstrsize; /* + strlen, except ignores utf-8 */ + +#if defined(CSQC) || defined(MENU) +string(string conname, string field, optional string newvalue) con_getset = #391; /* Part of FTE_CSQC_ALTCONSOLES + Reads or sets a property from a console object. The old value is returned. Iterrate through consoles with the 'next' field. Valid properties: title, name, next, unseen, markup, forceutf8, close, clear, hidden, linecount */ + +void(string conname, string messagefmt, ...) con_printf = #392; /* Part of FTE_CSQC_ALTCONSOLES + Prints onto a named console. */ + +void(string conname, vector pos, vector size, float fontsize) con_draw = #393; /* Part of FTE_CSQC_ALTCONSOLES + Draws the named console. */ + +float(string conname, float inevtype, float parama, float paramb, float paramc) con_input = #394; /* Part of FTE_CSQC_ALTCONSOLES + Forwards input events to the named console. Mouse updates should be absolute only. */ + +void(string newcaption) setwindowcaption = #0:setwindowcaption; /* Part of FTE_CSQC_WINDOWCAPTION + Replaces the title of the game window, as seen when task switching or just running in windowed mode. */ + +float() cvars_haveunsaved = #0:cvars_haveunsaved; /* + Returns true if any archived cvar has an unsaved value. */ + +#endif +float(entity e, float nowreadonly) entityprotection = #0:entityprotection; /* + Changes the protection on the specified entity to protect it from further edits from QC. The return value is the previous setting. Note that this can be used to unprotect the world, but doing so long term is not advised as you will no longer be able to detect invalid entity references. Also, world is not networked, so results might not be seen by clients (or in other words, world.avelocity_y=64 is a bad idea). */ + +#ifdef CSQC +string(vector pos) getlocationname = #0:getlocationname; /* + Looks up the specified position in the current map's .loc file and reports the nearest marked name. */ + +#endif +#ifdef MENU +void(int cliptype) clipboard_get = #0:clipboard_get; /* + Attempts to query the system clipboard. Any pasted text will be returned via Menu_InputEvent */ + +#endif +#if defined(CSQC) || defined(MENU) +void(int cliptype, string text) clipboard_set = #0:clipboard_set; /* + Changes the system clipboard to the specified text. */ + +#endif +#ifdef SSQC +entity(float entnum, optional __out float wasspawned) respawnedict = #0:respawnedict; /* + Acts like edict_num returning a specific entity number, but also marks it as spawned. If it was previously spawned then all of its prior field data will be LOST (you may wish to use wasfreed(edict_num(idx)) to check. */ + +#endif +#if defined(CSQC) || defined(SSQC) +entity(entity from, optional entity to) copyentity = #400; /* Part of DP_QC_COPYENTITY + Copies all fields from one entity to another. */ + +#endif +#ifdef SSQC +__deprecated("No RGB support.") void(entity ent, float colours) setcolor = #401; /* Part of DP_SV_SETCOLOR + Changes a player's colours. The bits 0-3 are the lower/trouser colour, bits 4-7 are the upper/shirt colours. */ + +#endif +#if defined(CSQC) || defined(SSQC) +entity(.string field, string match, optional .entity chainfield) findchain = #402; /* Part of DP_QC_FINDCHAIN*/ +entity(.float fld, float match, optional .entity chainfield) findchainfloat = #403; /* Part of DP_QC_FINDCHAINFLOAT*/ +void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404; /* Part of DP_SV_EFFECT + Spawns a self-animating sprite */ + +void(vector org, vector dir, float count) te_blood = #405; /* Part of DP_TE_BLOOD*/ +void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406; /* Part of _DP_TE_BLOODSHOWER*/ +void(vector org, vector color) te_explosionrgb = #407; /* Part of DP_TE_EXPLOSIONRGB*/ +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408; /* Part of DP_TE_PARTICLECUBE*/ +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409; /* Part of DP_TE_PARTICLERAIN*/ +void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410; /* Part of DP_TE_PARTICLESNOW*/ +void(vector org, vector vel, float howmany) te_spark = #411; /* Part of DP_TE_SPARK*/ +void(vector org) te_gunshotquad = #412; /* Part of _DP_TE_QUADEFFECTS1*/ +void(vector org) te_spikequad = #413; /* Part of _DP_TE_QUADEFFECTS1*/ +void(vector org) te_superspikequad = #414; /* Part of _DP_TE_QUADEFFECTS1*/ +void(vector org) te_explosionquad = #415; /* Part of _DP_TE_QUADEFFECTS1*/ +void(vector org) te_smallflash = #416; /* Part of DP_TE_SMALLFLASH*/ +void(vector org, float radius, float lifetime, vector color) te_customflash = #417; /* Part of DP_TE_CUSTOMFLASH*/ +void(vector org, optional float count) te_gunshot = #418; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ +void(vector org) te_spike = #419; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ +void(vector org) te_superspike = #420; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ +void(vector org) te_explosion = #421; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ +void(vector org) te_tarexplosion = #422; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ +void(vector org) te_wizspike = #423; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ +void(vector org) te_knightspike = #424; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ +void(vector org) te_lavasplash = #425; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ +void(vector org) te_teleport = #426; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ +void(vector org, float color, float colorlength) te_explosion2 = #427; /* Part of DP_TE_STANDARDEFFECTBUILTINS*/ +void(entity own, vector start, vector end) te_lightning1 = #428; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ +void(entity own, vector start, vector end) te_lightning2 = #429; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ +void(entity own, vector start, vector end) te_lightning3 = #430; /* Part of DP_TE_STANDARDEFFECTBUILTINS, FTE_TE_STANDARDEFFECTBUILTINS*/ +void(entity own, vector start, vector end) te_beam = #431; /* Part of DP_TE_STANDARDEFFECTBUILTINS*/ +void(vector dir) vectorvectors = #432; /* Part of DP_QC_VECTORVECTORS*/ +void(vector org) te_plasmaburn = #433; /* Part of _DP_TE_PLASMABURN*/ +float(entity e, float s) getsurfacenumpoints = #434; /* Part of DP_QC_GETSURFACE*/ +vector(entity e, float s, float n) getsurfacepoint = #435; /* Part of DP_QC_GETSURFACE*/ +vector(entity e, float s) getsurfacenormal = #436; /* Part of DP_QC_GETSURFACE*/ +string(entity e, float s) getsurfacetexture = #437; /* Part of DP_QC_GETSURFACE*/ +float(entity e, vector p) getsurfacenearpoint = #438; /* Part of DP_QC_GETSURFACE*/ +vector(entity e, float s, vector p) getsurfaceclippedpoint = #439; /* Part of DP_QC_GETSURFACE*/ +#endif +#ifdef MENU +strbuf() buf_create = #440; /* Part of DP_QC_STRINGBUFFERS*/ +void(strbuf bufhandle) buf_del = #441; /* Part of DP_QC_STRINGBUFFERS*/ +float(strbuf bufhandle) buf_getsize = #442; /* Part of DP_QC_STRINGBUFFERS*/ +void(strbuf bufhandle_from, float bufhandle_to) buf_copy = #443; /* Part of DP_QC_STRINGBUFFERS*/ +void(strbuf bufhandle, float sortprefixlen, float backward) buf_sort = #444; /* Part of DP_QC_STRINGBUFFERS*/ +string(strbuf bufhandle, string glue) buf_implode = #445; /* Part of DP_QC_STRINGBUFFERS*/ +string(strbuf bufhandle, float string_index) bufstr_get = #446; /* Part of DP_QC_STRINGBUFFERS*/ +void(strbuf bufhandle, float string_index, string str) bufstr_set = #447; /* Part of DP_QC_STRINGBUFFERS*/ +float(strbuf bufhandle, string str, float ordered) bufstr_add = #448; /* Part of DP_QC_STRINGBUFFERS*/ +void(strbuf bufhandle, float string_index) bufstr_free = #449; /* Part of DP_QC_STRINGBUFFERS*/ +float(string name) iscachedpic = #451; +string(string name, optional float flags) precache_pic = #452; +float(vector position, float character, vector scale, vector rgb, float alpha, optional float flag) drawcharacter = #454; +float(vector position, string text, vector scale, vector rgb, float alpha, optional float flag) drawrawstring = #455; +float(vector position, string pic, vector size, vector rgb, float alpha, optional float flag) drawpic = #456; +float(vector position, vector size, vector rgb, float alpha, optional float flag) drawfill = #457; +void(float x, float y, float width, float height) drawsetcliparea = #458; +void(void) drawresetcliparea = #459; +vector(string picname) drawgetimagesize = #460; +void(float width, vector pos1, vector pos2) drawline = #466; +float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring = #467; +float(string text, float usecolours, vector fontsize='8 8') stringwidth = #468; +void(vector pos, vector sz, string pic, vector srcpos, vector srcsz, vector rgb, float alpha, float flag) drawsubpic = #469; +#endif +#ifdef SSQC +void(entity e, string s) clientcommand = #440; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND*/ +#endif +#if defined(CSQC) || defined(SSQC) +float(string s) tokenize = #441; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND*/ +string(float n) argv = #442; /* Part of KRIMZON_SV_PARSECLIENTCOMMAND*/ +void(entity e, entity tagentity, string tagname) setattachment = #443; /* Part of DP_GFX_QUAKE3MODELTAGS*/ +searchhandle(string pattern, enumflags:float{SB_CASEINSENSITIVE=1<<0,SB_FULLPACKAGEPATH=1<<1,SB_ALLOWDUPES=1<<2,SB_FORCESEARCH=1<<3,SB_MULTISEARCH=1<<4,SB_NAMESORT=1<<5} flags, float quiet, optional string filterpackage) search_begin = #444; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE + initiate a filesystem scan based upon filenames. Be sure to call search_end on the returned handle. SB_FULLPACKAGEPATH interprets the filterpackage arg as a full package path to avoid gamedir ambiguity, equivelent to whichpack's WP_FULLPACKAGEPATH flag. SB_ALLOWDUPES allows returning multiple entries with the same name (but different package, useful with search_fopen). SB_FORCESEARCH requires use of the filterpackage and SB_FULLPACKAGEPATH flag, initiating searches from gamedirs/packages which are not currently active. */ + +void(searchhandle handle) search_end = #445; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE*/ +float(searchhandle handle) search_getsize = #446; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE + Retrieves the number of files that were found. */ + +string(searchhandle handle, float num) search_getfilename = #447; /* Part of DP_QC_FS_SEARCH, DP_QC_FS_SEARCH_PACKFILE + Retrieves name of one of the files that was found by the initial search. */ + +#endif +float(searchhandle handle, float num) search_getfilesize = #0:search_getfilesize; /* Part of FTE_QC_FS_SEARCH_SIZEMTIME + Retrieves the size of one of the files that was found by the initial search. */ + +string(searchhandle handle, float num) search_getfilemtime = #0:search_getfilemtime; /* Part of FTE_QC_FS_SEARCH_SIZEMTIME + Retrieves modification time of one of the files. */ + +string(searchhandle handle, float num) search_getpackagename = #0:search_getpackagename; /* + Retrieves the name of the package containing the file. Search with SB_FULLPACKAGEPATH to see gamedir/package info */ + +filestream(searchhandle handle, float num) search_fopen = #0:search_fopen; /* + Opens the file directly, without getting confused about entries from other packages. Read access only. */ + +#if defined(CSQC) || defined(SSQC) +string(string cvarname) cvar_string = #448; /* Part of DP_QC_CVAR_STRING*/ +entity(entity start, .float fld, float match) findflags = #449; /* Part of DP_QC_FINDFLAGS*/ +entity(.float fld, float match, optional .entity chainfield) findchainflags = #450; /* Part of DP_QC_FINDCHAINFLAGS*/ +float(entity ent, string tagname) gettagindex = #451; /* Part of DP_QC_GETTAGINFO*/ +vector(entity ent, float tagindex) gettaginfo = #452; /* Part of DP_QC_GETTAGINFO + Obtains the current worldspace position+orientation of the bone or tag from the given entity. The return value is the world coord, v_forward, v_right, v_up are also set according to the bone/tag's orientation. */ + +#endif +#ifdef SSQC +void(entity player) dropclient = #453; /* Part of DP_SV_DROPCLIENT*/ +entity() spawnclient = #454; /* Part of DP_SV_BOTCLIENT*/ +float(entity client) clienttype = #455; /* Part of DP_SV_BOTCLIENT*/ +void(float target, string str) WriteUnterminatedString = #456; /* Part of DP_SV_WRITEUNTERMINATEDSTRING*/ +#endif +#if defined(CSQC) || defined(SSQC) +void(vector org, vector vel, float howmany) te_flamejet = #457; /* Part of _DP_TE_FLAMEJET*/ +entity(float entnum) edict_num = #459; /* Part of DP_QC_EDICT_NUM*/ +strbuf() buf_create = #460; /* Part of DP_QC_STRINGBUFFERS*/ +void(strbuf bufhandle) buf_del = #461; /* Part of DP_QC_STRINGBUFFERS*/ +float(strbuf bufhandle) buf_getsize = #462; /* Part of DP_QC_STRINGBUFFERS*/ +void(strbuf bufhandle_from, strbuf bufhandle_to) buf_copy = #463; /* Part of DP_QC_STRINGBUFFERS*/ +void(strbuf bufhandle, float sortprefixlen, float backward) buf_sort = #464; /* Part of DP_QC_STRINGBUFFERS*/ +string(strbuf bufhandle, string glue) buf_implode = #465; /* Part of DP_QC_STRINGBUFFERS*/ +string(strbuf bufhandle, float string_index) bufstr_get = #466; /* Part of DP_QC_STRINGBUFFERS*/ +void(strbuf bufhandle, float string_index, string str) bufstr_set = #467; /* Part of DP_QC_STRINGBUFFERS*/ +float(strbuf bufhandle, string str, float ordered) bufstr_add = #468; /* Part of DP_QC_STRINGBUFFERS*/ +void(strbuf bufhandle, float string_index) bufstr_free = #469; /* Part of DP_QC_STRINGBUFFERS*/ +#endif +float(float s) asin = #471; /* Part of DP_QC_ASINACOSATANATAN2TAN*/ +float(float c) acos = #472; /* Part of DP_QC_ASINACOSATANATAN2TAN*/ +float(float t) atan = #473; /* Part of DP_QC_ASINACOSATANATAN2TAN*/ +float(float c, float s) atan2 = #474; /* Part of DP_QC_ASINACOSATANATAN2TAN*/ +float(float a) tan = #475; /* Part of DP_QC_ASINACOSATANATAN2TAN + Forgive me father, for I have a sunbed and I'm not afraid to use it. */ + +float(string s) strlennocol = #476; /* Part of DP_QC_STRINGCOLORFUNCTIONS + Returns the number of characters in the string after any colour codes or other markup has been parsed. */ + +string(string s) strdecolorize = #477; /* Part of DP_QC_STRINGCOLORFUNCTIONS + Flattens any markup/colours, removing them from the string. */ + +string(float uselocaltime, string format, ...) strftime = #478; /* Part of DP_QC_STRFTIME*/ +float(string s, string separator1, ...) tokenizebyseparator = #479; /* Part of DP_QC_TOKENIZEBYSEPARATOR + Splits up the string using only the specified delimiters/separators. Multiple delimiters can be given, they are each considered equivelent (though should start with the longest if you want to do weird subseparator stuff). + The resulting tokens can be queried via argv (and argv_start|end_index builtins, if you want to determine which of the separators was present between two tokens). + Note that while an input string containing JUST a separator will return 2, a string with no delimiter will return 1, while (in FTE) an empty string will ALWAYS return 0. */ + +string(string s) strtolower = #480; /* Part of DP_QC_STRING_CASE_FUNCTIONS*/ +string(string s) strtoupper = #481; /* Part of DP_QC_STRING_CASE_FUNCTIONS*/ +#if defined(CSQC) || defined(SSQC) +string(string s) cvar_defstring = #482; /* Part of DP_QC_CVAR_DEFSTRING*/ +void(vector origin, string sample, float volume, float attenuation) pointsound = #483; /* Part of DP_SV_POINTSOUND*/ +#endif +string(string search, string replace, string subject) strreplace = #484; /* Part of DP_QC_STRREPLACE*/ +string(string search, string replace, string subject) strireplace = #485; /* Part of DP_QC_STRREPLACE*/ +#if defined(CSQC) || defined(SSQC) +vector(entity e, float s, float n, float a) getsurfacepointattribute = #486; /* Part of DP_QC_GETSURFACEPOINTATTRIBUTE*/ +#endif +#if defined(CSQC) || defined(MENU) +float(string name, optional string initialURI) gecko_create = #487; /* Part of DP_GECKO_SUPPORT + Create a new 'browser tab' shader with the specified name that can then be drawn via drawpic (shader should not already exist - including from map/model textures or disk). In order to function correctly, this builtin depends upon external plugins being available. Use gecko_navigate to navigate it to a page of your choosing. */ + +void(string name) gecko_destroy = #488; /* Part of DP_GECKO_SUPPORT + Destroy a shader. */ + +void(string name, string URI) gecko_navigate = #489; /* Part of DP_GECKO_SUPPORT + Sends a command to the media decoder attached to the specified shader. In the case of a browser decoder, this changes the url that the browser displays. 'cmd:[un]focus' will tell the decoder that it has focus. */ + +float(string name, float key, float eventtype, optional float charcode) gecko_keyevent = #490; /* Part of DP_GECKO_SUPPORT + Send a key event to a media decoder. This applies only to interactive decoders like browsers. */ + +void(string name, float x, float y) gecko_mousemove = #491; /* Part of DP_GECKO_SUPPORT + Sets a media decoder shader's mouse position. Values should be 0-1. */ + +void(string name, float w, float h) gecko_resize = #492; /* Part of DP_GECKO_SUPPORT + Request to resize a media decoder. */ + +vector(string name) gecko_get_texture_extent = #493; /* Part of DP_GECKO_SUPPORT + Retrieves a media decoder current image pixel sizes. */ + +string(string shadname, string propname) gecko_getproperty = #0:gecko_getproperty; /* + Queries the media decoder (especially browser ones) for decoder-specific properties. The cef plugin recognises url, title, status. */ + +#endif +#ifdef CSQC +float(string file, string id) cin_open = #0:cin_open; +void(string id) cin_close = #0:cin_close; +void(string id, float newstate) cin_setstate = #0:cin_setstate; +float(string id) cin_getstate = #0:cin_getstate; +void(string file) cin_restart = #0:cin_restart; +#endif +__deprecated("Use digest_hex") float(float caseinsensitive, string s, ...) crc16 = #494; /* Part of DP_QC_CRC16*/ +float(string name) cvar_type = #495; /* Part of DP_QC_CVAR_TYPE*/ +float() numentityfields = #496; /* Part of DP_QC_ENTITYDATA + Gives the number of named entity fields. Note that this is not the size of an entity, but rather just the number of unique names (ie: vectors use 4 names rather than 3). */ + +float(string fieldname) findentityfield = #0:findentityfield; /* + Find a field index by name. */ + +typedef .__variant field_t; +field_t(float fieldnum) entityfieldref = #0:entityfieldref; /* + Returns a field value that can be directly used to read entity fields. Be sure to validate the type with entityfieldtype before using. */ + +string(float fieldnum) entityfieldname = #497; /* Part of DP_QC_ENTITYDATA + Retrieves the name of the given entity field. */ + +float(float fieldnum) entityfieldtype = #498; /* Part of DP_QC_ENTITYDATA + Provides information about the type of the field specified by the field num. Returns one of the EV_ values. */ + +string(float fieldnum, entity ent) getentityfieldstring = #499; /* Part of DP_QC_ENTITYDATA*/ +float(float fieldnum, entity ent, string s) putentityfieldstring = #500; /* Part of DP_QC_ENTITYDATA*/ +#ifdef SSQC +void(float to, string s, float sz) WritePicture = #501; /* Part of DP_SV_WRITEPICTURE + Encodes the named image across the network as-is adhering to some size limit. In FTE, this simply writes the string and is equivelent to writestring and sz is ignored. WritePicture should be paired with ReadPicture in csqc. */ + +#endif +#ifdef CSQC +string() ReadPicture = #501; /* + Reads a picture that was written by ReadPicture, and returns a name that can be used in drawpic and other 2d drawing functions. In FTE, this acts as a readstring-with-downloadcheck - the image will appear normally once it has been downloaded, but its size may be incorrect until then. */ + +void(float effectindex, entity own, vector org_from, vector org_to, vector dir_from, vector dir_to, float countmultiplier, optional float flags) boxparticles = #502; +#endif +string(string filename, optional enumflags:float{WP_REFERENCEPACKAGE,WP_FULLPACKAGEPATH} flags) whichpack = #503; /* Part of DP_QC_WHICHPACK + Returns the pak file name that contains the file specified. progs/player.mdl will generally return something like 'pak0.pak'. If WP_REFERENCE, clients will automatically be told that the returned package should be pre-downloaded and used, even if allow_download_refpackages is not set. */ + +#ifdef CSQC +__variant(float entnum, float fieldnum) getentity = #504; /* + Looks up fields from non-csqc-visible entities. The entity will need to be within the player's pvs. fieldnum should be one of the GE_ constants. */ + +#endif +string(string in) uri_escape = #510; /* Part of DP_QC_URI_ESCAPE + Uses percent-encoding to encode any bytes in the input string which are not ascii alphanumeric, period, hyphen, or underscore. All other bytes will expand to eg '%20' for a single space char. This encoding scheme is compatible with http and other uris. */ + +string(string in) uri_unescape = #511; /* Part of DP_QC_URI_ESCAPE + Undo any percent-encoding in the input string, hopefully resulting in the same original sequence of bytes (and thus chars too). */ + +float(entity ent) num_for_edict = #512; +#define uri_post uri_get +float(string uril, float id, optional string postmimetype, optional string postdata) uri_get = #513; /* Part of DP_QC_URI_GET, DP_QC_URI_POST + uri_get() gets content from an URL and calls a callback "uri_get_callback" with it set as string; an unique ID of the transfer is returned + returns 1 on success, and then calls the callback with the ID, 0 or the HTTP status code, and the received data in a string + For a POST request, you will typically want the postmimetype set to application/x-www-form-urlencoded. + For a GET request, omit the mime+data entirely. + Consult your webserver/php/etc documentation for best-practise. */ + +float(string str) tokenize_console = #514; /* + Tokenize a string exactly as the console's tokenizer would do so. The regular tokenize builtin became bastardized for convienient string parsing, which resulted in a large disparity that can be exploited to bypass checks implemented in a naive SV_ParseClientCommand function, therefore you can use this builtin to make sure it exactly matches. */ + +float(float idx) argv_start_index = #515; /* + Returns the character index that the tokenized arg started at. */ + +float(float idx) argv_end_index = #516; /* + Returns the character index that the tokenized arg stopped at. */ + +void(strbuf strbuf, string pattern, string antipattern) buf_cvarlist = #517; +string(string cvarname) cvar_description = #518; /* + Retrieves the description of a cvar, which might be useful for tooltips or help files. This may still not be useful. */ + +#if defined(CSQC) || defined(SSQC) +float(optional float timetype) gettime = #519; +#endif +#ifdef CSQC +DEP string(float keynum) keynumtostring_omgwtf = #520; +__deprecated("Does not support modifiers") string(string command, optional float bindmap) findkeysforcommand = #521; /* + Returns a list of keycodes that perform the given console command in a format that can only be parsed via tokenize (NOT tokenize_console). This only and always returns two values - if only one key is actually bound, -1 will be returned. The bindmap argument is listed for compatibility with dp-specific defs, but is ignored in FTE. */ + +#endif +#if defined(CSQC) || defined(MENU) +string(string command, optional float bindmap) findkeysforcommandex = #0:findkeysforcommandex; /* + Returns a list of key bindings in keyname format instead of keynums. Use tokenize to parse. This list may contain modifiers. May return large numbers of keys. */ + +#endif +#if defined(CSQC) || defined(SSQC) +void(string s) loadfromdata = #529; /* + Reads a set of entities from the given string. This string should have the same format as a .ent file or a saved game. Entities will be spawned as required. If you need to see the entities that were created, you should use parseentitydata instead. */ + +void(string s) loadfromfile = #530; /* + Reads a set of entities from the named file. This file should have the same format as a .ent file or a saved game. Entities will be spawned as required. If you need to see the entities that were created, you should use parseentitydata instead. */ + +void(float pause) setpause = #531; /* + Sets whether the server should or should not be paused. This does not affect auto-paused things like when the console is down. */ + +#endif +#ifdef SSQC +float(string mname) precache_vwep_model = #532; /* Part of ZQ_VWEP*/ +#endif +float(float v, optional float base) log = #532; /* + Determines the logarithm of the input value according to the specified base. This can be used to calculate how much something was shifted by. */ + +#ifdef CSQC +float(entity e, float channel, string newsample, float volume, float attenuation, float pitchpct, float flags, float timeoffset) soundupdate = #0:soundupdate; /* + Changes the properties of the current sound being played on the given entity channel. newsample may be empty, and will be ignored in this case. timeoffset is relative to the current position (subtract the result of getsoundtime for absolute positions). Negative volume can be used to stop the sound. Return value is a fractional value based upon the number of audio devices that could be updated - test against TRUE rather than non-zero. */ + +float(entity e, float channel) getsoundtime = #533; /* + Returns the current playback time of the sample on the given entity's channel. Beware CHAN_AUTO (in csqc, channels are not limited by network protocol). */ + +float(entity e, float channel) getchannellevel = #0:getchannellevel; /* + Reports how load the sound's sample is at its current offset. */ + +#endif +#if defined(CSQC) || defined(MENU) +float(string sample) soundlength = #534; /* + Provides a way to query the duration of a sound sample, allowing you to set up a timer to chain samples. */ + +#endif +float(string filename, strbuf bufhandle) buf_loadfile = #535; /* + Appends the named file into a string buffer (which must have been created in advance). The return value merely says whether the file was readable. */ + +float(filestream filehandle, strbuf bufhandle, optional float startpos, optional float numstrings) buf_writefile = #536; /* + Writes the contents of a string buffer onto the end of the supplied filehandle (you must have already used fopen). Additional optional arguments permit you to constrain the writes to a subsection of the stringbuffer. */ + +float(float bufhandle, string match, float matchrule, float startpos, float step) bufstr_find = #537; /* + Looks for the first occurence of the specified string in the buffer, returning its index or -1 on failure. */ + +#ifdef SSQC +float(optional float forcestate) physics_supported = #0:physics_supported; /* + Queries whether rigid body physics is enabled or not. CSQC and SSQC may report different values. If the force argument is specified then the engine will try to activate or release physics (returning the new state, which may fail if plugins or dlls are missing). Note that restarting the physics engine is likely to result in hitches when collision trees get generated. The state may change if a plugin is disabled mid-map. */ + +#endif +#if defined(CSQC) || defined(SSQC) +void(entity e, float physics_enabled) physics_enable = #540; /* + Enable or disable the physics attached to a MOVETYPE_PHYSICS entity. Entities which have been disabled in this way will stop taking so much cpu time. */ + +void(entity e, vector force, vector relative_ofs) physics_addforce = #541; /* + Apply some impulse directional force upon a MOVETYPE_PHYSICS entity. */ + +void(entity e, vector torque) physics_addtorque = #542; /* + Apply some impulse rotational force upon a MOVETYPE_PHYSICS entity. */ + +#endif +#ifdef MENU +void(float dest) setkeydest = #601; +float() getkeydest = #602; +#endif +#if defined(CSQC) || defined(MENU) +void(float trg) setmousetarget = #603; +float() getmousetarget = #604; +#endif +void(.../*, string funcname*/) callfunction = #605; /* + Invokes the named function. The function name is always passed as the last parameter and must always be present. The others are passed to the named function as-is */ + +void(filestream fh, entity e) writetofile = #606; /* + Writes an entity's fields to the named frik_file file handle. */ + +float(string s) isfunction = #607; /* + Returns true if the named function exists and can be called with the callfunction builtin. */ + +#if defined(CSQC) || defined(MENU) +vector(float vidmode, optional float forfullscreen) getresolution = #608; /* + Supposed to query the driver for supported video modes. FTE does not query drivers in this way, nor would it trust drivers anyway. */ + +#endif +#ifdef CSQC +DEP string(float keynum) keynumtostring_menu = #609; +#endif +#ifdef MENU +string(float keynum) keynumtostring = #609; /* + Converts a qscancode key number into a mostly-human-readable name, matching the bind command. */ + +string(string command, optional float bindmap) findkeysforcommand = #610; +#endif +#if defined(CSQC) || defined(MENU) +float(float type) gethostcachevalue = #611; /* Part of FTE_CSQC_SERVERBROWSER*/ +string(float type, float hostnr) gethostcachestring = #612; /* Part of FTE_CSQC_SERVERBROWSER*/ +#endif +float(entity e, string s, optional float offset) parseentitydata = #613; /* + Reads a single entity's fields into an already-spawned entity. s should contain field pairs like in a saved game: {"foo1" "bar" "foo2" "5"}. Returns <=0 on failure, otherwise returns the offset in the string that was read to. */ + +string(entity e) generateentitydata = #0:generateentitydata; /* + Dumps the entities fields into a string which can later be parsed with parseentitydata. */ + +#ifdef MENU +float(string key) stringtokeynum = #614; /* + Returns the qscancode of a key from its name. Names are identical to the bind command. ctrl/shift/alt modifiers are ignored. */ + +#endif +#ifdef CSQC +float(string key) stringtokeynum_menu = #614; +#endif +#if defined(CSQC) || defined(MENU) +void() resethostcachemasks = #615; /* Part of FTE_CSQC_SERVERBROWSER*/ +void(float mask, float fld, string str, float op) sethostcachemaskstring = #616; /* Part of FTE_CSQC_SERVERBROWSER*/ +void(float mask, float fld, float num, float op) sethostcachemasknumber = #617; /* Part of FTE_CSQC_SERVERBROWSER*/ +void() resorthostcache = #618; /* Part of FTE_CSQC_SERVERBROWSER*/ +void(float fld, float descending) sethostcachesort = #619; /* Part of FTE_CSQC_SERVERBROWSER*/ +void(optional float dopurge) refreshhostcache = #620; /* Part of FTE_CSQC_SERVERBROWSER*/ +float(float fld, float hostnr) gethostcachenumber = #621; /* Part of FTE_CSQC_SERVERBROWSER*/ +float(string key) gethostcacheindexforkey = #622; /* Part of FTE_CSQC_SERVERBROWSER*/ +void(string key) addwantedhostcachekey = #623; /* Part of FTE_CSQC_SERVERBROWSER*/ +string() getextresponse = #624; /* Part of FTE_CSQC_SERVERBROWSER*/ +#endif +string(string dnsname, optional float defport) netaddress_resolve = #625; +#if defined(CSQC) || defined(MENU) +string(float n, float prop) getgamedirinfo = #626; /* + Queries properties about an indexed gamedir (or -1 for the current gamedir). Returns null strings when out of bounds. Use the GDDI_* constants for the prop arg. */ + +string(int n, int prop) getpackagemanagerinfo = #0:getpackagemanagerinfo; /* + Queries information about a package from the engine's package manager subsystem. Actions can be taken via the pkg console command. */ + +#endif +string(string fmt, ...) sprintf = #627; /* Part of DP_QC_SPRINTF + 'prints' to a formatted temp-string. Mostly acts as in C, however %d assumes floats (fteqcc has arg checking. Use it.). + type conversions: l=arg is an int, h=arg is a float, and will work as a prefix for any float or int representation. + float representations: d=decimal, e,E=exponent-notation, f,F=floating-point notation, g,G=terse float, c=char code, x,X=hex + other representations: i=int, s=string, S=quoted and marked-up string, v=vector, p=pointer + so %ld will accept an int arg, while %hi will expect a float arg. + entities, fields, and functions will generally need to be printed as ints with %i. */ + +#if defined(CSQC) || defined(SSQC) +float(entity e, float s) getsurfacenumtriangles = #628; +vector(entity e, float s, float n) getsurfacetriangle = #629; +#endif +#if defined(CSQC) || defined(MENU) +float(float key, string bind, optional float bindmap, optional float modifier) setkeybind = #630; +vector() getbindmaps = #631; +float(vector bm) setbindmaps = #632; +#endif +string(string digest, string data, ...) digest_hex = #639; +string(string digest, void *data, int length) digest_ptr = #0:digest_ptr; /* + Calculates the digest of a single contiguous block of memory (including nulls) using the specified hash function. */ + +float(string src, string dst) fcopy = #650; /* + Equivelent to fopen+fread+fwrite+fclose from QC (ie: reads from $gamedir/data/ or $gamedir, but always writes to $gamedir/data/ ) */ + +float(string src, string dst) frename = #651; /* + Renames the file, returning 0 on success. Both paths are relative to the data/ subdir. */ + +float(string fname) fremove = #652; /* + Deletes the named file - path is relative to data/ subdir, like fopen's FILE_WRITE. Returns 0 on success. */ + +float(string fname) fexists = #653; /* + Returns true if it exists inside the default writable path. Use whichpack for greater portability. */ + +float(string path) rmtree = #654; /* + Dangerous, but sandboxed to data/ */ + +#if defined(CSQC) || defined(MENU) +const float K_TAB = 9; +const float K_ENTER = 13; +const float K_ESCAPE = 27; +const float K_SPACE = 32; +const float K_BACKSPACE = 127; +const float K_UPARROW = 128; +const float K_DOWNARROW = 129; +const float K_LEFTARROW = 130; +const float K_RIGHTARROW = 131; +const float K_LALT = 132; +const float K_RALT = -280; +const float K_LCTRL = 133; +const float K_RCTRL = -281; +const float K_LSHIFT = 134; +const float K_RSHIFT = -282; +const float K_F1 = 135; +const float K_F2 = 136; +const float K_F3 = 137; +const float K_F4 = 138; +const float K_F5 = 139; +const float K_F6 = 140; +const float K_F7 = 141; +const float K_F8 = 142; +const float K_F9 = 143; +const float K_F10 = 144; +const float K_F11 = 145; +const float K_F12 = 146; +const float K_INS = 147; +const float K_DEL = 148; +const float K_PGDN = 149; +const float K_PGUP = 150; +const float K_HOME = 151; +const float K_END = 152; +const float K_KP_HOME = 164; +const float K_KP_UPARROW = 165; +const float K_KP_PGUP = 166; +const float K_KP_LEFTARROW = 161; +const float K_KP_5 = 162; +const float K_KP_RIGHTARROW = 163; +const float K_KP_END = 158; +const float K_KP_DOWNARROW = 159; +const float K_KP_PGDN = 160; +const float K_KP_ENTER = 172; +const float K_KP_INS = 157; +const float K_KP_DEL = 167; +const float K_KP_SLASH = 168; +const float K_KP_MINUS = 170; +const float K_KP_PLUS = 171; +const float K_KP_NUMLOCK = 154; +const float K_KP_STAR = 169; +const float K_KP_EQUALS = 173; +const float K_MOUSE1 = 512; +const float K_MOUSE2 = 513; +const float K_MOUSE3 = 514; +const float K_MOUSE4 = 517; +const float K_MOUSE5 = 518; +const float K_MOUSE6 = 519; +const float K_MOUSE7 = 520; +const float K_MOUSE8 = 521; +const float K_MOUSE9 = 522; +const float K_MOUSE10 = 523; +const float K_MWHEELUP = 515; +const float K_MWHEELDOWN = 516; +const float K_LWIN = -274; +const float K_RWIN = -275; +const float K_APP = -276; +const float K_SEARCH = -277; +const float K_POWER = -130; +const float K_VOLUP = -278; +const float K_VOLDOWN = -279; +const float K_JOY1 = 768; +const float K_JOY2 = 769; +const float K_JOY3 = 770; +const float K_JOY4 = 771; +const float K_JOY5 = 772; +const float K_JOY6 = 773; +const float K_JOY7 = 774; +const float K_JOY8 = 775; +const float K_JOY9 = 776; +const float K_JOY10 = 777; +const float K_JOY11 = 778; +const float K_JOY12 = 779; +const float K_JOY13 = 780; +const float K_JOY14 = 781; +const float K_JOY15 = 782; +const float K_JOY16 = 783; +const float K_JOY17 = 784; +const float K_JOY18 = 785; +const float K_JOY19 = 786; +const float K_JOY20 = 787; +const float K_JOY21 = 788; +const float K_JOY22 = 789; +const float K_JOY23 = 790; +const float K_JOY24 = 791; +const float K_JOY25 = 792; +const float K_JOY26 = 793; +const float K_JOY27 = 794; +const float K_JOY28 = 795; +const float K_JOY29 = 796; +const float K_JOY30 = 797; +const float K_JOY31 = 798; +const float K_JOY32 = 799; +const float K_AUX1 = 800; +const float K_AUX2 = 801; +const float K_AUX3 = 802; +const float K_AUX4 = 803; +const float K_AUX5 = 804; +const float K_AUX6 = 805; +const float K_AUX7 = 806; +const float K_AUX8 = 807; +const float K_AUX9 = 808; +const float K_AUX10 = 809; +const float K_AUX11 = 810; +const float K_AUX12 = 811; +const float K_AUX13 = 812; +const float K_AUX14 = 813; +const float K_AUX15 = 814; +const float K_AUX16 = 815; +const float K_PAUSE = 153; +const float K_PRINTSCREEN = 174; +const float K_CAPSLOCK = 155; +const float K_SCROLLLOCK = 156; +const float K_SEMICOLON = 59; +const float K_PLUS = 43; +const float K_MINUS = 45; +const float K_APOSTROPHE = 39; +const float K_QUOTES = 34; +const float K_TILDE = 126; +const float K_BACKQUOTE = 96; +const float K_BACKSLASH = 92; +const float K_GP_A = 826; +const float K_GP_B = 827; +const float K_GP_X = 828; +const float K_GP_Y = 829; +const float K_GP_LSHOULDER = 824; +const float K_GP_RSHOULDER = 825; +const float K_GP_LTRIGGER = 830; +const float K_GP_RTRIGGER = 831; +const float K_GP_BACK = 821; +const float K_GP_START = 820; +const float K_GP_LTHUMB = 822; +const float K_GP_RTHUMB = 823; +const float K_GP_DPAD_UP = 816; +const float K_GP_DPAD_DOWN = 817; +const float K_GP_DPAD_LEFT = 818; +const float K_GP_DPAD_RIGHT = 819; +const float K_GP_GUIDE = -238; +const float K_GP_SHARE = -248; +const float K_GP_PADDLE1 = -249; +const float K_GP_PADDLE2 = -250; +const float K_GP_PADDLE3 = -251; +const float K_GP_PADDLE4 = -252; +const float K_GP_TOUCHPAD = -253; +const float K_GP_UNKNOWN = -264; +const float K_GP_LTHUMB_UP = 832; +const float K_GP_LTHUMB_DOWN = 833; +const float K_GP_LTHUMB_LEFT = 834; +const float K_GP_LTHUMB_RIGHT = 835; +const float K_GP_RTHUMB_UP = 836; +const float K_GP_RTHUMB_DOWN = 837; +const float K_GP_RTHUMB_LEFT = 838; +const float K_GP_RTHUMB_RIGHT = 839; +#endif +#ifdef _ACCESSORS +accessor strbuf : float +{ + inline get float asfloat[float idx] = {return stof(bufstr_get(this, idx));}; + inline set float asfloat[float idx] = {bufstr_set(this, idx, ftos(value));}; + get string[float] = bufstr_get; + set string[float] = bufstr_set; + get float length = buf_getsize; +}; +accessor searchhandle : float +{ + get string[float] = search_getfilename; + get float length = search_getsize; +}; +accessor hashtable : float +{ + inline get vector v[string key] = {return hash_get(this, key, '0 0 0', EV_VECTOR);}; + inline set vector v[string key] = {hash_add(this, key, value, HASH_REPLACE|EV_VECTOR);}; + inline get string s[string key] = {return hash_get(this, key, "", EV_STRING);}; + inline set string s[string key] = {hash_add(this, key, value, HASH_REPLACE|EV_STRING);}; + inline get float f[string key] = {return hash_get(this, key, 0.0, EV_FLOAT);}; + inline set float f[string key] = {hash_add(this, key, value, HASH_REPLACE|EV_FLOAT);}; + inline get __variant[string key] = {return hash_get(this, key, __NULL__);}; + inline set __variant[string key] = {hash_add(this, key, value, HASH_REPLACE);}; +}; +accessor infostring : string +{ + get string[string] = infoget; + inline set& string[string fld] = {this = infoadd(this, fld, value);}; +}; +accessor filestream : float +{ + get string = fgets; + inline set string = {fputs(this,value);}; +}; +#endif +accessor jsonnode : json_t +{ + inline get json_type_e type = json_get_value_type; + inline get string s = json_get_string; + inline get float f = json_get_float; + inline get __int i = json_get_integer; + inline get __int length = json_get_length; + inline get jsonnode a[__int key] = json_get_child_at_index; + inline get jsonnode[string key] = json_find_object_child; + inline get string name = json_get_name; +}; +#undef DEP_CSQC +#undef FTEDEP +#undef DEP +#pragma noref 0 + +typedef enum +{ + false, + true +} bool; diff --git a/src/shared/global.h b/src/shared/global.h index 748b3f57..360a8d97 100644 --- a/src/shared/global.h +++ b/src/shared/global.h @@ -172,3 +172,22 @@ _InitEnd(void) /** Calls a function (with parameters) in a new thread. */ #define thread(x) if (fork()) { x; abort(); } + +#define STRING_SET(x) ((x != __NULL__) && (x != "")) + +bool +fileExists(string filePath) +{ + if (filePath != "") /* not empty */ + if not(whichpack(filePath)) /* not present on disk */ + return false; + + return true; +} + +/* other parts of shared to include */ + + +#include "teams.h" +#include "events.h" +#include "flags.h" diff --git a/src/shared/include.src b/src/shared/include.src index 86f65fe6..79c38f9f 100644 --- a/src/shared/include.src +++ b/src/shared/include.src @@ -26,11 +26,13 @@ NSItem.qc NSWeapon.qc NSPortal.qc NSDebris.qc +NSSound.qc NSClient.qc NSClientSpectator.qc pmove_custom.qc cloader.qc sound.qc +NSRagdoll.qc NSClientPlayer.qc player_pmove.qc propdata.qc @@ -43,6 +45,7 @@ util.qc motd.qc entityDef.qc ammo.qc +api.qc ../xr/include.src ../botlib/NSBot.qc #endlist diff --git a/src/shared/input.h b/src/shared/input.h new file mode 100644 index 00000000..0d4622f7 --- /dev/null +++ b/src/shared/input.h @@ -0,0 +1,18 @@ +// Actually used by input_button etc. +#define INPUT_BUTTON0 0x00000001 /* attack 1*/ +#define INPUT_BUTTON2 0x00000002 /* jumping */ +#define INPUT_BUTTON3 0x00000004 /* prone */ +#define INPUT_BUTTON4 0x00000008 /* reload */ +#define INPUT_BUTTON5 0x00000010 /* secondary */ +#define INPUT_BUTTON6 0x00000020 /* use */ +#define INPUT_BUTTON7 0x00000040 /* reserved */ +#define INPUT_BUTTON8 0x00000080 /* crouching */ + +#define INPUT_PRIMARY INPUT_BUTTON0 +#define INPUT_JUMP INPUT_BUTTON2 +#define INPUT_PRONE INPUT_BUTTON3 +#define INPUT_RELOAD INPUT_BUTTON4 +#define INPUT_SECONDARY INPUT_BUTTON6 +#define INPUT_USE INPUT_BUTTON5 /* This can NEVER change. Engine hard-coded. */ +#define INPUT_SPRINT INPUT_BUTTON7 +#define INPUT_CROUCH INPUT_BUTTON8 diff --git a/src/shared/materials.qc b/src/shared/materials.qc index 835f485d..68bf3d09 100644 --- a/src/shared/materials.qc +++ b/src/shared/materials.qc @@ -35,29 +35,6 @@ var bool g_materialsAreLegacy; /* FIXME: world.... sigh, we should box this into a worldspawn class */ .string materials_file; -// Impact types -typedef enum -{ - IMPACT_MELEE, - IMPACT_EXPLOSION, - IMPACT_DEFAULT, - IMPACT_ALIEN, - IMPACT_COMPUTER, - IMPACT_CONCRETE, - IMPACT_DIRT, - IMPACT_FLESH, - IMPACT_FOLIAGE, - IMPACT_GLASS, - IMPACT_GRATE, - IMPACT_METAL, - IMPACT_SAND, - IMPACT_SLOSH, - IMPACT_SNOW, - IMPACT_TILE, - IMPACT_VENT, - IMPACT_WOOD -} impactType_t; - typedef enum { GSMATERIAL_GLASS, @@ -295,57 +272,38 @@ Materials_LoadFromMat(string filename) } } -/** FIXME: all this should be done exclusively in surfaceproperties.qc, however that -is currently server-side only. Make it shared and then we can get rid of this -whole file! */ - /** loads a temporary mapper so we can map letters to class names. */ static void Materials_Mapper_Init(void) { - string sTemp; + NSDict matDecl = NSDict::LoadDeclFromFile("material", "typeinfo/hlmat.decl"); + int tokenCount; int c = 0; - filestream fileLUT; - string spname = ""; - bool inbrace = false; + int lutSize = 0i; - fileLUT = fopen("scripts/surfaceproperties.txt", FILE_READ); - g_hlmlut_count = 0; - - /* count valid entries. */ - if (fileLUT >= 0) { - while ((sTemp = fgets(fileLUT))) { - if (tokenize_console(sTemp) == 2) { - if (argv(0) == "gamematerial") - g_hlmlut_count++; - } - } + if (!matDecl) { + return; } - /* back to the beginning... */ - fseek(fileLUT, 0); - g_hlmlut = memalloc(sizeof(hlmaterials_lut) * g_hlmlut_count); + tokenCount = matDecl.TokenCount(); + g_hlmlut_count = tokenCount / 2; + lutSize = sizeof(hlmaterials_lut) * g_hlmlut_count; + g_hlmlut = memalloc(lutSize); - /* read in the elements */ - if (fileLUT >= 0) { - while ((sTemp = fgets(fileLUT))) { - /* tokenize and just parse this stuff in */ - if (tokenize_console(sTemp) == 2) { - if (argv(0) == "gamematerial") { - g_hlmlut[c].idx = argv(1); - g_hlmlut[c].matclass = spname; - c++; - } - } - - if (argv(0) == "{") - inbrace = true; - else if (argv(0) == "}") - inbrace = false; - else if (inbrace == false) - spname = argv(0); - } + if (!g_hlmlut) { + NSError("Memory allocation failed for %i bytes.", lutSize); + g_hlmlut_count = 0; + remove(matDecl); + return; } + + for (int i = 0; i < tokenCount; i+=2) { + g_hlmlut[c].idx = argv(i); + g_hlmlut[c].matclass = argv(i+1); + c++; + } + + remove(matDecl); } /** takes a mat id and returns a classname */ diff --git a/src/shared/math.h b/src/shared/math.h index 2c8b7c03..ac388375 100644 --- a/src/shared/math.h +++ b/src/shared/math.h @@ -275,4 +275,4 @@ hsvToRGB(float h, float s, float v) } /** @} */ // end of multiprogs, server -#include "math_vector.h" \ No newline at end of file +#include "math_vector.h" diff --git a/src/shared/player_pmove.qc b/src/shared/player_pmove.qc index 1758359c..a6297323 100644 --- a/src/shared/player_pmove.qc +++ b/src/shared/player_pmove.qc @@ -100,8 +100,8 @@ NSClientPlayer::Physics_Crouch(void) if (CanCrouch() && input_buttons & INPUT_CROUCH) { if (!IsCrouching()) { - testMins = g_pmoveVars.GetCrouchMins(); - testMaxs = g_pmoveVars.GetCrouchMaxs(); + testMins = m_pmoveVars.GetCrouchMins(); + testMaxs = m_pmoveVars.GetCrouchMaxs(); if (PMove_IsStuck(this, origin, testMins, testMaxs) == false) { AddVFlags(VFL_CROUCHING); @@ -116,12 +116,12 @@ NSClientPlayer::Physics_Crouch(void) /* if they're going prone mode, we'll have to test that */ if (input_buttons & INPUT_PRONE) { - testMins = g_pmoveVars.GetProneMins(); - testMaxs = g_pmoveVars.GetProneMaxs(); + testMins = m_pmoveVars.GetProneMins(); + testMaxs = m_pmoveVars.GetProneMaxs(); /*printf("Want to prone.\n");*/ } else { - testMins = g_pmoveVars.GetStandingMins(); - testMaxs = g_pmoveVars.GetStandingMaxs(); + testMins = m_pmoveVars.GetStandingMins(); + testMaxs = m_pmoveVars.GetStandingMaxs(); /*printf("Want to stand.\n");*/ } @@ -145,8 +145,8 @@ NSClientPlayer::Physics_Crouch(void) return; if (IsCrouching()) { - mins = g_pmoveVars.GetCrouchMins(); - maxs = g_pmoveVars.GetCrouchMaxs(); + mins = m_pmoveVars.GetCrouchMins(); + maxs = m_pmoveVars.GetCrouchMaxs(); /*printf("State change finished.\n");*/ } else { mins = testMins; @@ -180,8 +180,8 @@ NSClientPlayer::Physics_Prone(void) if (CanProne() && input_buttons & INPUT_PRONE) { if (!IsProne()) { - testMins = g_pmoveVars.GetProneMins(); - testMaxs = g_pmoveVars.GetProneMaxs(); + testMins = m_pmoveVars.GetProneMins(); + testMaxs = m_pmoveVars.GetProneMaxs(); if (PMove_IsStuck(this, origin, testMins, testMaxs) == false) { AddVFlags(VFL_PRONE); @@ -196,12 +196,12 @@ NSClientPlayer::Physics_Prone(void) /* if they're going prone mode, we'll have to test that */ if (input_buttons & INPUT_CROUCH) { - testMins = g_pmoveVars.GetCrouchMins(); - testMaxs = g_pmoveVars.GetCrouchMaxs(); + testMins = m_pmoveVars.GetCrouchMins(); + testMaxs = m_pmoveVars.GetCrouchMaxs(); /*printf("Want to crouch.\n");*/ } else { - testMins = g_pmoveVars.GetStandingMins(); - testMaxs = g_pmoveVars.GetStandingMaxs(); + testMins = m_pmoveVars.GetStandingMins(); + testMaxs = m_pmoveVars.GetStandingMaxs(); /*printf("Want to stand.\n");*/ } @@ -226,8 +226,8 @@ NSClientPlayer::Physics_Prone(void) return; if (IsProne()) { - mins = g_pmoveVars.GetProneMins(); - maxs = g_pmoveVars.GetProneMaxs(); + mins = m_pmoveVars.GetProneMins(); + maxs = m_pmoveVars.GetProneMaxs(); /*printf("State change finished.\n");*/ } else { mins = testMins; @@ -267,7 +267,7 @@ NSClientPlayer::Physics_Jump(void) } else { /* standard jump here */ if (GetFlags() & FL_ONGROUND) - velocity[2] += g_pmoveVars.pm_jumpheight; + velocity[2] += m_pmoveVars.pm_jumpheight; } } @@ -308,11 +308,11 @@ NSClientPlayer::Physics_SetViewParms(void) { /* cheap operations */ if (IsCrouching()) { - view_ofs = g_pmoveVars.GetCrouchViewOffset(); + view_ofs = m_pmoveVars.GetCrouchViewOffset(); } else if (IsProne()) { - view_ofs = g_pmoveVars.GetProneViewOffset(); + view_ofs = m_pmoveVars.GetProneViewOffset(); } else { - view_ofs = g_pmoveVars.GetStandingViewOffset(); + view_ofs = m_pmoveVars.GetStandingViewOffset(); } } @@ -337,7 +337,7 @@ NSClientPlayer::Physics_WaterJump(void) /* there's nothing preventing us from putting our hands up here */ if (trace_fraction == 1.0) { - velocity[2] = g_pmoveVars.pm_waterjumpheight; + velocity[2] = m_pmoveVars.pm_waterjumpheight; AddFlags(FL_WATERJUMP); RemoveFlags(FL_JUMPRELEASED); return; @@ -419,11 +419,11 @@ float NSClientPlayer::Physics_MaxSpeed(void) { float wishSpeed = 0.0f; - float runSpeed = g_pmoveVars.pm_runspeed; - float maxStamina = g_pmoveVars.pm_stamina; - float crouchSpeed = g_pmoveVars.pm_crouchspeed; - float walkSpeed = g_pmoveVars.pm_walkspeed; - float proneSpeed = g_pmoveVars.pm_pronespeed; + float runSpeed = m_pmoveVars.pm_runspeed; + float maxStamina = m_pmoveVars.pm_stamina; + float crouchSpeed = m_pmoveVars.pm_crouchspeed; + float walkSpeed = m_pmoveVars.pm_walkspeed; + float proneSpeed = m_pmoveVars.pm_pronespeed; float speedMod = 1.0f; if (m_activeWeapon) { @@ -432,16 +432,16 @@ NSClientPlayer::Physics_MaxSpeed(void) if (CanSprint() && IsSprinting()) { if (m_flStamina < maxStamina) { - float slowDownThresh = g_pmoveVars.pm_staminathreshold; + float slowDownThresh = m_pmoveVars.pm_staminathreshold; if ((m_flStamina + slowDownThresh) > maxStamina) { float delta = (m_flStamina + slowDownThresh) - maxStamina; /* change maxValue to something between 1.0 and 1.5 */ runSpeed = lerp(runSpeed, walkSpeed, delta/slowDownThresh); } - } + } - wishSpeed = runSpeed; + wishSpeed = (m_flStamina >= maxStamina) ? walkSpeed : runSpeed; } else if (IsCrouching()) { wishSpeed = crouchSpeed; } else if (IsProne()) { @@ -522,12 +522,12 @@ NSClientPlayer::Physics_InputPostMove(void) m_flStamina += input_timelength; } else { float toSubtract = input_timelength; - toSubtract *= g_pmoveVars.pm_staminarate; + toSubtract *= m_pmoveVars.pm_staminarate; m_flStamina = max(0, m_flStamina - toSubtract); } - if (m_flStamina > g_pmoveVars.pm_stamina) { - m_flStamina = g_pmoveVars.pm_stamina; + if (m_flStamina > m_pmoveVars.pm_stamina) { + m_flStamina = m_pmoveVars.pm_stamina; } //printf("stamina: %f\n", m_flStamina); diff --git a/src/shared/pmove.h b/src/shared/pmove.h index 0f551af6..b806e9fc 100644 --- a/src/shared/pmove.h +++ b/src/shared/pmove.h @@ -108,7 +108,9 @@ public: #endif private: + nonvirtual void Refresh(void); nonvirtual void UpdateBoundingBoxes(void); + nonvirtual void LinkToEntity(string declClass); vector m_vecStandingMins; vector m_vecStandingMaxs; @@ -119,6 +121,7 @@ private: vector m_vecNormalViewOffset; vector m_vecCrouchViewOffset; vector m_vecProneViewOffset; + string m_defLink; }; /** The global, shared object containing all currently valid pmove parameters. */ @@ -130,4 +133,4 @@ void PMove_Init(void); void PMoveCustom_RunPlayerPhysics(entity); void PMoveCustom_RunCrouchPhysics(entity); -/** @} */ // end of pmove \ No newline at end of file +/** @} */ // end of pmove diff --git a/src/shared/pmove.qc b/src/shared/pmove.qc index e795479f..30acdcbc 100644 --- a/src/shared/pmove.qc +++ b/src/shared/pmove.qc @@ -189,6 +189,7 @@ separate cvars for overriding their speeds. */ void NSPMoveVars::NSPMoveVars(void) { + m_defLink = __NULL__; } void @@ -225,10 +226,198 @@ NSPMoveVars::UpdateBoundingBoxes(void) } } +void +NSPMoveVars::Refresh(void) +{ + printf("Refreshing pmove Vars %S\n", m_defLink); + + /* global. */ + if (!STRING_SET(m_defLink)) { + UpdateBoundingBoxes(); + return; + } + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "g_gravity"))) + g_gravity = stof(EntityDef_GetKeyValue(m_defLink, "g_gravity")); + else + g_gravity = g_pmoveVars.g_gravity; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_accelerate"))) + pm_accelerate = stof(EntityDef_GetKeyValue(m_defLink, "pm_accelerate")); + else + pm_accelerate = g_pmoveVars.pm_accelerate; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_airaccelerate"))) + pm_airaccelerate = stof(EntityDef_GetKeyValue(m_defLink, "pm_airaccelerate")); + else + pm_airaccelerate = g_pmoveVars.pm_airaccelerate; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_airstepsize"))) + pm_airstepsize = stof(EntityDef_GetKeyValue(m_defLink, "pm_airstepsize")); + else + pm_airstepsize = g_pmoveVars.pm_airstepsize; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_boxcenter"))) + pm_boxcenter = stof(EntityDef_GetKeyValue(m_defLink, "pm_boxcenter")); + else + pm_boxcenter = g_pmoveVars.pm_boxcenter; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_boxwidth"))) + pm_boxwidth = stof(EntityDef_GetKeyValue(m_defLink, "pm_boxwidth")); + else + pm_boxwidth = g_pmoveVars.pm_boxwidth; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_crouchheight"))) + pm_crouchheight = stof(EntityDef_GetKeyValue(m_defLink, "pm_crouchheight")); + else + pm_crouchheight = g_pmoveVars.pm_crouchheight; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_crouchspeed"))) + pm_crouchspeed = stof(EntityDef_GetKeyValue(m_defLink, "pm_crouchspeed")); + else + pm_crouchspeed = g_pmoveVars.pm_crouchspeed; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_crouchviewheight"))) + pm_crouchviewheight = stof(EntityDef_GetKeyValue(m_defLink, "pm_crouchviewheight")); + else + pm_crouchviewheight = g_pmoveVars.pm_crouchviewheight; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_edgefriction"))) + pm_edgefriction = stof(EntityDef_GetKeyValue(m_defLink, "pm_edgefriction")); + else + pm_edgefriction = g_pmoveVars.pm_edgefriction; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_friction"))) + pm_friction = stof(EntityDef_GetKeyValue(m_defLink, "pm_friction")); + else + pm_friction = g_pmoveVars.pm_friction; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_gravity"))) + pm_gravity = stof(EntityDef_GetKeyValue(m_defLink, "pm_gravity")); + else + pm_gravity = g_pmoveVars.pm_gravity; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_jumpheight"))) + pm_jumpheight = stof(EntityDef_GetKeyValue(m_defLink, "pm_jumpheight")); + else + pm_jumpheight = g_pmoveVars.pm_jumpheight; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_maxviewpitch"))) + pm_maxviewpitch = stof(EntityDef_GetKeyValue(m_defLink, "pm_maxviewpitch")); + else + pm_maxviewpitch = g_pmoveVars.pm_maxviewpitch; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_minviewpitch"))) + pm_minviewpitch = stof(EntityDef_GetKeyValue(m_defLink, "pm_minviewpitch")); + else + pm_minviewpitch = g_pmoveVars.pm_minviewpitch; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_noclipaccelerate"))) + pm_noclipaccelerate = stof(EntityDef_GetKeyValue(m_defLink, "pm_noclipaccelerate")); + else + pm_noclipaccelerate = g_pmoveVars.pm_noclipaccelerate; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_noclipspeed"))) + pm_noclipspeed = stof(EntityDef_GetKeyValue(m_defLink, "pm_noclipspeed")); + else + pm_noclipspeed = g_pmoveVars.pm_noclipspeed; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_normalheight"))) + pm_normalheight = stof(EntityDef_GetKeyValue(m_defLink, "pm_normalheight")); + else + pm_normalheight = g_pmoveVars.pm_normalheight; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_normalviewheight"))) + pm_normalviewheight = stof(EntityDef_GetKeyValue(m_defLink, "pm_normalviewheight")); + else + pm_normalviewheight = g_pmoveVars.pm_normalviewheight; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_nospeedcap"))) + pm_nospeedcap = stof(EntityDef_GetKeyValue(m_defLink, "pm_nospeedcap")); + else + pm_nospeedcap = g_pmoveVars.pm_nospeedcap; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_proneheight"))) + pm_proneheight = stof(EntityDef_GetKeyValue(m_defLink, "pm_proneheight")); + else + pm_proneheight = g_pmoveVars.pm_proneheight; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_pronespeed"))) + pm_pronespeed = stof(EntityDef_GetKeyValue(m_defLink, "pm_pronespeed")); + else + pm_pronespeed = g_pmoveVars.pm_pronespeed; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_proneviewheight"))) + pm_proneviewheight = stof(EntityDef_GetKeyValue(m_defLink, "pm_proneviewheight")); + else + pm_proneviewheight = g_pmoveVars.pm_proneviewheight; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_runspeed"))) + pm_runspeed = stof(EntityDef_GetKeyValue(m_defLink, "pm_runspeed")); + else + pm_runspeed = g_pmoveVars.pm_runspeed; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_stamina"))) + pm_stamina = stof(EntityDef_GetKeyValue(m_defLink, "pm_stamina")); + else + pm_stamina = g_pmoveVars.pm_stamina; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_staminarate"))) + pm_staminarate = stof(EntityDef_GetKeyValue(m_defLink, "pm_staminarate")); + else + pm_staminarate = g_pmoveVars.pm_staminarate; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_staminathreshold"))) + pm_staminathreshold = stof(EntityDef_GetKeyValue(m_defLink, "pm_staminathreshold")); + else + pm_staminathreshold = g_pmoveVars.pm_staminathreshold; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_stepsize"))) + pm_stepsize = stof(EntityDef_GetKeyValue(m_defLink, "pm_stepsize")); + else + pm_stepsize = g_pmoveVars.pm_stepsize; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_stopspeed"))) + pm_stopspeed = stof(EntityDef_GetKeyValue(m_defLink, "pm_stopspeed")); + else + pm_stopspeed = g_pmoveVars.pm_stopspeed; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_walkspeed"))) + pm_walkspeed = stof(EntityDef_GetKeyValue(m_defLink, "pm_walkspeed")); + else + pm_walkspeed = g_pmoveVars.pm_walkspeed; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_wateraccelerate"))) + pm_wateraccelerate = stof(EntityDef_GetKeyValue(m_defLink, "pm_wateraccelerate")); + else + pm_wateraccelerate = g_pmoveVars.pm_wateraccelerate; + + if (STRING_SET(EntityDef_GetKeyValue(m_defLink, "pm_waterjumpheight"))) + pm_waterjumpheight = stof(EntityDef_GetKeyValue(m_defLink, "pm_waterjumpheight")); + else + pm_waterjumpheight = g_pmoveVars.pm_waterjumpheight; + + + UpdateBoundingBoxes(); +} + +void +NSPMoveVars::LinkToEntity(string defName) +{ + m_defLink = defName; + Refresh(); + +} + #ifdef SERVER void NSPMoveVars::EvaluateEntity(void) { + /* this is belonging to a decl */ + if (STRING_SET(m_defLink)) { + return; + } + g_gravity = autocvar_g_gravity; pm_accelerate = autocvar_pm_accelerate; pm_airaccelerate = autocvar_pm_airaccelerate; @@ -300,6 +489,11 @@ NSPMoveVars::EvaluateEntity(void) bool NSPMoveVars::SendEntity(entity pvsEnt, float flChanged) { + /* this is belonging to a decl */ + if (STRING_SET(m_defLink)) { + return (false); + } + WriteByte(MSG_ENTITY, ENT_PMOVEVARS); WriteFloat(MSG_ENTITY, flChanged); @@ -380,7 +574,12 @@ NSPMoveVars::ReceiveEntity(float flNew, float flChanged) g_pmoveVars = this; } - UpdateBoundingBoxes(); + printf("Refreshing all pmove vars.\n"); + + for (NSPMoveVars vars = __NULL__;(vars = (NSPMoveVars)find(vars, ::classname, "NSPMoveVars"));) { + vars.Refresh(); + } + } #endif diff --git a/src/shared/pmove_custom.qc b/src/shared/pmove_custom.qc index 41d2bca8..1cdc06fc 100644 --- a/src/shared/pmove_custom.qc +++ b/src/shared/pmove_custom.qc @@ -52,6 +52,7 @@ PMoveCustom_Categorize(void) int contents; bool inladder = false; vector testPos; + vector ladderTestPos; if (self.movetype == MOVETYPE_NOCLIP) return; @@ -80,14 +81,16 @@ PMoveCustom_Categorize(void) self.flags &= ~FL_ONGROUND;*/ /* ladder content testing */ + makevectors(self.v_angle); + ladderTestPos = self.origin + v_forward * 8.0f; int oldhitcontents = self.hitcontentsmaski; - self.hitcontentsmaski = CONTENTBIT_FTELADDER; - tracebox(self.origin, self.mins, self.maxs, self.origin, MOVE_NORMAL, self); + self.hitcontentsmaski = CONTENTBIT_FTELADDER | CONTENTBIT_Q2LADDER; + tracebox(ladderTestPos, self.mins, self.maxs, ladderTestPos, MOVE_NORMAL, self); self.hitcontentsmaski = oldhitcontents; /* if set, you need to directly face the ladder or else you'll fall right off */ #ifdef LADDERFACING - if (trace_endcontentsi & CONTENTBIT_FTELADDER) { + if (trace_endcontentsi & CONTENTBIT_FTELADDER || trace_endcontentsi & CONTENTBIT_Q2LADDER) { /* place the ladder into a virtual space */ vector ladderpos = trace_ent.absmin + (0.5f * (trace_ent.absmax - trace_ent.absmin)); ladderpos[2] = self.origin[2]; @@ -105,7 +108,7 @@ PMoveCustom_Categorize(void) if (inladder) { #else - if (trace_endcontentsi & CONTENTBIT_FTELADDER) { + if (trace_endcontentsi & CONTENTBIT_FTELADDER || trace_endcontentsi & CONTENTBIT_Q2LADDER) { #endif self.vv_flags |= VFL_ONLADDER; } else { diff --git a/src/shared/propdata.qc b/src/shared/propdata.qc index 643e59d8..ae580f4c 100644 --- a/src/shared/propdata.qc +++ b/src/shared/propdata.qc @@ -96,7 +96,31 @@ PropData_ParseField(int i, string keyName, string setValue) g_propdata[i].name = setValue; break; case "base": +#if 0 + /* HACK: This should be loaded much, much later. */ + int baseID = -1i; g_propdata[i].base = setValue; + baseID = PropData_Load(setValue); + + if (baseID != -1) { + g_propdata[i].health = g_propdata[baseID].health; + g_propdata[i].flags = g_propdata[baseID].flags; + g_propdata[i].damage_bullets = g_propdata[baseID].damage_bullets; + g_propdata[i].damage_melee = g_propdata[baseID].damage_melee; + g_propdata[i].damage_explosive = g_propdata[baseID].damage_explosive; + g_propdata[i].explosive_damage = g_propdata[baseID].explosive_damage; + g_propdata[i].explosive_radius = g_propdata[baseID].explosive_radius; + g_propdata[i].breakable_model = g_propdata[baseID].breakable_model; + g_propdata[i].breakable_count = g_propdata[baseID].breakable_count; + g_propdata[i].breakable_skin = g_propdata[baseID].breakable_skin; + g_propdata[i].mass = g_propdata[baseID].mass; + g_propdata[i].damping_linear = g_propdata[baseID].damping_linear; + g_propdata[i].damping_angular = g_propdata[baseID].damping_angular; + g_propdata[i].inertia = g_propdata[baseID].inertia; + g_propdata[i].volume = g_propdata[baseID].volume; + g_propdata[i].surfaceprop = g_propdata[baseID].surfaceprop; + } +#endif break; case "blockLOS": g_propdata[i].flags |= PDFL_BLOCKLOS; @@ -312,10 +336,22 @@ PropData_ForModel(string modelname) return cache; } + /* harsh optimisation. don't attempt to load new propdata after. */ + /*if (time > 1.0f) { + return -1; + }*/ + g_propdata_count++; #ifdef PROPDATA_DYNAMIC g_propdata = (propdata_t *)memrealloc(g_propdata, sizeof(propdata_t), index, g_propdata_count); + + if (!g_propdata) { + NSError("Memory re-allocation failed."); + g_propdata_count = 0; + return -1i; + } + #else if (g_propdata_count >= PROPDATA_MAX) { NSError("PropData_ForModel: Reached PROPDATA_MAX (%d)", PROPDATA_MAX); @@ -347,7 +383,9 @@ PropData_ForModel(string modelname) filePos = fread(fh, (void*)&fileSize, 4i); /* header size, sanity check */ if (fileSize != 16i) { - error("Only .phy files from Source are supported."); + NSError("Only .phy files from Source are supported."); + fclose(fh); + return -1; } filePos = fread(fh, (void*)&phyID, 4i); /* some header id */ @@ -360,8 +398,11 @@ PropData_ForModel(string modelname) //print(sprintf("num fileSum: %i\n", fileSum)); /* HACK: We won't support ragdolls, for now. */ - if (numSolids > 1) + if (numSolids > 1) { + NSError("Only .phy files from Source are supported."); + fclose(fh); return -1; + } /* we skip over all these to get to the bottom of the file */ for (int i = 0i; i < numSolids; i++) { @@ -463,7 +504,7 @@ PropData_ForModel(string modelname) } fclose(fh); - NSError("No type found for %s", modelname); + NSLog("No type found for %s", modelname); return -1; } @@ -475,12 +516,15 @@ PropData_Load(string type) if (!type) return -1; + if (substring(type, 0, 1) == "*") + return -1; + type = strtolower(type); index = (int)hash_get(g_hashpropdata, type, -1); if (index < 0) { - NSError("PropData type %S is not defined.", type); + NSLog("PropData type %S is not defined.", type); return -1; } else { return index; @@ -602,6 +646,8 @@ PropData_Init(void) filestream fh; string line; int index; + int pdMemSize; + int bmMemSize; InitStart(); @@ -630,23 +676,43 @@ PropData_Init(void) } #ifdef PROPDATA_DYNAMIC - /* alocate our stuff */ - g_propdata = (propdata_t *)memalloc(sizeof(propdata_t) * g_propdata_count); - g_breakmodel = (breakModel_t *)memalloc(sizeof(breakModel_t) * g_breakmodel_count); + pdMemSize = sizeof(propdata_t) * g_propdata_count; #else - /* alocate our stuff */ - g_propdata = (propdata_t *)memalloc(sizeof(propdata_t) * PROPDATA_MAX); - g_breakmodel = (breakModel_t *)memalloc(sizeof(breakModel_t) * PROPDATA_MAX); - NSLog("...allocated %d bytes for prop data.", sizeof(propdata_t) * PROPDATA_MAX); - NSLog("...allocated %d bytes for breakmodels.", sizeof(breakModel_t) * PROPDATA_MAX); + pdMemSize = sizeof(propdata_t) * PROPDATA_MAX; #endif + g_propdata = (propdata_t *)memalloc(pdMemSize); + + if (!g_propdata) { + NSError("Memory allocation failed for %i bytes.", pdMemSize); + InitEnd(); + return; + } + +#ifdef PROPDATA_DYNAMIC + bmMemSize = sizeof(breakModel_t) * g_breakmodel_count; +#else + bmMemSize = sizeof(breakModel_t) * PROPDATA_MAX; +#endif + + g_breakmodel = (breakModel_t *)memalloc(bmMemSize); + + if (!g_breakmodel) { + NSError("Memory allocation failed for %i bytes.", bmMemSize); + InitEnd(); + return; + } + + NSLog("...allocated %i bytes for prop data.", pdMemSize); + NSLog("...allocated %i bytes for breakmodels.", bmMemSize); + fseek(fh, 0); while ((line = fgets(fh))) { /* when we found it, quit */ PropData_ParseLine(line); } + fclose(fh); /* now let's precache all of our breakmodel units. @@ -811,12 +877,10 @@ BreakModel_SpawnID(vector smins, vector smaxs, vector dir, float speed, int coun gib.SetSolid(SOLID_NOT); } else { gib.SetMovetype(MOVETYPE_PHYSICS); - gib.SetSolid(SOLID_NOT); + gib.SetSolid(SOLID_CORPSE); gib.mass = 1.0f; gib.friction = 1.0f; - gib.bouncefactor = 0.9f; - gib.bouncestop = 0.1f / cvar("sv_gravity"); - gib.geomtype = GEOMTYPE_TRIMESH; + gib.m_iShape = GEOMTYPE_TRIMESH; gib.ApplyForceOffset(dir * speed, endpos); } diff --git a/src/shared/sentences.qc b/src/shared/sentences.qc index a0d2c18f..a273081f 100644 --- a/src/shared/sentences.qc +++ b/src/shared/sentences.qc @@ -34,6 +34,7 @@ typedef struct #endif var string g_sentences_samplepath; +const string g_sentencesFile = "sound/sentences.txt"; void Sentences_Shutdown(void) @@ -57,10 +58,10 @@ Sentences_Init(void) Sentences_Shutdown(); - fs_sentences = fopen("sound/sentences.txt", FILE_READ); + fs_sentences = fopen(g_sentencesFile, FILE_READ); if (fs_sentences < 0) { - NSError("Missing file sound/sentences.txt"); + NSWarning("No Sentences, missing %S", g_sentencesFile); InitEnd(); return; } diff --git a/src/shared/surfaceproperties.qc b/src/shared/surfaceproperties.qc index ca123360..46fe1927 100644 --- a/src/shared/surfaceproperties.qc +++ b/src/shared/surfaceproperties.qc @@ -85,9 +85,6 @@ SurfData_ParseField(int i, int a) case "fx_bulletimpact": case "part_bulletimpact": g_surfdata[i].m_fxBulletImpact = argv(1); -#ifdef CLIENT - g_surfdata[i].m_fxBulletImpactID = particleeffectnum(g_surfdata[i].m_fxBulletImpact); -#endif break; } } @@ -138,12 +135,12 @@ SurfData_Parse(string line) } } - i++; } /* when we found it, quit */ tokenize_console(t_name); hash_add(g_hashsurfdata, argv(0), (int)i); + i++; braced--; t_name = ""; @@ -352,7 +349,9 @@ SurfData_Init(void) filestream fh; string line; int index; + int args; bool fromManifest = true; + int spMemSize; InitStart(); @@ -388,7 +387,7 @@ SurfData_Init(void) /* first we count all valid entries. yes, this is not how you're meant to parse it, but w/e */ while ((line = fgets(fh))) { - int args = tokenize_console(line); + args = tokenize_console(line); if (args == 2) { if (argv(0) == "file") { @@ -399,7 +398,16 @@ SurfData_Init(void) } /* now that we've counted the valid entries, alocate our stuff */ - g_surfdata = (surfaceData_t *)memalloc(sizeof(surfaceData_t) * g_surfdata_count); + spMemSize = sizeof(surfaceData_t) * g_surfdata_count; + g_surfdata = (surfaceData_t *)memalloc(spMemSize); + + if (!g_surfdata) { + NSError("Memory allocation failed for %i bytes.", spMemSize); + g_surfdata_count = 0; + InitEnd(); + return; + } + g_hashsurfdata = hash_createtab(2, HASH_ADD); /* Internal, defaults. Most of them get overriden by the first entry ('default') */ @@ -425,15 +433,17 @@ SurfData_Init(void) g_surfdata[i].m_sndStrain = ""; g_surfdata[i].m_sndRoll = ""; g_surfdata[i].m_sndBreak = ""; + g_surfdata[i].m_fxBulletImpact = ""; + g_surfdata[i].m_fxBulletImpactID = -1; } + fseek(fh, 0); + if (fromManifest == false) { SurfData_LoadFile("scripts/surfaceproperties.txt"); } else { - fseek(fh, 0); - while ((line = fgets(fh))) { - int args = tokenize_console(line); + args = tokenize_console(line); if (args == 2) { if (argv(0) == "file") { @@ -443,6 +453,58 @@ SurfData_Init(void) } } + fclose(fh); + +#if 1 + for (int i = 1i; i < g_surfdata_count; i++) { + int matID = -1; + + if (!STRING_SET(g_surfdata[i].m_strBase)) { + continue; + } + + matID = SurfData_Load(g_surfdata[i].m_strBase); + + /* ugly inheriting */ + if (matID == -1) { + continue; + } + + //printf("%i inheriting %S from %i\n", i, g_surfdata[i].m_strBase, matID); + + if (g_surfdata[i].m_flMaterial == -1) { + g_surfdata[i].m_flMaterial = g_surfdata[matID].m_flMaterial; + //printf("%i inheriting material %d %d from %i\n", i, g_surfdata[i].m_flMaterial, g_surfdata[matID].m_flMaterial, matID); + } + + if (!STRING_SET(g_surfdata[i].m_sndStepLeft)) + g_surfdata[i].m_sndStepLeft = g_surfdata[matID].m_sndStepLeft; + if (!STRING_SET(g_surfdata[i].m_sndStepRight)) + g_surfdata[i].m_sndStepRight = g_surfdata[matID].m_sndStepRight; + if (!STRING_SET(g_surfdata[i].m_sndBulletImpact)) + g_surfdata[i].m_sndBulletImpact = g_surfdata[matID].m_sndBulletImpact; + if (!STRING_SET(g_surfdata[i].m_sndScrapeRough)) + g_surfdata[i].m_sndScrapeRough = g_surfdata[matID].m_sndScrapeRough; + if (!STRING_SET(g_surfdata[i].m_sndScrapeSoft)) + g_surfdata[i].m_sndScrapeSoft = g_surfdata[matID].m_sndScrapeSoft; + if (!STRING_SET(g_surfdata[i].m_sndImpactHard)) + g_surfdata[i].m_sndImpactHard = g_surfdata[matID].m_sndImpactHard; + if (!STRING_SET(g_surfdata[i].m_sndImpactSoft)) + g_surfdata[i].m_sndImpactSoft = g_surfdata[matID].m_sndImpactSoft; + if (!STRING_SET(g_surfdata[i].m_sndShake)) + g_surfdata[i].m_sndShake = g_surfdata[matID].m_sndShake; + if (!STRING_SET(g_surfdata[i].m_sndStrain)) + g_surfdata[i].m_sndStrain = g_surfdata[matID].m_sndStrain; + if (!STRING_SET(g_surfdata[i].m_sndRoll)) + g_surfdata[i].m_sndRoll = g_surfdata[matID].m_sndRoll; + if (!STRING_SET(g_surfdata[i].m_sndBreak)) + g_surfdata[i].m_sndBreak = g_surfdata[matID].m_sndBreak; + if (!STRING_SET(g_surfdata[i].m_fxBulletImpact)) + g_surfdata[i].m_fxBulletImpact = g_surfdata[matID].m_fxBulletImpact; + + } +#endif + for (int i = 0i; i < g_surfdata_count; i++) { Sound_Precache(g_surfdata[i].m_sndStepLeft); Sound_Precache(g_surfdata[i].m_sndStepRight); @@ -455,6 +517,44 @@ SurfData_Init(void) Sound_Precache(g_surfdata[i].m_sndStrain); Sound_Precache(g_surfdata[i].m_sndRoll); Sound_Precache(g_surfdata[i].m_sndBreak); +#if 1 + /* HACK: HL2 hard-codes these! */ + if (!STRING_SET(g_surfdata[i].m_fxBulletImpact) && g_surfdata[i].m_flMaterial != -1) { + string newFXImpact = ""; + + switch (g_surfdata[i].m_flMaterial) { + case 'C': + case 'T': + newFXImpact = "impact.concrete"; + break; + case 'W': + newFXImpact = "impact.wood"; + break; + case 'D': + newFXImpact = "impact.dirt"; + break; + case 'N': + newFXImpact = "impact.sand"; + break; + case 'A': + newFXImpact = "impact.alien"; + break; + case 'M': + case 'V': + newFXImpact = "impact.metal"; + break; + case 'C': + newFXImpact = "impact.computer"; + break; + } + + g_surfdata[i].m_fxBulletImpact = newFXImpact; + } +#endif + + if (STRING_SET(g_surfdata[i].m_fxBulletImpact)) { + g_surfdata[i].m_fxBulletImpactID = particleeffectnum(g_surfdata[i].m_fxBulletImpact); + } } NSLog("...SurfData initialized with %i entries.", g_surfdata_count); @@ -541,6 +641,11 @@ SurfData_Impact_Parse(void) float impactid = SurfData_GetInfo(matid, SURFDATA_FX_BULLETIMPACTID); Sound_PlayAt(impactorg, impactsfx); + +#if 0 + impactid = particleeffectnum("impact.concrete"); +#endif + pointparticles( impactid, impactorg, normalize(impactang), 1 ); } @@ -564,6 +669,13 @@ SurfData_ImpactID_Parse(void) string impactsfx = SurfData_GetInfo(matid, SURFDATA_SND_BULLETIMPACT); float impactid = SurfData_GetInfo(matid, SURFDATA_FX_BULLETIMPACTID); Sound_PlayAt(impactorg, impactsfx); + + //printf("Prop Impact Receive %i %S %S\n", matid, impactsfx, SurfData_GetInfo(matid, SURFDATA_FX_BULLETIMPACT)); + +#if 0 + impactid = particleeffectnum("impact.concrete"); +#endif + pointparticles( impactid, impactorg, normalize(impactang), 1 ); } #endif @@ -588,8 +700,9 @@ SurfData_Impact(entity e, vector org, vector ang) } else { /* anything with else is a NSurfacePropEntity. */ NSSurfacePropEntity foo = (NSSurfacePropEntity)e; - if (foo.HasSurfaceData() && foo.GetSurfaceData(SURFDATA_MATERIAL) != -1) { - SurfData_ImpactOfType(foo.GetSurfaceData(SURFDATA_MATERIAL), org, ang); + if (foo.HasSurfaceData()) { + SurfData_ImpactOfType(foo.m_iMaterial, org, ang); + //printf("Prop Impact Send %i\n", foo.m_iMaterial); } else { SurfData_Impact_SurfaceParm(e, org, ang); } diff --git a/src/shared/teams.h b/src/shared/teams.h new file mode 100644 index 00000000..f6573fd2 --- /dev/null +++ b/src/shared/teams.h @@ -0,0 +1,8 @@ +/** We basically follow what GMod does. https://wiki.facepunch.com/gmod/Enums/TEAM */ +enum +{ + TEAM_CONNECTING = 0,/**< Set upon ClientConnect. Player is not done joining. */ + /* this is where games can set up whatever they want */ + TEAM_UNASSIGNED = 1001, /**< set on PutClientInServer (first time only */ + TEAM_SPECTATOR = 1002, /**< spectator. can be real (never playable) or fake (see CS, inbetween rounds) */ +}; diff --git a/src/vgui/include.src b/src/vgui/include.src index c426f95d..1ce74d79 100644 --- a/src/vgui/include.src +++ b/src/vgui/include.src @@ -4,6 +4,7 @@ ../vgui/ui.qc ../vgui/ui_control.qc ../vgui/ui_button.qc +../vgui/ui_commandbutton.qc ../vgui/ui_menubutton.qc ../vgui/ui_radio.qc ../vgui/ui_checkbox.qc @@ -18,4 +19,7 @@ ../vgui/ui_listbox.qc ../vgui/ui_textbox.qc ../vgui/ui_tabview.qc +../vgui/ui_progressbar.qc +../vgui/ui_loadingpanel.qc +../vgui/ui_console.qc #endlist diff --git a/src/vgui/ui.qc b/src/vgui/ui.qc index 1d4ee70c..fdaaad43 100644 --- a/src/vgui/ui.qc +++ b/src/vgui/ui.qc @@ -33,6 +33,7 @@ font_s g_fntDefault; var int g_vguiWidgetCount; +int g_lastmousepos[2]; /** @ingroup vgui * @@ -328,7 +329,14 @@ VGUIWidget::HasFlag(int flag) void VGUIWidget::Reposition(void) { + VGUIWidget wNext = this; + do { + wNext = wNext.m_next; + if (wNext) { + wNext.Reposition(); + } + } while (wNext); } void @@ -420,28 +428,80 @@ VGUIWidget::Spawned(void) { } + void UISystem_Init(void) { - /* we support fancier stuff in non-classic mode */ -#ifndef CLASSIC_VGUI string strTemp; - string strUIFile = "scripts/ui_style.txt"; + +#ifdef CLIENT + string strUIFile = "scripts/client_style.txt"; +#else + string strUIFile = "scripts/menu_style.txt"; +#endif + filestream fileUI = fopen(strUIFile, FILE_READ); + if (fileUI < 0) { + strUIFile = "scripts/ui_style.txt"; + fileUI = fopen(strUIFile, FILE_READ); + } + UI_MAINCOLOR = [68,68,68] / 255; + UI_FGCOLOR = [255,255,255] / 255; UI_MAINALPHA = 1.0f; + UI_ROUNDED = false; + UI_NOICONS = false; + UI_HICOLOR = [255,255,255] / 255; + UI_LOCOLOR = [0,0,0] / 255; + UI_BORDERCOLOR = [255,255,255] / 255; + UI_BORDERALPHA = 0 / 255; + UI_FILLCOLOR = [255,255,255] / 255; + UI_HOVERCOLOR = [255,255,255] / 255; + UI_HOVERALPHA = 0; if (fileUI >= 0) { while ((strTemp = fgets(fileUI))) { if (tokenizebyseparator(strTemp, "=") == 2) { switch (argv(0)) { + case "BG_COLOR": case "COLOR": UI_MAINCOLOR = stov(argv(1)) / 255; break; + case "FG_COLOR": + UI_FGCOLOR = stov(argv(1)) / 255; + break; + case "HILIGHT_COLOR": + UI_HICOLOR = stov(argv(1)) / 255; + break; + case "SHADOW_COLOR": + UI_LOCOLOR = stov(argv(1)) / 255; + break; + case "BORDER_COLOR": + UI_BORDERCOLOR = stov(argv(1)) / 255; + break; + case "FILL_COLOR": + UI_FILLCOLOR = stov(argv(1)) / 255; + break; + case "BORDER_ALPHA": + UI_BORDERALPHA = stof(argv(1)) / 255; + break; + case "HOVER_COLOR": + UI_HOVERCOLOR = stov(argv(1)) / 255; + break; + case "HOVER_ALPHA": + UI_HOVERALPHA = stof(argv(1)) / 255; + break; + case "BG_ALPHA": case "ALPHA": UI_MAINALPHA = stof(argv(1)) / 255; break; + case "ROUNDED": + UI_ROUNDED = (bool)stof(argv(1)); + break; + case "NOICONS": + UI_NOICONS = (bool)stof(argv(1)); + break; } } } @@ -449,16 +509,9 @@ UISystem_Init(void) } else { NSError(sprintf("[MENU] Cannot load UI file %s!", strUIFile)); } -#endif Font_Load("fonts/ui.font", g_fntDefault); - precache_pic("textures/ui/steam/icon_radiosel"); - precache_pic("textures/ui/steam/icon_radiounsel"); - precache_pic("textures/ui/steam/icon_checked"); - precache_pic("textures/ui/steam/icon_emptybox"); - precache_pic("textures/ui/steam/icon_down"); - precache_pic("textures/ui/steam/icon_up"); - precache_pic("textures/ui/steam/icon_close"); + } #ifdef CLIENT @@ -484,4 +537,4 @@ UIClass_Spawn(string cname) } #endif -/** @} */ // end of vgui \ No newline at end of file +/** @} */ // end of vgui diff --git a/src/vgui/ui_button.qc b/src/vgui/ui_button.qc index 56a18497..3404e4d0 100644 --- a/src/vgui/ui_button.qc +++ b/src/vgui/ui_button.qc @@ -18,7 +18,8 @@ enumflags { BUTTON_HOVER, BUTTON_DOWN, - BUTTON_LASTACTIVE + BUTTON_LASTACTIVE, + BUTTON_CUSTOMFLAGS }; /* TODO: MOVE THESE INTO VGUIButton! COMPILER NEEDS TO BE FIXED FIRST HOWEVER. */ @@ -97,14 +98,14 @@ void VGUIButton::SetIconColor(vector vecColor) { m_vecIconColor = vecColor; -}; +} void VGUIButton::SetTitle(string strName) { vector newsize = [0.0f, 0.0f, 0.0f]; - m_strTitle = strName; + m_strTitle = sprintf("%s%s", Font_RGBtoHex(UI_FGCOLOR), strName); m_strTitleActive = sprintf("^3%s", m_strTitle); //m_strTitle = sprintf("%s%s", Font_RGBtoHex(UI_MAINCOLOR), strName); drawfont = g_fntDefault.iID; @@ -161,11 +162,12 @@ VGUIButton::GetKeyEquivalent(void) void VGUIButton::Draw(void) { -#ifndef CLASSIC_VGUI VGUITheme theme = GetTheme(); if (m_iFlags & BUTTON_DOWN) { theme.DrawButton(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, VGUI_STATE_ACTIVE); + } else if (m_iFlags & BUTTON_HOVER) { + theme.DrawButton(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, VGUI_STATE_HOVER); } else { theme.DrawButton(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, VGUI_STATE_NORMAL); } @@ -181,63 +183,22 @@ VGUIButton::Draw(void) theme.DrawText(m_parent.m_vecOrigin + m_vecOrigin + [8, 8], keyText, m_vecSize, g_fntDefault); } - if (m_strTitle) { + if (STRING_SET(m_strIcon) && UI_NOICONS == false) { + if (m_iFlags & BUTTON_DOWN) + drawpic(m_parent.m_vecOrigin + m_vecOrigin + [4,4], m_strIcon, m_vecIMGSize, m_vecIconColor * 0.25, 1.0f, 0); + else + drawpic(m_parent.m_vecOrigin + m_vecOrigin + [4,4], m_strIcon, m_vecIMGSize, m_vecIconColor, 1.0f, 0); + + textPadding += m_vecIMGSize[0] + 4; + } + + if (STRING_SET(m_strTitle)) { if (m_iFlags & BUTTON_HOVER) { theme.DrawText(m_parent.m_vecOrigin + m_vecOrigin + [textPadding, 8], m_strTitle, m_vecSize, g_fntDefault); } else { theme.DrawText(m_parent.m_vecOrigin + m_vecOrigin + [textPadding, 8], m_strTitle, m_vecSize, g_fntDefault); } } - - if (m_strIcon) { - if (m_iFlags & BUTTON_DOWN) - drawpic(m_parent.m_vecOrigin + m_vecOrigin + [2,2], m_strIcon, m_vecIMGSize, m_vecIconColor * 0.25, 1.0f, 0); - else - drawpic(m_parent.m_vecOrigin + m_vecOrigin + [2,2], m_strIcon, m_vecIMGSize, m_vecIconColor, 1.0f, 0); - } - -#else - if (m_iFlags & BUTTON_HOVER) { - drawfill(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, m_vecColor, 0.25f); - } - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f); - - - float textPadding = 8; - - { - vector pos = m_parent.m_vecOrigin + m_vecOrigin; - drawsetcliparea(pos[0], pos[1], m_vecSize[0], m_vecSize[1]); - } - - if (m_keyEquivalent >= 0) { - float length; - string keyText = GetKeyEquivalent(); - - length = Font_StringWidth(keyText, FALSE, g_fntDefault); - textPadding += length + 8; - Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + [8, 8], keyText, g_fntDefault); - } - - if (m_strTitle) { - if (m_iFlags & BUTTON_LASTACTIVE) { - Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + [textPadding, 8], m_strTitleActive, g_fntDefault); - } else { - Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + [textPadding, 8], m_strTitle, g_fntDefault); - } - } - if (m_strIcon) { - if (m_iFlags & BUTTON_DOWN) - drawpic(m_parent.m_vecOrigin + m_vecOrigin + [2,2], m_strIcon, m_vecIMGSize, m_vecIconColor * 0.25, 1.0f, 0); - else - drawpic(m_parent.m_vecOrigin + m_vecOrigin + [2,2], m_strIcon, m_vecIMGSize, m_vecIconColor, 1.0f, 0); - } - - drawresetcliparea(); -#endif } bool diff --git a/src/vgui/ui_checkbox.qc b/src/vgui/ui_checkbox.qc index 346bbd17..287acefe 100644 --- a/src/vgui/ui_checkbox.qc +++ b/src/vgui/ui_checkbox.qc @@ -79,7 +79,6 @@ void VGUICheckbox::SetValue (int iValue) void VGUICheckbox::Draw(void) { -#ifndef CLASSIC_VGUI VGUITheme theme = GetTheme(); theme.DrawControlBackground(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, VGUI_STATE_ACTIVE); @@ -89,31 +88,14 @@ void VGUICheckbox::Draw(void) } if (m_iFlags & CHECKBOX_CHECKED) { - drawpic(m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_checked", [16,16], [1,1,1], 1.0f, 0); + drawpic(m_parent.m_vecOrigin + m_vecOrigin, "gfx/icon16/bullet_toggle_plus", [16,16], [1,1,1], 1.0f, 0); } else { - drawpic(m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_emptybox", [16,16], [1,1,1], 1.0f, 0); + drawpic(m_parent.m_vecOrigin + m_vecOrigin, "gfx/icon16/bullet_black", [16,16], [1,1,1], 1.0f, 0); } if (m_strTitle) { theme.DrawText(m_parent.m_vecOrigin + m_vecOrigin + [24, 3], m_strTitle, m_vecSize, g_fntDefault); } -#else - if (m_iFlags & CHECKBOX_DOWN) { - drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f); - } - - if (m_iFlags & CHECKBOX_CHECKED) { - drawpic(m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_checked", [16,16], m_vecColor, 1.0f, 0); - } else { - drawpic(m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_emptybox", [16,16], m_vecColor, 1.0f, 0); - } - if (m_strTitle) { - Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + [24, 3], m_strTitle, g_fntDefault); - } -#endif } bool VGUICheckbox::Input (float flEVType, float flKey, float flChar, float flDevID) diff --git a/src/vgui/ui_commandbutton.qc b/src/vgui/ui_commandbutton.qc new file mode 100644 index 00000000..7656b5d8 --- /dev/null +++ b/src/vgui/ui_commandbutton.qc @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2016-2022 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +enumflags +{ + BUTTON_HOVER, + BUTTON_DOWN, + BUTTON_LASTACTIVE, + BUTTON_CUSTOMFLAGS +}; + +/* TODO: MOVE THESE INTO VGUIButton! COMPILER NEEDS TO BE FIXED FIRST HOWEVER. */ +.void(void) tmpVGUIButton1; + +/** VGUI Widget: Command Menu Button + +@ingroup vgui +*/ +class VGUICommandButton:VGUIButton +{ +public: + void VGUICommandButton(void); + + /* overrides */ + virtual void Draw(void); + virtual bool Input(float,float,float,float); + + nonvirtual bool WillDisplay(void); + nonvirtual void SetMapCondition(string); + nonvirtual void SetTeamCondition(string); + nonvirtual void SetClassCondition(string); + nonvirtual void SetClientCommand(string); +private: + + string m_strMapCondition; + string m_strTeamCondition; + string m_strClassCondition; +}; + +void +VGUICommandButton::VGUICommandButton(void) +{ + m_strMapCondition = __NULL__; + m_strTeamCondition = __NULL__; + m_strClassCondition = __NULL__; +} + +void +VGUICommandButton::SetMapCondition(string condition) +{ + m_strMapCondition = condition; +} + +void +VGUICommandButton::SetTeamCondition(string condition) +{ + m_strTeamCondition = condition; +} + +void +VGUICommandButton::SetClassCondition(string condition) +{ + m_strClassCondition = condition; +} + +void +VGUICommandButton::SetClientCommand(string condition) +{ +} + +bool +VGUICommandButton::WillDisplay(void) +{ + if (STRING_SET(m_strMapCondition)) { + + } + + if (STRING_SET(m_strTeamCondition)) { + + } + + if (STRING_SET(m_strClassCondition)) { + + } + + return (true); +} + +void +VGUICommandButton::Draw(void) +{ + super::Draw(); + //VGUIWidget::Draw(); +} + +bool +VGUICommandButton::Input(float flEVType, float flKey, float flChar, float flDevID) +{ + bool returnValue = super::Input(flEVType, flKey, flChar, flDevID); + + if (!returnValue) { + //return VGUIWidget::Input(flEVType, flKey, flChar, flDevID); + } + + return (returnValue); +} diff --git a/src/vgui/ui_console.qc b/src/vgui/ui_console.qc new file mode 100644 index 00000000..db4ceada --- /dev/null +++ b/src/vgui/ui_console.qc @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2016-2022 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#ifdef MENU +/** VGUI: Console + +A 'portable' console. It takes up less space. +Not sure what the benefit of it is besides that. + +@ingroup vgui +*/ +class VGUIConsole:VGUIWindow +{ +public: + void VGUIConsole(void); + virtual void Spawned(void); + nonvirtual void ConsoleResized(void); + +private: + VGUIFrame m_outlineFrame; + VGUIButton m_submitButton; + VGUITextBox m_commandBox; +}; + +void +VGUIConsole::VGUIConsole(void) +{ + m_outlineFrame = __NULL__; + m_submitButton = __NULL__; + m_commandBox = __NULL__; +} + +void +VGUIConsole::ConsoleResized(void) +{ + m_outlineFrame.SetSize(GetSize() - [16, 76]); + m_commandBox.SetSize([GetSizeWidth() - 88,24]); + m_commandBox.SetPos([8, GetSizeHeight() - 32]); + m_submitButton.SetPos([GetSizeWidth() - 72, GetSizeHeight() - 32]); +} + +void +VGUIConsole::Spawned(void) +{ + super::Spawned(); + + SetTitle("Console"); + SetSize([560, 400]); + SetPos([40, 40]); + m_outlineFrame = spawn(VGUIFrame); + m_outlineFrame.SetPos([8,36]); + m_outlineFrame.SetSize([544,324]); + + m_commandBox = spawn(VGUITextBox); + m_commandBox.SetPos([8,368]); + m_commandBox.SetSize([472,24]); + + m_submitButton = spawn(VGUIButton); + m_submitButton.SetSize([64,24]); + m_submitButton.SetPos([488,368]); + m_submitButton.SetTitle("Submit"); + + SetStyleMask( VGUIWindowStyleDefault | VGUIWindowResizeable ); + CallOnResize(ConsoleResized); + Add(m_outlineFrame); + Add(m_commandBox); + Add(m_submitButton); +} +#endif diff --git a/src/vgui/ui_frame.qc b/src/vgui/ui_frame.qc index 12df6c1a..50ef8c25 100644 --- a/src/vgui/ui_frame.qc +++ b/src/vgui/ui_frame.qc @@ -40,16 +40,9 @@ VGUIFrame::VGUIFrame(void) void VGUIFrame::Draw(void) { -#ifdef CLASSIC_VGUI - drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f); -#else drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], [1,1,1], 0.5f); drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], [0,0,0], 0.5f); drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], [1,1,1], 0.5f); drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], [0,0,0], 0.5f); -#endif } diff --git a/src/vgui/ui_label.qc b/src/vgui/ui_label.qc index ccc7a32d..b26a2696 100644 --- a/src/vgui/ui_label.qc +++ b/src/vgui/ui_label.qc @@ -30,6 +30,7 @@ public: virtual bool Input(float, float, float, float); virtual void Spawned(void); virtual void SetTextSize(int); + virtual void SetAlignment(float); private: string m_strTitle; @@ -53,11 +54,7 @@ VGUILabel::Spawned(void) void VGUILabel::SetTitle (string strName) { -#ifndef CLASSIC_VGUI - m_strTitle = strName; -#else - m_strTitle = sprintf("%s%s", Font_RGBtoHex(UI_MAINCOLOR), strName); -#endif + m_strTitle = sprintf("%s%s", Font_RGBtoHex(UI_FGCOLOR), strName); drawfont = g_fntDefault.iID; if (GetSize() == [0,0]) { @@ -73,6 +70,16 @@ VGUILabel::SetTextSize(int val) m_textSize = val; } +void +VGUILabel::SetAlignment(float alignment) +{ + m_labelFlags &= ~AF_LEFT; + m_labelFlags &= ~AF_TOP; + m_labelFlags &= ~AF_RIGHT; + m_labelFlags &= ~AF_BOTTOM; + m_labelFlags |= alignment; +} + void VGUILabel::Draw(void) { @@ -82,14 +89,11 @@ VGUILabel::Draw(void) pos = m_parent.m_vecOrigin + m_vecOrigin; size = m_vecSize; - drawsetcliparea(pos[0], pos[1], size[0], size[1]); if (!m_textSize) Font_DrawField(pos, size, m_strTitle, g_fntDefault, m_labelFlags); else Font_DrawFieldAtHeight(pos, size, m_textSize, m_strTitle, g_fntDefault, m_labelFlags); - - drawresetcliparea(); } } diff --git a/src/vgui/ui_list.qc b/src/vgui/ui_list.qc index 90f7ab53..9b86ea5a 100644 --- a/src/vgui/ui_list.qc +++ b/src/vgui/ui_list.qc @@ -66,23 +66,17 @@ void VGUIList::Spawned(void) void VGUIList::Draw(void) { + VGUITheme theme = GetTheme(); int iMaxDisplay; if (!m_iItemCount) { return; } -#ifdef CLASSIC_VGUI - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], UI_MAINCOLOR, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], UI_MAINCOLOR, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], UI_MAINCOLOR, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], UI_MAINCOLOR, 1.0f); -#else drawfill(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, [0,0,0], 0.25f); drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], [0,0,0], 0.5f); drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], [1,1,1], 0.5f); drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], [0,0,0], 0.5f); drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], [1,1,1], 0.5f); -#endif vector vecOffset = [8,8]; @@ -100,7 +94,7 @@ void VGUIList::Draw(void) drawfill(m_parent.m_vecOrigin + m_vecOrigin + vecOffset + [-7,-3], [m_vecSize[0] - 2, 18], [1,1,1], 0.1f); } - Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + vecOffset, m_strItems[i], g_fntDefault); + theme.DrawText(m_parent.m_vecOrigin + m_vecOrigin + vecOffset, m_strItems[i], m_vecSize, g_fntDefault); vecOffset[1] += 20; } drawresetcliparea(); diff --git a/src/vgui/ui_listbox.qc b/src/vgui/ui_listbox.qc index 21e734cb..f1816886 100644 --- a/src/vgui/ui_listbox.qc +++ b/src/vgui/ui_listbox.qc @@ -94,6 +94,8 @@ void VGUIListBox::AddItem (string strItem) void VGUIListBox::Draw(void) { + VGUITheme theme = GetTheme(); + int iMaxDisplay; if (!m_iItemCount) { return; @@ -117,7 +119,7 @@ void VGUIListBox::Draw(void) drawfill(m_parent.m_vecOrigin + m_vecOrigin + vecOffset + [-7,-3], [m_vecSize[0] - 2, 18], [1,1,1], 0.5f); } - Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + vecOffset, m_strItems[i], g_fntDefault); + theme.DrawText(m_parent.m_vecOrigin + m_vecOrigin + vecOffset, m_strItems[i], m_vecSize, g_fntDefault); vecOffset[1] += 20; } } diff --git a/src/vgui/ui_loadingpanel.qc b/src/vgui/ui_loadingpanel.qc new file mode 100644 index 00000000..48cb5088 --- /dev/null +++ b/src/vgui/ui_loadingpanel.qc @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2016-2022 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +class +VGUILoadingPanel:VGUIWindow +{ + void VGUILoadingPanel(void); + virtual void Spawned(void); + nonvirtual void UpdateProgress(void); + +private: + + VGUILabel m_lblLoading; + VGUIButton m_btnCancel; + VGUIProgressBar m_progressBar; + float timePassed; +}; + +void +VGUILoadingPanel::VGUILoadingPanel(void) +{ + m_lblLoading = __NULL__; + m_btnCancel = __NULL__; +} + +void +VGUILoadingPanel::UpdateProgress(void) +{ + timePassed += frametime; + + if (timePassed > 1.0f) + timePassed = 0.0f; + + m_progressBar.SetProgress(timePassed); +} + +void +VGUILoadingPanel::Spawned(void) +{ + super::Spawned(); + + SetSize( [380,112] ); + SetTitle( "Loading..." ); + SetStyleMask(VGUIWindowTitled); + + m_progressBar = spawn( VGUIProgressBar ); + m_progressBar.SetSize( [260,24] ); + m_progressBar.SetPos( [20,64] ); + + m_btnCancel = spawn( VGUIButton ); + m_btnCancel.SetTitle( "Cancel" ); + m_btnCancel.SetSize( [72,24] ); + m_btnCancel.SetPos( [288,64] ); + + m_lblLoading = spawn( VGUILabel ); + m_lblLoading.SetTitle( "Starting local game server" ); + m_lblLoading.SetSize( [248,16] ); + m_lblLoading.SetPos( [20,40] ); + //m_lblLoading.SetAlignment(AF_NONE); + + //m_btnCancel.SetFunc( QuitGame_No ); + + Add( m_progressBar ); + Add( m_btnCancel ); + Add( m_lblLoading ); + SetPos( ( g_vidsize / 2 ) - ( GetSize() / 2 ) ); +} diff --git a/src/vgui/ui_menubutton.qc b/src/vgui/ui_menubutton.qc index 5438ed58..83bba255 100644 --- a/src/vgui/ui_menubutton.qc +++ b/src/vgui/ui_menubutton.qc @@ -17,10 +17,7 @@ #ifdef MENU enumflags { - MBUTTON_VISIBLE, - MBUTTON_HOVER, - MBUTTON_DOWN, - MBUTTON_SHOWOFFLINE, + MBUTTON_SHOWOFFLINE = BUTTON_CUSTOMFLAGS, MBUTTON_SHOWSP, MBUTTON_SHOWMP }; @@ -32,38 +29,27 @@ enumflags @ingroup vgui */ class -VGUIMenuButton:VGUIWidget +VGUIMenuButton: VGUIButton { public: void VGUIMenuButton(void); - nonvirtual void SetTitle(string); - nonvirtual void SetIcon(string); - nonvirtual void SetFunc(void(void)); virtual void Draw(void); virtual bool Input(float, float, float, float); virtual void Spawned(void); - -private: - vector m_vecColor; - float m_flAlpha; - string m_strTitle; - string m_strIcon; }; void VGUIMenuButton::VGUIMenuButton(void) { - m_vecColor = UI_MAINCOLOR; - m_flAlpha = 1.0f; } void VGUIMenuButton::Spawned(void) { - SetSize([96,24]); - FlagAdd(MBUTTON_VISIBLE | MBUTTON_SHOWOFFLINE | MBUTTON_SHOWSP | MBUTTON_SHOWMP); + super::Spawned(); + FlagAdd(MBUTTON_SHOWOFFLINE | MBUTTON_SHOWSP | MBUTTON_SHOWMP); } void @@ -80,62 +66,12 @@ VGUIMenuButton::Draw(void) } } -#ifndef CLASSIC_VGUI - drawfill(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, m_vecColor, m_flAlpha); - - if (m_iFlags & BUTTON_DOWN) { - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], [1,1,1], 0.5f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], [0,0,0], 0.5f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], [0,0,0], 0.5f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], [1,1,1], 0.5f); - } else { - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], [0,0,0], 0.5f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], [1,1,1], 0.5f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], [1,1,1], 0.5f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], [0,0,0], 0.5f); - } -#else - if (m_iFlags & BUTTON_DOWN) { - drawfill(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, m_vecColor, 0.25f); - } - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f); -#endif - - - if (m_strIcon) { - drawpic(m_parent.m_vecOrigin + m_vecOrigin + [4, 4], m_strIcon, [16,16], [1,1,1], 1.0f); - if (m_strTitle) { - Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + [26, 8], m_strTitle, g_fntDefault); - } - } else { - if (m_strTitle) { - Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + [8, 8], m_strTitle, g_fntDefault); - } - } + super::Draw(); } bool VGUIMenuButton::Input (float flEVType, float flKey, float flChar, float flDevID) { - bool ret = false; - bool mouseHover = false; - - if (Util_MouseAbove(g_vecMousePos, m_parent.m_vecOrigin + m_vecOrigin, m_vecSize)) { - mouseHover = true; - } - - if (mouseHover == true && HasFlag(BUTTON_HOVER) == false) { - FlagAdd(MBUTTON_HOVER); - // OnMouseEntered(); - } else if (HasFlag(BUTTON_HOVER) && mouseHover == false) { - FlagRemove(MBUTTON_HOVER); - // OnMouseExited(); - } - - // If we're not ingame if (clientstate() == 2 && !g_background) { if (!(m_iFlags & MBUTTON_SHOWSP)) { @@ -147,42 +83,7 @@ VGUIMenuButton::Input (float flEVType, float flKey, float flChar, float flDevID) } } - if (flEVType == IE_KEYDOWN) { - if (flKey == K_MOUSE1) { - if (mouseHover == true) { - m_iFlags |= MBUTTON_DOWN; - ret = true; - } - } - } else if (flEVType == IE_KEYUP) { - if (flKey == K_MOUSE1) { - if (m_iFlags & MBUTTON_DOWN && mouseHover == true) { - if (tmpVGUIMenuButton1) { - tmpVGUIMenuButton1(); - } - ret = true; - } - m_iFlags -= (m_iFlags & MBUTTON_DOWN); - } - } - return (ret); + return super::Input(flEVType, flKey, flChar, flDevID); } -void -VGUIMenuButton::SetTitle (string strName) -{ - m_strTitle = strName; -} - -void -VGUIMenuButton::SetIcon (string strName) -{ - m_strIcon = strName; -} - -void -VGUIMenuButton::SetFunc (void(void) vFunc) -{ - tmpVGUIMenuButton1 = vFunc; -} #endif diff --git a/src/vgui/ui_progressbar.qc b/src/vgui/ui_progressbar.qc new file mode 100644 index 00000000..a718d908 --- /dev/null +++ b/src/vgui/ui_progressbar.qc @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2016-2022 Vera Visions LLC. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER + * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +/** VGUI Widget: Frame + +@ingroup vgui +*/ +class VGUIProgressBar:VGUIWidget +{ +public: + void VGUIProgressBar(void); + + /* overrides */ + virtual void Draw(void); + + nonvirtual void SetProgress(float); + +private: + float m_flProgress; +}; + +void +VGUIProgressBar::VGUIProgressBar(void) +{ + m_flProgress = 1.0f; +} + +void +VGUIProgressBar::SetProgress(float newProgress) +{ + m_flProgress = newProgress; +} + +void VGUIProgressBar::Draw(void) +{ + VGUITheme theme = GetTheme(); + theme.DrawProgressIndicator(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, m_flProgress, VGUI_STATE_NORMAL); +} diff --git a/src/vgui/ui_radio.qc b/src/vgui/ui_radio.qc index 474eb14f..39a7d2c0 100644 --- a/src/vgui/ui_radio.qc +++ b/src/vgui/ui_radio.qc @@ -88,7 +88,6 @@ void VGUIRadio::SetFunc (void(void) vFunc) void VGUIRadio::Draw(void) { -#ifndef CLASSIC_VGUI VGUITheme theme = GetTheme(); theme.DrawControlBackground(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, VGUI_STATE_ACTIVE); @@ -97,31 +96,14 @@ void VGUIRadio::Draw(void) theme.DrawBorder(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, VGUI_BORDER_INSET, __NULL__); } if (m_iFlags & RADIO_ACTIVE) { - drawpic(m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_radiosel", [16,16], [1,1,1], 1.0f, 0); + drawpic(m_parent.m_vecOrigin + m_vecOrigin, "gfx/icon16/bullet_white", [16,16], [1,1,1], 1.0f, 0); } else { - drawpic(m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_radiounsel", [16,16], [1,1,1], 1.0f, 0); + drawpic(m_parent.m_vecOrigin + m_vecOrigin, "gfx/icon16/bullet_black", [16,16], [1,1,1], 1.0f, 0); } if (m_strTitle) { theme.DrawText(m_parent.m_vecOrigin + m_vecOrigin + [24, 3], m_strTitle, m_vecSize, g_fntDefault); } -#else - if (m_iFlags & RADIO_DOWN) { - drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], m_vecColor, 1.0f, 0); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f, 0); - } - if (m_iFlags & RADIO_ACTIVE) { - drawpic(m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_radiosel", [16,16], m_vecColor, 1.0f, 0); - } else { - drawpic(m_parent.m_vecOrigin + m_vecOrigin, "textures/ui/steam/icon_radiounsel", [16,16], m_vecColor, 1.0f, 0); - } - - if (m_strTitle) { - Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + [24, 3], m_strTitle, g_fntDefault); - } -#endif } bool VGUIRadio::Input (float flEVType, float flKey, float flChar, float flDevID) diff --git a/src/vgui/ui_scrollbar.qc b/src/vgui/ui_scrollbar.qc index 520a39f3..8219474f 100644 --- a/src/vgui/ui_scrollbar.qc +++ b/src/vgui/ui_scrollbar.qc @@ -14,219 +14,254 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -enumflags -{ - SCROLLBAR_UP_DOWN, - SCROLLBAR_DN_DOWN, - SCROLLBAR_SLIDER_DOWN -}; +const vector VGUIScrollbar_ArrowSize = [19,20]; -.void(void) tmpVGUIScrollbar1; - -/** VGUI Widget: Scrollbar - -@ingroup vgui -*/ class VGUIScrollbar:VGUIWidget { -public: + int m_hold; + int m_hover; + + int m_height; + int m_theight; + int m_scroll; + int m_minus; + int m_maxvisible; + int m_totalentries; + int m_itemheight; + virtual void(void) m_changed = 0; + + int m_up_hover; + int m_up_hold; + int m_dn_hover; + int m_dn_hold; + void VGUIScrollbar(void); - - /** Sets the ??? */ - nonvirtual void SetLength(int); - nonvirtual int GetLength(void); - nonvirtual void SetMin(float); - nonvirtual float GetMin(void); - nonvirtual void SetMax(float); - nonvirtual float GetMax(void); - nonvirtual void SetStep(float); - nonvirtual float GetStep(void); - nonvirtual void SetValue(float,int); - nonvirtual float GetValue(void); - nonvirtual void CallOnChange(void(void)); - virtual void Draw(void); - virtual bool Input(float, float, float, float); + virtual float Input(float, float, float, float); -private: - vector m_vecColor; - float m_flAlpha; - - int m_iLength; - - float m_flMin; - float m_flMax; - float m_flStep; - float m_flValue; + virtual int GetValue(void); + virtual void SetStep(int); + virtual void SetMin(int); + virtual void SetValue(int); + virtual void SetMax(int); + virtual void SetLength(int); + virtual void SetItemheight(int) ; + virtual void CallOnChange(void(void)); + + nonvirtual void DrawArrowUp(vector); + nonvirtual void DrawArrowDown(vector); }; -void VGUIScrollbar::VGUIScrollbar(void) +void +VGUIScrollbar::VGUIScrollbar(void) { - m_vecColor = UI_MAINCOLOR; - m_flAlpha = 1.0f; + /* There's the physical length (t_length) and the actual length + * (border, etc. ignored) */ + SetItemheight(20); + SetLength(128); } -void VGUIScrollbar::Draw(void) +void +VGUIScrollbar::SetStep(int step) { - vector vecSize = [20, m_iLength]; - vector vecUpPos = m_parent.m_vecOrigin + m_vecOrigin; - vector vecDownPos = m_parent.m_vecOrigin + m_vecOrigin + [0, m_iLength - 20]; - vector vecSliderPos = m_parent.m_vecOrigin + m_vecOrigin + [0, 20]; -#ifndef CLASSIC_VGUI +} + +void +VGUIScrollbar::SetMin(int step) +{ + +} + + +void +VGUIScrollbar::DrawArrowUp(vector vecPos) +{ VGUITheme theme = GetTheme(); - - vecSliderPos[1] += (m_iLength - 60) * (m_flValue / m_flMax); - - if (m_iFlags & BUTTON_DOWN) { - theme.DrawScrollbar(m_parent.m_vecOrigin + m_vecOrigin, vecSize, VGUI_STATE_ACTIVE); + if (m_up_hold) { + theme.DrawButton(vecPos, VGUIScrollbar_ArrowSize, VGUI_STATE_ACTIVE); } else { - theme.DrawScrollbar(m_parent.m_vecOrigin + m_vecOrigin, vecSize, VGUI_STATE_NORMAL); + theme.DrawButton(vecPos, VGUIScrollbar_ArrowSize, VGUI_STATE_NORMAL); } - // Slider Button - if (m_iFlags & SCROLLBAR_SLIDER_DOWN) { - theme.DrawScroller(vecSliderPos, [20,20], VGUI_STATE_ACTIVE); - } else { - theme.DrawScroller(vecSliderPos, [20,20], VGUI_STATE_NORMAL); - } - - // Button UP - if (m_iFlags & SCROLLBAR_UP_DOWN) { - theme.DrawButton(vecUpPos, [20,20], VGUI_STATE_ACTIVE); - } else { - theme.DrawButton(vecUpPos, [20,20], VGUI_STATE_NORMAL); - } - drawpic(vecUpPos + [2,2], "textures/ui/steam/icon_up", [16,16], [1,1,1], 1.0f, 0); - - if (m_iFlags & SCROLLBAR_DN_DOWN) { - theme.DrawButton(vecDownPos, [20,20], VGUI_STATE_ACTIVE); - } else { - theme.DrawButton(vecDownPos, [20,20], VGUI_STATE_NORMAL); - } - drawpic(vecDownPos + [2,2], "textures/ui/steam/icon_down", [16,16], [1,1,1], 1.0f, 0); - -#else - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, vecSize[1] - 1], [vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin, [vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, vecSize[1] - 2], m_vecColor, 1.0f); - drawfill(m_parent.m_vecOrigin + m_vecOrigin + [vecSize[0] - 1, 1], [1, vecSize[1] - 2], m_vecColor, 1.0f); - - if (m_iFlags & SCROLLBAR_UP_DOWN) { - drawfill(vecUpPos, [20,20], m_vecColor, 0.25f); - drawfill(vecUpPos, [20, 1], m_vecColor, 1.0f); - drawfill(vecUpPos + [0, 19], [20, 1], m_vecColor, 1.0f); - drawfill(vecUpPos + [0, 1], [1, 18], m_vecColor, 1.0f); - drawfill(vecUpPos + [19, 1], [1, 18], m_vecColor, 1.0f); - } else { - drawfill(vecUpPos, [20, 1], [1,1,1], 0.5f); - drawfill(vecUpPos + [0, 19], [20, 1], m_vecColor, 1.0f); - drawfill(vecUpPos + [0, 1], [1, 18], m_vecColor, 1.0f); - drawfill(vecUpPos + [19, 1], [1, 18], m_vecColor, 1.0f); - } - drawpic(vecUpPos + [2,2], "textures/ui/steam/icon_up", [16,16], m_vecColor, 1.0f, 0); - - // Button DOWN - if (m_iFlags & SCROLLBAR_DN_DOWN) { - drawfill(vecDownPos, [20,20], m_vecColor, 0.25f); - drawfill(vecDownPos, [20, 1], m_vecColor, 1.0f); - drawfill(vecDownPos + [0, 19], [20, 1], m_vecColor, 1.0f); - drawfill(vecDownPos + [0, 1], [1, 18], m_vecColor, 1.0f); - drawfill(vecDownPos + [19, 1], [1, 18], m_vecColor, 1.0f); - } else { - drawfill(vecDownPos, [20, 1], m_vecColor, 1.0f); - drawfill(vecDownPos+ [0, 19], [20, 1], m_vecColor, 1.0f); - drawfill(vecDownPos + [0, 1], [1, 18], m_vecColor, 1.0f); - drawfill(vecDownPos + [19, 1], [1, 18], m_vecColor, 1.0f); - } - drawpic(vecDownPos + [2,2], "textures/ui/steam/icon_down", [16,16], m_vecColor, 1.0f, 0); -#endif + drawpic(vecPos + [2,2], "gfx/icon16/bullet_arrow_up", [16,16], [1,1,1], 1.0f, 0); } -bool VGUIScrollbar::Input (float flEVType, float flKey, float flChar, float flDevID) +void +VGUIScrollbar::DrawArrowDown(vector vecPos) { - bool ret = false; - vector vecUpPos = m_parent.m_vecOrigin + m_vecOrigin; - vector vecDownPos = m_parent.m_vecOrigin + m_vecOrigin + [0, m_iLength - 20]; - - if (flEVType == IE_KEYDOWN) { - if (flKey == K_MOUSE1) { - if (Util_MouseAbove(g_vecMousePos, vecUpPos, [20,20])) { - m_iFlags |= SCROLLBAR_UP_DOWN; - ret = true; - } else if (Util_MouseAbove(g_vecMousePos, vecDownPos, [20,20])) { - m_iFlags |= SCROLLBAR_DN_DOWN; - ret = true; - } - } - } else if (flEVType == IE_KEYUP) { - if (flKey == K_MOUSE1) { - if (m_iFlags & SCROLLBAR_UP_DOWN && Util_MouseAbove(g_vecMousePos, vecUpPos, [20,20])) { - SetValue(GetValue() - GetStep(), TRUE); - } else if (m_iFlags & SCROLLBAR_DN_DOWN && Util_MouseAbove(g_vecMousePos, vecDownPos, [20,20])) { - SetValue(GetValue() + GetStep(), TRUE); - } - m_iFlags -= (m_iFlags & SCROLLBAR_UP_DOWN); - m_iFlags -= (m_iFlags & SCROLLBAR_DN_DOWN); - } else if (flKey == K_MWHEELDOWN && Util_MouseAbove(g_vecMousePos, m_parent.m_vecOrigin + m_vecOrigin, [20, m_iLength])) { - SetValue(GetValue() + GetStep(), TRUE); - } else if (flKey == K_MWHEELUP && Util_MouseAbove(g_vecMousePos, m_parent.m_vecOrigin + m_vecOrigin, [20, m_iLength])) { - SetValue(GetValue() - GetStep(), TRUE); + VGUITheme theme = GetTheme(); + if (m_dn_hold) { + theme.DrawButton(vecPos, VGUIScrollbar_ArrowSize, VGUI_STATE_ACTIVE); + } else { + theme.DrawButton(vecPos, VGUIScrollbar_ArrowSize, VGUI_STATE_NORMAL); + } + + drawpic(vecPos + [2,2], "gfx/icon16/bullet_arrow_down", [16,16], [1,1,1], 1.0f, 0); +} + +void +VGUIScrollbar::Draw(void) +{ + VGUITheme theme = GetTheme(); + int barheight = 0; + float barstep = 0; + + barheight = (float)(m_minus) / (float)(m_totalentries) * m_theight; + + drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0,VGUIScrollbar_ArrowSize[1]], [VGUIScrollbar_ArrowSize[0],m_theight], [1.0f,1.0f,1.0f], 0.1f); + + DrawArrowUp([m_parent.m_vecOrigin[0]+m_vecOrigin[0],m_parent.m_vecOrigin[1]+m_vecOrigin[1]]); + DrawArrowDown([m_parent.m_vecOrigin[0]+m_vecOrigin[0],m_parent.m_vecOrigin[1]+m_vecOrigin[1]+m_theight + VGUIScrollbar_ArrowSize[1]]); + + + if (barheight < 20) + barheight = 20; + + barstep = m_theight - barheight; + barstep *= (float)(m_scroll) / (float)(m_maxvisible); + + /* too few entries? don't even bother */ + if (m_totalentries * m_itemheight < m_height) { + drawfill([m_parent.m_vecOrigin[0]+m_vecOrigin[0],m_parent.m_vecOrigin[1]+m_vecOrigin[1]+VGUIScrollbar_ArrowSize[1]], [VGUIScrollbar_ArrowSize[0],m_theight], [0.25,0.25,0.25], 1.0f); + return; + } + + drawfill([m_parent.m_vecOrigin[0]+m_vecOrigin[0],m_parent.m_vecOrigin[1]+m_vecOrigin[1]+VGUIScrollbar_ArrowSize[1]+barstep], [VGUIScrollbar_ArrowSize[0],barheight], UI_MAINCOLOR, UI_MAINALPHA); + + if (!m_hold) { + theme.DrawButton([m_parent.m_vecOrigin[0]+m_vecOrigin[0],m_parent.m_vecOrigin[1]+m_vecOrigin[1]+VGUIScrollbar_ArrowSize[1]+barstep], [VGUIScrollbar_ArrowSize[0],barheight], VGUI_STATE_NORMAL); + } else { + theme.DrawButton([m_parent.m_vecOrigin[0]+m_vecOrigin[0],m_parent.m_vecOrigin[1]+m_vecOrigin[1]+VGUIScrollbar_ArrowSize[1]+barstep], [VGUIScrollbar_ArrowSize[0],barheight], VGUI_STATE_ACTIVE); + } +} + +float +VGUIScrollbar::Input(float type, float x, float y, float devid) +{ + int barheight = 0; + float barstep = 0; + float returnVal = false; + + /* too few entries? don't even bother */ + if (m_totalentries * m_itemheight < m_height) { + return false; + } + + barheight = (float)(m_minus) / (float)(m_totalentries) * m_theight; + + if (barheight < 20) + barheight = 20; + + barstep = m_theight - barheight; + barstep *= (float)(m_scroll) / (float)(m_maxvisible); + + if (Util_MouseAbove(g_vecMousePos, m_parent.m_vecOrigin + m_vecOrigin, VGUIScrollbar_ArrowSize)) { + m_up_hover = TRUE; + } else { + m_up_hover = FALSE; + } + + if (Util_MouseAbove(g_vecMousePos, m_parent.m_vecOrigin + m_vecOrigin + [0, m_theight + VGUIScrollbar_ArrowSize[1]], VGUIScrollbar_ArrowSize)) { + m_dn_hover = TRUE; + } else { + m_dn_hover = FALSE; + } + + if (Util_MouseAbove(g_vecMousePos, m_parent.m_vecOrigin + m_vecOrigin + [0, barstep + VGUIScrollbar_ArrowSize[1]], [VGUIScrollbar_ArrowSize[0],barheight])) { + m_hover = TRUE; + } else { + m_hover = FALSE; + } + + if (m_up_hover && type == IE_KEYDOWN && x == K_MOUSE1) { + m_up_hold = TRUE; + returnVal = true; + } else if (type == IE_KEYUP && x == K_MOUSE1) { + m_up_hold = FALSE; + } + if (m_up_hold) { + SetValue(m_scroll - 1); + } + + if (m_dn_hover && type == IE_KEYDOWN && x == K_MOUSE1) { + m_dn_hold = TRUE; + returnVal = true; + } else if (type == IE_KEYUP && x == K_MOUSE1) { + m_dn_hold = FALSE; + } + if (m_dn_hold) { + SetValue(m_scroll + 1); + } + + if (m_hover && type == IE_KEYDOWN && x == K_MOUSE1) { + m_hold = TRUE; + returnVal = true; + } else if (type == IE_KEYUP && x == K_MOUSE1) { + m_hold = FALSE; + } + + if (m_hold) { + if (g_vecMousePos[0] != g_lastmousepos[0] || g_vecMousePos[1] != g_lastmousepos[1]) { + int mdelta; + float m_value; + /* The - 10 is putting the slider in the middle of the cursor */ + mdelta = (g_vecMousePos[1] - (barheight / 2)) - ( m_parent.m_vecOrigin[1] + m_vecOrigin[1]); + m_value = ((float)mdelta / (float)m_theight); + m_value = bound(0.0f, m_value, 1.0f); + + SetValue(rint(m_totalentries * m_value)); + g_lastmousepos[0] = g_vecMousePos[0]; + g_lastmousepos[1] = g_vecMousePos[1]; + + /*if (m_changed) { + m_changed(m_value); + }*/ } } - return (ret); + + return (returnVal); } -void VGUIScrollbar::SetLength (int iLength) +int +VGUIScrollbar::GetValue(void) { - m_iLength = iLength; -} -int VGUIScrollbar::GetLength(void) -{ - return m_iLength; + return m_scroll; } -void VGUIScrollbar::SetMin (float flVal) +void +VGUIScrollbar::SetValue(int val) { - m_flMin = flVal; -} -float VGUIScrollbar::GetMin(void) -{ - return m_flMin; -} + m_scroll = bound(0,val,m_totalentries); -void VGUIScrollbar::SetMax (float flVal) -{ - m_flMax = flVal; -} -float VGUIScrollbar::GetMax(void) -{ - return m_flMax; -} - -void VGUIScrollbar::SetStep (float flVal) -{ - m_flStep = flVal; -} -float VGUIScrollbar::GetStep(void) -{ - return m_flStep; -} - -void VGUIScrollbar::SetValue (float flVal, int iCallBack) -{ - m_flValue = bound(m_flMin, flVal, m_flMax); - - if (tmpVGUIScrollbar1 && iCallBack) { - tmpVGUIScrollbar1(); + if (m_changed) { + m_changed(); } } -float VGUIScrollbar::GetValue(void) + +void +VGUIScrollbar::SetMax(int val) { - return m_flValue; + m_minus = m_height / m_itemheight; + m_totalentries = val; + m_maxvisible = m_totalentries - m_minus; } -void VGUIScrollbar::CallOnChange (void(void) vFunc) +void +VGUIScrollbar::SetLength(int val) { - tmpVGUIScrollbar1 = vFunc; + m_height = val; + m_theight = m_height - (VGUIScrollbar_ArrowSize[1] * 2); +} + +void +VGUIScrollbar::SetItemheight(int val) +{ + m_itemheight = val; +} + +void +VGUIScrollbar::CallOnChange(void(void) vFunc) +{ + m_changed = vFunc; } diff --git a/src/vgui/ui_textbox.qc b/src/vgui/ui_textbox.qc index 8900e61d..61ada18f 100644 --- a/src/vgui/ui_textbox.qc +++ b/src/vgui/ui_textbox.qc @@ -69,18 +69,14 @@ string VGUITextBox::GetText(void) void VGUITextBox::Draw(void) { - -#ifdef CLASSIC_VGUI VGUITheme theme = GetTheme(); - theme. DrawTextBackground(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, VGUI_STATE_NORMAL); -#else drawfill(m_parent.m_vecOrigin + m_vecOrigin, m_vecSize, [0,0,0], 0.25f); drawfill(m_parent.m_vecOrigin + m_vecOrigin, [m_vecSize[0], 1], [0,0,0], 0.5f); drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], [1,1,1], 0.5f); drawfill(m_parent.m_vecOrigin + m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], [0,0,0], 0.5f); drawfill(m_parent.m_vecOrigin + m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], [1,1,1], 0.5f); -#endif + m_flTime += frametime * 2; /* these are to deal with text going off-screen */ @@ -90,17 +86,13 @@ void VGUITextBox::Draw(void) // blinking cursor if (m_iFlags & TEXTBOX_FOCUS) { if (rint(m_flTime) & 1) { - drawsetcliparea(m_parent.m_vecOrigin[0] + m_vecOrigin[0], m_parent.m_vecOrigin[1] + m_vecOrigin[1], m_vecSize[0], m_vecSize[1]); - Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + [8 - ofs, 8], sprintf("%s|", m_strText), g_fntDefault); - drawresetcliparea(); + theme.DrawText(m_parent.m_vecOrigin + m_vecOrigin + [8 - ofs, 8], sprintf("%s|", m_strText), m_vecSize, g_fntDefault); return; } } if (m_strText) { - drawsetcliparea(m_parent.m_vecOrigin[0] + m_vecOrigin[0], m_parent.m_vecOrigin[1] + m_vecOrigin[1], m_vecSize[0], m_vecSize[1]); - Font_DrawText(m_parent.m_vecOrigin + m_vecOrigin + [8 - ofs, 8], m_strText, g_fntDefault); - drawresetcliparea(); + theme.DrawText(m_parent.m_vecOrigin + m_vecOrigin + [8 - ofs, 8], m_strText, m_vecSize, g_fntDefault); } } diff --git a/src/vgui/ui_theme.qc b/src/vgui/ui_theme.qc index 2ace713f..f45f973e 100644 --- a/src/vgui/ui_theme.qc +++ b/src/vgui/ui_theme.qc @@ -10,17 +10,19 @@ also referred to as TrackerUI has changed many times in appearance and we'd like means of handling any such styles. */ -#ifdef CLASSIC_VGUI - #ifndef UI_MAINCOLOR - #define UI_MAINCOLOR [255,170,0] / 255 - #endif - #ifndef UI_MAINALPHA - #define UI_MAINALPHA 255 - #endif -#else - var vector UI_MAINCOLOR; - var float UI_MAINALPHA; -#endif + +var vector UI_MAINCOLOR; +var vector UI_FGCOLOR; +var float UI_MAINALPHA; +var vector UI_HICOLOR; +var vector UI_FILLCOLOR; +var vector UI_LOCOLOR; +var vector UI_BORDERCOLOR; +var float UI_BORDERALPHA; +var bool UI_ROUNDED; +var bool UI_NOICONS; +var vector UI_HOVERCOLOR; +var float UI_HOVERALPHA; /** State of the widget we're going to draw. */ typedef enum @@ -61,6 +63,8 @@ public: virtual void DrawTextBackground(vector, vector, VGUIDrawState_t); /** Draw a window background at the specified position, size and VGUIDrawState_t. */ virtual void DrawWindowBackground(vector, vector, VGUIDrawState_t); + /** Draw a window background at the specified position, size and VGUIDrawState_t. */ + virtual void DrawWindowTitle(vector, vector, string, string, font_s, VGUIDrawState_t); /** Draw a button body at the specified position, size and VGUIDrawState_t. */ virtual void DrawButton(vector, vector, VGUIDrawState_t); /** Draw a scroller at the specified position, size and VGUIDrawState_t. */ @@ -80,26 +84,33 @@ private: VGUIColor m_textBackgroundColor; VGUIColor m_textColor; VGUIColor m_windowBorderColor; + VGUIColor m_hilightColor; + VGUIColor m_shadowColor; }; void VGUITheme::VGUITheme(void) { m_controlBackgroundColor = spawn(VGUIColor); - //m_controlBackgroundColor.SetColor([0.298, 0.345, 0.267]); - m_controlBackgroundColor.SetColor(UI_MAINCOLOR); + m_controlBackgroundColor. SetColorWithAlpha(UI_MAINCOLOR, 0.0f); + m_windowBackgroundColor = spawn(VGUIColor); - //m_windowBackgroundColor.SetColor([0.298, 0.345, 0.267]); - m_windowBackgroundColor.SetColor(UI_MAINCOLOR); + m_windowBackgroundColor.SetColorWithAlpha(UI_MAINCOLOR, UI_MAINALPHA); + m_textBackgroundColor = spawn(VGUIColor); - //m_textBackgroundColor.SetColor([0.243, 0.275, 0.216]); m_textBackgroundColor.SetColor(UI_MAINCOLOR); + m_textColor = spawn(VGUIColor); - //m_textColor.SetColor([0.847, 0.871, 0.827]); - m_textColor.SetColor(UI_MAINCOLOR); + m_textColor.SetColor(UI_FGCOLOR); + m_windowBorderColor = spawn(VGUIColor); - //m_windowBorderColor.SetColor([0.533, 0.569, 0.502]); - m_windowBorderColor.SetColor(UI_MAINCOLOR); + m_windowBorderColor.SetColor(UI_BORDERCOLOR); + + m_hilightColor = spawn(VGUIColor); + m_hilightColor.SetColorWithAlpha(UI_HICOLOR, 0.5f); + + m_shadowColor = spawn(VGUIColor); + m_shadowColor.SetColorWithAlpha(UI_LOCOLOR, 0.5f); } void @@ -107,16 +118,16 @@ VGUITheme::DrawBorder(vector atPos, vector withSize, VGUIBorderStyle_t borderSty { switch (borderStyle) { case VGUI_BORDER_INSET: - drawfill(atPos + [0, withSize[1] - 1], [withSize[0], 1], [1,1,1], 0.5f); - drawfill(atPos, [withSize[0], 1], [0,0,0], 0.5f); - drawfill(atPos + [0, 1], [1, withSize[1] - 2], [0,0,0], 0.5f); - drawfill(atPos + [withSize[0] - 1, 1], [1, withSize[1] - 2], [1,1,1], 0.5f); + drawfill(atPos + [0, withSize[1] - 1], [withSize[0], 1], m_hilightColor.GetColor(), m_hilightColor.GetAlpha()); + drawfill(atPos, [withSize[0], 1], m_shadowColor.GetColor(), m_shadowColor.GetAlpha()); + drawfill(atPos + [0, 1], [1, withSize[1] - 2], m_shadowColor.GetColor(), m_shadowColor.GetAlpha()); + drawfill(atPos + [withSize[0] - 1, 1], [1, withSize[1] - 2], m_hilightColor.GetColor(), m_hilightColor.GetAlpha()); break; case VGUI_BORDER_OUTSET: - drawfill(atPos + [0, withSize[1] - 1], [withSize[0], 1], [0,0,0], 0.5f); - drawfill(atPos, [withSize[0], 1], [1,1,1], 0.5f); - drawfill(atPos + [0, 1], [1, withSize[1] - 2], [1,1,1], 0.5f); - drawfill(atPos + [withSize[0] - 1, 1], [1, withSize[1] - 2], [0,0,0], 0.5f); + drawfill(atPos + [0, withSize[1] - 1], [withSize[0], 1], m_shadowColor.GetColor(), 0.5f); + drawfill(atPos, [withSize[0], 1], m_hilightColor.GetColor(), 0.5f); + drawfill(atPos + [0, 1], [1, withSize[1] - 2], m_hilightColor.GetColor(), 0.5f); + drawfill(atPos + [withSize[0] - 1, 1], [1, withSize[1] - 2], m_shadowColor.GetColor(), 0.5f); break; case VGUI_BORDER_LINE: drawfill(atPos + [0, withSize[1] - 1], [withSize[0], 1], color.GetColor(), color.GetAlpha()); @@ -154,15 +165,19 @@ VGUITheme::DrawButton(vector atPos, vector withSize, VGUIDrawState_t drawStyle) DrawControlBackground(atPos, withSize, drawStyle); if (drawStyle == VGUI_STATE_ACTIVE) { - drawfill(atPos + [0, withSize[1] - 1], [withSize[0], 1], [1,1,1], 0.5f); - drawfill(atPos, [withSize[0], 1], [0,0,0], 0.5f); - drawfill(atPos + [0, 1], [1, withSize[1] - 2], [0,0,0], 0.5f); - drawfill(atPos + [withSize[0] - 1, 1], [1, withSize[1] - 2], [1,1,1], 0.5f); + drawfill(atPos + [0, withSize[1] - 1], [withSize[0], 1], m_hilightColor.GetColor(), m_hilightColor.GetAlpha()); + drawfill(atPos, [withSize[0], 1], m_shadowColor.GetColor(), m_shadowColor.GetAlpha()); + drawfill(atPos + [0, 1], [1, withSize[1] - 2], m_shadowColor.GetColor(), m_shadowColor.GetAlpha()); + drawfill(atPos + [withSize[0] - 1, 1], [1, withSize[1] - 2], m_hilightColor.GetColor(), m_hilightColor.GetAlpha()); } else { - drawfill(atPos + [0, withSize[1] - 1], [withSize[0], 1], [0,0,0], 0.5f); - drawfill(atPos, [withSize[0], 1], [1,1,1], 0.5f); - drawfill(atPos + [0, 1], [1, withSize[1] - 2], [1,1,1], 0.5f); - drawfill(atPos + [withSize[0] - 1, 1], [1, withSize[1] - 2], [0,0,0], 0.5f); + drawfill(atPos + [0, withSize[1] - 1], [withSize[0], 1], m_shadowColor.GetColor(), m_shadowColor.GetAlpha()); + drawfill(atPos, [withSize[0], 1], m_hilightColor.GetColor(), m_hilightColor.GetAlpha()); + drawfill(atPos + [0, 1], [1, withSize[1] - 2], m_hilightColor.GetColor(), m_hilightColor.GetAlpha()); + drawfill(atPos + [withSize[0] - 1, 1], [1, withSize[1] - 2], m_shadowColor.GetColor(), m_shadowColor.GetAlpha()); + } + + if (drawStyle == VGUI_STATE_HOVER) { + drawfill(atPos, withSize, UI_HOVERCOLOR, UI_HOVERALPHA); } } @@ -170,10 +185,10 @@ void VGUITheme::DrawScroller(vector atPos, vector withSize, VGUIDrawState_t drawStyle) { DrawControlBackground(atPos, withSize, drawStyle); - drawfill(atPos + [0, withSize[1] - 1], [withSize[0], 1], [0,0,0], 0.5f); - drawfill(atPos, [withSize[0], 1], [1,1,1], 0.5f); - drawfill(atPos + [0, 1], [1, withSize[1] - 2], [1,1,1], 0.5f); - drawfill(atPos + [withSize[0] - 1, 1], [1, withSize[1] - 2], [0,0,0], 0.5f); + drawfill(atPos + [0, withSize[1] - 1], [withSize[0], 1], m_shadowColor.GetColor(), m_shadowColor.GetAlpha()); + drawfill(atPos, [withSize[0], 1], m_hilightColor.GetColor(), m_hilightColor.GetAlpha()); + drawfill(atPos + [0, 1], [1, withSize[1] - 2], m_hilightColor.GetColor(), m_hilightColor.GetAlpha()); + drawfill(atPos + [withSize[0] - 1, 1], [1, withSize[1] - 2], m_shadowColor.GetColor(), m_shadowColor.GetAlpha()); } void @@ -185,9 +200,19 @@ VGUITheme::DrawScrollbar(vector atPos, vector withSize, VGUIDrawState_t drawStyl void VGUITheme::DrawProgressIndicator(vector atPos, vector withSize, float progressValue, VGUIDrawState_t drawStyle) { - float barLength = (withSize[0] - 4) * progressValue; - DrawTextBackground(atPos, withSize, drawStyle); - drawfill(atPos + [2, 2], [barLength, withSize[1] - 4], [1,1,1], 1.0f); + drawfill(atPos, [withSize[0], 1], m_shadowColor.GetColor(), m_shadowColor.GetAlpha()); + drawfill(atPos + [0, withSize[1] - 1], [withSize[0], 1], m_hilightColor.GetColor(), m_hilightColor.GetAlpha()); + drawfill(atPos + [0, 1], [1, withSize[1] - 2], m_shadowColor.GetColor(), m_shadowColor.GetAlpha()); + drawfill(atPos + [withSize[0] - 1, 1], [1, withSize[1] - 2], m_hilightColor.GetColor(), m_hilightColor.GetAlpha()); + drawfill(atPos + [1,1], [withSize[0] - 2, withSize[1]-2], m_shadowColor.GetColor(), m_shadowColor.GetAlpha()); + + vector drawPos = [4,4]; + float max = floor(((withSize[0] - 8) * progressValue) / 12); + + for (float i = 0; i < max; i++ ) { + drawfill(atPos + drawPos, [8, 16], UI_FILLCOLOR, 1.0f); + drawPos[0] += 12; + } } void @@ -195,13 +220,74 @@ VGUITheme::DrawText(vector atPos, string withText, vector boundSize, font_s text { //drawsetcliparea(atPos[0], atPos[1], boundSize[0], boundSize[1]); //drawfill(atPos, boundSize, [1,1,1], 0.5f); - Font_DrawText(atPos, withText, textFont); + Font_DrawText_RGB(atPos, withText, UI_FGCOLOR, textFont); //drawresetcliparea(); } void VGUITheme::DrawWindow(vector atPos, vector withSize, VGUIDrawState_t drawStyle) { - DrawWindowBackground(atPos, withSize, drawStyle); - DrawBorder(atPos, withSize, VGUI_BORDER_OUTSET, m_windowBorderColor); -} \ No newline at end of file + static void + DRB(vector pos, vector size, vector rgb, float a) + { + drawpic(pos, "textures/ui/m_topleft.tga", [16,16], rgb, a, 0); + drawpic(pos + [size[0] - 16, 0], "textures/ui/m_topright.tga", [16,16], rgb, a, 0); + drawpic(pos + [0, size[1] - 16], "textures/ui/m_bottomleft.tga", [16,16], rgb, a, 0); + drawpic(pos + [size[0] - 16, size[1] - 16], "textures/ui/m_bottomright.tga", [16,16], rgb, a, 0); + + if (size_x > 32) { + drawpic(pos + [16, 0], "textures/ui/m_top.tga", [size[0] - 32, 16], rgb, a, 0); + drawpic(pos + [16, size[1] - 16], "textures/ui/m_bottom.tga", [size[0] - 32, 16], rgb, a, 0); + } + + if (size_y > 32) { + drawpic(pos + [0, 16], "textures/ui/m_left.tga", [16, size[1] - 32], rgb, a, 0); + drawpic(pos + [size[0] - 16, 16], "textures/ui/m_right.tga", [16, size[1] - 32], rgb, a, 0); + drawpic(pos + [16, 16], "textures/ui/m_mid.tga", [size[0] - 32, size[1] - 32], rgb, a, 0); + } + } + + static void + DRB2(vector pos, vector size, vector rgb, float a) + { + drawpic(pos, "textures/ui/m_linetopleft.tga", [16,16], rgb, a, 0); + drawpic(pos + [size[0] - 16, 0], "textures/ui/m_linetopright.tga", [16,16], rgb, a, 0); + drawpic(pos + [0, size[1] - 16], "textures/ui/m_linebottomleft.tga", [16,16], rgb, a, 0); + drawpic(pos + [size[0] - 16, size[1] - 16], "textures/ui/m_linebottomright.tga", [16,16], rgb, a, 0); + + if (size_x > 32) { + drawpic(pos + [16, 0], "textures/ui/m_linetop.tga", [size[0] - 32, 16], rgb, a, 0); + drawpic(pos + [16, size[1] - 16], "textures/ui/m_linebottom.tga", [size[0] - 32, 16], rgb, a, 0); + } + + if (size_y > 32) { + drawpic(pos + [0, 16], "textures/ui/m_lineleft.tga", [16, size[1] - 32], rgb, a, 0); + drawpic(pos + [size[0] - 16, 16], "textures/ui/m_lineright.tga", [16, size[1] - 32], rgb, a, 0); + drawpic(pos + [16, 16], "textures/ui/m_linemid.tga", [size[0] - 32, size[1] - 32], rgb, a, 0); + } + } + + if (UI_ROUNDED == true) { + DRB(atPos, withSize, m_windowBackgroundColor.GetColor(), m_windowBackgroundColor.GetAlpha()); + + if (UI_BORDERALPHA > 0.0f) { + DRB2(atPos, withSize, m_windowBorderColor.GetColor(), m_windowBorderColor.GetAlpha()); + } + } else { + DrawWindowBackground(atPos, withSize, drawStyle); + DrawBorder(atPos, withSize, VGUI_BORDER_OUTSET, m_windowBorderColor); + } +} + +void +VGUITheme::DrawWindowTitle(vector atPos, vector withSize, string titleText, string withIcon, font_s textFont, VGUIDrawState_t drawStyle) +{ + if (STRING_SET(titleText)) { + if (STRING_SET(withIcon) && UI_NOICONS == false) { + DrawText(atPos + [26, 8], titleText, withSize, textFont); + drawpic(atPos + [4, 4], withIcon, [16,16], [1,1,1], 1.0f, 0); + } else { + DrawText(atPos + [8, 8], titleText, withSize, textFont); + } + } +} diff --git a/src/vgui/ui_window.qc b/src/vgui/ui_window.qc index 28d6449c..c5637610 100644 --- a/src/vgui/ui_window.qc +++ b/src/vgui/ui_window.qc @@ -185,13 +185,8 @@ VGUIWindow::Spawned(void) m_btnClose = spawn(VGUIButton); m_btnClose.SetTitle(__NULL__); - m_btnClose.SetIcon("textures/ui/steam/icon_close"); -#ifdef CLASSIC_VGUI - m_btnClose.SetIconColor(m_vecColor); -#else m_btnClose.SetIconColor([1,1,1]); -#endif m_btnClose.SetColor(m_vecColor); m_btnClose.SetFunc(VGUIWindowButtonClose); m_btnClose.SetSize([20,20]); @@ -243,33 +238,6 @@ VGUIWindow::WindowDidClose(void) void VGUIWindow::Draw(void) { -#ifdef CLASSIC_VGUI - if (m_styleMask & VGUIWindowFullscreen) - drawfill([0,0], g_vidsize, [0,0,0], 0.5); - else - drawfill(m_vecOrigin, m_vecSize, [0,0,0], 0.5); - - if (!(m_styleMask & VGUIWindowBorderless)) { - drawfill(m_vecOrigin, [m_vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_vecOrigin + [0, m_vecSize[1] - 1], [m_vecSize[0], 1], m_vecColor, 1.0f); - drawfill(m_vecOrigin + [0, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f); - drawfill(m_vecOrigin + [m_vecSize[0] - 1, 1], [1, m_vecSize[1] - 2], m_vecColor, 1.0f); - } - - if (m_styleMask & VGUIWindowResizeable) { - drawpic(m_vecOrigin + m_vecSize - [16,16], "textures/ui/steam/icon_resizer", [16,16], m_vecColor, 1.0f, 0); - } - - if (m_styleMask & VGUIWindowTitled) - if (m_strTitle) { - if (m_strIcon) { - Font_DrawText(m_vecOrigin + [26, 8], m_strTitle, g_fntDefault); - drawpic(m_vecOrigin + [4, 4], m_strIcon, [16,16], [1,1,1], 1.0f, 0); - } else { - Font_DrawText(m_vecOrigin + [8, 8], m_strTitle, g_fntDefault); - } - } -#else VGUITheme theme = GetTheme(); if (m_styleMask & VGUIWindowFullscreen) @@ -280,22 +248,19 @@ void VGUIWindow::Draw(void) theme.DrawWindowBackground(m_vecOrigin, m_vecSize, VGUI_STATE_ACTIVE); if (m_styleMask & VGUIWindowResizeable) { - drawpic(m_vecOrigin + m_vecSize - [16,16], "textures/ui/steam/icon_resizer", [16,16], m_vecColor, 1.0f, 0); + drawpic(m_vecOrigin + m_vecSize - [16,16], "gfx/icon16/arrow_out", [16,16], m_vecColor, 1.0f, 0); } - if (m_styleMask & VGUIWindowTitled) - if (m_strTitle) { - if (m_strIcon) { - theme.DrawText(m_vecOrigin + [26, 8], m_strTitle, m_vecSize, g_fntDefault); - drawpic(m_vecOrigin + [4, 4], m_strIcon, [16,16], [1,1,1], 1.0f, 0); - } else { - theme.DrawText(m_vecOrigin + [8, 8], m_strTitle, m_vecSize, g_fntDefault); - } + if (m_styleMask & VGUIWindowTitled) { + theme.DrawWindowTitle(m_vecOrigin, m_vecSize, m_strTitle, m_strIcon, g_fntDefault, VGUI_STATE_ACTIVE); } -#endif super::Draw(); + if (m_styleMask & VGUIWindowClosable) { + drawpic(m_vecOrigin + m_btnClose.m_vecOrigin + [2,2], "gfx/icon16/cross_mono", [16,16], [1,1,1], 1.0f, 0); + } + #ifdef UI_DEVELOPER if (m_iFlags & WINDOW_DRAGGING) { Font_DrawText([8, g_vidsize[1] - 18], sprintf("Window Position: %d, %d\n", m_vecOrigin[0], m_vecOrigin[1]), g_fntDefault); @@ -352,9 +317,20 @@ bool VGUIWindow::Input (float flEVType, float flKey, float flChar, float flDevID ret = true; } + /* if we hadn't had a successful input yet, pass it onto the children */ if (ret == false) { ret = super::Input(flEVType, flKey, flChar, flDevID); } + /* don't send clicks to elements behind our window */ + if (flEVType == IE_KEYDOWN && flKey == K_MOUSE1 && ret == false && Util_MouseAbove(g_vecMousePos, m_vecOrigin, m_vecSize)) { + ret = true; + } + + /* if an input was a success? refocus */ + if (ret == true) { + Focus(); + } + return (ret); }