visible grid (optional) for the configuration mode!
authorFruitieX <rasse@rasse-lappy.localdomain>
Sun, 6 Jun 2010 16:08:55 +0000 (19:08 +0300)
committerFruitieX <rasse@rasse-lappy.localdomain>
Sun, 6 Jun 2010 16:08:55 +0000 (19:08 +0300)
defaultXonotic.cfg
qcsrc/client/hud.qc

index 4a44930..0ab71ad 100644 (file)
@@ -1336,6 +1336,7 @@ seta hud_configure_bg_minalpha 0.5 "minimum panel background alpha when in hud c
 seta hud_configure_grid 1 "snap to grid when moving/resizing panels"
 seta hud_configure_grid_x 10 "snap each X pixels"
 seta hud_configure_grid_y 10 "snap each Y pixels"
+seta hud_configure_grid_alpha 0.15 "alpha for visible grid when in configure mode"
 
 seta hud_dock "dock" "enable a fullscreen background for the hud, useful for creating artificial docks, \"\" = disable"
 seta hud_dock_color "0 0.6 0.9" "dock color, accepts \"shirt\" and \"pants\""
index 88d94c6..962c95c 100644 (file)
@@ -3276,6 +3276,23 @@ void HUD_Main (void)
        hud_configure = cvar("_hud_configure");
 
        // Drawing stuff
+
+       // HUD configure visible grid
+       if(hud_configure && cvar("hud_configure_grid") && cvar("hud_configure_grid_alpha"))
+       {
+               float i;
+               // x-axis
+               for(i = 0; i < vid_conwidth/cvar("hud_configure_grid_x"); ++i)
+               {
+                       drawfill(eX * i * cvar("hud_configure_grid_x"), eX + eY * vid_conheight, '0.5 0.5 0.5', cvar("hud_configure_grid_alpha"), DRAWFLAG_NORMAL);
+               }
+               // y-axis
+               for(i = 0; i < vid_conheight/cvar("hud_configure_grid_y"); ++i)
+               {
+                       drawfill(eY * i * cvar("hud_configure_grid_y"), eY + eX * vid_conwidth, '0.5 0.5 0.5', cvar("hud_configure_grid_alpha"), DRAWFLAG_NORMAL);
+               }
+       }
+
        if(cvar_string("hud_dock") != "")
                drawpic_skin('0 0 0', cvar_string("hud_dock"), eX * vid_conwidth + eY * vid_conheight, HUD_Panel_Dock_GetColor(), cvar("hud_dock_alpha"), DRAWFLAG_NORMAL);