r3288 - in trunk/data: . gfx/menu/default gfx/menu/xaw qcsrc/menu
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat Jan 26 16:18:44 EST 2008
Author: div0
Date: 2008-01-26 16:18:44 -0500 (Sat, 26 Jan 2008)
New Revision: 3288
Added:
trunk/data/gfx/menu/default/background_ingame.tga
Modified:
trunk/data/gfx/menu/default/background.tga
trunk/data/gfx/menu/default/skinvalues.txt
trunk/data/gfx/menu/xaw/skinvalues.txt
trunk/data/keybinds.txt
trunk/data/qcsrc/menu/menu.qc
trunk/data/qcsrc/menu/skin-customizables.inc
Log:
fix userbinds;
menu uses background image background_ingame.tga from skin, with ALPHA_BACKGROUND_INGAME, to darken the background in game
Modified: trunk/data/gfx/menu/default/background.tga
===================================================================
(Binary files differ)
Added: trunk/data/gfx/menu/default/background_ingame.tga
===================================================================
(Binary files differ)
Property changes on: trunk/data/gfx/menu/default/background_ingame.tga
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/data/gfx/menu/default/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/default/skinvalues.txt 2008-01-26 20:58:53 UTC (rev 3287)
+++ trunk/data/gfx/menu/default/skinvalues.txt 2008-01-26 21:18:44 UTC (rev 3288)
@@ -32,6 +32,8 @@
// general
// uses "background" images
+// uses "background_ingame" images
+ALPHA_BACKGROUND_INGAME 0.7
ALPHA_DISABLED 0.2
ALPHA_BEHIND 0.5
Modified: trunk/data/gfx/menu/xaw/skinvalues.txt
===================================================================
--- trunk/data/gfx/menu/xaw/skinvalues.txt 2008-01-26 20:58:53 UTC (rev 3287)
+++ trunk/data/gfx/menu/xaw/skinvalues.txt 2008-01-26 21:18:44 UTC (rev 3288)
@@ -32,6 +32,8 @@
// general
// uses background.tga
+// uses "background_ingame" images
+ALPHA_BACKGROUND_INGAME 0
ALPHA_DISABLED 0.2
ALPHA_BEHIND 1
Modified: trunk/data/keybinds.txt
===================================================================
--- trunk/data/keybinds.txt 2008-01-26 20:58:53 UTC (rev 3287)
+++ trunk/data/keybinds.txt 2008-01-26 21:18:44 UTC (rev 3288)
@@ -52,19 +52,19 @@
"+use" "drop key"
"" ""
"" "User defined"
-"+userbind 1" ""
-"+userbind 2" ""
-"+userbind 3" ""
-"+userbind 4" ""
-"+userbind 5" ""
-"+userbind 6" ""
-"+userbind 7" ""
-"+userbind 8" ""
-"+userbind 9" ""
-"+userbind 10" ""
-"+userbind 11" ""
-"+userbind 12" ""
-"+userbind 13" ""
-"+userbind 14" ""
-"+userbind 15" ""
-"+userbind 16" ""
+"+userbind 1" "$userbind1"
+"+userbind 2" "$userbind2"
+"+userbind 3" "$userbind3"
+"+userbind 4" "$userbind4"
+"+userbind 5" "$userbind5"
+"+userbind 6" "$userbind6"
+"+userbind 7" "$userbind7"
+"+userbind 8" "$userbind8"
+"+userbind 9" "$userbind9"
+"+userbind 10" "$userbind10"
+"+userbind 11" "$userbind11"
+"+userbind 12" "$userbind12"
+"+userbind 13" "$userbind13"
+"+userbind 14" "$userbind14"
+"+userbind 15" "$userbind15"
+"+userbind 16" "$userbind16"
Modified: trunk/data/qcsrc/menu/menu.qc
===================================================================
--- trunk/data/qcsrc/menu/menu.qc 2008-01-26 20:58:53 UTC (rev 3287)
+++ trunk/data/qcsrc/menu/menu.qc 2008-01-26 21:18:44 UTC (rev 3288)
@@ -165,6 +165,29 @@
if(key == K_SHIFT) menuShiftState |= S_SHIFT;
};
+void(string img, float a) drawBackground =
+{
+ vector sz;
+ vector isz;
+ sz = draw_PictureSize(img);
+ // keep aspect of image
+ if(sz_x * draw_scale_y >= sz_y * draw_scale_x)
+ {
+ // that is, sz_x/sz_y >= draw_scale_x/draw_scale_y
+ // match up the height
+ isz_y = 1;
+ isz_x = isz_y * (sz_x / sz_y) * (draw_scale_y / draw_scale_x);
+ }
+ else
+ {
+ // that is, sz_x/sz_y <= draw_scale_x/draw_scale_y
+ // match up the width
+ isz_x = 1;
+ isz_y = isz_x * (sz_y / sz_x) * (draw_scale_x / draw_scale_y);
+ }
+ draw_Picture('0.5 0.5 0' - 0.5 * isz, img, isz, '1 1 1', a);
+}
+
void() m_draw =
{
float t;
@@ -243,34 +266,24 @@
draw_reset();
- if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)) && menuLogoAlpha > 0)
+ if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER)))
{
- vector sz;
- vector isz;
- sz = draw_PictureSize(SKINGFX_BACKGROUND);
- // keep aspect of image
- if(sz_x * draw_scale_y >= sz_y * draw_scale_x)
+ if(menuLogoAlpha > 0)
{
- // that is, sz_x/sz_y >= draw_scale_x/draw_scale_y
- // match up the height
- isz_y = 1;
- isz_x = isz_y * (sz_x / sz_y) * (draw_scale_y / draw_scale_x);
+ drawBackground(SKINGFX_BACKGROUND, bound(0, menuLogoAlpha, 1));
+ if(menuAlpha <= 0 && SKINALPHA_CURSOR_INTRO > 0)
+ {
+ draw_alpha = SKINALPHA_CURSOR_INTRO * bound(0, menuLogoAlpha, 1);
+ draw_drawMousePointer(menuMousePos);
+ draw_alpha = 1;
+ }
}
- else
- {
- // that is, sz_x/sz_y <= draw_scale_x/draw_scale_y
- // match up the width
- isz_x = 1;
- isz_y = isz_x * (sz_y / sz_x) * (draw_scale_x / draw_scale_y);
- }
- draw_Picture('0.5 0.5 0' - 0.5 * isz, SKINGFX_BACKGROUND, isz, '1 1 1', bound(0, menuLogoAlpha, 1));
- if(menuAlpha <= 0 && SKINALPHA_CURSOR_INTRO > 0)
- {
- draw_alpha = SKINALPHA_CURSOR_INTRO * bound(0, menuLogoAlpha, 1);
- draw_drawMousePointer(menuMousePos);
- draw_alpha = 1;
- }
}
+ else if(SKINALPHA_BACKGROUND_INGAME)
+ {
+ if(menuAlpha > 0)
+ drawBackground(SKINGFX_BACKGROUND_INGAME, menuAlpha * SKINALPHA_BACKGROUND_INGAME);
+ }
draw_reset();
preMenuDraw();
Modified: trunk/data/qcsrc/menu/skin-customizables.inc
===================================================================
--- trunk/data/qcsrc/menu/skin-customizables.inc 2008-01-26 20:58:53 UTC (rev 3287)
+++ trunk/data/qcsrc/menu/skin-customizables.inc 2008-01-26 21:18:44 UTC (rev 3288)
@@ -64,6 +64,8 @@
// general
SKINSTRING(GFX_BACKGROUND, "background");
+ SKINSTRING(GFX_BACKGROUND_INGAME, "background_ingame");
+ SKINFLOAT(ALPHA_BACKGROUND_INGAME, 0);
SKINFLOAT(ALPHA_DISABLED, 0.2);
SKINFLOAT(ALPHA_BEHIND, 0.5);
More information about the nexuiz-commits
mailing list