mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-10 07:11:36 +00:00
UI vectors + bot menu
This commit is contained in:
parent
a021d87d84
commit
185872b141
2 changed files with 139 additions and 130 deletions
|
@ -3101,12 +3101,18 @@ static void UI_DrawBotName(rectDef_t * rect, float scale, vec4_t color, int text
|
||||||
}
|
}
|
||||||
text = UI_GetBotNameByNumber(value);
|
text = UI_GetBotNameByNumber(value);
|
||||||
// }
|
// }
|
||||||
|
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);
|
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) {
|
||||||
|
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);
|
Text_Paint(rect->x, rect->y, scale, color, skillLevels[uiInfo.skillIndex], 0, 0, 0, textStyle, qfalse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3114,6 +3120,9 @@ static void UI_DrawBotSkill(rectDef_t * rect, float scale, vec4_t color, int tex
|
||||||
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
|
||||||
|
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);
|
Text_Paint(rect->x, rect->y, scale, color, (uiInfo.redBlue == 0) ? "1 (Red)" : "2 (Blue)", 0, 0, 0, textStyle, qfalse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,131 +1,131 @@
|
||||||
#include "ui/menudef.h"
|
#include "ui/menudef.h"
|
||||||
|
#define FADEIN_TIME 125
|
||||||
|
#define ANGLES -8 -98
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
menuDef {
|
menuDef {
|
||||||
name "ingame_addbot"
|
name "ingame_addbot"
|
||||||
visible 0
|
visible 0
|
||||||
fullscreen 0
|
fullscreen 0
|
||||||
//outOfBoundsClick // this closes the window if it gets a click out of the rectangle
|
rect 40 32 232 160
|
||||||
|
anglevectors ANGLES
|
||||||
|
focusColor RQ3_MAIN_FOCUSCOLOR
|
||||||
|
popup
|
||||||
|
style WINDOW_STYLE_EMPTY
|
||||||
onOOBClick { close _self ; open _prev }
|
onOOBClick { close _self ; open _prev }
|
||||||
rect 384 64 152 128
|
onOpen {
|
||||||
disableColor .5 .5 .5 1
|
play "sound/ui/whoosh3.wav" ;
|
||||||
focusColor 1 .75 0 1 // Menu focus color for text and items
|
setitemcolor window forecolor 5 5 5 0 ;
|
||||||
style 1
|
timefade window forecolor 5 5 5 1 0 FADEIN_TIME ;
|
||||||
shadowStyle 1
|
setfocus "botname"
|
||||||
onOpen { play "sound/misc/menu1.wav" ; setfocus "ig-bot-name" }
|
|
||||||
|
|
||||||
//Window
|
|
||||||
|
|
||||||
itemdef {
|
|
||||||
rect 0 0 152 128
|
|
||||||
style WINDOW_STYLE_FILLED
|
|
||||||
backcolor Ig_Window_Color
|
|
||||||
visible 1
|
|
||||||
border 1
|
|
||||||
bordersize 1
|
|
||||||
bordercolor Ig_Window_BorderColor
|
|
||||||
decoration
|
|
||||||
}
|
}
|
||||||
|
onESC { close _self ; open _prev }
|
||||||
|
|
||||||
itemdef {
|
itemDef {
|
||||||
rect 33 1 120 24
|
renderpoint
|
||||||
|
name "paper"
|
||||||
|
menuAnchor
|
||||||
|
group window
|
||||||
style WINDOW_STYLE_SHADER
|
style WINDOW_STYLE_SHADER
|
||||||
background "ui/assets/rq3-ingame-title"
|
background UI_ASSETS"/paper_1"
|
||||||
|
forecolor .92 .97 1 1
|
||||||
|
rect -4 -12 256 192
|
||||||
|
anglevectors ANGLES
|
||||||
visible 1
|
visible 1
|
||||||
decoration
|
decoration
|
||||||
}
|
}
|
||||||
|
|
||||||
itemdef {
|
// TITLE //
|
||||||
rect 33 1 120 24
|
|
||||||
|
itemDef {
|
||||||
|
renderpoint
|
||||||
|
name "title"
|
||||||
|
text "Add bot:"
|
||||||
|
forecolor .6 .0 .0 1
|
||||||
style WINDOW_STYLE_EMPTY
|
style WINDOW_STYLE_EMPTY
|
||||||
forecolor Ig_Window_TitleColor
|
|
||||||
textstyle ITEM_TEXTSTYLE_NORMAL
|
|
||||||
textscale .225
|
|
||||||
textalign ITEM_ALIGN_LEFT
|
textalign ITEM_ALIGN_LEFT
|
||||||
textalignx 24
|
textalignx 0
|
||||||
textaligny 16
|
textaligny 12
|
||||||
text "Add bot"
|
textscale RQ3_MAIN_TEXTSIZE
|
||||||
|
alignrect paper ITEM_ALIGN_LEFT 28 36 240 36
|
||||||
visible 1
|
visible 1
|
||||||
|
autowrapped
|
||||||
decoration
|
decoration
|
||||||
}
|
}
|
||||||
|
|
||||||
//Objects
|
// BUTTONS //
|
||||||
|
|
||||||
itemdef {
|
|
||||||
name "ig-bot-name"
|
// NAME //
|
||||||
style WINDOW_STYLE_EMPTY
|
|
||||||
|
itemDef {
|
||||||
|
name "botname"
|
||||||
text "^_N^_ame:"
|
text "^_N^_ame:"
|
||||||
shortcutKey "N"
|
shortcutKey "N"
|
||||||
ownerdraw UI_BOTNAME
|
ownerdraw UI_BOTNAME
|
||||||
rect 0 32 128 20
|
|
||||||
textalign ITEM_ALIGN_RIGHT
|
|
||||||
textalignx 48
|
|
||||||
textaligny 18
|
|
||||||
textscale .225
|
textscale .225
|
||||||
forecolor 1 1 1 1
|
style WINDOW_STYLE_EMPTY
|
||||||
border 0
|
alignrect "title" ITEM_ALIGN_LEFT 32 20 128 20
|
||||||
bordercolor 0 0 0 0
|
textalign 1
|
||||||
|
textalignx 8
|
||||||
|
textaligny 16
|
||||||
|
forecolor 0 0 0 1
|
||||||
visible 1
|
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
|
||||||
rect 0 72 128 20
|
|
||||||
textalign ITEM_ALIGN_RIGHT
|
|
||||||
textalignx 48
|
|
||||||
textaligny 18
|
|
||||||
textscale .225
|
textscale .225
|
||||||
forecolor 1 1 1 1
|
style WINDOW_STYLE_EMPTY
|
||||||
border 0
|
alignrect "botname" ITEM_ALIGN_LEFT 0 20 128 20
|
||||||
bordercolor 0 0 0 0
|
textalign 1
|
||||||
|
textalignx 10
|
||||||
|
textaligny 16
|
||||||
|
forecolor 0 0 0 1
|
||||||
visible 1
|
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"
|
||||||
|
ownerdraw UI_REDBLUE
|
||||||
textscale .225
|
textscale .225
|
||||||
textalign ITEM_ALIGN_CENTER
|
style WINDOW_STYLE_EMPTY
|
||||||
textalignx 32
|
alignrect "botskill" ITEM_ALIGN_LEFT 0 20 128 20
|
||||||
textaligny 14
|
textalign 1
|
||||||
text "^_O^_k"
|
textalignx 8
|
||||||
shortcutKey "O"
|
textaligny 16
|
||||||
border 1
|
forecolor 0 0 0 1
|
||||||
bordersize 1
|
|
||||||
backcolor Ig_Sub_Color1
|
|
||||||
forecolor Ig_Sub_TextColor
|
|
||||||
bordercolor Ig_Sub_BorderColor1
|
|
||||||
visible 1
|
visible 1
|
||||||
action { play "sound/misc/menu1.wav" ; uiScript addBot ; uiScript closeingame }
|
cvarTest "g_gametype"
|
||||||
onFocus { setcolor backcolor Ig_Sub_Color2 ; setcolor bordercolor Ig_Sub_BorderColor2 }
|
disableCvar { "0" ; "1" }
|
||||||
leaveFocus { setcolor backcolor Ig_Sub_Color1 ; setcolor bordercolor Ig_Sub_BorderColor1 }
|
//style WINDOW_STYLE_FILLED
|
||||||
|
//backcolor 0 0 0 .25
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue