summaryrefslogtreecommitdiff
path: root/ui/tremulous_common_hud.h
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2007-10-30 18:18:47 +0000
committerTim Angus <tim@ngus.net>2007-10-30 18:18:47 +0000
commit1e0b515a6031a2cd2a77e9c34f2e4292fc9f9750 (patch)
tree51193c4f5cac62d5c5626c360c80218bc7fab71c /ui/tremulous_common_hud.h
parente552cbda632662d32ffccc662c6d12ec1cc54719 (diff)
* (bug 3384) Remove server side armoury refresh and replace with UI side
refresh * Add trap_Key_SetOverstrikeMode and trap_Key_GetOverstrikeMode to cgame * Change Text_[Width|Height] to return floats * Add Text_Em[Width|Height] * Add CG_AlignText to cut down on code duplication * Add itemDef_t::textvalignment for vertical text alignment * Add UI_DrawTextBlock to replace a lot of duplicate code * Rewrite text wrapping code from scratch so that it actually works * Add UI_OwnerDrawText * Add expression evaluator to .menu parser * Split off Border_Paint from Window_Paint * Scale slider items to fit their rect * Rework edit field widgets to behave somewhat more correctly * Fix a few listbox widget layout issues * Don't display scrollbars in "notselectable" listbox widgets * Make scoreboard team labels ownerdrawn * Menu script rework + Use the expression evaluator to replace lots and lots of absolute coords with relative ones, hopefully easing future maintenance + Remove lots and lots of textalign[xy] that were present to work around broken text alignment routines + Replace a bunch of numeric constants with ones from menudef.h + Compose the huds from tremulous_common_hud.h + Generally neaten things up + Lots of whitespace fixes
Diffstat (limited to 'ui/tremulous_common_hud.h')
-rw-r--r--ui/tremulous_common_hud.h158
1 files changed, 158 insertions, 0 deletions
diff --git a/ui/tremulous_common_hud.h b/ui/tremulous_common_hud.h
new file mode 100644
index 00000000..025bc68e
--- /dev/null
+++ b/ui/tremulous_common_hud.h
@@ -0,0 +1,158 @@
+#define BORDER 10
+
+#define STAT_W 45
+#define STAT_H 22
+#define STAT_X (W-(BORDER+STAT_W))
+
+#define CONSOLE_W (W-((3*BORDER)+STAT_W))
+#define CONSOLE_H 180
+#define MAIN_W (W-(2*BORDER))
+
+//CONSOLE
+itemDef
+{
+ name "console"
+ rect BORDER BORDER CONSOLE_W CONSOLE_H
+ style WINDOW_STYLE_EMPTY
+ visible MENU_TRUE
+ decoration
+ forecolor 1 1 1 1
+ textalign ITEM_ALIGN_LEFT
+ textvalign ITEM_VALIGN_TOP
+ textscale 0.4
+ textstyle ITEM_TEXTSTYLE_NORMAL
+ ownerdraw CG_CONSOLE
+}
+
+//TUTORIAL
+itemDef
+{
+ name "tutorial"
+ rect BORDER 250 MAIN_W 180
+ style WINDOW_STYLE_EMPTY
+ visible MENU_TRUE
+ decoration
+ forecolor 1 1 1 0.35
+ textalign ITEM_ALIGN_LEFT
+ textvalign ITEM_VALIGN_TOP
+ textscale 0.3
+ textstyle ITEM_TEXTSTYLE_NORMAL
+ ownerdraw CG_TUTORIAL
+}
+
+//FPS
+itemDef
+{
+ name "fps"
+ rect STAT_X BORDER STAT_W STAT_H
+ style WINDOW_STYLE_EMPTY
+ visible MENU_TRUE
+ decoration
+ forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 1
+ textalign ITEM_ALIGN_RIGHT
+ textvalign ITEM_VALIGN_CENTER
+ textscale 0.3
+ textstyle ITEM_TEXTSTYLE_NORMAL
+ ownerdraw CG_FPS
+}
+//TIMER
+itemDef
+{
+ name "timer"
+ rect STAT_X ((2*BORDER)+STAT_H) STAT_W STAT_H
+ style WINDOW_STYLE_EMPTY
+ visible MENU_TRUE
+ decoration
+ forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 1
+ textalign ITEM_ALIGN_RIGHT
+ textvalign ITEM_VALIGN_CENTER
+ textscale 0.3
+ textstyle ITEM_TEXTSTYLE_NORMAL
+ ownerdraw CG_TIMER
+}
+//LAGOMETER
+itemDef
+{
+ name "lagometer"
+ rect STAT_X ((3*BORDER)+(2*STAT_H)) STAT_W STAT_H
+ style WINDOW_STYLE_EMPTY
+ visible MENU_TRUE
+ decoration
+ forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 1
+ textscale 0.3
+ textalignx 1
+ textaligny 0.5
+ ownerdraw CG_LAGOMETER
+}
+//CLOCK
+itemDef
+{
+ name "clock"
+ rect 572 90 56 22
+ rect STAT_X ((4*BORDER)+(3*STAT_H)) STAT_W STAT_H
+ style WINDOW_STYLE_EMPTY
+ visible MENU_TRUE
+ decoration
+ forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 1
+ textalign ITEM_ALIGN_RIGHT
+ textvalign ITEM_VALIGN_CENTER
+ textscale 0.25
+ textstyle ITEM_TEXTSTYLE_NORMAL
+ ownerdraw CG_CLOCK
+}
+//DEMO STATE
+itemDef
+{
+ name "demoRecording"
+ rect (STAT_X+(STAT_W-32)) ((5*BORDER)+(4*STAT_H)) 32 32
+ style WINDOW_STYLE_EMPTY
+ visible MENU_TRUE
+ decoration
+ forecolor 1 0 0 1
+ textscale 0.3
+ textalignx 1
+ textaligny 0.5
+ ownerdraw CG_DEMO_RECORDING
+ background "ui/assets/neutral/circle.tga"
+}
+itemDef
+{
+ name "demoPlayback"
+ rect (STAT_X+(STAT_W-32)) ((5*BORDER)+(4*STAT_H)) 32 32
+ style WINDOW_STYLE_EMPTY
+ visible MENU_TRUE
+ decoration
+ forecolor 1 1 1 1
+ textscale 0.3
+ textalignx 1
+ textaligny 0.5
+ ownerdraw CG_DEMO_PLAYBACK
+ background "ui/assets/forwardarrow.tga"
+}
+
+//SNAPSHOT
+itemDef
+{
+ name "snapshot"
+ rect BORDER 196 MAIN_W STAT_H
+ style WINDOW_STYLE_EMPTY
+ visible MENU_TRUE
+ decoration
+ forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 1
+ textalign ITEM_ALIGN_LEFT
+ textvalign ITEM_VALIGN_CENTER
+ textscale 0.4
+ textstyle ITEM_TEXTSTYLE_NORMAL
+ ownerdraw CG_SNAPSHOT
+}
+
+//PLAYER NAME
+itemDef
+{
+ name "playername"
+ rect 200 275 240 25
+ visible MENU_TRUE
+ decoration
+ textScale .5
+ ownerdraw CG_PLAYER_CROSSHAIRNAMES
+}