} while(0)
// return smoothly faded pos and size of given panel when a dialog is active
-#define HUD_Panel_UpdatePosSize_ForMenu() do { \
- vector menu_enable_pos; \
- vector menu_enable_size = '0 0 0'; \
- float menu_enable_maxsize_x = 0.3 * vid_conwidth; \
- float menu_enable_maxsize_y = 0.18 * vid_conheight; \
- if (panel_size.x > panel_size.y) { \
- if (panel_size.y > menu_enable_maxsize_y) { \
- menu_enable_size.y = menu_enable_maxsize_y; \
- menu_enable_size.x = panel_size.x * (menu_enable_maxsize_y/panel_size.y); \
- panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * menu_enable_size; \
- } \
- menu_enable_pos = eX * 0.5 * vid_conwidth - eX * 0.5 * panel_size.x + eY * (vid_conheight - menu_enable_maxsize_y);\
- } else { \
- if (panel_size.x > menu_enable_maxsize_x) { \
- menu_enable_size.x = menu_enable_maxsize_x; \
- menu_enable_size.y = panel_size.y * (menu_enable_maxsize_x/panel_size.x); \
- panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * menu_enable_size; \
- } \
- menu_enable_pos = eY * 0.5 * vid_conheight - eY * 0.5 * panel_size.y + eX * (vid_conwidth - menu_enable_maxsize_x);\
- } \
- panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * menu_enable_pos; \
+// don't center too wide panels, it doesn't work with different resolutions
+#define HUD_Panel_UpdatePosSize_ForMenu() do { \
+ vector menu_enable_size = panel_size; \
+ float max_panel_width = 0.52 * vid_conwidth; \
+ if(panel_size.x > max_panel_width) \
+ { \
+ menu_enable_size.x = max_panel_width; \
+ menu_enable_size.y = panel_size.y * (menu_enable_size.x / panel_size.x); \
+ } \
+ vector menu_enable_pos = eX * (panel_bg_border + 0.5 * max_panel_width) + eY * 0.5 * vid_conheight - 0.5 * menu_enable_size; \
+ panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * menu_enable_pos; \
+ panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * menu_enable_size; \
} while(0)
// Scale the pos and size vectors to absolute coordinates
METHOD(Container, resizeNotifyLie, void(entity, vector, vector, vector, vector, .vector, .vector, .vector))
METHOD(Container, addItem, void(entity, entity, vector, vector, float))
METHOD(Container, addItemCentered, void(entity, entity, vector, float))
+ METHOD(Container, addItemRightCentered, void(entity, entity, vector, float))
METHOD(Container, moveItemAfter, void(entity, entity, entity))
METHOD(Container, removeItem, void(entity, entity))
METHOD(Container, setFocus, void(entity, entity))
me.addItem(me, other, '0.5 0.5 0' - 0.5 * theSize, theSize, theAlpha);
}
+void Container_addItemRightCentered(entity me, entity other, vector theSize, float theAlpha)
+{
+ me.addItem(me, other, '1 0.5 0' - 0.5 * theSize, theSize, theAlpha);
+}
+
void Container_addItem(entity me, entity other, vector theOrigin, vector theSize, float theAlpha)
{
if(other.parent)
i = spawnXonoticHUDNotificationDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDAmmoDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDHealthArmorDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDChatDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDModIconsDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDPowerupsDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDPressedKeysDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDRaceTimerDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDRadarDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDScoreDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDTimerDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDVoteDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDWeaponsDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDEngineInfoDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDInfoMessagesDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDPhysicsDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
-
- me.screenshotViewerDialog = i = spawnXonoticScreenshotViewerDialog();
- i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDCenterprintDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
i = spawnXonoticHUDBuffsDialog();
i.configureDialog(i);
- me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.addItemRightCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
// dialogs used by settings
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ // dialogs used by multiplayer/media
+ me.screenshotViewerDialog = i = spawnXonoticScreenshotViewerDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+
// mutator dialogs
i = spawnXonoticSandboxToolsDialog();
i.configureDialog(i);