UI vectors + bot menu

This commit is contained in:
Tomi Isoaho 2011-02-25 02:12:08 +00:00
parent a021d87d84
commit 185872b141
2 changed files with 139 additions and 130 deletions

View file

@ -3101,20 +3101,29 @@ static void UI_DrawBotName(rectDef_t * rect, float scale, vec4_t color, int text
} }
text = UI_GetBotNameByNumber(value); text = UI_GetBotNameByNumber(value);
// } // }
Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, 0, textStyle, qfalse); if (rect->hasVectors)
Text_PaintAngled(rect->x, rect->y, rect->u, rect->v, scale, color, text, 0, 0, 0, textStyle, qfalse);
else
Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, 0, textStyle, qfalse);
} }
static void UI_DrawBotSkill(rectDef_t * rect, float scale, vec4_t color, int textStyle) static void UI_DrawBotSkill(rectDef_t * rect, float scale, vec4_t color, int textStyle)
{ {
if (uiInfo.skillIndex >= 0 && uiInfo.skillIndex < numSkillLevels) { if (uiInfo.skillIndex >= 0 && uiInfo.skillIndex < numSkillLevels) {
Text_Paint(rect->x, rect->y, scale, color, skillLevels[uiInfo.skillIndex], 0, 0, 0, textStyle, qfalse); if (rect->hasVectors)
Text_PaintAngled(rect->x, rect->y, rect->u, rect->v, scale, color, skillLevels[uiInfo.skillIndex], 0, 0, 0, textStyle, qfalse);
else
Text_Paint(rect->x, rect->y, scale, color, skillLevels[uiInfo.skillIndex], 0, 0, 0, textStyle, qfalse);
} }
} }
static void UI_DrawRedBlue(rectDef_t * rect, float scale, vec4_t color, int textStyle) static void UI_DrawRedBlue(rectDef_t * rect, float scale, vec4_t color, int textStyle)
{ {
//Makro - added Team 1/2 //Makro - added Team 1/2
Text_Paint(rect->x, rect->y, scale, color, (uiInfo.redBlue == 0) ? "1 (Red)" : "2 (Blue)", 0, 0, 0, textStyle, qfalse); if (rect->hasVectors)
Text_PaintAngled(rect->x, rect->y, rect->u, rect->v, scale, color, (uiInfo.redBlue == 0) ? "1 (Red)" : "2 (Blue)", 0, 0, 0, textStyle, qfalse);
else
Text_Paint(rect->x, rect->y, scale, color, (uiInfo.redBlue == 0) ? "1 (Red)" : "2 (Blue)", 0, 0, 0, textStyle, qfalse);
} }
static void UI_DrawCrosshair(rectDef_t * rect, float scale) static void UI_DrawCrosshair(rectDef_t * rect, float scale)

View file

@ -1,131 +1,131 @@
#include "ui/menudef.h" #include "ui/menudef.h"
#define FADEIN_TIME 125
#define ANGLES -8 -98
{ {
menuDef {
name "ingame_addbot"
visible 0
fullscreen 0
rect 40 32 232 160
anglevectors ANGLES
focusColor RQ3_MAIN_FOCUSCOLOR
popup
style WINDOW_STYLE_EMPTY
onOOBClick { close _self ; open _prev }
onOpen {
play "sound/ui/whoosh3.wav" ;
setitemcolor window forecolor 5 5 5 0 ;
timefade window forecolor 5 5 5 1 0 FADEIN_TIME ;
setfocus "botname"
}
onESC { close _self ; open _prev }
menuDef { itemDef {
name "ingame_addbot" renderpoint
visible 0 name "paper"
fullscreen 0 menuAnchor
//outOfBoundsClick // this closes the window if it gets a click out of the rectangle group window
onOOBClick { close _self ; open _prev } style WINDOW_STYLE_SHADER
rect 384 64 152 128 background UI_ASSETS"/paper_1"
disableColor .5 .5 .5 1 forecolor .92 .97 1 1
focusColor 1 .75 0 1 // Menu focus color for text and items rect -4 -12 256 192
style 1 anglevectors ANGLES
shadowStyle 1 visible 1
onOpen { play "sound/misc/menu1.wav" ; setfocus "ig-bot-name" } decoration
}
//Window // TITLE //
itemdef { itemDef {
rect 0 0 152 128 renderpoint
style WINDOW_STYLE_FILLED name "title"
backcolor Ig_Window_Color text "Add bot:"
visible 1 forecolor .6 .0 .0 1
border 1 style WINDOW_STYLE_EMPTY
bordersize 1 textalign ITEM_ALIGN_LEFT
bordercolor Ig_Window_BorderColor textalignx 0
decoration textaligny 12
} textscale RQ3_MAIN_TEXTSIZE
alignrect paper ITEM_ALIGN_LEFT 28 36 240 36
visible 1
autowrapped
decoration
}
itemdef { // BUTTONS //
rect 33 1 120 24
style WINDOW_STYLE_SHADER
background "ui/assets/rq3-ingame-title"
visible 1
decoration
}
itemdef {
rect 33 1 120 24
style WINDOW_STYLE_EMPTY
forecolor Ig_Window_TitleColor
textstyle ITEM_TEXTSTYLE_NORMAL
textscale .225
textalign ITEM_ALIGN_LEFT
textalignx 24
textaligny 16
text "Add bot"
visible 1
decoration
}
//Objects // NAME //
itemdef { itemDef {
name "ig-bot-name" name "botname"
style WINDOW_STYLE_EMPTY text "^_N^_ame:"
text "^_N^_ame:" shortcutKey "N"
shortcutKey "N" ownerdraw UI_BOTNAME
ownerdraw UI_BOTNAME textscale .225
rect 0 32 128 20 style WINDOW_STYLE_EMPTY
textalign ITEM_ALIGN_RIGHT alignrect "title" ITEM_ALIGN_LEFT 32 20 128 20
textalignx 48 textalign 1
textaligny 18 textalignx 8
textscale .225 textaligny 16
forecolor 1 1 1 1 forecolor 0 0 0 1
border 0 visible 1
bordercolor 0 0 0 0 }
visible 1
}
itemdef { // SKILL //
name "ig-bot-team"
style WINDOW_STYLE_EMPTY
text "^_T^_eam:"
shortcutKey "T"
ownerdraw UI_REDBLUE
rect 0 52 128 20
textalign ITEM_ALIGN_RIGHT
textalignx 48
textaligny 18
textscale .225
cvarTest "g_gametype"
disableCvar { "0" ; "1" }
forecolor 1 1 1 1
border 0
bordercolor 0 0 0 0
visible 1
}
itemdef { itemDef {
name "ig-bot-skill" name "botskill"
style WINDOW_STYLE_EMPTY text "^_S^_kill:"
text "^_S^_kill:" shortcutKey "S"
shortcutKey "S" ownerdraw UI_BOTSKILL
ownerdraw UI_BOTSKILL textscale .225
rect 0 72 128 20 style WINDOW_STYLE_EMPTY
textalign ITEM_ALIGN_RIGHT alignrect "botname" ITEM_ALIGN_LEFT 0 20 128 20
textalignx 48 textalign 1
textaligny 18 textalignx 10
textscale .225 textaligny 16
forecolor 1 1 1 1 forecolor 0 0 0 1
border 0 visible 1
bordercolor 0 0 0 0 }
visible 1
}
itemdef { // TEAM //
name ok
rect 80 100 64 20 itemDef {
style WINDOW_STYLE_FILLED name "botteam"
type ITEM_TYPE_BUTTON text "^_T^_eam:"
textstyle ITEM_TEXTSTYLE_NORMAL shortcutKey "T"
textscale .225 ownerdraw UI_REDBLUE
textalign ITEM_ALIGN_CENTER textscale .225
textalignx 32 style WINDOW_STYLE_EMPTY
textaligny 14 alignrect "botskill" ITEM_ALIGN_LEFT 0 20 128 20
text "^_O^_k" textalign 1
shortcutKey "O" textalignx 8
border 1 textaligny 16
bordersize 1 forecolor 0 0 0 1
backcolor Ig_Sub_Color1 visible 1
forecolor Ig_Sub_TextColor cvarTest "g_gametype"
bordercolor Ig_Sub_BorderColor1 disableCvar { "0" ; "1" }
visible 1 //style WINDOW_STYLE_FILLED
action { play "sound/misc/menu1.wav" ; uiScript addBot ; uiScript closeingame } //backcolor 0 0 0 .25
onFocus { setcolor backcolor Ig_Sub_Color2 ; setcolor bordercolor Ig_Sub_BorderColor2 } }
leaveFocus { setcolor backcolor Ig_Sub_Color1 ; setcolor bordercolor Ig_Sub_BorderColor1 }
} // OK //
}
itemDef {
text "^_O^_K"
shortcutKey "O"
type ITEM_TYPE_BUTTON
textscale .225
style WINDOW_STYLE_EMPTY
alignrect "botteam" ITEM_ALIGN_LEFT 112 20 60 20
textalign 1
textalignx 8
textaligny 16
forecolor 0 0 0 1
visible 1
action { play "sound/ui/whoosh3.wav" ; uiScript addBot }
}
}
} }