mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-30 04:30:43 +00:00
876eaa467c
The player global branch variable is now updated with useful information and the location.get builtin is available to return the current location of the player based on loc files. Fixed a bug with zooming out in zoom.gib.
100 lines
2.3 KiB
Text
100 lines
2.3 KiB
Text
// zoom.gib
|
|
//
|
|
// zoom script 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$
|
|
|
|
global zoom
|
|
|
|
function "zoom.init" { // Initialize basic options
|
|
if ($argc != 6) {
|
|
echo "Usage: $0 base_amp base_fov min_zoom max_zoom zoom_step"
|
|
return
|
|
}
|
|
zoom.amp = $1
|
|
zoom.fov = $2
|
|
zoom.mult.lower = $3
|
|
zoom.mult = $3
|
|
zoom.mult.upper = $4
|
|
zoom.mult.step = $5
|
|
zoom.zoomed = 0
|
|
set fov ${zoom.fov}
|
|
set in_amp ${zoom.amp}
|
|
}
|
|
|
|
// Default initial values
|
|
zoom.init 1 90 1 90 1.15
|
|
|
|
function "zoom.adjust" { // Adjust fov and sensitivity to match zoom factor
|
|
if ${zoom.zoomed} {
|
|
set fov (${zoom.fov}/${zoom.mult})
|
|
set in_amp (${zoom.amp}/${zoom.mult})
|
|
return
|
|
} else {
|
|
set fov ${zoom.fov}
|
|
set in_amp ${zoom.amp}
|
|
}
|
|
}
|
|
|
|
function "zoom.in" { // Replaced ID zoom function
|
|
zoom.zoomed = 1
|
|
zoom.adjust
|
|
}
|
|
|
|
function "zoom.out" { // Replaced ID zoom function
|
|
zoom.zoomed = 0
|
|
zoom.adjust
|
|
}
|
|
|
|
function "zoom.toggle" {
|
|
zoom.zoomed = (!${zoom.zoomed})
|
|
zoom.adjust
|
|
}
|
|
|
|
function "zoom.increase" {
|
|
ifnot ${zoom.zoomed} {
|
|
return
|
|
}
|
|
zoom.mult = (${zoom.mult.step}*${zoom.mult})
|
|
if (${zoom.mult} > ${zoom.mult.upper}) {
|
|
zoom.mult = ${zoom.mult.upper}
|
|
}
|
|
zoom.adjust
|
|
}
|
|
|
|
function "zoom.decrease" {
|
|
ifnot ${zoom.zoomed} return
|
|
zoom.mult = (${zoom.mult}/${zoom.mult.step})
|
|
if (${zoom.mult} < ${zoom.mult.lower}) {
|
|
zoom.mult = ${zoom.mult.lower}
|
|
}
|
|
zoom.adjust
|
|
}
|
|
|
|
export zoom.init
|
|
export zoom.increase
|
|
export zoom.decrease
|
|
export zoom.in
|
|
export zoom.out
|
|
export zoom.toggle
|
|
|