diff --git a/doc/config/gib/adjustvolume.gib b/doc/config/gib/adjustvolume.gib new file mode 100644 index 000000000..ea6436502 --- /dev/null +++ b/doc/config/gib/adjustvolume.gib @@ -0,0 +1,58 @@ +// adjustvolume.gib +// +// Volume adjustment script for GIB in QuakeForge 0.5.3 +// +// Copyright (C) 2003 Erik Jan Tromp +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to: +// +// Free Software Foundation, Inc. +// 59 Temple Place - Suite 330 +// Boston, MA 02111-1307, USA +// + +// Updated for QuakeForge 0.5.3 by Brian Koropoff + +// this thing is primitive. as such, any attempt to break it will +// succeed. use your head! + +// simply set up a couple of bindings like the ones below.. +// in_bind IMT_0 K_KP_MINUS "adjustvolume 5" // Increase 5 percent +// in_bind IMT_0 K_KP_PLUS "adjustvolume -5" // Decrease 5 percent +// & something like this in autoexec.cfg.. +// // on the fly volume adjust +// exec adjustvolume.gib +// set maxvolume (whatever max volume you want) + +domain adjustvolume + +global rcsid = "$Id$" + +global slider = "\129\129\129\129\129\129\129\129\129\129\129\129\129\129\129\129" +set maxvolume 1.5 + +function adjustvolume { + if (#args != 2) {return} + hold_volume = ($volume + $maxvolume * $args[1] / 100) + if ($hold_volume < 0) {hold_volume = 0} else if ($hold_volume > $maxvolume) {hold_volume = $maxvolume} + set volume $hold_volume + ratio = ($volume / $maxvolume) + percent = `split ($ratio * 100) .` + index = ($ratio * 15) + print::center "Volume: ", $percent, "%\n\n", "\128", `slice $slider 0 $index`, "\131", `slice $slider $index -1`, "\130" + play "doors/runetry.wav" +} + +function::export adjustvolume diff --git a/doc/config/gib/cb.gib b/doc/config/gib/cb.gib deleted file mode 100644 index 4d9eec142..000000000 --- a/doc/config/gib/cb.gib +++ /dev/null @@ -1,182 +0,0 @@ -// cb.gib -// -// CustomTF class builder for GIB in QuakeForge 0.5 -// -// Copyright (C) 2002 Brian Koropoff -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to: -// -// Free Software Foundation, Inc. -// 59 Temple Place - Suite 330 -// Boston, MA 02111-1307, USA -// -// $Id$ - -// Instructions: -// -// First, you'll need to load a menu for whatever server you are on, -// otherwise it won't know what items are available and where to find -// them on the custom menu. To use the provided prozac.menu, you would -// type: -// custom::load::menu prozac -// -// To load a class, get to the first page of the custom menu and use -// custom::load::class to load up a class file. To use the provided -// warlock.class, you would type: -// custom::load::class warlock -// -// To record a class, again get to the first page of the custom menu. -// Now type custom::record at the menu. This will rebind all your -// number keys to keep track of what selections you have made. -// If you decide to restart building your class, you will have to -// type custom::record again. After you have built your class, -// press 0 as usual. Instead of spawning, you will get a message -// that recording has finished. To save your class with the name -// "engy" you would then type: -// custom::record::save engy -// You can now use custom::load::class to construct your class at any -// time. - -global custom - -custom.load.menu_f = { - custom.menu.${custom.menu.size}.name = $1 - custom.menu.${custom.menu.size}.size = 0 - function "__menu" $2 - __menu - custom.menu.size++ -} - -custom.load.item_f = { - local i - local n - i = ${custom.menu.size} - n = ${custom.menu.$i.size} - custom.menu.$i.$n = $1 - custom.item.$1 = 1 - custom.item.$1.menu = $i - custom.item.$1.number = $n - custom.menu.$i.size++ -} - -custom.load.buy_f = { - local i n - ifnot ${custom.item.$1} return - i = ${custom.item.$1.menu} - n = ${custom.item.$1.number} - custom::menu::seek $i - impulse ($n+1) - wait; wait; wait -} - - -function custom::load::menu { - local oldm oldi - oldm = `function::get menu` - oldi = `function::get item` - function "menu" ${custom.load.menu_f} - function "item" ${custom.load.item_f} - // Clear out old junk - global::delete custom.menu - global::delete custom.item - custom.menu.size = 0 - exec "custom/", $1, ".menu" - function "menu" $oldm - function "item" $oldi -} - -function custom::load::class { - local oldb - oldb = `function::get buy` - custom.menu.cur = 0 - function "buy" ${custom.load.buy_f} - exec "custom/", $1, ".class" - function "buy" $oldb -} - -function custom::menu::seek::forward { - custom.menu.cur = (${custom.menu.cur} + 1) - impulse 9 - wait; wait; -} - -function custom::menu::seek::backward { - custom.menu.cur = (${custom.menu.cur} - 1) - impulse 8 - wait; wait; -} - -function custom::menu::seek { - local func - if (${custom.menu.cur} < $1) { - func = custom::menu::seek::forward - } else { - func = custom::menu::seek::backward - } - while (${custom.menu.cur} != $1) $func -} - -function custom::record::item { - local m line - m = ${custom.menu.cur} - ifnot ($1 < ${custom.menu.$m.size}) return - line = "buy \"", ${custom.menu.$m.$1}, "\"" - custom.recording = ${custom.recording}, "\n", $line - impulse ($1+1) -} - -function custom::record::seek { - local new - new = (${custom.menu.cur} + $1) - if ($new < 0 || $new >= ${custom.menu.size}) return - custom.menu.cur = $new - if ($1 < 0) { - impulse 8 - } else { - impulse 9 - } -} - -function custom::record::stop { - bind "0" "impulse 10" - for i in `range 1 9` { - bind $i "impulse ", $i - } - echo "CustomBuild-> Recording finished" - custom.recording = "// Script recorded by CustomTF class builder", ${custom.recording} -} - -function custom::record { - custom.menu.cur = 0 - custom.recording = "" - bind "0" "custom::record::stop" - bind "8" "custom::record::seek -1" - bind "9" "custom::record::seek 1" - for i in `range 1 7` { - bind $i "custom::record::item ",($i-1) - } - echo "CustomBuild-> Recording class. Please build a class as usual." - custom -} - -function custom::record::save { - local file - file = "custom/", $1, ".class" - echo "Saving class script to ", $file, "..." - file::write $file ${custom.recording} -} - -function::export custom::load::menu custom::load::class custom::record::item -function::export custom::record::seek custom::record::stop custom::record custom::record::save diff --git a/doc/config/gib/sshot.gib b/doc/config/gib/sshot.gib new file mode 100644 index 000000000..51fbd8090 --- /dev/null +++ b/doc/config/gib/sshot.gib @@ -0,0 +1,91 @@ +// sshot.gib +// +// Screenshot script for GIB in QuakeForge 0.5.3 +// +// Copyright (C) 2003 Erik Jan Tromp +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// +// See the GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to: +// +// Free Software Foundation, Inc. +// 59 Temple Place - Suite 330 +// Boston, MA 02111-1307, USA +// + +// Updated for QuakeForge 0.5.3 by Brian Koropoff + +// save settings, set maximum eyecandy, take shot, restore settings + +// eyecandy settings for screenshots: +// crosshair 0 (off) +// r_dlight_lightmap 1 (on) +// r_shadows 1 (on) +// r_wateralpha 0.3 (translucent) +// show_fps 0 (off) + +domain sshot + +global rcsid = "$Id$" + +global cvars = crosshair r_dlight_lightmap r_shadows r_wateralpha show_fps + +function cvar::save { + for i in @args[1:] { + dprint "Saving cvar ", $i, ".\n" + global hold_$i = ${$i} + } +} + +function cvar::restore { + for i in @args[1:] { + dprint "Restoring cvar", $i, " to ", ${hold_$i}, ".\n" + set $i ${hold_$i} + } +} + +function sshot { + cvar::save @cvars + set crosshair 0 + set r_dlight_lightmap 1 + set r_shadows 1 + set r_wateralpha 0.3 + set show_fps 0 + wait + if (#args == 2) { // named screenshot + // find next available name + name_s = 0 + for name_t in `file::find qf???.tga` { + if (`slice $name_t 2 5` > $name_s) {break} + name_s = ($name_s + 1) + } + // take shot _now_ + screenshot + // pad & normalize source + name_s = "00", $name_s + name_s = "qf", `slice $name_s -3 0`, ".tga" + // destination specified with extension? + name_d = $args[1] + ifnot $(equal $(slice $name_d -4 0) ".tga") { + name_d = $name_d, ".tga" + } + // rename + file::move $name_s $name_d + } else { + screenshot // generic screenshot + } + wait + cvar::restore @cvars +} + +function::export sshot diff --git a/doc/config/gib/zoom.gib b/doc/config/gib/zoom.gib index 20a8c7359..c81a30deb 100644 --- a/doc/config/gib/zoom.gib +++ b/doc/config/gib/zoom.gib @@ -22,9 +22,11 @@ // 59 Temple Place - Suite 330 // Boston, MA 02111-1307, USA // -// $Id$ domain zoom + +global rcsid = "$Id$" + global amp global fov global min @@ -33,7 +35,7 @@ global step global mult global zoomed -// clamp returns the second argument clamped +// zoom::clamp returns the second argument clamped // between the first and third function zoom::clamp { if ($args[2] < $args[1]) {