69 lines
No EOL
2.5 KiB
Text
69 lines
No EOL
2.5 KiB
Text
#include <guis/common/colors.include>
|
|
#include <guis/game/hud/hud.include>
|
|
//#include <guis/game/sights/assaultrifle_lines.include>
|
|
#include <guis/game/sights/generic_scope.include>
|
|
|
|
gui game/sights/assaultrifle_scope {
|
|
properties {
|
|
string range = "";
|
|
float zoomState = 0;
|
|
float zoomCycleTransition = 1.f;
|
|
float zoomCycleTransitionLerp = 1.f;
|
|
float flags = immediate( flags ) | GUI_FULLSCREEN;
|
|
}
|
|
events {
|
|
onActivate {
|
|
globals.gameHud.showPostProcess = immediate( globals.gameHud.showPostProcess + 1 );
|
|
}
|
|
onDeactivate {
|
|
globals.gameHud.showPostProcess = immediate( globals.gameHud.showPostProcess - 1 );
|
|
}
|
|
onNamedEvent "onZoomCycle" {
|
|
zoomCycleTransitionLerp = transition( "0", "1", 200 );
|
|
}
|
|
}
|
|
|
|
materials {
|
|
"ring_tl" "guis/assets/weapons/sniper/ring"
|
|
"ring_tr" "guis/assets/weapons/sniper/ring, flipX"
|
|
"ring_bl" "guis/assets/weapons/sniper/ring, flipY"
|
|
"ring_br" "guis/assets/weapons/sniper/ring, flipX, flipY"
|
|
|
|
"crosshair_tl" "guis/assets/weapons/sniper/crosshair"
|
|
"crosshair_br" "guis/assets/weapons/sniper/crosshair, flipX, flipY"
|
|
}
|
|
|
|
_hud_materials
|
|
|
|
windowDef desktop {
|
|
properties {
|
|
rect rect = 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT;
|
|
}
|
|
//__assaultrifle_lines( "noborder", "nocircles" )
|
|
|
|
windowDef draw {
|
|
properties {
|
|
handle ringTL = gui.cacheMaterial( "ringTL", "ring_tl" );
|
|
handle ringTR = gui.cacheMaterial( "ringTR", "ring_tr" );
|
|
handle ringBL = gui.cacheMaterial( "ringBL", "ring_bl" );
|
|
handle ringBR = gui.cacheMaterial( "ringBR", "ring_br" );
|
|
|
|
handle crosshairTL = gui.cacheMaterial( "crosshairTL", "crosshair_tl" );
|
|
handle crosshairBR = gui.cacheMaterial( "crosshairBR", "crosshair_br" );
|
|
}
|
|
events {
|
|
onPreDraw {
|
|
drawCachedMaterial( ringTL, "immediate( gui.screenCenter.x ) - 230, 10, 230, 230", COLOR_WHITE );
|
|
drawCachedMaterial( ringTR, "immediate( gui.screenCenter.x ), 10, 230, 230", COLOR_WHITE );
|
|
drawCachedMaterial( ringBL, "immediate( gui.screenCenter.x ) - 230, 240, 230, 230", COLOR_WHITE );
|
|
drawCachedMaterial( ringBR, "immediate( gui.screenCenter.x ), 240, 230, 230", COLOR_WHITE );
|
|
drawCachedMaterial( crosshairTL, "immediate( gui.screenCenter.x ) - 52.9, immediate( gui.screenCenter.y ) - 52.9, 53, 53", COLOR_WHITE );
|
|
drawCachedMaterial( crosshairBR, "immediate( gui.screenCenter.x ), immediate( gui.screenCenter.y ), 53, 53", COLOR_WHITE );
|
|
gui.scriptPushFloat( false );
|
|
}
|
|
}
|
|
}
|
|
|
|
__scope_info( "nozoom", "longrange", "0.3, 1, 0.2, 0.7" )
|
|
}
|
|
} |