- 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)
- pos_y = pos_y - vid_conheight;
+ if(cvar("hud_configure_checkcollisions")) {
+ mySize = HUD_Panel_CheckResize(id, myPos, mySize);
+ myPos = HUD_Panel_CheckMove(id, myPos, mySize);
+ }
+
+ mySize_x = bound(0.025 * vid_conwidth, mySize_x, vid_conwidth - myPos_x);
+ mySize_y = bound(0.025 * vid_conheight, mySize_y, vid_conheight - myPos_y);
+
+ if(oldSize_x == mySize_x)
+ myPos_x = oldPos_x;
+ if(oldSize_y == mySize_y)
+ myPos_y = oldPos_y;
+
+ myPos_x = bound(0, myPos_x, vid_conwidth - mySize_x);
+ myPos_y = bound(0, myPos_y, vid_conheight - mySize_y);
+
+ if(cvar("hud_configure_grid"))
+ {
+ myPos_x = floor(myPos_x/cvar("hud_configure_grid_x") + 0.5) * cvar("hud_configure_grid_x");
+ myPos_y = floor(myPos_y/cvar("hud_configure_grid_y") + 0.5) * cvar("hud_configure_grid_y");
+ }
+
+ if (myPos_x + 0.5 * mySize_x > 0.5 * vid_conwidth)
+ myPos_x = myPos_x - vid_conwidth;
+ if (myPos_y + 0.5 * mySize_y > 0.5 * vid_conheight)
+ myPos_y = myPos_y - vid_conheight;
+ */