seta hud_configure_checkcollisions 1 "check for collisions against other panels when in hud configure mode"
seta hud_configure_bg_minalpha 0.5 "minimum panel background alpha when in hud configure mode"
+seta hud_configure_grid 0 "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_dock 1 "enable/disable a fullscreen background for the hud, useful for creating artificial docks"
seta hud_dock_color "0 0.6 0.9" "dock color"
//mySize_x = bound(0.025 * vid_conwidth, mySize_x, vid_conwidth);
//mySize_y = bound(0.025 * vid_conheight, mySize_y, vid_conheight);
+ if(cvar("hud_configure_grid"))
+ {
+ mySize_x = floor(mySize_x/cvar("hud_configure_grid_x") + 0.5) * cvar("hud_configure_grid_x");
+ mySize_y = floor(mySize_y/cvar("hud_configure_grid_y") + 0.5) * cvar("hud_configure_grid_y");
+ }
+
// TODO: is this needed?
// this is to check if (and how) SetPos should be called
if(mySize_x == oldSize_x && mySize_y == oldSize_y)
pos_x = bound(0, pos_x, vid_conwidth - mySize_x);
pos_y = bound(0, pos_y, vid_conheight - mySize_y);
+ if(cvar("hud_configure_grid"))
+ {
+ pos_x = floor(pos_x/cvar("hud_configure_grid_x") + 0.5) * cvar("hud_configure_grid_x");
+ pos_y = floor(pos_y/cvar("hud_configure_grid_y") + 0.5) * cvar("hud_configure_grid_y");
+ }
+
if (pos_x + 0.5 * mySize_x > 0.5 * vid_conwidth)
pos_x = pos_x - vid_conwidth;
if (pos_y + 0.5 * mySize_y > 0.5 * vid_conheight)