From 3289f089c3b6f6196fe9508e7d3d48b32a42d10d Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Fri, 2 Nov 2007 20:42:47 +0000 Subject: * s/ui_loading/ui_hideCursor/ * Hide cursor when using edit fields and binding keys * Remove client side chat handling, moving it to UI module * Remove target and last attacker message modes * Add ui_developer cvar * Fix edit field bug where cvar changes under it * Add onTextEntry UI script event * Give the user some feedback when binding keys * Stop doing a UI refresh when primed (and remove cgame ui_loading sets) * Move cg_drawSnapshot to bottom of the screen --- ui/ingame_options.menu | 48 ++++------------------------------------------- ui/say.menu | 46 +++++++++++++++++++++++++++++++++++++++++++++ ui/tremulous.txt | 1 + ui/tremulous_common_hud.h | 2 +- 4 files changed, 52 insertions(+), 45 deletions(-) create mode 100644 ui/say.menu (limited to 'ui') diff --git a/ui/ingame_options.menu b/ui/ingame_options.menu index 74a42f76..3f2978a4 100644 --- a/ui/ingame_options.menu +++ b/ui/ingame_options.menu @@ -1177,46 +1177,6 @@ } } - itemDef - { - name misc - group optionsGrp - type ITEM_TYPE_BIND - text "Target Chat:" - cvar "messagemode3" - rect SCONTENT_X (SCONTENT_Y+(8*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER - textalignx SCONTENT_OFF - textscale .25 - forecolor 1 1 1 1 - visible MENU_FALSE - action - { - play "sound/misc/menu1.wav"; - } - } - - itemDef - { - name misc - group optionsGrp - type ITEM_TYPE_BIND - text "Attack Chat:" - cvar "messagemode4" - rect SCONTENT_X (SCONTENT_Y+(9*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER - textalignx SCONTENT_OFF - textscale .25 - forecolor 1 1 1 1 - visible MENU_FALSE - action - { - play "sound/misc/menu1.wav"; - } - } - itemDef { name misc @@ -1224,7 +1184,7 @@ type ITEM_TYPE_BIND text "Vote Yes:" cvar "vote yes" - rect SCONTENT_X (SCONTENT_Y+(10*ELEM_H)) SCONTENT_W ELEM_H + rect SCONTENT_X (SCONTENT_Y+(8*ELEM_H)) SCONTENT_W ELEM_H textalign ITEM_ALIGN_RIGHT textvalign ITEM_VALIGN_CENTER textalignx SCONTENT_OFF @@ -1244,7 +1204,7 @@ type ITEM_TYPE_BIND text "Vote No:" cvar "vote no" - rect SCONTENT_X (SCONTENT_Y+(11*ELEM_H)) SCONTENT_W ELEM_H + rect SCONTENT_X (SCONTENT_Y+(9*ELEM_H)) SCONTENT_W ELEM_H textalign ITEM_ALIGN_RIGHT textvalign ITEM_VALIGN_CENTER textalignx SCONTENT_OFF @@ -1264,7 +1224,7 @@ type ITEM_TYPE_BIND text "Team Vote Yes:" cvar "teamvote yes" - rect SCONTENT_X (SCONTENT_Y+(12*ELEM_H)) SCONTENT_W ELEM_H + rect SCONTENT_X (SCONTENT_Y+(10*ELEM_H)) SCONTENT_W ELEM_H textalign ITEM_ALIGN_RIGHT textvalign ITEM_VALIGN_CENTER textalignx SCONTENT_OFF @@ -1284,7 +1244,7 @@ type ITEM_TYPE_BIND text "Team Vote No:" cvar "teamvote no" - rect SCONTENT_X (SCONTENT_Y+(13*ELEM_H)) SCONTENT_W ELEM_H + rect SCONTENT_X (SCONTENT_Y+(11*ELEM_H)) SCONTENT_W ELEM_H textalign ITEM_ALIGN_RIGHT textvalign ITEM_VALIGN_CENTER textalignx SCONTENT_OFF diff --git a/ui/say.menu b/ui/say.menu new file mode 100644 index 00000000..089b1fea --- /dev/null +++ b/ui/say.menu @@ -0,0 +1,46 @@ +#include "ui/menudef.h" + +{ + +#define BORDER 10 + +#define X BORDER +#define Y 200 +#define W (640-(2*BORDER)) +#define H 40 + + menuDef + { + name say + fullScreen MENU_FALSE + visible MENU_TRUE + rect X Y W H + focusColor 1 1 1 1 + style WINDOW_STYLE_EMPTY + onOpen + { + setfocus say_field + } + + itemDef + { + name say_field + type ITEM_TYPE_EDITFIELD + style WINDOW_STYLE_EMPTY + text "Say:" + cvar "ui_sayBuffer" + maxchars 128 + rect 0 0 W H + textalign ITEM_ALIGN_LEFT + textvalign ITEM_VALIGN_CENTER + textscale .5 + forecolor 1 1 1 1 + visible MENU_TRUE + onTextEntry + { + uiScript Say; + close say + } + } + } +} diff --git a/ui/tremulous.txt b/ui/tremulous.txt index deb04d9a..e7732024 100644 --- a/ui/tremulous.txt +++ b/ui/tremulous.txt @@ -16,4 +16,5 @@ loadMenu { "ui/tremulous_alienupgrade.menu" } loadMenu { "ui/ptrc.menu" } + loadMenu { "ui/say.menu" } } diff --git a/ui/tremulous_common_hud.h b/ui/tremulous_common_hud.h index 025bc68e..ae85d7e5 100644 --- a/ui/tremulous_common_hud.h +++ b/ui/tremulous_common_hud.h @@ -134,7 +134,7 @@ itemDef itemDef { name "snapshot" - rect BORDER 196 MAIN_W STAT_H + rect BORDER (H-(BORDER+STAT_H)) MAIN_W STAT_H style WINDOW_STYLE_EMPTY visible MENU_TRUE decoration -- cgit