diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_mouse_over.vmt b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_mouse_over.vmt new file mode 100644 index 000000000..e83c3b05b --- /dev/null +++ b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_mouse_over.vmt @@ -0,0 +1,10 @@ +UnlitGeneric +{ +$baseTexture "vgui\briefing\trace_me_icon_mouse_over" +$translucent 1 +$alpha 1 +$vertexalpha 1 +$ignorez 1 +$no_fullbright 1 +$vertexcolor 1 +} diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_mouse_over.vtf b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_mouse_over.vtf new file mode 100644 index 000000000..493cb0a73 Binary files /dev/null and b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_mouse_over.vtf differ diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_on.vmt b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_on.vmt new file mode 100644 index 000000000..8e94572d5 --- /dev/null +++ b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_on.vmt @@ -0,0 +1,10 @@ +UnlitGeneric +{ +$baseTexture "vgui\briefing\trace_me_icon_on" +$translucent 1 +$alpha 1 +$vertexalpha 1 +$ignorez 1 +$no_fullbright 1 +$vertexcolor 1 +} diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_on.vtf b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_on.vtf new file mode 100644 index 000000000..2a53de630 Binary files /dev/null and b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_on.vtf differ diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_pressed.vmt b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_pressed.vmt new file mode 100644 index 000000000..9043b79f5 --- /dev/null +++ b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_pressed.vmt @@ -0,0 +1,10 @@ +UnlitGeneric +{ +$baseTexture "vgui\briefing\trace_me_icon_pressed" +$translucent 1 +$alpha 1 +$vertexalpha 1 +$ignorez 1 +$no_fullbright 1 +$vertexcolor 1 +} diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_pressed.vtf b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_pressed.vtf new file mode 100644 index 000000000..493cb0a73 Binary files /dev/null and b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_me_icon_pressed.vtf differ diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_mouse_over.vmt b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_mouse_over.vmt new file mode 100644 index 000000000..3101af921 --- /dev/null +++ b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_mouse_over.vmt @@ -0,0 +1,10 @@ +UnlitGeneric +{ +$baseTexture "vgui\briefing\trace_player_icon_mouse_over" +$translucent 1 +$alpha 1 +$vertexalpha 1 +$ignorez 1 +$no_fullbright 1 +$vertexcolor 1 +} diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_mouse_over.vtf b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_mouse_over.vtf new file mode 100644 index 000000000..a1182722f Binary files /dev/null and b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_mouse_over.vtf differ diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_off.vmt b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_off.vmt new file mode 100644 index 000000000..03cba1c06 --- /dev/null +++ b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_off.vmt @@ -0,0 +1,10 @@ +UnlitGeneric +{ +$baseTexture "vgui\briefing\trace_player_icon_off" +$translucent 1 +$alpha 1 +$vertexalpha 1 +$ignorez 1 +$no_fullbright 1 +$vertexcolor 1 +} diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_off.vtf b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_off.vtf new file mode 100644 index 000000000..2f4fcf6c5 Binary files /dev/null and b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_off.vtf differ diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_on.vmt b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_on.vmt new file mode 100644 index 000000000..38619a918 --- /dev/null +++ b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_on.vmt @@ -0,0 +1,10 @@ +UnlitGeneric +{ +$baseTexture "vgui\briefing\trace_player_icon_on" +$translucent 1 +$alpha 1 +$vertexalpha 1 +$ignorez 1 +$no_fullbright 1 +$vertexcolor 1 +} diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_on.vtf b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_on.vtf new file mode 100644 index 000000000..2a75874e7 Binary files /dev/null and b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_on.vtf differ diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_pressed.vmt b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_pressed.vmt new file mode 100644 index 000000000..12484db06 --- /dev/null +++ b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_pressed.vmt @@ -0,0 +1,10 @@ +UnlitGeneric +{ +$baseTexture "vgui\briefing\trace_player_icon_pressed" +$translucent 1 +$alpha 1 +$vertexalpha 1 +$ignorez 1 +$no_fullbright 1 +$vertexcolor 1 +} diff --git a/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_pressed.vtf b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_pressed.vtf new file mode 100644 index 000000000..a1182722f Binary files /dev/null and b/reactivedrop/content/trace_player_ui/materials/vgui/briefing/trace_player_icon_pressed.vtf differ diff --git a/reactivedrop/content/trace_player_ui/resource/ui/nb_lobby_row.res b/reactivedrop/content/trace_player_ui/resource/ui/nb_lobby_row.res new file mode 100644 index 000000000..257b91c79 --- /dev/null +++ b/reactivedrop/content/trace_player_ui/resource/ui/nb_lobby_row.res @@ -0,0 +1,441 @@ +"Resource/UI/NB_Lobby_Row.res" +{ + "AvatarBackground" + { + "fieldName" "AvatarBackground" + "xpos" "20" + "ypos" "0" + "wide" "22" + "tall" "22" + "ControlName" "Panel" + "bgcolor_override" "0 0 0 180" + "zpos" "4" + } + "AvatarImage" + { + "fieldName" "AvatarImage" + "xpos" "21" + "ypos" "1" + "wide" "20" + "tall" "20" + "ControlName" "CAvatarImagePanel" + "legacy_padding" "0" + "scaleImage" "1" + "zpos" "4" + } + "ClassImage" + { + "fieldName" "ClassImage" + "xpos" "314" + "ypos" "28" + "wide" "21" + "tall" "21" + "ControlName" "ImagePanel" + "scaleImage" "1" + "zpos" "4" + } + "VoiceIcon" + { + "fieldName" "VoiceIcon" + "ControlName" "ImagePanel" + "xpos" "4" + "ypos" "2" + "scaleImage" "1" + "wide" "12" + "tall" "12" + "zpos" "1" + "image" "../voice/voice_icon_hud" + } + "TracePlayerButton" + { + "fieldName" "TracePlayerButton" + "xpos" "4" + "ypos" "20" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "PromotionIcon" + { + "fieldName" "PromotionIcon" + "ControlName" "ImagePanel" + "xpos" "194" + "ypos" "0" + "scaleImage" "1" + "wide" "12" + "tall" "12" + "zpos" "1" + } + "MedalIcon" + { + "fieldName" "MedalIcon" + "ControlName" "ImagePanel" + "xpos" "182" + "ypos" "0" + "scaleImage" "1" + "wide" "12" + "tall" "12" + "zpos" "1" + } + "MedalIcon1" + { + "fieldName" "MedalIcon1" + "ControlName" "ImagePanel" + "xpos" "170" + "ypos" "0" + "scaleImage" "1" + "wide" "12" + "tall" "12" + "zpos" "1" + } + "MedalIcon2" + { + "fieldName" "MedalIcon2" + "ControlName" "ImagePanel" + "xpos" "158" + "ypos" "0" + "scaleImage" "1" + "wide" "12" + "tall" "12" + "zpos" "1" + } + "DrpNameLabel" + { + "ControlName" "DropDownMenu" + "fieldName" "DrpNameLabel" + "xpos" "47" + "ypos" "1" + "wide" "109" + "tall" "12" + "visible" "1" + "enabled" "1" + "tabPosition" "0" + + "BtnDropButton" + { + "ControlName" "BaseModHybridButton" + "fieldName" "BtnDropButton" + "xpos" "0" + "ypos" "0" + "tall" "12" + "wide" "109" + "visible" "1" + "enabled" "1" + "tabPosition" "0" + "tooltiptext" "" + "style" "AlienSwarmDefault" + "command" "PlayerFlyout" + "ShowDropDownIndicator" "0" + } + } + "LevelLabel" + { + "fieldName" "LevelLabel" + "xpos" "208" + "ypos" "1" + "wide" "140" + "tall" "14" + "font" "Default" + "labelText" "LevelLabel" + "textAlignment" "north-west" + "ControlName" "Label" + "fgcolor_override" "83 148 192 255" + "zpos" "4" + } + "XPBar" + { + "fieldName" "XPBar" + "xpos" "47" + "ypos" "16" + "wide" "291" + "tall" "6" + "ControlName" "StatsBar" + "zpos" "4" + } + "PortraitButton" + { + "fieldName" "PortraitButton" + "xpos" "22" + "ypos" "28" + "wide" "73" + "tall" "73" + "ControlName" "CBitmapButton" + "zpos" "4" + } + "WeaponButton0" + { + "fieldName" "WeaponButton0" + "xpos" "96" + "ypos" "51" + "wide" "94" + "tall" "47" + "ControlName" "CBitmapButton" + "zpos" "4" + } + "WeaponButton1" + { + "fieldName" "WeaponButton1" + "xpos" "192" + "ypos" "51" + "wide" "94" + "tall" "47" + "ControlName" "CBitmapButton" +// "pin_to_sibling" "WeaponButton0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "1" + "zpos" "4" + } + "WeaponButton2" + { + "fieldName" "WeaponButton2" + "xpos" "288" + "ypos" "51" + "wide" "47" + "tall" "47" + "ControlName" "CBitmapButton" +// "pin_to_sibling" "WeaponButton1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "1" + "zpos" "4" + } + "ClassLabel" + { + "fieldName" "ClassLabel" + "xpos" "223" + "ypos" "31" + "wide" "90" + "tall" "12" + "font" "Default" + "labelText" "ClassLabel" + "textAlignment" "east" + "ControlName" "Label" + "fgcolor_override" "83 148 192 255" + "zpos" "4" + } + "Background" + { + "fieldName" "Background" + "xpos" "20" + "ypos" "26" + "wide" "319" + "tall" "76" + "ControlName" "Panel" + "PaintBackgroundType" "0" + "bgcolor_override" "255 255 255 255" + "image" "briefing/lobby_row_bg" + "scaleImage" "1" + "zpos" "0" + } + "BackgroundWeapon0" + { + "fieldName" "BackgroundWeapon0" + "xpos" "96" + "ypos" "51" + "wide" "94" + "tall" "47" + "ControlName" "Panel" + "PaintBackgroundType" "2" + "bgcolor_override" "16 32 49 255" +// "pin_to_sibling" "WeaponButton0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "zpos" "1" + } + "BackgroundWeapon1" + { + "fieldName" "BackgroundWeapon1" + "xpos" "192" + "ypos" "51" + "wide" "94" + "tall" "47" + "ControlName" "Panel" +// "pin_to_sibling" "WeaponButton1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "16 32 49 255" + "zpos" "1" + } + "BackgroundWeapon2" + { + "fieldName" "BackgroundWeapon2" + "xpos" "288" + "ypos" "51" + "wide" "47" + "tall" "47" + "ControlName" "Panel" +// "pin_to_sibling" "WeaponButton2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "16 32 49 255" + "zpos" "1" + } + "BackgroundInnerWeapon0" + { + "fieldName" "BackgroundInnerWeapon0" + "xpos" "97" + "ypos" "52" +// "xpos" "-1" +// "ypos" "-1" + "wide" "92" + "tall" "45" + "ControlName" "Panel" + "PaintBackgroundType" "2" + "bgcolor_override" "32 57 82 255" +// "pin_to_sibling" "BackgroundWeapon0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "zpos" "2" + } + "BackgroundInnerWeapon1" + { + "fieldName" "BackgroundInnerWeapon1" +// "xpos" "-1" +// "ypos" "-1" + "xpos" "193" + "ypos" "52" + "wide" "92" + "tall" "45" + "ControlName" "Panel" +// "pin_to_sibling" "BackgroundWeapon1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "32 57 82 255" + "zpos" "2" + } + "BackgroundInnerWeapon2" + { + "fieldName" "BackgroundInnerWeapon2" +// "xpos" "-1" +// "ypos" "-1" + "xpos" "289" + "ypos" "52" + "wide" "45" + "tall" "45" + "ControlName" "Panel" +// "pin_to_sibling" "BackgroundWeapon2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "32 57 82 255" + "zpos" "2" + } + "SilhouetteWeapon0" + { + "fieldName" "SilhouetteWeapon0" +// "xpos" "-8" +// "ypos" "-6" + "xpos" "104" + "ypos" "57" + "wide" "80" + "tall" "40" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "briefing/weapon_primary_silhouette" + "zpos" "3" + "visible" "1" + } + "SilhouetteWeapon1" + { + "fieldName" "SilhouetteWeapon1" +// "xpos" "-8" +// "ypos" "-6" + "xpos" "200" + "ypos" "57" + "wide" "80" + "tall" "40" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "briefing/weapon_primary_silhouette" + "zpos" "3" + } + "SilhouetteWeapon2" + { + "fieldName" "SilhouetteWeapon2" +// "xpos" "-7" +// "ypos" "-6" + "xpos" "295" + "ypos" "57" + "wide" "36" + "tall" "36" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "briefing/weapon_extra_silhouette" + "zpos" "3" + } + // changing cyclers + "ChangingSlot0" + { + "fieldName" "ChangingSlot0" + "xpos" "25" + "ypos" "31" + "wide" "67" + "tall" "67" + "ControlName" "ImagePanel" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } + "ChangingSlot1" + { + "fieldName" "ChangingSlot1" + "xpos" "-19" + "ypos" "-3" + "wide" "32" + "tall" "32" + "ControlName" "ImagePanel" + "pin_to_sibling" "BackgroundWeapon0" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } + "ChangingSlot2" + { + "fieldName" "ChangingSlot2" + "xpos" "-19" + "ypos" "-3" + "wide" "32" + "tall" "32" + "ControlName" "ImagePanel" + "pin_to_sibling" "BackgroundWeapon1" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } + "ChangingSlot3" + { + "fieldName" "ChangingSlot3" + "xpos" "-3" + "ypos" "-3" + "wide" "30" + "tall" "30" + "ControlName" "ImagePanel" + "pin_to_sibling" "BackgroundWeapon2" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } +} diff --git a/reactivedrop/content/trace_player_ui/resource/ui/nb_lobby_row_2024.res b/reactivedrop/content/trace_player_ui/resource/ui/nb_lobby_row_2024.res new file mode 100644 index 000000000..5a5c15fba --- /dev/null +++ b/reactivedrop/content/trace_player_ui/resource/ui/nb_lobby_row_2024.res @@ -0,0 +1,455 @@ +"Resource/UI/NB_Lobby_Row.res" +{ + "AvatarBackground" + { + "fieldName" "AvatarBackground" + "xpos" "96" + "ypos" "3" + "wide" "24" + "tall" "24" + "ControlName" "Panel" + "bgcolor_override" "0 0 0 180" + "zpos" "4" + } + "AvatarImage" + { + "fieldName" "AvatarImage" + "xpos" "97" + "ypos" "4" + "wide" "22" + "tall" "22" + "ControlName" "CAvatarImagePanel" + "legacy_padding" "0" + "scaleImage" "1" + "zpos" "4" + } + "PromotionIcon" + { + "fieldName" "PromotionIcon" + "ControlName" "ImagePanel" + "xpos" "203" + "ypos" "3" + "scaleImage" "1" + "wide" "16" + "tall" "16" + "zpos" "1" + } + "MedalIcon" + { + "fieldName" "MedalIcon" + "ControlName" "ImagePanel" + "xpos" "220" + "ypos" "2" + "scaleImage" "1" + "wide" "18" + "tall" "18" + "zpos" "1" + } + "MedalIcon1" + { + "fieldName" "MedalIcon1" + "ControlName" "ImagePanel" + "xpos" "239" + "ypos" "2" + "scaleImage" "1" + "wide" "18" + "tall" "18" + "zpos" "1" + } + "MedalIcon2" + { + "fieldName" "MedalIcon2" + "ControlName" "ImagePanel" + "xpos" "258" + "ypos" "2" + "scaleImage" "1" + "wide" "18" + "tall" "18" + "zpos" "1" + } + "XPBar" + { + "fieldName" "XPBar" + "xpos" "122" + "ypos" "21" + "wide" "192" + "tall" "6" + "ControlName" "StatsBar" + "zpos" "4" + } + "LevelLabel" + { + "fieldName" "LevelLabel" + "xpos" "316" + "ypos" "16" + "wide" "43" + "tall" "14" + "font" "Default" + "labelText" "LevelLabel" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "83 148 192 255" + "zpos" "4" + } + "ClassImage" + { + "fieldName" "ClassImage" + "xpos" "16" + "ypos" "0" + "wide" "16" + "tall" "16" + "ControlName" "ImagePanel" + "scaleImage" "1" + "zpos" "3" + } + "ClassLabel" + { + "fieldName" "ClassLabel" + "xpos" "36" + "ypos" "1" + "wide" "46" + "tall" "12" + "font" "Default" + "labelText" "ClassLabel" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "83 148 192 255" + "zpos" "4" + } + "VoiceIcon" + { + "fieldName" "VoiceIcon" + "ControlName" "ImagePanel" + "xpos" "6" + "ypos" "20" + "scaleImage" "1" + "wide" "14" + "tall" "14" + "zpos" "1" + "image" "../voice/voice_icon_hud" + } + "TracePlayerButton" + { + "fieldName" "TracePlayerButton" + "xpos" "6" + "ypos" "46" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } +// "NameLabel" +// { +// "fieldName" "NameLabel" +// "xpos" "47" +// "ypos" "1" +// "wide" "145" +// "tall" "14" +// "font" "Default" +// "labelText" "NameLabel" +// "textAlignment" "north-west" +// "ControlName" "Label" +// "fgcolor_override" "169 213 255 255" +// "zpos" "4" +// } + "DrpNameLabel" + { + "ControlName" "DropDownMenu" + "fieldName" "DrpNameLabel" + "xpos" "122" + "ypos" "4" + "wide" "170" + "tall" "12" + "visible" "1" + "enabled" "1" + "tabPosition" "0" + "zpos" "4" + "BtnDropButton" + { + "ControlName" "BaseModHybridButton" + "fieldName" "BtnDropButton" + "xpos" "0" + "ypos" "0" + "tall" "12" + "wide" "170" + "visible" "1" + "enabled" "1" + "tabPosition" "0" + "tooltiptext" "" + "style" "AlienSwarmDefault" + "command" "PlayerFlyout" + "ShowDropDownIndicator" "0" + } + } + "PortraitButton" + { + "fieldName" "PortraitButton" + "xpos" "22" + "ypos" "3" + "wide" "73" + "tall" "73" + "ControlName" "CBitmapButton" + "zpos" "4" + } + "WeaponButton0" + { + "fieldName" "WeaponButton0" + "xpos" "96" + "ypos" "28" + "wide" "94" + "tall" "47" + "ControlName" "CBitmapButton" + "zpos" "4" + } + "WeaponButton1" + { + "fieldName" "WeaponButton1" + "xpos" "192" + "ypos" "28" + "wide" "94" + "tall" "47" + "ControlName" "CBitmapButton" +// "pin_to_sibling" "WeaponButton0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "1" + "zpos" "4" + } + "WeaponButton2" + { + "fieldName" "WeaponButton2" + "xpos" "288" + "ypos" "28" + "wide" "47" + "tall" "47" + "ControlName" "CBitmapButton" +// "pin_to_sibling" "WeaponButton1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "1" + "zpos" "4" + } + "Background" + { + "fieldName" "Background" + "xpos" "20" + "ypos" "1" + "wide" "329" + "tall" "76" + "ControlName" "Panel" + "PaintBackgroundType" "0" + "bgcolor_override" "160 160 128 255" + "image" "briefing/lobby_row_bg" + "scaleImage" "1" + "zpos" "0" + } + "BackgroundWeapon0" + { + "fieldName" "BackgroundWeapon0" + "xpos" "96" + "ypos" "28" + "wide" "94" + "tall" "47" + "ControlName" "Panel" + "PaintBackgroundType" "2" + "bgcolor_override" "16 32 49 255" +// "pin_to_sibling" "WeaponButton0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "zpos" "1" + } + "BackgroundWeapon1" + { + "fieldName" "BackgroundWeapon1" + "xpos" "192" + "ypos" "28" + "wide" "94" + "tall" "47" + "ControlName" "Panel" +// "pin_to_sibling" "WeaponButton1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "16 32 49 255" + "zpos" "1" + } + "BackgroundWeapon2" + { + "fieldName" "BackgroundWeapon2" + "xpos" "288" + "ypos" "28" + "wide" "47" + "tall" "47" + "ControlName" "Panel" +// "pin_to_sibling" "WeaponButton2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "16 32 49 255" + "zpos" "1" + } + "BackgroundInnerWeapon0" + { + "fieldName" "BackgroundInnerWeapon0" + "xpos" "97" + "ypos" "29" +// "xpos" "-1" +// "ypos" "-1" + "wide" "92" + "tall" "45" + "ControlName" "Panel" + "PaintBackgroundType" "2" + "bgcolor_override" "32 57 82 255" +// "pin_to_sibling" "BackgroundWeapon0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "zpos" "2" + } + "BackgroundInnerWeapon1" + { + "fieldName" "BackgroundInnerWeapon1" +// "xpos" "-1" +// "ypos" "-1" + "xpos" "193" + "ypos" "29" + "wide" "92" + "tall" "45" + "ControlName" "Panel" +// "pin_to_sibling" "BackgroundWeapon1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "32 57 82 255" + "zpos" "2" + } + "BackgroundInnerWeapon2" + { + "fieldName" "BackgroundInnerWeapon2" +// "xpos" "-1" +// "ypos" "-1" + "xpos" "289" + "ypos" "29" + "wide" "45" + "tall" "45" + "ControlName" "Panel" +// "pin_to_sibling" "BackgroundWeapon2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "32 57 82 255" + "zpos" "2" + } + "SilhouetteWeapon0" + { + "fieldName" "SilhouetteWeapon0" +// "xpos" "-8" +// "ypos" "-6" + "xpos" "104" + "ypos" "34" + "wide" "80" + "tall" "40" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "briefing/weapon_primary_silhouette" + "zpos" "3" + "visible" "1" + } + "SilhouetteWeapon1" + { + "fieldName" "SilhouetteWeapon1" +// "xpos" "-8" +// "ypos" "-6" + "xpos" "200" + "ypos" "34" + "wide" "80" + "tall" "40" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "briefing/weapon_primary_silhouette" + "zpos" "3" + } + "SilhouetteWeapon2" + { + "fieldName" "SilhouetteWeapon2" +// "xpos" "-7" +// "ypos" "-6" + "xpos" "295" + "ypos" "34" + "wide" "36" + "tall" "36" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "briefing/weapon_extra_silhouette" + "zpos" "3" + } + // changing cyclers + "ChangingSlot0" + { + "fieldName" "ChangingSlot0" + "xpos" "25" + "ypos" "6" + "wide" "67" + "tall" "67" + "ControlName" "ImagePanel" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } + "ChangingSlot1" + { + "fieldName" "ChangingSlot1" + "xpos" "-31" + "ypos" "-8" + "wide" "32" + "tall" "32" + "ControlName" "ImagePanel" + "pin_to_sibling" "BackgroundWeapon0" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } + "ChangingSlot2" + { + "fieldName" "ChangingSlot2" + "xpos" "-31" + "ypos" "-8" + "wide" "32" + "tall" "32" + "ControlName" "ImagePanel" + "pin_to_sibling" "BackgroundWeapon1" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } + "ChangingSlot3" + { + "fieldName" "ChangingSlot3" + "xpos" "-9" + "ypos" "-8" + "wide" "30" + "tall" "30" + "ControlName" "ImagePanel" + "pin_to_sibling" "BackgroundWeapon2" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } +} diff --git a/reactivedrop/content/trace_player_ui/resource/ui/nb_lobby_row_small.res b/reactivedrop/content/trace_player_ui/resource/ui/nb_lobby_row_small.res new file mode 100644 index 000000000..03990e153 --- /dev/null +++ b/reactivedrop/content/trace_player_ui/resource/ui/nb_lobby_row_small.res @@ -0,0 +1,441 @@ +"Resource/UI/NB_Lobby_Row_Small.res" +{ + "AvatarImage" + { + "fieldName" "AvatarImage" + "xpos" "19" + "ypos" "0" + "wide" "16" + "tall" "16" + "ControlName" "CAvatarImagePanel" + "legacy_padding" "0" + "scaleImage" "1" + "zpos" "2" + } + "ClassImage" + { + "fieldName" "ClassImage" + "xpos" "225" + "ypos" "0" + "wide" "16" + "tall" "16" + "ControlName" "ImagePanel" + "scaleImage" "1" + "zpos" "2" + } + "DrpNameLabel" + { + "ControlName" "DropDownMenu" + "fieldName" "DrpNameLabel" + "xpos" "37" + "ypos" "2" + "wide" "63" + "tall" "12" + "visible" "1" + "enabled" "1" + "zpos" "2" + "tabPosition" "0" + + "BtnDropButton" + { + "ControlName" "BaseModHybridButton" + "fieldName" "BtnDropButton" + "xpos" "0" + "ypos" "0" + "tall" "12" + "wide" "63" + "visible" "1" + "enabled" "1" + "tabPosition" "0" + "tooltiptext" "" + "style" "AlienSwarmDefault" + "command" "PlayerFlyout" + "ShowDropDownIndicator" "0" + } + } + "LevelLabel" + { + "fieldName" "LevelLabel" + "xpos" "135" + "ypos" "0" + "wide" "45" + "tall" "15" + "font" "Default" + "labelText" "LevelLabel" + "textAlignment" "west" + "ControlName" "Label" + "zpos" "2" + "fgcolor_override" "83 148 192 255" + } + "PromotionIcon" + { + "fieldName" "PromotionIcon" + "ControlName" "ImagePanel" + "xpos" "123" + "ypos" "2" + "scaleImage" "1" + "wide" "10" + "tall" "10" + "zpos" "1" + } + "MedalIcon" + { + "fieldName" "MedalIcon" + "ControlName" "ImagePanel" + "xpos" "113" + "ypos" "2" + "scaleImage" "1" + "wide" "10" + "tall" "10" + "zpos" "1" + } + "MedalIcon1" + { + "fieldName" "MedalIcon1" + "ControlName" "ImagePanel" + "xpos" "103" + "ypos" "2" + "scaleImage" "1" + "wide" "10" + "tall" "10" + "zpos" "1" + } + "MedalIcon2" + { + "fieldName" "MedalIcon2" + "ControlName" "ImagePanel" + "xpos" "93" + "ypos" "2" + "scaleImage" "1" + "wide" "10" + "tall" "10" + "zpos" "1" + } + "XPBar" + { + "fieldName" "XPBar" + "xpos" "47" + "ypos" "150" + "wide" "292" + "tall" "6" + "ControlName" "StatsBar" + "visible" "0" + "zpos" "2" + } + "PortraitButton" + { + "fieldName" "PortraitButton" + "xpos" "21" + "ypos" "17" + "wide" "39" + "tall" "39" + "ControlName" "CBitmapButton" + "zpos" "2" + } + "WeaponButton0" + { + "fieldName" "WeaponButton0" + "xpos" "60" + "ypos" "16" + "wide" "72" + "tall" "38" + "ControlName" "CBitmapButton" + "zpos" "2" + } + "WeaponButton1" + { + "fieldName" "WeaponButton1" + "xpos" "132" + "ypos" "16" + "wide" "72" + "tall" "38" + "ControlName" "CBitmapButton" +// "pin_to_sibling" "WeaponButton0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "1" + "zpos" "2" + } + "WeaponButton2" + { + "fieldName" "WeaponButton2" + "xpos" "204" + "ypos" "16" + "wide" "38" + "tall" "38" + "ControlName" "CBitmapButton" +// "pin_to_sibling" "WeaponButton1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "1" + "zpos" "2" + } + "ClassLabel" + { + "fieldName" "ClassLabel" + "xpos" "158" + "ypos" "0" + "wide" "66" + "tall" "15" + "font" "Default" + "labelText" "ClassLabel" + "textAlignment" "east" + "ControlName" "Label" + "zpos" "2" + "fgcolor_override" "83 148 192 255" + } + "Background" + { + "fieldName" "Background" + "visible" "0" + "ControlName" "ImagePanel" + } + "BackroundPlain" + { + "fieldName" "BackroundPlain" + "xpos" "19" + "ypos" "0" + "wide" "225" + "tall" "56" + "ControlName" "Panel" + "PaintBackgroundEnabled" "1" + "PaintBackgroundType" "2" + "bgcolor_override" "23 43 65 255" + } + "BackgroundWeapon0" + { + "fieldName" "BackgroundWeapon0" + "xpos" "60" + "ypos" "17" + "wide" "70" + "tall" "37" + "ControlName" "Panel" + "PaintBackgroundType" "2" + "bgcolor_override" "16 32 49 255" +// "pin_to_sibling" "WeaponButton0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "zpos" "1" + } + "BackgroundWeapon1" + { + "fieldName" "BackgroundWeapon1" + "xpos" "132" + "ypos" "17" + "wide" "70" + "tall" "37" + "ControlName" "Panel" +// "pin_to_sibling" "WeaponButton1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "16 32 49 255" + "zpos" "1" + } + "BackgroundWeapon2" + { + "fieldName" "BackgroundWeapon2" + "xpos" "204" + "ypos" "17" + "wide" "37" + "tall" "37" + "ControlName" "Panel" +// "pin_to_sibling" "WeaponButton2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "16 32 49 255" + "zpos" "1" + } + "BackgroundInnerWeapon0" + { + "fieldName" "BackgroundInnerWeapon0" + "xpos" "61" + "ypos" "18" + "wide" "68" + "tall" "35" + "ControlName" "Panel" + "PaintBackgroundType" "2" + "bgcolor_override" "32 57 82 255" +// "pin_to_sibling" "BackgroundWeapon0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "zpos" "2" + } + "BackgroundInnerWeapon1" + { + "fieldName" "BackgroundInnerWeapon1" + "xpos" "133" + "ypos" "18" + "wide" "68" + "tall" "35" + "ControlName" "Panel" +// "pin_to_sibling" "BackgroundWeapon1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "32 57 82 255" + "zpos" "2" + } + "BackgroundInnerWeapon2" + { + "fieldName" "BackgroundInnerWeapon2" + "xpos" "205" + "ypos" "18" + "wide" "35" + "tall" "35" + "ControlName" "Panel" +// "pin_to_sibling" "BackgroundWeapon2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "32 57 82 255" + "zpos" "2" + } + "SilhouetteWeapon0" + { + "fieldName" "SilhouetteWeapon0" +// "xpos" "-4" +// "ypos" "-4" + "xpos" "64" + "ypos" "21" + "wide" "64" + "tall" "32" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "briefing/weapon_primary_silhouette" + "zpos" "3" + "visible" "1" + } + "SilhouetteWeapon1" + { + "fieldName" "SilhouetteWeapon1" +// "xpos" "-4" +// "ypos" "-4" + "xpos" "136" + "ypos" "21" + "wide" "64" + "tall" "32" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "briefing/weapon_primary_silhouette" + "zpos" "3" + } + "SilhouetteWeapon2" + { + "fieldName" "SilhouetteWeapon2" +// "xpos" "-4" +// "ypos" "-4" + "xpos" "208" + "ypos" "21" + "wide" "30" + "tall" "30" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "briefing/weapon_extra_silhouette" + "zpos" "3" + } + "ReadyCheckImage" + { + "fieldName" "ReadyCheckImage" + "ControlName" "ImagePanel" + "xpos" "3" + "ypos" "2" + "scaleImage" "1" + "wide" "12" + "tall" "12" + "zpos" "1" + } + "VoiceIcon" + { + "fieldName" "VoiceIcon" + "ControlName" "ImagePanel" + "xpos" "3" + "ypos" "16" + "scaleImage" "1" + "wide" "12" + "tall" "12" + "zpos" "1" + "image" "../voice/voice_icon_hud" + } + "TracePlayerButton" + { + "fieldName" "TracePlayerButton" + "xpos" "0" + "ypos" "30" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + // changing cyclers + "ChangingSlot0" + { + "fieldName" "ChangingSlot0" + "xpos" "24" + "ypos" "20" + "wide" "33" + "tall" "33" + "ControlName" "ImagePanel" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } + "ChangingSlot1" + { + "fieldName" "ChangingSlot1" + "xpos" "-19" + "ypos" "-3" + "wide" "32" + "tall" "32" + "ControlName" "ImagePanel" + "pin_to_sibling" "BackgroundWeapon0" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } + "ChangingSlot2" + { + "fieldName" "ChangingSlot2" + "xpos" "-19" + "ypos" "-3" + "wide" "32" + "tall" "32" + "ControlName" "ImagePanel" + "pin_to_sibling" "BackgroundWeapon1" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } + "ChangingSlot3" + { + "fieldName" "ChangingSlot3" + "xpos" "-3" + "ypos" "-3" + "wide" "30" + "tall" "30" + "ControlName" "ImagePanel" + "pin_to_sibling" "BackgroundWeapon2" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } +} diff --git a/reactivedrop/content/trace_player_ui/resource/ui/nb_lobby_row_small_2024.res b/reactivedrop/content/trace_player_ui/resource/ui/nb_lobby_row_small_2024.res new file mode 100644 index 000000000..36b5cfbf8 --- /dev/null +++ b/reactivedrop/content/trace_player_ui/resource/ui/nb_lobby_row_small_2024.res @@ -0,0 +1,441 @@ +"Resource/UI/NB_Lobby_Row_Small.res" +{ + "AvatarImage" + { + "fieldName" "AvatarImage" + "xpos" "24" + "ypos" "6" + "wide" "24" + "tall" "24" + "ControlName" "CAvatarImagePanel" + "legacy_padding" "0" + "scaleImage" "1" + "zpos" "1" + } + "DrpNameLabel" + { + "ControlName" "DropDownMenu" + "fieldName" "DrpNameLabel" + "xpos" "50" + "ypos" "1" + "wide" "102" + "tall" "12" + "visible" "1" + "enabled" "1" + "zpos" "3" + "tabPosition" "0" + + "BtnDropButton" + { + "ControlName" "BaseModHybridButton" + "fieldName" "BtnDropButton" + "xpos" "0" + "ypos" "0" + "tall" "12" + "wide" "102" + "visible" "1" + "enabled" "1" + "tabPosition" "0" + "tooltiptext" "" + "style" "AlienSwarmDefault" + "command" "PlayerFlyout" + "ShowDropDownIndicator" "0" + } + } + "ClassImage" + { + "fieldName" "ClassImage" + "xpos" "118" + "ypos" "12" + "wide" "14" + "tall" "14" + "ControlName" "ImagePanel" + "scaleImage" "1" + "zpos" "2" + } + "ClassLabel" + { + "fieldName" "ClassLabel" + "xpos" "43" + "ypos" "41" + "wide" "66" + "tall" "15" + "font" "Default" + "labelText" "ClassLabel" + "textAlignment" "east" + "ControlName" "Label" + "zpos" "2" + "fgcolor_override" "83 148 192 255" + } + "LevelLabel" + { + "fieldName" "LevelLabel" + "xpos" "50" + "ypos" "9" + "wide" "60" + "tall" "15" + "font" "Default" + "labelText" "LevelLabel" + "textAlignment" "west" + "ControlName" "Label" + "zpos" "2" + "fgcolor_override" "83 148 192 255" + } + "PromotionIcon" + { + "fieldName" "PromotionIcon" + "ControlName" "ImagePanel" + "xpos" "50" + "ypos" "23" + "scaleImage" "1" + "wide" "11" + "tall" "11" + "zpos" "2" + } + "MedalIcon" + { + "fieldName" "MedalIcon" + "ControlName" "ImagePanel" + "xpos" "62" + "ypos" "22" + "scaleImage" "1" + "wide" "13" + "tall" "13" + "zpos" "1" + } + "MedalIcon1" + { + "fieldName" "MedalIcon1" + "ControlName" "ImagePanel" + "xpos" "76" + "ypos" "22" + "scaleImage" "1" + "wide" "13" + "tall" "13" + "zpos" "1" + } + "MedalIcon2" + { + "fieldName" "MedalIcon2" + "ControlName" "ImagePanel" + "xpos" "90" + "ypos" "22" + "scaleImage" "1" + "wide" "13" + "tall" "13" + "zpos" "1" + } + "XPBar" + { + "fieldName" "XPBar" + "xpos" "74" + "ypos" "45" + "wide" "30" + "tall" "6" + "ControlName" "StatsBar" + "visible" "1" + "zpos" "2" + } + "PortraitButton" + { + "fieldName" "PortraitButton" + "xpos" "124" + "ypos" "0" + "wide" "36" + "tall" "36" + "ControlName" "CBitmapButton" + "zpos" "2" + } + "WeaponButton0" + { + "fieldName" "WeaponButton0" + "xpos" "162" + "ypos" "0" + "wide" "66" + "tall" "35" + "ControlName" "CBitmapButton" + "zpos" "2" + } + "WeaponButton1" + { + "fieldName" "WeaponButton1" + "xpos" "234" + "ypos" "0" + "wide" "66" + "tall" "35" + "ControlName" "CBitmapButton" +// "pin_to_sibling" "WeaponButton0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "1" + "zpos" "2" + } + "WeaponButton2" + { + "fieldName" "WeaponButton2" + "xpos" "305" + "ypos" "1" + "wide" "35" + "tall" "35" + "ControlName" "CBitmapButton" +// "pin_to_sibling" "WeaponButton1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "1" + "zpos" "2" + } + "Background" + { + "fieldName" "Background" + "visible" "0" + "ControlName" "ImagePanel" + } + "BackroundPlain" + { + "fieldName" "BackroundPlain" + "xpos" "19" + "ypos" "0" + "wide" "324" + "tall" "36" + "ControlName" "Panel" + "PaintBackgroundEnabled" "1" + "PaintBackgroundType" "2" + "bgcolor_override" "23 43 65 255" + } + "BackgroundWeapon0" + { + "fieldName" "BackgroundWeapon0" + "xpos" "160" + "ypos" "1" + "wide" "70" + "tall" "34" + "ControlName" "Panel" + "PaintBackgroundType" "2" + "bgcolor_override" "16 32 49 255" +// "pin_to_sibling" "WeaponButton0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "zpos" "1" + } + "BackgroundWeapon1" + { + "fieldName" "BackgroundWeapon1" + "xpos" "232" + "ypos" "1" + "wide" "70" + "tall" "34" + "ControlName" "Panel" +// "pin_to_sibling" "WeaponButton1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "16 32 39 255" + "zpos" "1" + } + "BackgroundWeapon2" + { + "fieldName" "BackgroundWeapon2" + "xpos" "304" + "ypos" "1" + "wide" "37" + "tall" "34" + "ControlName" "Panel" +// "pin_to_sibling" "WeaponButton2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "16 32 39 255" + "zpos" "1" + } + "BackgroundInnerWeapon0" + { + "fieldName" "BackgroundInnerWeapon0" + "xpos" "161" + "ypos" "2" + "wide" "68" + "tall" "32" + "ControlName" "Panel" + "PaintBackgroundType" "2" + "bgcolor_override" "32 57 82 255" +// "pin_to_sibling" "BackgroundWeapon0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "zpos" "2" + } + "BackgroundInnerWeapon1" + { + "fieldName" "BackgroundInnerWeapon1" + "xpos" "233" + "ypos" "2" + "wide" "68" + "tall" "32" + "ControlName" "Panel" +// "pin_to_sibling" "BackgroundWeapon1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "32 57 82 255" + "zpos" "2" + } + "BackgroundInnerWeapon2" + { + "fieldName" "BackgroundInnerWeapon2" + "xpos" "305" + "ypos" "2" + "wide" "35" + "tall" "32" + "ControlName" "Panel" +// "pin_to_sibling" "BackgroundWeapon2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "PaintBackgroundType" "2" + "bgcolor_override" "32 57 82 255" + "zpos" "2" + } + "SilhouetteWeapon0" + { + "fieldName" "SilhouetteWeapon0" +// "xpos" "-4" +// "ypos" "-4" + "xpos" "165" + "ypos" "4" + "wide" "60" + "tall" "30" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "briefing/weapon_primary_silhouette" + "zpos" "3" + "visible" "1" + } + "SilhouetteWeapon1" + { + "fieldName" "SilhouetteWeapon1" +// "xpos" "-4" +// "ypos" "-4" + "xpos" "237" + "ypos" "4" + "wide" "60" + "tall" "30" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "briefing/weapon_primary_silhouette" + "zpos" "3" + } + "SilhouetteWeapon2" + { + "fieldName" "SilhouetteWeapon2" +// "xpos" "-4" +// "ypos" "-4" + "xpos" "309" + "ypos" "4" + "wide" "28" + "tall" "28" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "briefing/weapon_extra_silhouette" + "zpos" "3" + } + "ReadyCheckImage" + { + "fieldName" "ReadyCheckImage" + "ControlName" "ImagePanel" + "xpos" "3" + "ypos" "0" + "scaleImage" "1" + "wide" "12" + "tall" "12" + "zpos" "1" + } + "VoiceIcon" + { + "fieldName" "VoiceIcon" + "ControlName" "ImagePanel" + "xpos" "3" + "ypos" "11" + "scaleImage" "1" + "wide" "12" + "tall" "12" + "zpos" "1" + "image" "../voice/voice_icon_hud" + } + "TracePlayerButton" + { + "fieldName" "TracePlayerButton" + "xpos" "0" + "ypos" "22" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + // changing cyclers + "ChangingSlot0" + { + "fieldName" "ChangingSlot0" + "xpos" "128" + "ypos" "4" + "wide" "28" + "tall" "28" + "ControlName" "ImagePanel" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } + "ChangingSlot1" + { + "fieldName" "ChangingSlot1" + "xpos" "180" + "ypos" "4" + "wide" "28" + "tall" "28" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon0" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } + "ChangingSlot2" + { + "fieldName" "ChangingSlot2" + "xpos" "253" + "ypos" "4" + "wide" "28" + "tall" "28" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon1" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } + "ChangingSlot3" + { + "fieldName" "ChangingSlot3" + "xpos" "308" + "ypos" "4" + "wide" "28" + "tall" "28" + "ControlName" "ImagePanel" +// "pin_to_sibling" "BackgroundWeapon2" +// "pin_corner_to_sibling" "0" +// "pin_to_sibling_corner" "0" + "scaleImage" "1" + "image" "common/swarm_cycle_anim" + "zpos" "5" + "drawcolor" "169 213 255 64" + } +} diff --git a/reactivedrop/content/trace_player_ui/resource/ui/nb_main_panel.res b/reactivedrop/content/trace_player_ui/resource/ui/nb_main_panel.res new file mode 100644 index 000000000..9c8d9fec7 --- /dev/null +++ b/reactivedrop/content/trace_player_ui/resource/ui/nb_main_panel.res @@ -0,0 +1,300 @@ +"Resource/UI/NB_Main_Panel.res" +{ + "MainPanel" + { + "fieldName" "MainPanel" + "xpos" "0" + "ypos" "0" + "wide" "f0" + "tall" "f0" + "ControlName" "NB_Main_Panel" + } + "LeaderLabel" + { + "fieldName" "LeaderLabel" + "xpos" "c-120" + "ypos" "0" + "wide" "200" + "tall" "23" + "font" "Default" + "labelText" "LeaderLabel" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "47 79 111 255" + "zpos" "2" + } + "TeamLabel" + { + "fieldName" "TeamLabel" + "xpos" "c85" + "ypos" "0" + "wide" "200" + "tall" "23" + "font" "Default" + "labelText" "TeamLabel" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "255 0 0 255" + "zpos" "2" + } + "MissionDetailsButton" + { + "fieldName" "MissionDetailsButton" + "xpos" "c147" + "ypos" "r23" + "wide" "117" + "tall" "27" + "ControlName" "CNB_Button" + "labelText" "#nb_mission_details_button" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "FriendsButton" + { + "fieldName" "FriendsButton" + "xpos" "c10" + "ypos" "r23" + "wide" "117" + "tall" "27" + "ControlName" "CNB_Button" + "labelText" "#nb_friends" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "ChangeMissionButton" + { + "fieldName" "ChangeMissionButton" + "xpos" "c10" + "ypos" "r23" + "wide" "117" + "tall" "27" + "ControlName" "CNB_Button" + "labelText" "#asw_campaign_vote" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "PromotionButton" + { + "fieldName" "PromotionButton" + "xpos" "c-26" + "ypos" "39" + "wide" "80" + "tall" "18" + "ControlName" "CNB_Button" + "labelText" "#nb_promote" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "TeamChangeButton" + { + "fieldName" "TeamChangeButton" + "xpos" "c-186" + "ypos" "75" + "wide" "80" + "tall" "18" + "ControlName" "CNB_Button" + "labelText" "#rd_str_change_team" // CHANGE TEAM + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + "visible" "0" // by default it is invisible and only shown for team deathmatch + } + "ReadyButton" + { + "fieldName" "ReadyButton" + "xpos" "c-264" + "ypos" "r23" + "wide" "117" + "tall" "27" + "ControlName" "CNB_Button" + "labelText" "#nb_ready" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "ChatButton" + { + "fieldName" "ChatButton" + "xpos" "c-142" + "ypos" "r20" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "VoteButton" + { + "fieldName" "VoteButton" + "xpos" "c-122" + "ypos" "r20" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "LeaderboardButton" + { + "fieldName" "LeaderboardButton" + "xpos" "c-102" + "ypos" "r20" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "TraceMeButton" + { + "fieldName" "TraceMeButton" + "xpos" "c-261" + "ypos" "150" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "AddBotButton" + { + "fieldName" "AddBotButton" + "xpos" "c-243" + "ypos" "150" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "DeselectMarines" + { + "fieldName" "DeselectMarines" + "xpos" "c-225" + "ypos" "150" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "ReadyCheckImage" + { + "fieldName" "ReadyCheckImage" + "xpos" "c-278" + "ypos" "r17" + "wide" "14" + "tall" "14" + "ControlName" "ImagePanel" + "zpos" "4" + "scaleImage" "1" + } + "LobbyRowsScroll" + { + "fieldName" "LobbyRowsScroll" + "xpos" "c-204" + "ypos" "156" + "wide" "270" + "tall" "248" + "ControlName" "GenericPanelList" + "zpos" "1" + "autoResize" "1" + "pinCorner" "0" + "visible" "1" + "enabled" "1" + "tabPosition" "1" + "proportionalToParent" "1" + "bgcolor_override" "0 0 0 0" + } + "LobbyRow0" + { + "fieldName" "LobbyRow0" + "xpos" "c-284" + "ypos" "45" + "wide" "338" + "tall" "102" + "ControlName" "CNB_Lobby_Row" + } + "FlmPlayerFlyout" + { + "ControlName" "FlyoutMenu" + "fieldName" "FlmPlayerFlyout" + "visible" "0" + "wide" "0" + "tall" "0" + "zpos" "3" + "InitialFocus" "BtnSendMessage" + "ResourceFile" "resource/UI/basemodui/DropDownLobbySteamPlayer.res" + } + "LobbyTooltip" + { + "fieldName" "LobbyTooltip" + "xpos" "c70" + "ypos" "46" + "wide" "194" + "tall" "200" + "ControlName" "CNB_Lobby_Tooltip" + } + "VotePanel" + { + "fieldName" "VotePanel" + "ControlName" "CNB_VotePanel" + "visible" "0" + } + "MissionSummary" + { + "fieldName" "MissionSummary" + "xpos" "0" + "ypos" "5" + "wide" "194" + "ControlName" "CNB_Mission_Summary" + "pin_to_sibling" "LobbyTooltip" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "2" + } +// "ChatBackground" +// { +// "fieldName" "ChatBackground" +// "ControlName" "Panel" +// "bgcolor_override" "12 23 37 64" +// "PaintBackgroundType" "2" +// "xpos" "c-264" +// "ypos" "349" +// "wide" "319" +// "tall" "97" +// } +// "ChatBackgroundInner" +// { +// "fieldName" "ChatBackgroundInner" +// "ControlName" "Panel" +// "PaintBackgroundType" "2" +// "bgcolor_override" "16 39 63 200" +// "xpos" "c-262" +// "ypos" "351" +// "wide" "315" +// "tall" "93" +// } + + "WorkshopDownloadProgress" + { + "ControlName" "CRD_VGUI_Workshop_Download_Progress" + "fieldName" "WorkshopDownloadProgress" + "xpos" "r154" + "ypos" "r54" + "wide" "149" + "tall" "49" + "zpos" "20" + "visible" "1" + "enabled" "1" + } +} diff --git a/reactivedrop/content/trace_player_ui/resource/ui/nb_main_panel_2024.res b/reactivedrop/content/trace_player_ui/resource/ui/nb_main_panel_2024.res new file mode 100644 index 000000000..50b1e3244 --- /dev/null +++ b/reactivedrop/content/trace_player_ui/resource/ui/nb_main_panel_2024.res @@ -0,0 +1,301 @@ +"Resource/UI/NB_Main_Panel.res" +{ + "MainPanel" + { + "fieldName" "MainPanel" + "xpos" "0" + "ypos" "0" + "wide" "f0" + "tall" "f0" + "ControlName" "NB_Main_Panel" + } + "LeaderLabel" + { + "fieldName" "LeaderLabel" + "xpos" "c-120" + "ypos" "0" + "wide" "200" + "tall" "23" + "font" "Default" + "labelText" "LeaderLabel" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "47 79 111 255" + "zpos" "2" + } + "TeamLabel" + { + "fieldName" "TeamLabel" + "xpos" "c85" + "ypos" "0" + "wide" "200" + "tall" "23" + "font" "Default" + "labelText" "TeamLabel" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "113 142 181 255" + "zpos" "2" + } + "MissionDetailsButton" + { + "fieldName" "MissionDetailsButton" + "xpos" "c147" + "ypos" "r23" + "wide" "117" + "tall" "27" + "ControlName" "CNB_Button" + "labelText" "#nb_mission_details_button" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "FriendsButton" + { + "fieldName" "FriendsButton" + "xpos" "c10" + "ypos" "r23" + "wide" "117" + "tall" "27" + "ControlName" "CNB_Button" + "labelText" "#nb_friends" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "ChangeMissionButton" + { + "fieldName" "ChangeMissionButton" + "xpos" "c10" + "ypos" "r23" + "wide" "117" + "tall" "27" + "ControlName" "CNB_Button" + "labelText" "#asw_campaign_vote" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "PromotionButton" + { + "fieldName" "PromotionButton" + "xpos" "c-24" + "ypos" "24" + "wide" "68" + "tall" "14" + "ControlName" "CNB_Button" + "labelText" "#nb_promote" + "textAlignment" "center" + "font" "Default" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "TeamChangeButton" + { + "fieldName" "TeamChangeButton" + "xpos" "c186" + "ypos" "4" + "wide" "74" + "tall" "14" + "ControlName" "CNB_Button" + "labelText" "#rd_str_change_team" // CHANGE TEAM + "textAlignment" "center" + "font" "Default" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + "visible" "0" // by default it is invisible and only shown for team deathmatch + } + "ReadyButton" + { + "fieldName" "ReadyButton" + "xpos" "c-264" + "ypos" "r23" + "wide" "117" + "tall" "27" + "ControlName" "CNB_Button" + "labelText" "#nb_ready" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "ChatButton" + { + "fieldName" "ChatButton" + "xpos" "c-142" + "ypos" "r20" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "VoteButton" + { + "fieldName" "VoteButton" + "xpos" "c-122" + "ypos" "r20" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "LeaderboardButton" + { + "fieldName" "LeaderboardButton" + "xpos" "c-102" + "ypos" "r20" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "TraceMeButton" + { + "fieldName" "TraceMeButton" + "xpos" "c-300" + "ypos" "60" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "AddBotButton" + { + "fieldName" "AddBotButton" + "xpos" "c-300" + "ypos" "74" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "DeselectMarines" + { + "fieldName" "DeselectMarines" + "xpos" "c-300" + "ypos" "88" + "wide" "16" + "tall" "16" + "ControlName" "CBitmapButton" + "zpos" "4" + "scaleImage" "1" + } + "ReadyCheckImage" + { + "fieldName" "ReadyCheckImage" + "xpos" "c-296" + "ypos" "r20" + "wide" "12" + "tall" "12" + "ControlName" "ImagePanel" + "zpos" "4" + "scaleImage" "1" + } + + "LobbyRowsScroll" + { + "fieldName" "LobbyRowsScroll" + "xpos" "c-304" + "ypos" "101" + "wide" "370" + "tall" "326" + "ControlName" "GenericPanelList" + "zpos" "1" + "autoResize" "1" + "pinCorner" "0" + "visible" "1" + "enabled" "1" + "tabPosition" "1" + "proportionalToParent" "1" + "bgcolor_override" "0 0 0 0" + } + "LobbyRow0" + { + "fieldName" "LobbyRow0" + "xpos" "c-304" + "ypos" "24" + "wide" "370" + "tall" "102" + "ControlName" "CNB_Lobby_Row" + } + "FlmPlayerFlyout" + { + "ControlName" "FlyoutMenu" + "fieldName" "FlmPlayerFlyout" + "visible" "0" + "wide" "0" + "tall" "0" + "zpos" "3" + "InitialFocus" "BtnSendMessage" + "ResourceFile" "resource/UI/basemodui/DropDownLobbySteamPlayer.res" + } + "LobbyTooltip" + { + "fieldName" "LobbyTooltip" + "xpos" "c70" + "ypos" "46" + "wide" "194" + "tall" "200" + "ControlName" "CNB_Lobby_Tooltip" + } + "VotePanel" + { + "fieldName" "VotePanel" + "ControlName" "CNB_VotePanel" + "visible" "0" + } + "MissionSummary" + { + "fieldName" "MissionSummary" + "xpos" "0" + "ypos" "5" + "wide" "194" + "ControlName" "CNB_Mission_Summary" + "pin_to_sibling" "LobbyTooltip" + "pin_corner_to_sibling" "0" + "pin_to_sibling_corner" "2" + } +// "ChatBackground" +// { +// "fieldName" "ChatBackground" +// "ControlName" "Panel" +// "bgcolor_override" "12 23 37 64" +// "PaintBackgroundType" "2" +// "xpos" "c-264" +// "ypos" "349" +// "wide" "319" +// "tall" "97" +// } +// "ChatBackgroundInner" +// { +// "fieldName" "ChatBackgroundInner" +// "ControlName" "Panel" +// "PaintBackgroundType" "2" +// "bgcolor_override" "16 39 63 200" +// "xpos" "c-262" +// "ypos" "351" +// "wide" "315" +// "tall" "93" +// } + + "WorkshopDownloadProgress" + { + "ControlName" "CRD_VGUI_Workshop_Download_Progress" + "fieldName" "WorkshopDownloadProgress" + "xpos" "r150" + "ypos" "r75" + "wide" "145" + "tall" "45" + "zpos" "20" + "visible" "1" + "enabled" "1" + } +} diff --git a/reactivedrop/content/trace_player_ui/resource/ui/playerlistpanel.res b/reactivedrop/content/trace_player_ui/resource/ui/playerlistpanel.res new file mode 100644 index 000000000..3b9e37f8c --- /dev/null +++ b/reactivedrop/content/trace_player_ui/resource/ui/playerlistpanel.res @@ -0,0 +1,298 @@ +"Resource/UI/PlayerListPanel.res" +{ + "PlayerListPanel" + { + "fieldName" "PlayerListPanel" + "ControlName" "EditablePanel" + "xpos" "0" + "ypos" "0" + "wide" "f0" + "tall" "f0" + } +// "VoteBG" +// { +// "fieldName" "VoteBG" +// "xpos" "c-250" +// "ypos" "300" +// "wide" "500" +// "tall" "70" +// "ControlName" "Panel" +// "bgcolor_override" "0 0 0 128" +// "zpos" "1" +// } + "MissionLabel" + { + "fieldName" "MissionLabel" + "xpos" "c-210" + "ypos" "40" + "wide" "250" + "tall" "22" + "zpos" "5" + "font" "DefaultExtraLarge" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "224 224 224 255" + } + "Team1Score" + { + "fieldName" "Team1Score" + "xpos" "c15" + "ypos" "40" + "wide" "150" + "tall" "25" + "zpos" "5" + "font" "DefaultLarge" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "224 224 224 255" + } + "Team2Score" + { + "fieldName" "Team2Score" + "xpos" "c165" + "ypos" "40" + "wide" "150" + "tall" "25" + "zpos" "5" + "font" "DefaultLarge" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "224 224 224 255" + } + "CurrentVoteTitle" + { + "fieldName" "CurrentVoteTitle" + "xpos" "c-240" + "ypos" "398" + "wide" "250" + "tall" "25" + "zpos" "5" + "font" "Default" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "224 224 224 255" + } + "MapName" + { + "fieldName" "MapName" + "xpos" "c-240" + "ypos" "422" + "wide" "250" + "tall" "25" + "zpos" "5" + "font" "DefaultLarge" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "83 148 192 255" + } + "VisibilityLabel" + { + "fieldName" "VisibilityLabel" + "xpos" "c-290" + "ypos" "20" + "wide" "420" + "tall" "17" + "font" "Default" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "224 224 224 255" + "zpos" "5" + } + "DifficultyLabel" + { + "fieldName" "DifficultyLabel" + "xpos" "c-210" + "ypos" "60" + "wide" "420" + "tall" "17" + "font" "Default" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "224 224 224 255" + "zpos" "5" + } + "ServerLabel" + { + "fieldName" "ServerLabel" + "xpos" "c-210" + "ypos" "60" + "wide" "420" + "tall" "17" + "font" "Default" + "textAlignment" "east" + "ControlName" "Label" + "fgcolor_override" "224 224 224 255" + "zpos" "5" + } + "Counter" + { + "fieldName" "Counter" + "xpos" "c-75" + "ypos" "398" + "wide" "150" + "tall" "25" + "font" "Default" + "textAlignment" "center" + "ControlName" "Label" + "fgcolor_override" "224 224 224 255" + "zpos" "5" + } + "YesCount" + { + "fieldName" "YesCount" + "xpos" "c-25" + "ypos" "398" + "wide" "150" + "tall" "25" + "font" "Default" + "textAlignment" "east" + "ControlName" "Label" + "fgcolor_override" "224 224 224 255" + "zpos" "5" + } + "NoCount" + { + "fieldName" "NoCount" + "xpos" "c-25" + "ypos" "426" + "wide" "150" + "tall" "25" + "font" "Default" + "textAlignment" "east" + "ControlName" "Label" + "fgcolor_override" "224 224 224 255" + "zpos" "5" + } + "RestartButton" + { + "fieldName" "RestartButton" + "ControlName" "CNB_Button" + "xpos" "c147" + "ypos" "r23" + "wide" "117" + "tall" "27" + "labelText" "#asw_button_restart_mis" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "BackButton" + { + "fieldName" "BackButton" + "ControlName" "CNB_Button" + "xpos" "c-264" + "ypos" "r23" + "wide" "117" + "tall" "27" + "labelText" "#nb_back" + "textAlignment" "center" + "font" "DefaultMedium" + "command" "Back" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "VisibilityButton" + { + "fieldName" "VisibilityButton" + "xpos" "c-108" + "ypos" "r23" + "wide" "117" + "tall" "27" + "ControlName" "CNB_Button" + "labelText" "#L4D360UI_Lobby_FriendsTitle" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "TipsLabel" + { + "fieldName" "TipsLabel" + "xpos" "c-120" + "ypos" "r39" + "wide" "420" + "tall" "17" + "font" "Default" + "textAlignment" "west" + "ControlName" "Label" + "fgcolor_override" "224 224 224 255" + "zpos" "5" + } + "CampaignVoteButton" + { + "fieldName" "CampaignVoteButton" + "ControlName" "CNB_Button" + "xpos" "c20" + "ypos" "r23" + "wide" "117" + "tall" "27" + "labelText" "#asw_campaign_vote" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "Yes" + { + "fieldName" "Yes" + "ControlName" "CNB_Button" + "xpos" "c132" + "ypos" "398" + "wide" "110" + "tall" "25" + "labelText" "#asw_vote_yes" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "No" + { + "fieldName" "No" + "ControlName" "CNB_Button" + "xpos" "c132" + "ypos" "426" + "wide" "110" + "tall" "25" + "labelText" "#asw_vote_no" + "textAlignment" "center" + "font" "DefaultMedium" + "fgcolor_override" "113 142 181 255" + "zpos" "3" + } + "PlayerListScroll" + { + "ControlName" "GenericPanelList" + "fieldName" "PlayerListScroll" + // positioning done by code + "zpos" "1" + "autoResize" "1" + "pinCorner" "0" + "visible" "1" + "enabled" "1" + "tabPosition" "1" + "proportionalToParent" "1" + "bgcolor_override" "0 0 0 0" + } + "SettingAutoReportVotes" + { + "ControlName" "CCvarToggleCheckButton" + "fieldName" "SettingAutoReportVotes" + "xpos" "c-250" + "ypos" "360" + "wide" "500" + "tall" "20" + "ResourceFile" "resource/ui/option_simple_checkbox.res" + } + "SettingTracePlayerToggle" + { + "ControlName" "CCvarToggleCheckButton" + "fieldName" "SettingTracePlayerToggle" + "xpos" "c" + "ypos" "360" + "wide" "500" + "tall" "20" + "ResourceFile" "resource/ui/option_simple_checkbox.res" + } +} diff --git a/src/game/client/swarm/asw_briefing.cpp b/src/game/client/swarm/asw_briefing.cpp index d6c14e311..f4d035cc1 100644 --- a/src/game/client/swarm/asw_briefing.cpp +++ b/src/game/client/swarm/asw_briefing.cpp @@ -1083,3 +1083,16 @@ const CRD_ItemInstance &CASW_Briefing::GetEquippedWeapon( int nLobbySlot, int nW return instance; } + +int CASW_Briefing::GetPlayerIndex(int nLobbySlot) +{ + if (nLobbySlot < 0 || nLobbySlot >= NUM_BRIEFING_LOBBY_SLOTS || !IsLobbySlotOccupied(nLobbySlot)) + return -1; + + C_ASW_Player* pPlayer = m_LobbySlotMapping[nLobbySlot].m_hPlayer.Get(); + if (pPlayer) + { + return pPlayer->entindex(); + } + return -1; // not found, or not a player +} diff --git a/src/game/client/swarm/asw_briefing.h b/src/game/client/swarm/asw_briefing.h index ccf77dd4f..d7cc991af 100644 --- a/src/game/client/swarm/asw_briefing.h +++ b/src/game/client/swarm/asw_briefing.h @@ -79,6 +79,7 @@ class CASW_Briefing : public IBriefing int LobbySlotToMarineResourceIndex( int nLobbySlot ); void UpdateLobbySlotMapping(); + virtual int GetPlayerIndex(int nLobbySlot); int m_nLastLobbySlotMappingFrame; LobbySlotMapping_t m_LobbySlotMapping[ NUM_BRIEFING_LOBBY_SLOTS ]; diff --git a/src/game/client/swarm/c_asw_marine.cpp b/src/game/client/swarm/c_asw_marine.cpp index 5df9170f3..a48b1423e 100644 --- a/src/game/client/swarm/c_asw_marine.cpp +++ b/src/game/client/swarm/c_asw_marine.cpp @@ -49,6 +49,10 @@ #include #include "stats_report.h" #include "asw_weapon_night_vision.h" +#ifdef CLIENT_DLL +#include +#include +#endif // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" @@ -103,6 +107,98 @@ extern ConVar rd_team_color_ally; extern ConVar rd_team_color_enemy; extern float g_fMarinePoisonDuration; +#ifdef CLIENT_DLL +Color g_TraceColorArray[8] = +{ + Color(0, 0, 0, 255), // black (unused) + Color(255, 255, 255, 255), // white + Color(255, 255, 0, 255), // yellow + Color(0, 255, 0, 255), // green + Color(255, 0, 0, 255), // red + Color(0, 0, 255, 255), // blue + Color(255, 0, 255, 255), // pink + Color(0, 255, 255, 255), // cyan +}; +std::vector g_nTracePlayer2Color = std::vector(MAX_PLAYERS, 0); +std::vector g_nTraceColor2Player = std::vector(8, 0); +ConVar cl_trace_player_enable("cl_trace_player_enable", "0", FCVAR_ARCHIVE | FCVAR_CLIENTDLL, "Show player movement traces in the client. 0 = disabled, 1 = enabled."); +ConVar cl_trace_player_max_targets("cl_trace_player_max_targets", "3", FCVAR_ARCHIVE | FCVAR_CLIENTDLL, "Maximum number of players to trace positions for in the client.", true, 1.0f, true, 7.0f); +ConVar cl_trace_player_fadeout_time("cl_trace_player_fadeout_time", "-1", FCVAR_ARCHIVE | FCVAR_CLIENTDLL, "Trace fadeout time."); +ConVar cl_trace_player_opacity("cl_trace_player_opacity", "1", FCVAR_ARCHIVE | FCVAR_CLIENTDLL, "Opacity of the player trace positions in the client. 0.0 means fully transparent, 1.0 means fully opaque.", true, 0.0f, true, 1.0f); + +void RemoveInvalidTracePlayersAndColors() +{ + for (int i = 1; i <= 7; i++) + { + // if this color's playerIndex is not a valid player, or if the color index is greater than the max targets, reset it + if (g_nTraceColor2Player[i] <= 0 || g_nTraceColor2Player[i] >= MAX_PLAYERS || !UTIL_PlayerByIndex(g_nTraceColor2Player[i]) || i > cl_trace_player_max_targets.GetInt()) + { + g_nTraceColor2Player[i] = 0; + } + } + for (int i = 1; i < MAX_PLAYERS; i++) + { + // if this playerIndex is not a valid player, or if the player's colorIndex is greater than the max targets, reset it + if (!UTIL_PlayerByIndex(i) || g_nTracePlayer2Color[i] <= 0 || g_nTracePlayer2Color[i] > cl_trace_player_max_targets.GetInt()) + { + g_nTracePlayer2Color[i] = 0; + } + + } + // cross-check the color -> player mapping, remove any record if not match + for (int i = 1; i <= cl_trace_player_max_targets.GetInt(); i++) + { + if (g_nTracePlayer2Color[g_nTraceColor2Player[i]] != i) + { + g_nTraceColor2Player[i] = 0; + } + } + // cross-check the player -> color mapping, remove any record if not match + for (int i = 1; i < MAX_PLAYERS; i++) + { + if (g_nTraceColor2Player[g_nTracePlayer2Color[i]] != i) + { + g_nTracePlayer2Color[i] = 0; + } + } +} + +void ToggleTraceColor(int playerIndex) +{ + RemoveInvalidTracePlayersAndColors(); + if ( playerIndex < 0 || playerIndex >= MAX_PLAYERS ) + return; + int nColorIndex = g_nTracePlayer2Color[playerIndex]; + if ( nColorIndex != 0 ) + { + g_nTracePlayer2Color[playerIndex] == 0; + g_nTraceColor2Player[nColorIndex] = 0; + } + else + { + // find an available color index + bool hasAvailableColor = false; + for ( int i = 1; i <= cl_trace_player_max_targets.GetInt(); i++ ) + { + if ( g_nTraceColor2Player[i] == 0 ) + { + g_nTracePlayer2Color[playerIndex] = i; + g_nTraceColor2Player[i] = playerIndex; + hasAvailableColor = true; + break; + } + } + if(!hasAvailableColor) + { + // no available color, so replace the last one + g_nTracePlayer2Color[g_nTraceColor2Player[cl_trace_player_max_targets.GetInt()]] = 0; + g_nTraceColor2Player[cl_trace_player_max_targets.GetInt()] = playerIndex; + g_nTracePlayer2Color[playerIndex] = cl_trace_player_max_targets.GetInt(); + } + } +} +#endif + #define FLASHLIGHT_DISTANCE 1000 #define ASW_PROJECTOR_FLASHLIGHT 1 @@ -860,6 +956,8 @@ void C_ASW_Marine::ClientThink() TickEmotes( deltatime ); TickRedName( deltatime ); + TickTrace(deltatime); + UpdateFireEmitters(); UpdateJumpJetEffects(); UpdateElectrifiedArmor(); @@ -974,7 +1072,129 @@ void C_ASW_Marine::DoWaterRipples() DispatchEffect( "aswwatersplash", data ); //static Vector s_MarineWaterSplashColor( 0.5, 0.5, 0.5 ); //FX_ASWWaterRipple(data.m_vOrigin, 1.0f, &s_MarineWaterSplashColor, 1.5f, 0.1f); - } + } +} + +inline float ManhattanDistance(const Vector &a, const Vector &b) +{ + return fabs(a.x - b.x) + fabs(a.y - b.y) + fabs(a.z - b.z); +} + +/// +/// Performs Catmull-Rom interpolation on the player movement traces stored in lstIn and outputs the interpolated positions to vecOut vector. +/// +/// List of player movement traces to interpolate. +/// Output vector to store the interpolated positions. +/// Number of interpolation steps between each pair of points. +void CatmullRomInterp(std::list& lstIn, std::vector& vecOut, int interpCount) +{ + vecOut.clear(); + std::vector vecPoints; + vecPoints.reserve(lstIn.size()); + for (const auto& point : lstIn) { + vecPoints.push_back(point); + } + + const size_t numPoints = vecPoints.size(); + if (numPoints == 0) { + return; + } + if (numPoints == 1) { + vecOut.push_back(vecPoints[0]); + return; + } + + size_t totalPoints = numPoints + (numPoints - 1) * interpCount; + vecOut.reserve(totalPoints); + + // add the start point of the segment + vecOut.push_back(vecPoints[0]); + for (size_t i = 0; i < numPoints - 1; ++i) { + // get the previous, current, next and next-next points. Need to pad virtual points at the start and end to ensure we can interpolate the first and last segments correctly. + const Vector& p0 = (i == 0) ? vecPoints[0].m_vecPosition : vecPoints[i - 1].m_vecPosition; + const Vector& p1 = vecPoints[i].m_vecPosition; + const Vector& p2 = vecPoints[i + 1].m_vecPosition; + const Vector& p3 = (i + 2 < numPoints) ? vecPoints[i + 2].m_vecPosition : vecPoints[i + 1].m_vecPosition; + + // add interpolated points between p1 and p2, excluding p1 and p2 themselves + for (int j = 1; j <= interpCount; ++j) { + // calculate the interpolation parameter u, (0, 1) + float u = (float)j / (interpCount + 1); + float u2 = u * u; + float u3 = u2 * u; + + // Catmull-Rom interpolation formula for a point q(u) on the curve defined by points p0, p1, p2, p3 + // q(u) = 0.5 * ((2 * p1) + + // (-p0 + p2) * u + + // (2*p0 - 5*p1 + 4*p2 - p3) * u^2 + + // (-p0 + 3*p1 - 3*p2 + p3) * u^3) + MovementTrace_t temp; + temp.m_flTimestamp = -1; + temp.m_vecPosition = 0.5f * ((2 * p1) + (-p0 + p2) * u + (2 * p0 - 5 * p1 + 4 * p2 - p3) * u2 + (-p0 + 3 * p1 - 3 * p2 + p3) * u3); + if (j == 1) { + auto vecTargetDirection = temp.m_vecPosition - vecOut.back().m_vecPosition; + vecTargetDirection.z = 0; + float angleRad = atan2(vecTargetDirection.y, vecTargetDirection.x); + vecOut.back().m_flAngleDegree = RAD2DEG(angleRad); + } + vecOut.push_back(temp); + } + + // add the end point of the segment + vecOut.push_back(vecPoints[i + 1]); + } +} + +void C_ASW_Marine::TickTrace(float d) +{ + // Not sure if the engine is single threaded or not, meanwhile, the list is accessed form other places. Therefore, lock m_TraceLock, just in case we are accessing the list from multiple threads, preventing concurrent modification of m_lstTracePlayerMovementList. Can safely remove the lock if the engine is gauranteed to be single threaded. + std::lock_guard lock(m_TraceLock); + + m_nTraceSkip--; + + m_vecCurrentTraceOrigin = GetAbsOrigin(); + m_vecLastTraceOrigin = m_vecCurrentTraceOrigin; + // get current marine position + struct MovementTrace_t movement; + movement.m_flTimestamp = gpGlobals->curtime; + movement.m_vecPosition = m_vecCurrentTraceOrigin; + m_lstTrace.push_back(movement); + + if (m_nTraceSkip > 0) + return; + + m_nTraceSkip = 30; + for (auto iter = m_lstTrace.begin(); iter != m_lstTrace.end(); ++iter) + { + // Entering the loop means list is not empty, so we can safely use rbegin() here. + auto iter2 = m_lstTrace.rbegin(); + // iterate through the list of player movement traces reversily, until we reach the iter postion. The rbegin() always stores the latest player position, so we skip it. + for (iter2++; iter2 != m_lstTrace.rend() && iter2->m_flTimestamp > iter->m_flTimestamp; ++iter2) + { + if (fabs(iter->m_vecPosition.z - iter2->m_vecPosition.z) < 20 && ManhattanDistance(iter->m_vecPosition, iter2->m_vecPosition) < 400.0f) + { + Ray_t ray; + ray.Init(iter->m_vecPosition + Vector(0, 0, 10), iter2->m_vecPosition + Vector(0, 0, 10), GetCollideable()->OBBMins(), GetCollideable()->OBBMaxs()); + + trace_t trace; + UTIL_TraceRay(ray, (CONTENTS_SOLID | CONTENTS_MOVEABLE | CONTENTS_PLAYERCLIP | CONTENTS_GRATE), this, COLLISION_GROUP_PLAYER_MOVEMENT, &trace); + + if (trace.fraction != 1.0f) + { + continue; // no ground + } + + // if the distance is less than 500 units and there is no obstacle between the two positions, we can remove the trace. It is believed as the player moves back to the same position, then we can remove the trace between the two positions + auto timeStamp1 = iter->m_flTimestamp; + auto timeStamp2 = iter2->m_flTimestamp; + m_lstTrace.remove_if([timeStamp1, timeStamp2](const MovementTrace_t& item) { + return item.m_flTimestamp > timeStamp1 && item.m_flTimestamp <= timeStamp2; + }); + } + } + } + + CatmullRomInterp(m_lstTrace, m_vecTraceInterpolated, 10); } void C_ASW_Marine::CreateWeaponEmitters() diff --git a/src/game/client/swarm/c_asw_marine.h b/src/game/client/swarm/c_asw_marine.h index 8722f02a6..d8fb7a601 100644 --- a/src/game/client/swarm/c_asw_marine.h +++ b/src/game/client/swarm/c_asw_marine.h @@ -16,6 +16,18 @@ #include "asw_deathmatch_mode.h" #include "dlight.h" #include "rd_inventory_shared.h" +#ifdef CLIENT_DLL +#include +#include +#include + +struct MovementTrace_t +{ + float m_flTimestamp; + Vector m_vecPosition; + float m_flAngleDegree; +}; +#endif class C_ASW_Player; class C_ASW_Marine_Resource; @@ -293,6 +305,15 @@ class C_ASW_Marine : public C_ASW_VPhysics_NPC, public IASWPlayerAnimStateHelper // emote system void TickEmotes( float d ); bool TickEmote( float d, int bit, float &fEmoteTime ); +#ifdef CLIENT_DLL + int m_nTraceSkip = 10; + std::mutex m_TraceLock; + Vector m_vecCurrentTraceOrigin = vec3_origin; + Vector m_vecLastTraceOrigin = vec3_origin; + void TickTrace(float d); + std::list m_lstTrace = std::list(); // list of positions and times for the last few frames + std::vector m_vecTraceInterpolated = std::vector(); +#endif CNetworkVar( int, m_iEmote ); int m_iClientEmote; float m_fEmoteMedicTime; diff --git a/src/game/client/swarm/ibriefing.h b/src/game/client/swarm/ibriefing.h index 359614e2b..3559cb0c8 100644 --- a/src/game/client/swarm/ibriefing.h +++ b/src/game/client/swarm/ibriefing.h @@ -71,6 +71,7 @@ abstract_class IBriefing virtual const IBriefing_ItemInstance &GetEquippedMedal( int nLobbySlot, int nMedalIndex ) = 0; virtual const IBriefing_ItemInstance &GetEquippedSuit( int nLobbySlot ) = 0; virtual const IBriefing_ItemInstance &GetEquippedWeapon( int nLobbySlot, int nWeaponSlot ) = 0; + virtual int GetPlayerIndex(int nLobbySlot) { return -1; }; }; #define NUM_BRIEFING_LOBBY_SLOTS ( ASW_MAX_MARINE_RESOURCES + MAX_PLAYERS - 1 ) // was 9, was 4 diff --git a/src/game/client/swarm/vgui/asw_hud_emotes.cpp b/src/game/client/swarm/vgui/asw_hud_emotes.cpp index dd33e0594..ab3299965 100644 --- a/src/game/client/swarm/vgui/asw_hud_emotes.cpp +++ b/src/game/client/swarm/vgui/asw_hud_emotes.cpp @@ -1,4 +1,3 @@ - #include "cbase.h" #include "hud.h" #include "hud_macros.h" @@ -31,6 +30,13 @@ #include "engine/IVDebugOverlay.h" #include "vguimatsurface/imatsystemsurface.h" #include "tier1/fmtstr.h" +#ifdef CLIENT_DLL + #include + #include + #include "c_basetempentity.h" + #include "c_te_legacytempents.h" + #include "tempent.h" +#endif // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" @@ -40,6 +46,17 @@ using namespace vgui; extern ConVar asw_draw_hud; ConVar _rd_traitors_challenge_enabled("_rd_traitors_challenge_enabled", "0", FCVAR_REPLICATED | FCVAR_HIDDEN, "An internal convar to indicate whether the traitors challenge is enabled or not. This is used to determine whether the traitor emotes should be shown or not."); +#ifdef CLIENT_DLL +extern ConVar cl_trace_player_enable; +extern ConVar cl_trace_player_opacity; +extern ConVar cl_trace_player_max_targets; +extern Color g_TraceColorArray[8]; +extern std::vector g_nTracePlayer2Color; +extern std::vector g_nTraceColor2Player; +extern void RemoveInvalidTracePlayersAndColors(); +extern void ToggleTraceColor(int playerIndex); +#endif + //----------------------------------------------------------------------------- // Purpose: Shows the marines emote graphics //----------------------------------------------------------------------------- @@ -59,6 +76,9 @@ class CASWHudEmotes : public CASW_HudElement, public vgui::Panel virtual void PaintTraitorEmote(C_BaseEntity* pEnt, int iTexture, float fScale = 1.0f); virtual bool ShouldDraw( void ) { return asw_draw_hud.GetBool() && CASW_HudElement::ShouldDraw(); } + virtual void PaintTraces(); + virtual void PaintTracesFor(C_ASW_Marine* pMarine, Color color); + CPanelAnimationVarAliasType( int, m_nMedicTexture, "MedicEmoteTexture", "vgui/swarm/Emotes/EmoteMedic", "textureid" ); CPanelAnimationVarAliasType( int, m_nAmmoTexture, "AmmoEmoteTexture", "vgui/swarm/Emotes/EmoteAmmo", "textureid" ); CPanelAnimationVarAliasType( int, m_nSmileTexture, "SmileEmoteTexture", "vgui/swarm/Emotes/EmoteSmile", "textureid" ); @@ -75,6 +95,9 @@ class CASWHudEmotes : public CASW_HudElement, public vgui::Panel CPanelAnimationVarAliasType( int, m_nWeldTexture, "WeldTexture", "vgui/swarm/ClassIcons/WeldIcon", "textureid" ); CPanelAnimationVarAliasType( int, m_nReviveMarineTexture, "ReviveMarineTexture", "vgui/swarm/ClassIcons/revivemarine", "textureid" ); + //TracePlayer + CPanelAnimationVarAliasType(int, m_nTraceTexture, "TraceTexture", "vgui/arrow_right", "textureid"); + // Traitors emotes CPanelAnimationVarAliasType(int, m_nTraitorEmoteTexture, "TraitorEmoteTexture", "vgui/swarm/Emotes/EmoteTraitor", "textureid"); CPanelAnimationVarAliasType(int, m_nTraitorLeaderEmoteTexture, "TraitorLeaderEmoteTexture", "vgui/swarm/Emotes/EmoteTraitorLeader", "textureid"); @@ -112,6 +135,7 @@ void CASWHudEmotes::Paint() VPROF_BUDGET( "CASWHudEmotes::Paint", VPROF_BUDGETGROUP_ASW_CLIENT ); BaseClass::Paint(); PaintEmotes(); + PaintTraces(); } void CASWHudEmotes::PaintEmotes() @@ -311,6 +335,108 @@ void CASWHudEmotes::PaintEmote( C_BaseEntity *pEnt, float fTime, int iTexture, f } } +void CASWHudEmotes::PaintTraces() +{ + RemoveInvalidTracePlayersAndColors(); + C_ASW_Game_Resource* pGameResource = ASWGameResource(); + if (!pGameResource) + return; + + for (int i = 0; i < pGameResource->GetMaxMarineResources(); i++) + { + C_ASW_Marine_Resource* pMR = pGameResource->GetMarineResource(i); + if (!pMR) + continue; + + C_ASW_Marine* marine = pMR->GetMarineEntity(); + if (!pMR->IsInhabited() || !marine || g_nTracePlayer2Color[pMR->GetCommanderIndex()] == 0) + continue; + + PaintTracesFor(marine, g_TraceColorArray[g_nTracePlayer2Color[pMR->GetCommanderIndex()]]); + } +} + +void CASWHudEmotes::PaintTracesFor(C_ASW_Marine* pMarine, Color color) +{ + // Not sure if the engine is single threaded or not, meanwhile, the list is accessed form other places. Therefore, lock m_TraceLock, just in case we are accessing the list from multiple threads, preventing concurrent modification of m_lstTracePlayerMovementList. Can safely remove the lock if the engine is gauranteed to be single threaded. + std::lock_guard lock(pMarine->m_TraceLock); + + float fTimeRatio = 1.0 - gpGlobals->curtime / 3.0 + (int)(gpGlobals->curtime / 3.0); // current time + color[3] = 255 * pow(cl_trace_player_opacity.GetFloat(), 2.2); + int omx, omy; + float xPos, yPos; + float fScale = (ScreenHeight() / 768.0f); + float HalfW = 16.0f * fScale; + float HalfH = 16.0f * fScale; + Vector vecPosition, vecPositionNext, screenPos, screenPosNext; + Vector vecCameraFocus; + QAngle cameraAngle; + + ASWInput()->ASW_GetCameraLocation(C_ASW_Player::GetLocalASWPlayer(), vecCameraFocus, cameraAngle, omx, omy, false); + + // draw trace lines + surface()->DrawSetColor(color); + for (int i = 0; i < pMarine->m_vecTraceInterpolated.size() - 2; i++) + { + Vector vecPosition = pMarine->m_vecTraceInterpolated[i].m_vecPosition; + Vector vecPositionNext = pMarine->m_vecTraceInterpolated[i + 1].m_vecPosition; + + if (!debugoverlay->ScreenPosition(vecPosition, screenPos) && !debugoverlay->ScreenPosition(vecPositionNext, screenPosNext)) + { + surface()->DrawLine(screenPos[0], screenPos[1], screenPosNext[0], screenPosNext[1]); + } + } + + // draw trace direction icons + surface()->DrawSetColor(color); + surface()->DrawSetTexture(m_nTraceTexture); + for (auto iter = pMarine->m_vecTraceInterpolated.begin(); iter != pMarine->m_vecTraceInterpolated.end(); ++iter) + { + if (iter->m_flTimestamp < 0.0f || iter->m_flTimestamp + 1.0f > gpGlobals->curtime) + { + continue; + } + Vector vecPosition = iter->m_vecPosition; + + if (!debugoverlay->ScreenPosition(vecPosition, screenPos)) + { + xPos = screenPos[0]; + yPos = screenPos[1]; + + if (m_nTraceTexture != -1) + { + QAngle angFacing(0, -iter->m_flAngleDegree + cameraAngle.y - 90, 0); + + Vector vecCornerTL(-HalfW, -HalfH, 0); + Vector vecCornerTR(HalfW, -HalfH, 0); + Vector vecCornerBR(HalfW, HalfH, 0); + Vector vecCornerBL(-HalfW, HalfH, 0); + Vector vecCornerTL_rotated, vecCornerTR_rotated, vecCornerBR_rotated, vecCornerBL_rotated; + + // rotate it by our facing yaw + VectorRotate(vecCornerTL, angFacing, vecCornerTL_rotated); + VectorRotate(vecCornerTR, angFacing, vecCornerTR_rotated); + VectorRotate(vecCornerBR, angFacing, vecCornerBR_rotated); + VectorRotate(vecCornerBL, angFacing, vecCornerBL_rotated); + + Vertex_t points[4] = + { + Vertex_t(Vector2D(xPos + vecCornerTL_rotated.x, yPos + vecCornerTL_rotated.y), + Vector2D(0,0)), + Vertex_t(Vector2D(xPos + vecCornerTR_rotated.x, yPos + vecCornerTR_rotated.y), + Vector2D(1,0)), + Vertex_t(Vector2D(xPos + vecCornerBR_rotated.x, yPos + vecCornerBR_rotated.y), + Vector2D(1,1)), + Vertex_t(Vector2D(xPos + vecCornerBL_rotated.x, yPos + vecCornerBL_rotated.y), + Vector2D(0,1)) + }; + + surface()->DrawTexturedPolygon(4, points); + } + } + } +} + void CASWHudEmotes::PaintTraitorEmote(C_BaseEntity* pEnt, int iTexture, float fEmoteScale) { //Msg("PaintEmote scale = %f\n", fEmoteScale); diff --git a/src/game/client/swarm/vgui/nb_lobby_row.cpp b/src/game/client/swarm/vgui/nb_lobby_row.cpp index d7940278b..adff0328d 100644 --- a/src/game/client/swarm/vgui/nb_lobby_row.cpp +++ b/src/game/client/swarm/vgui/nb_lobby_row.cpp @@ -20,12 +20,24 @@ #include "gameui/swarm/vdropdownmenu.h" #include "gameui/swarm/vhybridbutton.h" #include "rd_inventory_shared.h" +#include "asw_deathmatch_mode.h" +#include // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" extern ConVar rd_legacy_ui; +#ifdef CLIENT_DLL +extern Color g_TraceColorArray[8]; +extern std::vector g_nTracePlayer2Color; +extern std::vector g_nTraceColor2Player; +extern ConVar cl_trace_player_enable; +extern ConVar cl_trace_player_max_targets; +extern void RemoveInvalidTracePlayersAndColors(); +extern void ToggleTraceColor(int playerIndex); +#endif + using namespace BaseModUI; CNB_Lobby_Row::CNB_Lobby_Row( vgui::Panel *parent, const char *name ) : BaseClass( parent, name ) @@ -98,35 +110,57 @@ CNB_Lobby_Row::CNB_Lobby_Row( vgui::Panel *parent, const char *name ) : BaseClas m_pXPBar->m_flBorder = 1.5f; m_nLobbySlot = 0; + // Create the TracePlayerButton + m_pTracePlayerButton = new CBitmapButton( this, "TracePlayerButton", " " ); + m_pTracePlayerButton->AddActionSignalTarget( this ); + m_pTracePlayerButton->SetCommand( "TracePlayerPressed" ); + m_pTracePlayerButton->SetImage(CBitmapButton::BUTTON_ENABLED, "vgui/briefing/trace_player_icon_off", color32{ 255, 255, 255, 255 }); + m_pTracePlayerButton->SetImage(CBitmapButton::BUTTON_PRESSED, "vgui/briefing/trace_player_icon_pressed", color32{ 255, 255, 255, 255 }); + m_pTracePlayerButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, "vgui/briefing/trace_player_icon_mouse_over", color32{ 255, 255, 255, 255 }); + + GetControllerFocus()->AddToFocusList( m_pPortraitButton ); GetControllerFocus()->AddToFocusList( m_pWeaponButton0 ); GetControllerFocus()->AddToFocusList( m_pWeaponButton1 ); GetControllerFocus()->AddToFocusList( m_pWeaponButton2 ); + GetControllerFocus()->AddToFocusList( m_pTracePlayerButton ); } CNB_Lobby_Row::~CNB_Lobby_Row() { - GetControllerFocus()->RemoveFromFocusList( m_pPortraitButton ); - GetControllerFocus()->RemoveFromFocusList( m_pWeaponButton0 ); - GetControllerFocus()->RemoveFromFocusList( m_pWeaponButton1 ); - GetControllerFocus()->RemoveFromFocusList( m_pWeaponButton2 ); + GetControllerFocus()->RemoveFromFocusList(m_pPortraitButton); + GetControllerFocus()->RemoveFromFocusList(m_pWeaponButton0); + GetControllerFocus()->RemoveFromFocusList(m_pWeaponButton1); + GetControllerFocus()->RemoveFromFocusList(m_pWeaponButton2); + GetControllerFocus()->RemoveFromFocusList(m_pTracePlayerButton); } -void CNB_Lobby_Row::ApplySchemeSettings( vgui::IScheme *pScheme ) +void CNB_Lobby_Row::ApplySchemeSettings(vgui::IScheme* pScheme) { - BaseClass::ApplySchemeSettings( pScheme ); - - if ( rd_legacy_ui.GetString()[0] != '\0' ) - LoadControlSettings( "resource/ui/nb_lobby_row.res" ); - else - LoadControlSettings( "resource/ui/nb_lobby_row_2024.res" ); + BaseClass::ApplySchemeSettings(pScheme); - for ( int i = 0;i < ASW_NUM_INVENTORY_SLOTS; i++ ) + // Unless we have clearly specified a correct scheme, we will use the default scheme for the game. + auto currentScheme = rd_legacy_ui.GetString(); + if (!Q_stricmp(currentScheme, "2004") + || !Q_stricmp(currentScheme, "2010") + || !Q_stricmp(currentScheme, "2017")) + { + LoadControlSettings("resource/ui/nb_lobby_row.res"); + } + else + { + LoadControlSettings("resource/ui/nb_lobby_row_2024.res"); + } + for (int i = 0; i < ASW_NUM_INVENTORY_SLOTS; i++) { m_szLastWeaponImage[i][0] = 0; } - m_szLastPortraitImage[ 0 ] = 0; - m_lastSteamID.Set( 0, k_EUniverseInvalid, k_EAccountTypeInvalid ); + m_szLastPortraitImage[0] = 0; + m_lastSteamID.Set(0, k_EUniverseInvalid, k_EAccountTypeInvalid); + + m_pTracePlayerButton->SetImage(CBitmapButton::BUTTON_ENABLED, "vgui/briefing/trace_player_icon_off", color32{ 255, 255, 255, 255 }); + m_pTracePlayerButton->SetImage(CBitmapButton::BUTTON_PRESSED, "vgui/briefing/trace_player_icon_pressed", color32{ 255, 255, 255, 255 }); + m_pTracePlayerButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, "vgui/briefing/trace_player_icon_mouse_over", color32{ 255, 255, 255, 255 }); } void CNB_Lobby_Row::PerformLayout() @@ -150,44 +184,44 @@ void CNB_Lobby_Row::UpdateDetails() white.b = 255; white.a = 255; - m_pVoiceIcon->SetVisible( Briefing()->IsCommanderSpeaking( m_nLobbySlot ) ); + m_pVoiceIcon->SetVisible(Briefing()->IsCommanderSpeaking(m_nLobbySlot)); - if ( m_nLobbySlot == -1 || !Briefing()->IsLobbySlotOccupied( m_nLobbySlot ) ) + if (m_nLobbySlot == -1 || !Briefing()->IsLobbySlotOccupied(m_nLobbySlot)) { - m_pXPBar->SetVisible( false ); - m_pLevelLabel->SetVisible( false ); - m_pPromotionIcon->SetVisible( false ); - for ( int i = 0; i < NELEMS( m_pMedalIcon ); i++ ) + m_pXPBar->SetVisible(false); + m_pLevelLabel->SetVisible(false); + m_pPromotionIcon->SetVisible(false); + for (int i = 0; i < NELEMS(m_pMedalIcon); i++) { - m_pMedalIcon[i]->SetVisible( false ); + m_pMedalIcon[i]->SetVisible(false); m_lastMedal[i] = 0; } - m_pNameDropdown->SetVisible( false ); - m_pAvatarImage->SetVisible( false ); - m_pClassLabel->SetVisible( false ); - m_pClassImage->SetVisible( false ); + m_pNameDropdown->SetVisible(false); + m_pAvatarImage->SetVisible(false); + m_pClassLabel->SetVisible(false); + m_pClassImage->SetVisible(false); - if ( Briefing()->IsOfflineGame() ) + if (Briefing()->IsOfflineGame()) { // in singleplayer, empty slots show the empty portrait button - const char *szEmptyFace = "vgui/briefing/face_empty"; - const char *szEmptyFaceLit = "vgui/briefing/face_empty_lit"; - if ( Q_strcmp( szEmptyFace, m_szLastPortraitImage ) ) + const char* szEmptyFace = "vgui/briefing/face_empty"; + const char* szEmptyFaceLit = "vgui/briefing/face_empty_lit"; + if (Q_strcmp(szEmptyFace, m_szLastPortraitImage)) { - Q_snprintf( m_szLastPortraitImage, sizeof( m_szLastPortraitImage ), "%s", szEmptyFace ); - m_pPortraitButton->SetImage( CBitmapButton::BUTTON_ENABLED, szEmptyFace, white ); - m_pPortraitButton->SetImage( CBitmapButton::BUTTON_PRESSED, szEmptyFace, white ); + Q_snprintf(m_szLastPortraitImage, sizeof(m_szLastPortraitImage), "%s", szEmptyFace); + m_pPortraitButton->SetImage(CBitmapButton::BUTTON_ENABLED, szEmptyFace, white); + m_pPortraitButton->SetImage(CBitmapButton::BUTTON_PRESSED, szEmptyFace, white); - if ( Briefing()->IsLobbySlotLocal( m_nLobbySlot ) ) + if (Briefing()->IsLobbySlotLocal(m_nLobbySlot)) { - m_pPortraitButton->SetImage( CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, szEmptyFaceLit, white ); + m_pPortraitButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, szEmptyFaceLit, white); } else { - m_pPortraitButton->SetImage( CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, szEmptyFace, white ); + m_pPortraitButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, szEmptyFace, white); } } - m_pPortraitButton->SetVisible( true ); + m_pPortraitButton->SetVisible(true); } else { @@ -207,43 +241,43 @@ void CNB_Lobby_Row::UpdateDetails() lightblue.b = 192; lightblue.a = 255; - BaseModHybridButton *pButton = m_pNameDropdown->GetButton(); - if ( pButton ) + BaseModHybridButton* pButton = m_pNameDropdown->GetButton(); + if (pButton) { - pButton->SetText( Briefing()->GetMarineOrPlayerName( m_nLobbySlot ) ); + pButton->SetText(Briefing()->GetMarineOrPlayerName(m_nLobbySlot)); } - m_pNameDropdown->SetVisible( true ); + m_pNameDropdown->SetVisible(true); #if !defined(NO_STEAM) - CSteamID steamID = Briefing()->GetCommanderSteamID( m_nLobbySlot ); - if ( steamID.IsValid() ) + CSteamID steamID = Briefing()->GetCommanderSteamID(m_nLobbySlot); + if (steamID.IsValid()) { - if ( steamID.ConvertToUint64() != m_lastSteamID.ConvertToUint64() ) + if (steamID.ConvertToUint64() != m_lastSteamID.ConvertToUint64()) { - m_pAvatarImage->SetAvatarBySteamID( &steamID ); + m_pAvatarImage->SetAvatarBySteamID(&steamID); - for ( int i = 0; i < NELEMS( m_pMedalIcon ); i++ ) + for (int i = 0; i < NELEMS(m_pMedalIcon); i++) { - m_pMedalIcon[i]->SetVisible( false ); + m_pMedalIcon[i]->SetVisible(false); m_lastMedal[i] = 0; } } m_lastSteamID = steamID; - for ( int i = 0; i < NELEMS( m_pMedalIcon ); i++ ) + for (int i = 0; i < NELEMS(m_pMedalIcon); i++) { - const C_RD_ItemInstance &medal = Briefing()->GetEquippedMedal( m_nLobbySlot, i ); - if ( medal.m_iItemDefID != m_lastMedal[i] ) + const C_RD_ItemInstance& medal = Briefing()->GetEquippedMedal(m_nLobbySlot, i); + if (medal.m_iItemDefID != m_lastMedal[i]) { - if ( !medal.IsSet() ) + if (!medal.IsSet()) { - m_pMedalIcon[i]->SetVisible( false ); + m_pMedalIcon[i]->SetVisible(false); m_lastMedal[i] = medal.m_iItemDefID; } else { - m_pMedalIcon[i]->SetImage( medal.GetIcon() ); - m_pMedalIcon[i]->SetVisible( true ); + m_pMedalIcon[i]->SetImage(medal.GetIcon()); + m_pMedalIcon[i]->SetVisible(true); m_lastMedal[i] = medal.m_iItemDefID; } } @@ -251,181 +285,199 @@ void CNB_Lobby_Row::UpdateDetails() } #endif - int nLevel = Briefing()->GetCommanderLevel( m_nLobbySlot ) + 1; // levels start from 0 in code, but present as 1 - int nXP = Briefing()->GetCommanderXP( m_nLobbySlot ); - int nPromotion = Briefing()->GetCommanderPromotion( m_nLobbySlot ); + int nLevel = Briefing()->GetCommanderLevel(m_nLobbySlot) + 1; // levels start from 0 in code, but present as 1 + int nXP = Briefing()->GetCommanderXP(m_nLobbySlot); + int nPromotion = Briefing()->GetCommanderPromotion(m_nLobbySlot); - if ( nPromotion <= 0 || nPromotion > ASW_PROMOTION_CAP ) + if (nPromotion <= 0 || nPromotion > ASW_PROMOTION_CAP) { - m_pPromotionIcon->SetVisible( false ); + m_pPromotionIcon->SetVisible(false); m_nLastPromotion = 0; } else { - m_pPromotionIcon->SetVisible( true ); - m_pPromotionIcon->SetImage( VarArgs( "briefing/promotion_%d", nPromotion ) ); + m_pPromotionIcon->SetVisible(true); + m_pPromotionIcon->SetImage(VarArgs("briefing/promotion_%d", nPromotion)); m_nLastPromotion = nPromotion; } m_pXPBar->ClearMinMax(); - m_pXPBar->AddMinMax( 0, g_iLevelExperience[0] * g_flPromotionXPScale[m_nLastPromotion] ); - for ( int i = 0; i < ASW_NUM_EXPERIENCE_LEVELS - 1; i++ ) + m_pXPBar->AddMinMax(0, g_iLevelExperience[0] * g_flPromotionXPScale[m_nLastPromotion]); + for (int i = 0; i < ASW_NUM_EXPERIENCE_LEVELS - 1; i++) { - m_pXPBar->AddMinMax( g_iLevelExperience[i] * g_flPromotionXPScale[m_nLastPromotion], g_iLevelExperience[i + 1] * g_flPromotionXPScale[m_nLastPromotion] ); + m_pXPBar->AddMinMax(g_iLevelExperience[i] * g_flPromotionXPScale[m_nLastPromotion], g_iLevelExperience[i + 1] * g_flPromotionXPScale[m_nLastPromotion]); } - if ( !Briefing()->IsFullyConnected( m_nLobbySlot ) ) + if (!Briefing()->IsFullyConnected(m_nLobbySlot)) { - m_pXPBar->SetVisible( false ); - m_pLevelLabel->SetVisible( true ); - m_pLevelLabel->SetText( "#nb_commander_connecting" ); + m_pXPBar->SetVisible(false); + m_pLevelLabel->SetVisible(true); + m_pLevelLabel->SetText("#nb_commander_connecting"); } - else if ( nLevel == -1 || nXP == -1 ) + else if (nLevel == -1 || nXP == -1) { - m_pXPBar->SetVisible( false ); - m_pLevelLabel->SetVisible( false ); + m_pXPBar->SetVisible(false); + m_pLevelLabel->SetVisible(false); } else { - m_pXPBar->SetVisible( true ); - m_pLevelLabel->SetVisible( true ); + m_pXPBar->SetVisible(true); + m_pLevelLabel->SetVisible(true); - m_pXPBar->Init( nXP, nXP, 1.0, true, false ); + m_pXPBar->Init(nXP, nXP, 1.0, true, false); wchar_t szLevelNum[16] = L""; - V_snwprintf( szLevelNum, ARRAYSIZE( szLevelNum ), L"%i", nLevel ); + V_snwprintf(szLevelNum, ARRAYSIZE(szLevelNum), L"%i", nLevel); wchar_t wzLevelLabel[64]; - g_pVGuiLocalize->ConstructString( wzLevelLabel, sizeof( wzLevelLabel ), g_pVGuiLocalize->Find( "#nb_commander_level" ), 1, szLevelNum ); - m_pLevelLabel->SetText( wzLevelLabel ); + g_pVGuiLocalize->ConstructString(wzLevelLabel, sizeof(wzLevelLabel), g_pVGuiLocalize->Find("#nb_commander_level"), 1, szLevelNum); + m_pLevelLabel->SetText(wzLevelLabel); } - ASW_Marine_Class nMarineClass = Briefing()->GetMarineClass( m_nLobbySlot ); - m_pClassLabel->SetText( nMarineClass > MARINE_CLASS_UNDEFINED && nMarineClass < NUM_MARINE_CLASSES ? g_szMarineClassLabel[nMarineClass] : "" ); - m_pClassLabel->SetVisible( true ); - if ( nMarineClass > MARINE_CLASS_UNDEFINED && nMarineClass < NUM_MARINE_CLASSES ) + ASW_Marine_Class nMarineClass = Briefing()->GetMarineClass(m_nLobbySlot); + m_pClassLabel->SetText(nMarineClass > MARINE_CLASS_UNDEFINED && nMarineClass < NUM_MARINE_CLASSES ? g_szMarineClassLabel[nMarineClass] : ""); + m_pClassLabel->SetVisible(true); + if (nMarineClass > MARINE_CLASS_UNDEFINED && nMarineClass < NUM_MARINE_CLASSES) { - m_pClassImage->SetImage( g_szMarineClassImage[nMarineClass] ); - m_pClassImage->SetVisible( true ); + m_pClassImage->SetImage(g_szMarineClassImage[nMarineClass]); + m_pClassImage->SetVisible(true); } else { - m_pClassImage->SetVisible( false ); + m_pClassImage->SetVisible(false); } - if ( Briefing()->IsOfflineGame() && m_nLobbySlot != 0 ) + if (Briefing()->IsOfflineGame() && m_nLobbySlot != 0) { // AI slots - m_pLevelLabel->SetVisible( false ); - m_pPromotionIcon->SetVisible( false ); - for ( int i = 0; i < NELEMS( m_pMedalIcon ); i++ ) + m_pLevelLabel->SetVisible(false); + m_pPromotionIcon->SetVisible(false); + for (int i = 0; i < NELEMS(m_pMedalIcon); i++) { - m_pMedalIcon[i]->SetVisible( false ); + m_pMedalIcon[i]->SetVisible(false); m_lastMedal[i] = 0; } - m_pAvatarImage->SetVisible( false ); + m_pAvatarImage->SetVisible(false); int nAvatarX, nAvatarY; - m_pAvatarImage->GetPos( nAvatarX, nAvatarY ); + m_pAvatarImage->GetPos(nAvatarX, nAvatarY); int nNameX, nNameY; - m_pNameDropdown->GetPos( nNameX, nNameY ); + m_pNameDropdown->GetPos(nNameX, nNameY); - m_pNameDropdown->SetPos( nAvatarX + YRES( 5 ), nNameY ); + m_pNameDropdown->SetPos(nAvatarX + YRES(5), nNameY); } else { - m_pAvatarImage->SetVisible( true ); + m_pAvatarImage->SetVisible(true); } - CASW_Marine_Profile *pProfile = Briefing()->GetMarineProfile( m_nLobbySlot ); - if ( !pProfile ) + CASW_Marine_Profile* pProfile = Briefing()->GetMarineProfile(m_nLobbySlot); + if (!pProfile) { // Set to some blank image - const char *szEmptyFace = "vgui/briefing/face_empty"; - const char *szEmptyFaceLit = "vgui/briefing/face_empty_lit"; - if ( Q_strcmp( szEmptyFace, m_szLastPortraitImage ) ) + const char* szEmptyFace = "vgui/briefing/face_empty"; + const char* szEmptyFaceLit = "vgui/briefing/face_empty_lit"; + if (Q_strcmp(szEmptyFace, m_szLastPortraitImage)) { - Q_snprintf( m_szLastPortraitImage, sizeof( m_szLastPortraitImage ), "%s", szEmptyFace ); - m_pPortraitButton->SetImage( CBitmapButton::BUTTON_ENABLED, szEmptyFace, white ); - m_pPortraitButton->SetImage( CBitmapButton::BUTTON_PRESSED, szEmptyFace, white ); + Q_snprintf(m_szLastPortraitImage, sizeof(m_szLastPortraitImage), "%s", szEmptyFace); + m_pPortraitButton->SetImage(CBitmapButton::BUTTON_ENABLED, szEmptyFace, white); + m_pPortraitButton->SetImage(CBitmapButton::BUTTON_PRESSED, szEmptyFace, white); - if ( Briefing()->IsLobbySlotLocal( m_nLobbySlot ) ) + if (Briefing()->IsLobbySlotLocal(m_nLobbySlot)) { - m_pPortraitButton->SetImage( CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, szEmptyFaceLit, white ); + m_pPortraitButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, szEmptyFaceLit, white); } else { - m_pPortraitButton->SetImage( CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, szEmptyFace, white ); + m_pPortraitButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, szEmptyFace, white); } } } else { char imagename[255]; - Q_snprintf( imagename, sizeof( imagename ), "vgui/briefing/face_%s", pProfile->m_PortraitName ); - if ( Q_strcmp( imagename, m_szLastPortraitImage ) ) + Q_snprintf(imagename, sizeof(imagename), "vgui/briefing/face_%s", pProfile->m_PortraitName); + if (Q_strcmp(imagename, m_szLastPortraitImage)) { - Q_snprintf( m_szLastPortraitImage, sizeof( m_szLastPortraitImage ), "%s", imagename ); - m_pPortraitButton->SetImage( CBitmapButton::BUTTON_ENABLED, imagename, white ); - m_pPortraitButton->SetImage( CBitmapButton::BUTTON_PRESSED, imagename, white ); + Q_snprintf(m_szLastPortraitImage, sizeof(m_szLastPortraitImage), "%s", imagename); + m_pPortraitButton->SetImage(CBitmapButton::BUTTON_ENABLED, imagename, white); + m_pPortraitButton->SetImage(CBitmapButton::BUTTON_PRESSED, imagename, white); - if ( Briefing()->IsLobbySlotLocal( m_nLobbySlot ) ) + if (Briefing()->IsLobbySlotLocal(m_nLobbySlot)) { - Q_snprintf( imagename, sizeof( imagename ), "vgui/briefing/face_%s_lit", pProfile->m_PortraitName ); + Q_snprintf(imagename, sizeof(imagename), "vgui/briefing/face_%s_lit", pProfile->m_PortraitName); } - m_pPortraitButton->SetImage( CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, imagename, white ); + m_pPortraitButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, imagename, white); } } - for ( int i = 0; i < ASW_NUM_INVENTORY_SLOTS; i++ ) + for (int i = 0; i < ASW_NUM_INVENTORY_SLOTS; i++) { bool bSetButtonImage = false; - CBitmapButton *pButton = NULL; - vgui::ImagePanel *pSilhouette = NULL; - switch ( i ) + CBitmapButton* pButton = NULL; + vgui::ImagePanel* pSilhouette = NULL; + switch (i) { case ASW_INVENTORY_SLOT_PRIMARY: pButton = m_pWeaponButton0; pSilhouette = m_pSilhouetteWeapon0; break; case ASW_INVENTORY_SLOT_SECONDARY: pButton = m_pWeaponButton1; pSilhouette = m_pSilhouetteWeapon1; break; case ASW_INVENTORY_SLOT_EXTRA: pButton = m_pWeaponButton2; pSilhouette = m_pSilhouetteWeapon2; break; } - Assert( pButton && pSilhouette ); + Assert(pButton && pSilhouette); - int nWeapon = Briefing()->GetMarineSelectedWeapon( m_nLobbySlot, i ); - if ( nWeapon != -1 ) + int nWeapon = Briefing()->GetMarineSelectedWeapon(m_nLobbySlot, i); + if (nWeapon != -1) { - CASW_EquipItem *pItem = g_ASWEquipmentList.GetItemForSlot( i, nWeapon ); - Assert( pItem ); - if ( pItem ) + CASW_EquipItem* pItem = g_ASWEquipmentList.GetItemForSlot(i, nWeapon); + Assert(pItem); + if (pItem) { bSetButtonImage = true; char imagename[255]; - Q_snprintf( imagename, sizeof( imagename ), "vgui/%s", pItem->m_szEquipIcon ); - if ( Q_strcmp( imagename, m_szLastWeaponImage[i] ) ) + Q_snprintf(imagename, sizeof(imagename), "vgui/%s", pItem->m_szEquipIcon); + if (Q_strcmp(imagename, m_szLastWeaponImage[i])) { - Q_snprintf( m_szLastWeaponImage[i], sizeof( m_szLastWeaponImage[i] ), "%s", imagename ); - pButton->SetImage( CBitmapButton::BUTTON_ENABLED, imagename, lightblue ); - pButton->SetImage( CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, imagename, Briefing()->IsLobbySlotLocal( m_nLobbySlot ) ? white : lightblue ); - pButton->SetImage( CBitmapButton::BUTTON_PRESSED, imagename, lightblue ); + Q_snprintf(m_szLastWeaponImage[i], sizeof(m_szLastWeaponImage[i]), "%s", imagename); + pButton->SetImage(CBitmapButton::BUTTON_ENABLED, imagename, lightblue); + pButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, imagename, Briefing()->IsLobbySlotLocal(m_nLobbySlot) ? white : lightblue); + pButton->SetImage(CBitmapButton::BUTTON_PRESSED, imagename, lightblue); } } } - if ( !bSetButtonImage ) + if (!bSetButtonImage) { - if ( Q_strcmp( "vgui/white", m_szLastWeaponImage[i] ) ) + if (Q_strcmp("vgui/white", m_szLastWeaponImage[i])) { - Q_snprintf( m_szLastWeaponImage[i], sizeof( m_szLastWeaponImage[i] ), "%s", "vgui/white" ); - pButton->SetImage( CBitmapButton::BUTTON_ENABLED, "vgui/white", invisible ); - pButton->SetImage( CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, "vgui/white", invisible ); - pButton->SetImage( CBitmapButton::BUTTON_PRESSED, "vgui/white", invisible ); + Q_snprintf(m_szLastWeaponImage[i], sizeof(m_szLastWeaponImage[i]), "%s", "vgui/white"); + pButton->SetImage(CBitmapButton::BUTTON_ENABLED, "vgui/white", invisible); + pButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, "vgui/white", invisible); + pButton->SetImage(CBitmapButton::BUTTON_PRESSED, "vgui/white", invisible); } - pSilhouette->SetVisible( true ); + pSilhouette->SetVisible(true); } else { - pSilhouette->SetVisible( false ); + pSilhouette->SetVisible(false); } } + + if (m_pTracePlayerButton) { + RemoveInvalidTracePlayersAndColors(); + // In online games, show the button only for other players (not local player, not bot, and occupied slot) + bool isDeathMatch = ASWDeathmatchMode() && (ASWDeathmatchMode()->IsDeathmatchEnabled() || ASWDeathmatchMode()->IsTeamDeathmatchEnabled()); + if (!Briefing() + || Briefing()->IsOfflineGame() + || Briefing()->IsLobbySlotLocal(m_nLobbySlot) + || Briefing()->IsLobbySlotBot(m_nLobbySlot) + || !Briefing()->IsLobbySlotOccupied(m_nLobbySlot) + || isDeathMatch) + { + m_pTracePlayerButton->SetVisible(false); + return; + } + + m_pTracePlayerButton->SetVisible(cl_trace_player_enable.GetBool() ); + } } void CNB_Lobby_Row::CheckTooltip( CNB_Lobby_Tooltip *pTooltip ) @@ -465,61 +517,65 @@ void CNB_Lobby_Row::CheckTooltip( CNB_Lobby_Tooltip *pTooltip ) extern ConVar developer; -void CNB_Lobby_Row::OnCommand( const char *command ) +void CNB_Lobby_Row::OnCommand(const char* command) { - CNB_Main_Panel *pMainPanel = GetMainPanel(); - if ( !pMainPanel ) + CNB_Main_Panel* pMainPanel = GetMainPanel(); + if (!pMainPanel) return; - if ( !Q_stricmp( command, "ChangeMarine" ) ) + if (!Q_stricmp(command, "ChangeMarine")) { - pMainPanel->ChangeMarine( m_nLobbySlot ); + pMainPanel->ChangeMarine(m_nLobbySlot); } - else if ( !Q_stricmp( command, "ChangeWeapon0" ) ) + else if (!Q_stricmp(command, "ChangeWeapon0")) { - pMainPanel->ChangeWeapon( m_nLobbySlot, 0 ); - } - else if ( !Q_stricmp( command, "ChangeWeapon1" ) ) + pMainPanel->ChangeWeapon(m_nLobbySlot, 0); + } + else if (!Q_stricmp(command, "ChangeWeapon1")) { - pMainPanel->ChangeWeapon( m_nLobbySlot, 1 ); + pMainPanel->ChangeWeapon(m_nLobbySlot, 1); } - else if ( !Q_stricmp( command, "ChangeWeapon2" ) ) + else if (!Q_stricmp(command, "ChangeWeapon2")) { - pMainPanel->ChangeWeapon( m_nLobbySlot, 2 ); + pMainPanel->ChangeWeapon(m_nLobbySlot, 2); } - else if ( !Q_stricmp( command, "PlayerFlyout" ) ) + else if (!Q_stricmp(command, "PlayerFlyout")) { - if ( !Briefing()->IsLobbySlotBot( m_nLobbySlot ) && Briefing()->GetCommanderSteamID( m_nLobbySlot ).IsValid() ) + if (!Briefing()->IsLobbySlotBot(m_nLobbySlot) && Briefing()->GetCommanderSteamID(m_nLobbySlot).IsValid()) { OpenPlayerFlyout(); } } - else if ( !Q_stricmp( command, "#L4D360UI_SendMessage" ) ) + else if (!Q_stricmp(command, "#L4D360UI_SendMessage")) { - BaseModUI::CUIGameData::Get()->ExecuteOverlayCommand( "chat", pMainPanel->m_FlyoutSteamID ); + BaseModUI::CUIGameData::Get()->ExecuteOverlayCommand("chat", pMainPanel->m_FlyoutSteamID); } - else if ( !Q_stricmp( command, "#L4D360UI_ViewSteamID" ) ) + else if (!Q_stricmp(command, "#L4D360UI_ViewSteamID")) { - BaseModUI::CUIGameData::Get()->ExecuteOverlayCommand( "steamid", pMainPanel->m_FlyoutSteamID ); + BaseModUI::CUIGameData::Get()->ExecuteOverlayCommand("steamid", pMainPanel->m_FlyoutSteamID); } - else if ( !Q_stricmp( command, "#L4D360UI_ViewSteamStats" ) ) + else if (!Q_stricmp(command, "#L4D360UI_ViewSteamStats")) { #if !defined( _X360 ) && !defined( NO_STEAM ) - if ( SteamUser() ) + if (SteamUser()) { - if ( developer.GetBool() ) + if (developer.GetBool()) { - Msg( "Local player SteamID = %I64u\n", SteamUser()->GetSteamID().ConvertToUint64() ); - Msg( "Activating stats for SteamID = %I64u\n", Briefing()->GetCommanderSteamID( m_nLobbySlot ).ConvertToUint64() ); + Msg("Local player SteamID = %I64u\n", SteamUser()->GetSteamID().ConvertToUint64()); + Msg("Activating stats for SteamID = %I64u\n", Briefing()->GetCommanderSteamID(m_nLobbySlot).ConvertToUint64()); } char statsWeb[256]; - Q_snprintf( statsWeb, sizeof( statsWeb ), "https://stats.reactivedrop.com/profiles/%I64u?lang=%s&utm_source=briefing", - Briefing()->GetCommanderSteamID( m_nLobbySlot ).ConvertToUint64(), - SteamApps()->GetCurrentGameLanguage() ); - BaseModUI::CUIGameData::Get()->ExecuteOverlayUrl( statsWeb ); + Q_snprintf(statsWeb, sizeof(statsWeb), "https://stats.reactivedrop.com/profiles/%I64u?lang=%s&utm_source=briefing", + Briefing()->GetCommanderSteamID(m_nLobbySlot).ConvertToUint64(), + SteamApps()->GetCurrentGameLanguage()); + BaseModUI::CUIGameData::Get()->ExecuteOverlayUrl(statsWeb); } #endif } + else if (!Q_stricmp(command, "TracePlayerPressed")) + { + OnTracePlayerPressed(); + } } void CNB_Lobby_Row::OpenPlayerFlyout() @@ -578,3 +634,16 @@ void CNB_Lobby_Row::UpdateChangingSlot() m_pChangingSlot[ 2 ]->SetVisible( nSlot == 3 ); m_pChangingSlot[ 3 ]->SetVisible( nSlot == 4 ); } + +void CNB_Lobby_Row::OnTracePlayerPressed() +{ + int playerIndex = Briefing()->GetPlayerIndex(m_nLobbySlot); + if (playerIndex < 0 || playerIndex >= gpGlobals->maxClients) + { + Msg("Invalid player index for lobby slot %d\n", m_nLobbySlot); + return; // Invalid player index + } + // flip the trace state for this player + ToggleTraceColor(playerIndex); + m_pTracePlayerButton->SetImage(CBitmapButton::BUTTON_ENABLED, (g_nTracePlayer2Color[playerIndex] != 0) ? "vgui/briefing/trace_player_icon_on" : "vgui/briefing/trace_player_icon_off", color32{ 255, 255, 255, 255 }); +} diff --git a/src/game/client/swarm/vgui/nb_lobby_row.h b/src/game/client/swarm/vgui/nb_lobby_row.h index d17ea0995..1a834b2ff 100644 --- a/src/game/client/swarm/vgui/nb_lobby_row.h +++ b/src/game/client/swarm/vgui/nb_lobby_row.h @@ -27,68 +27,62 @@ namespace BaseModUI class CNB_Lobby_Row : public vgui::EditablePanel { - DECLARE_CLASS_SIMPLE( CNB_Lobby_Row, vgui::EditablePanel ); + DECLARE_CLASS_SIMPLE(CNB_Lobby_Row, vgui::EditablePanel); public: - CNB_Lobby_Row( vgui::Panel *parent, const char *name ); + CNB_Lobby_Row(vgui::Panel* parent, const char* name); virtual ~CNB_Lobby_Row(); - - virtual void ApplySchemeSettings( vgui::IScheme *pScheme ); + + virtual void ApplySchemeSettings(vgui::IScheme* pScheme); virtual void PerformLayout(); virtual void OnThink(); - virtual void OnCommand( const char *command ); + virtual void OnCommand(const char* command); void OpenPlayerFlyout(); - CNB_Main_Panel *GetMainPanel(); + CNB_Main_Panel* GetMainPanel(); virtual void UpdateDetails(); - virtual void CheckTooltip( CNB_Lobby_Tooltip *pTooltip ); + virtual void CheckTooltip(CNB_Lobby_Tooltip* pTooltip); void UpdateChangingSlot(); - + void OnTracePlayerPressed(); + // == MANAGED_MEMBER_POINTERS_START: Do not edit by hand == - vgui::ImagePanel *m_pBackground; - vgui::Panel *m_pBackgroundWeapon0; - vgui::Panel *m_pBackgroundWeapon1; - vgui::Panel *m_pBackgroundWeapon2; - vgui::Panel *m_pBackgroundInnerWeapon0; - vgui::Panel *m_pBackgroundInnerWeapon1; - vgui::Panel *m_pBackgroundInnerWeapon2; - vgui::ImagePanel *m_pSilhouetteWeapon0; - vgui::ImagePanel *m_pSilhouetteWeapon1; - vgui::ImagePanel *m_pSilhouetteWeapon2; - vgui::Panel *m_pAvatarBackground; - CAvatarImagePanel *m_pAvatarImage; - vgui::ImagePanel *m_pClassImage; - BaseModUI::DropDownMenu *m_pNameDropdown; - vgui::Label *m_pLevelLabel; - StatsBar *m_pXPBar; - vgui::Label *m_pClassLabel; + vgui::ImagePanel* m_pBackground; + vgui::Panel* m_pBackgroundWeapon0; + vgui::Panel* m_pBackgroundWeapon1; + vgui::Panel* m_pBackgroundWeapon2; + vgui::Panel* m_pBackgroundInnerWeapon0; + vgui::Panel* m_pBackgroundInnerWeapon1; + vgui::Panel* m_pBackgroundInnerWeapon2; + vgui::ImagePanel* m_pSilhouetteWeapon0; + vgui::ImagePanel* m_pSilhouetteWeapon1; + vgui::ImagePanel* m_pSilhouetteWeapon2; + vgui::Panel* m_pAvatarBackground; + CAvatarImagePanel* m_pAvatarImage; + vgui::ImagePanel* m_pClassImage; + BaseModUI::DropDownMenu* m_pNameDropdown; + vgui::Label* m_pLevelLabel; + StatsBar* m_pXPBar; + vgui::Label* m_pClassLabel; // == MANAGED_MEMBER_POINTERS_END == - CBitmapButton *m_pPortraitButton; - CBitmapButton *m_pWeaponButton0; - CBitmapButton *m_pWeaponButton1; - CBitmapButton *m_pWeaponButton2; - vgui::ImagePanel *m_pVoiceIcon; - vgui::ImagePanel *m_pPromotionIcon; - vgui::ImagePanel *m_pMedalIcon[RD_STEAM_INVENTORY_NUM_MEDAL_SLOTS]; - vgui::ImagePanel *m_pChangingSlot[ 4 ]; - - char m_szLastWeaponImage[ ASW_NUM_INVENTORY_SLOTS ][ 255 ]; - char m_szLastPortraitImage[ 255 ]; + CBitmapButton* m_pPortraitButton; + CBitmapButton* m_pWeaponButton0; + CBitmapButton* m_pWeaponButton1; + CBitmapButton* m_pWeaponButton2; + vgui::ImagePanel* m_pVoiceIcon; + vgui::ImagePanel* m_pPromotionIcon; + vgui::ImagePanel* m_pMedalIcon[RD_STEAM_INVENTORY_NUM_MEDAL_SLOTS]; + vgui::ImagePanel* m_pChangingSlot[4]; + + char m_szLastWeaponImage[ASW_NUM_INVENTORY_SLOTS][255]; + char m_szLastPortraitImage[255]; CSteamID m_lastSteamID; int m_nLastPromotion; SteamItemDef_t m_lastMedal[RD_STEAM_INVENTORY_NUM_MEDAL_SLOTS]; int m_nLobbySlot; -}; - -#endif // _INCLUDED_NB_LOBBY_ROW_H - - - - - - - + CBitmapButton* m_pTracePlayerButton; +}; +#endif // _INCLUDED_NB_LOBBY_ROW_H \ No newline at end of file diff --git a/src/game/client/swarm/vgui/nb_lobby_row_small.cpp b/src/game/client/swarm/vgui/nb_lobby_row_small.cpp index e44befe14..86e78dde9 100644 --- a/src/game/client/swarm/vgui/nb_lobby_row_small.cpp +++ b/src/game/client/swarm/vgui/nb_lobby_row_small.cpp @@ -24,23 +24,32 @@ CNB_Lobby_Row_Small::~CNB_Lobby_Row_Small() } -void CNB_Lobby_Row_Small::ApplySchemeSettings( vgui::IScheme *pScheme ) +void CNB_Lobby_Row_Small::ApplySchemeSettings(vgui::IScheme* pScheme) { - BaseClass::BaseClass::ApplySchemeSettings( pScheme ); - - if ( rd_legacy_ui.GetString()[0] != '\0' ) - LoadControlSettings( "resource/ui/nb_lobby_row_small.res" ); + BaseClass::BaseClass::ApplySchemeSettings(pScheme); + + // Unless we have clearly specified a correct scheme, we will use the default scheme for the game. + auto currentScheme = rd_legacy_ui.GetString(); + if (!Q_stricmp(currentScheme, "2004") + || !Q_stricmp(currentScheme, "2010") + || !Q_stricmp(currentScheme, "2017")) + { + LoadControlSettings("resource/ui/nb_lobby_row_small.res"); + } else - LoadControlSettings( "resource/ui/nb_lobby_row_small_2024.res" ); + { + LoadControlSettings("resource/ui/nb_lobby_row_small_2024.res"); + } + - for ( int i = 0;i < ASW_NUM_INVENTORY_SLOTS; i++ ) + for (int i = 0; i < ASW_NUM_INVENTORY_SLOTS; i++) { m_szLastWeaponImage[i][0] = 0; } - m_szLastPortraitImage[ 0 ] = 0; - m_lastSteamID.Set( 0, k_EUniverseInvalid, k_EAccountTypeInvalid ); + m_szLastPortraitImage[0] = 0; + m_lastSteamID.Set(0, k_EUniverseInvalid, k_EAccountTypeInvalid); - SetTall( m_pBackroundPlain->GetTall() ); + SetTall(m_pBackroundPlain->GetTall()); } void CNB_Lobby_Row_Small::PerformLayout() diff --git a/src/game/client/swarm/vgui/nb_main_panel.cpp b/src/game/client/swarm/vgui/nb_main_panel.cpp index 06290cae9..87b4ee61c 100644 --- a/src/game/client/swarm/vgui/nb_main_panel.cpp +++ b/src/game/client/swarm/vgui/nb_main_panel.cpp @@ -39,7 +39,6 @@ // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" - #define CHAT_BUTTON_ICON "vgui/briefing/chat_icon" #define VOTE_BUTTON_ICON "vgui/briefing/vote_icon" #define LEADERBOARD_BUTTON_ICON "vgui/briefing/leaderboard_icon" @@ -51,6 +50,7 @@ extern ConVar mm_max_players; extern ConVar rd_player_bots_allowed; extern ConVar rd_legacy_ui; ConVar rd_draw_briefing_ui( "rd_draw_briefing_ui", "1", FCVAR_CHEAT ); +extern ConVar cl_trace_player_enable; using BaseModUI::GenericPanelList; @@ -131,9 +131,15 @@ CNB_Main_Panel::CNB_Main_Panel( vgui::Panel *parent, const char *name ) : BaseCl m_bLobbyValidityChecked = false; + // Create the TraceMe button + m_pTraceMeButton = new CBitmapButton(this, "TraceMeButton", ""); + m_pTraceMeButton->AddActionSignalTarget(this); + m_pTraceMeButton->SetCommand("TraceMePressed"); + GetControllerFocus()->AddToFocusList( m_pChatButton ); GetControllerFocus()->AddToFocusList( m_pVoteButton ); GetControllerFocus()->AddToFocusList( m_pLeaderboardButton ); + GetControllerFocus()->AddToFocusList(m_pTraceMeButton); GetControllerFocus()->AddToFocusList( m_pAddBotButton ); GetControllerFocus()->AddToFocusList( m_pDeselectMarinesButton ); } @@ -143,6 +149,7 @@ CNB_Main_Panel::~CNB_Main_Panel() GetControllerFocus()->RemoveFromFocusList( m_pChatButton ); GetControllerFocus()->RemoveFromFocusList( m_pVoteButton ); GetControllerFocus()->RemoveFromFocusList( m_pLeaderboardButton ); + GetControllerFocus()->RemoveFromFocusList(m_pTraceMeButton); GetControllerFocus()->RemoveFromFocusList( m_pAddBotButton ); GetControllerFocus()->RemoveFromFocusList( m_pDeselectMarinesButton ); } @@ -161,14 +168,22 @@ void CNB_Main_Panel::OnFinishedSpendingSkillPoints() ProcessSkillSpendQueue(); } -void CNB_Main_Panel::ApplySchemeSettings( vgui::IScheme *pScheme ) +void CNB_Main_Panel::ApplySchemeSettings(vgui::IScheme* pScheme) { - BaseClass::ApplySchemeSettings( pScheme ); - - if ( rd_legacy_ui.GetString()[0] != '\0' ) - LoadControlSettings( "resource/ui/nb_main_panel.res" ); + BaseClass::ApplySchemeSettings(pScheme); + + // Unless we have clearly specified a correct scheme, we will use the default scheme for the game. + auto currentScheme = rd_legacy_ui.GetString(); + if (!Q_stricmp(currentScheme, "2004") + || !Q_stricmp(currentScheme, "2010") + || !Q_stricmp(currentScheme, "2017")) + { + LoadControlSettings("resource/ui/nb_main_panel.res"); + } else - LoadControlSettings( "resource/ui/nb_main_panel_2024.res" ); + { + LoadControlSettings("resource/ui/nb_main_panel_2024.res"); + } color32 white; white.r = 255; @@ -182,20 +197,25 @@ void CNB_Main_Panel::ApplySchemeSettings( vgui::IScheme *pScheme ) grey.b = 190; grey.a = 255; - m_pChatButton->SetImage( CBitmapButton::BUTTON_ENABLED, CHAT_BUTTON_ICON, grey ); - m_pChatButton->SetImage( CBitmapButton::BUTTON_DISABLED, CHAT_BUTTON_ICON, grey ); - m_pChatButton->SetImage( CBitmapButton::BUTTON_PRESSED, CHAT_BUTTON_ICON, white ); - m_pChatButton->SetImage( CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, CHAT_BUTTON_ICON, white ); + m_pChatButton->SetImage(CBitmapButton::BUTTON_ENABLED, CHAT_BUTTON_ICON, grey); + m_pChatButton->SetImage(CBitmapButton::BUTTON_DISABLED, CHAT_BUTTON_ICON, grey); + m_pChatButton->SetImage(CBitmapButton::BUTTON_PRESSED, CHAT_BUTTON_ICON, white); + m_pChatButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, CHAT_BUTTON_ICON, white); - m_pVoteButton->SetImage( CBitmapButton::BUTTON_ENABLED, VOTE_BUTTON_ICON, grey ); - m_pVoteButton->SetImage( CBitmapButton::BUTTON_DISABLED, VOTE_BUTTON_ICON, grey ); - m_pVoteButton->SetImage( CBitmapButton::BUTTON_PRESSED, VOTE_BUTTON_ICON, white ); - m_pVoteButton->SetImage( CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, VOTE_BUTTON_ICON, white ); + m_pVoteButton->SetImage(CBitmapButton::BUTTON_ENABLED, VOTE_BUTTON_ICON, grey); + m_pVoteButton->SetImage(CBitmapButton::BUTTON_DISABLED, VOTE_BUTTON_ICON, grey); + m_pVoteButton->SetImage(CBitmapButton::BUTTON_PRESSED, VOTE_BUTTON_ICON, white); + m_pVoteButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, VOTE_BUTTON_ICON, white); - m_pLeaderboardButton->SetImage( CBitmapButton::BUTTON_ENABLED, LEADERBOARD_BUTTON_ICON, grey ); - m_pLeaderboardButton->SetImage( CBitmapButton::BUTTON_DISABLED, LEADERBOARD_BUTTON_ICON, grey ); - m_pLeaderboardButton->SetImage( CBitmapButton::BUTTON_PRESSED, LEADERBOARD_BUTTON_ICON, white ); - m_pLeaderboardButton->SetImage( CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, LEADERBOARD_BUTTON_ICON, white ); + m_pLeaderboardButton->SetImage(CBitmapButton::BUTTON_ENABLED, LEADERBOARD_BUTTON_ICON, grey); + m_pLeaderboardButton->SetImage(CBitmapButton::BUTTON_DISABLED, LEADERBOARD_BUTTON_ICON, grey); + m_pLeaderboardButton->SetImage(CBitmapButton::BUTTON_PRESSED, LEADERBOARD_BUTTON_ICON, white); + m_pLeaderboardButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, LEADERBOARD_BUTTON_ICON, white); + + m_pTraceMeButton->SetImage(CBitmapButton::BUTTON_ENABLED, "vgui/briefing/trace_me_icon_on", grey); + m_pTraceMeButton->SetImage(CBitmapButton::BUTTON_DISABLED, "vgui/briefing/trace_me_icon_on", grey); + m_pTraceMeButton->SetImage(CBitmapButton::BUTTON_PRESSED, "vgui/briefing/trace_me_icon_pressed", white); + m_pTraceMeButton->SetImage(CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, "vgui/briefing/trace_me_icon_mouse_over", white); m_pAddBotButton->SetImage(CBitmapButton::BUTTON_ENABLED, ADDBOT_BUTTON_ICON, grey); m_pAddBotButton->SetImage(CBitmapButton::BUTTON_DISABLED, ADDBOT_BUTTON_ICON, grey); @@ -326,6 +346,25 @@ void CNB_Main_Panel::OnThink() } } } + if (m_pTraceMeButton) + { + // Check if the TraceMe button should be enabled or not + // It should be enabled if it's an online game, the slot is the local player's slot, the slot is not a bot, the slot is occupied, and the marine profile exists + int m_nLobbySlot = m_pLobbyRow0->m_nLobbySlot; + bool isDeathMatch = ASWDeathmatchMode() && (ASWDeathmatchMode()->IsDeathmatchEnabled() || ASWDeathmatchMode()->IsTeamDeathmatchEnabled()); + if (!Briefing() + || Briefing()->IsOfflineGame() + || !Briefing()->IsLobbySlotLocal(m_nLobbySlot) + || Briefing()->IsLobbySlotBot(m_nLobbySlot) + || !Briefing()->IsLobbySlotOccupied(m_nLobbySlot) + || Briefing()->GetMarineProfile(m_nLobbySlot) == NULL + || isDeathMatch) + { + m_pTraceMeButton->SetVisible(false); + return; + } + m_pTraceMeButton->SetVisible(cl_trace_player_enable.GetBool()); + } } void CNB_Main_Panel::OnTick() @@ -497,36 +536,36 @@ void CNB_Main_Panel::SpendSkillPointsOnMarine( int nProfileIndex ) extern vgui::DHANDLE g_hBriefingFrame; -void CNB_Main_Panel::OnCommand( const char *command ) +void CNB_Main_Panel::OnCommand(const char* command) { - if ( !Q_stricmp( command, "ReadyButton" ) ) + if (!Q_stricmp(command, "ReadyButton")) { // Firstly check if we are in the deathmatch - if ( ASWDeathmatchMode() ) + if (ASWDeathmatchMode()) { // because briefing frame fades out slowly a user can click the // Ready button one more time and get a crash here, so we do this check - if ( g_hBriefingFrame.Get() ) + if (g_hBriefingFrame.Get()) { // for DM we only close the briefing panel - g_hBriefingFrame->SetDeleteSelfOnClose( true ); + g_hBriefingFrame->SetDeleteSelfOnClose(true); g_hBriefingFrame->Close(); g_hBriefingFrame = NULL; } } - else if ( m_bLocalLeader ) + else if (m_bLocalLeader) { - if ( Briefing()->CheckMissionRequirements() ) + if (Briefing()->CheckMissionRequirements()) { - if ( Briefing()->AreOtherPlayersReady() ) + if (Briefing()->AreOtherPlayersReady()) { Briefing()->StartMission(); } else { // force other players to be ready? - engine->ClientCmd( "cl_wants_start" ); // notify other players that we're waiting on them - new ForceReadyPanel( GetParent(), "ForceReady", "#asw_force_startm", ASW_FR_BRIEFING ); // TODO: this breaks the IBriefing abstraction, fix it if we need that + engine->ClientCmd("cl_wants_start"); // notify other players that we're waiting on them + new ForceReadyPanel(GetParent(), "ForceReady", "#asw_force_startm", ASW_FR_BRIEFING); // TODO: this breaks the IBriefing abstraction, fix it if we need that } } } @@ -535,55 +574,59 @@ void CNB_Main_Panel::OnCommand( const char *command ) Briefing()->ToggleLocalPlayerReady(); } } - else if ( !Q_stricmp( command, "FriendsButton" ) ) + else if (!Q_stricmp(command, "FriendsButton")) { #ifndef _X360 - if ( BaseModUI::CUIGameData::Get() ) + if (BaseModUI::CUIGameData::Get()) { - BaseModUI::CUIGameData::Get()->OpenInviteUI( "friends" ); + BaseModUI::CUIGameData::Get()->OpenInviteUI("friends"); } #endif } - else if ( !Q_stricmp( command, "ChangeMissionButton" ) ) + else if (!Q_stricmp(command, "ChangeMissionButton")) { - engine->ClientCmd( "asw_mission_chooser callvote" ); + engine->ClientCmd("asw_mission_chooser callvote"); } - else if ( !Q_stricmp( command, "MissionDetailsButton" ) ) + else if (!Q_stricmp(command, "MissionDetailsButton")) { ShowMissionDetails(); } - else if ( !Q_stricmp( command, "ChatButton" ) ) + else if (!Q_stricmp(command, "ChatButton")) { - if ( GetClientModeASW() ) + if (GetClientModeASW()) { GetClientModeASW()->ToggleMessageMode(); } } - else if ( !Q_stricmp( command, "VoteButton" ) ) + else if (!Q_stricmp(command, "VoteButton")) { - engine->ClientCmd( "playerlist" ); + engine->ClientCmd("playerlist"); } - else if ( !Q_stricmp( command, "LeaderboardButton" ) ) + else if (!Q_stricmp(command, "LeaderboardButton")) { ShowLeaderboard(); } - else if ( !Q_stricmp( command, "AddBotButton" ) ) + else if (!Q_stricmp(command, "AddBotButton")) { AddBot(); } - else if ( !Q_stricmp( command, "DeselectMarines" ) ) + else if (!Q_stricmp(command, "DeselectMarines")) { - engine->ClientCmd( "cl_dselectallm" ); + engine->ClientCmd("cl_dselectallm"); } - else if ( !Q_stricmp( command, "PromotionButton" ) ) + else if (!Q_stricmp(command, "PromotionButton")) { ShowPromotionPanel(); } - else if ( !Q_stricmp( command, "TeamChangeButton" ) ) + else if (!Q_stricmp(command, "TeamChangeButton")) + { + engine->ServerCmd("rd_team_change"); + } + else if (!Q_stricmp(command, "TraceMePressed")) { - engine->ServerCmd( "rd_team_change" ); + TraceMePressed(); } - BaseClass::OnCommand( command ); + BaseClass::OnCommand(command); } @@ -626,3 +669,31 @@ void CNB_Main_Panel::ShowLeaderboard() m_hSubScreen = pPanel; } + +void CNB_Main_Panel::TraceMePressed() +{ + // Get the local player index + int localPlayerIndex = -1; + if (engine && engine->IsInGame()) + { + localPlayerIndex = engine->GetLocalPlayer(); + if (localPlayerIndex < 0 || localPlayerIndex >= gpGlobals->maxClients) + { + return; // Invalid player index + } + + if (lastTraceMePressedTime < 0 || (lastTraceMePressedTime + 30.0) <= gpGlobals->curtime) + { + lastTraceMePressedTime = gpGlobals->curtime; // Prevent spamming the command + char cmd[128]; + Q_snprintf(cmd, sizeof(cmd), "rd_lobby_suggest_trace_player %d", localPlayerIndex); + // Send a message in chat to all other players to suggest them to trace this player + engine->ClientCmd_Unrestricted(cmd); + } + else + { + ClientPrint(CBasePlayer::GetLocalPlayer(), HUD_PRINTTALK, "asw_trace_me_cooling_down"); + } + } +} + diff --git a/src/game/client/swarm/vgui/nb_main_panel.h b/src/game/client/swarm/vgui/nb_main_panel.h index 7b9c6ee21..40bb1f27d 100644 --- a/src/game/client/swarm/vgui/nb_main_panel.h +++ b/src/game/client/swarm/vgui/nb_main_panel.h @@ -45,6 +45,7 @@ class CNB_Main_Panel : public vgui::EditablePanel void ShowMissionDetails(); void ShowPromotionPanel(); void ShowLeaderboard(); + void TraceMePressed(); vgui::DHANDLE m_hSubScreen; @@ -72,6 +73,9 @@ class CNB_Main_Panel : public vgui::EditablePanel CBitmapButton *m_pAddBotButton; CBitmapButton *m_pDeselectMarinesButton; + float lastTraceMePressedTime = -1.0f; + CBitmapButton* m_pTraceMeButton; + bool m_bLocalLeader; uint64 m_FlyoutSteamID; diff --git a/src/game/client/swarm/vgui/playerlistline.cpp b/src/game/client/swarm/vgui/playerlistline.cpp index 397985d87..6d0b779e5 100644 --- a/src/game/client/swarm/vgui/playerlistline.cpp +++ b/src/game/client/swarm/vgui/playerlistline.cpp @@ -33,6 +33,16 @@ ConVar rd_muted_color( "rd_muted_color", "255 66 66", FCVAR_NONE, "Color of the ConVar rd_speaking_color( "rd_speaking_color", "0 240 240", FCVAR_NONE, "Color of the speaker icon in Player List window (F9) while talking" ); ConVar rd_unmuted_color( "rd_unmuted_color", "190 190 190", FCVAR_NONE, "Color of the speaker icon in Player List window (F9) while silent" ); +#ifdef CLIENT_DLL +extern Color g_TraceColorArray[8]; +extern std::vector g_nTracePlayer2Color; +extern std::vector g_nTraceColor2Player; +extern ConVar cl_trace_player_enable; +extern ConVar cl_trace_player_max_targets; +extern void RemoveInvalidTracePlayersAndColors(); +extern void ToggleTraceColor(int playerIndex); +#endif + PlayerListLine::PlayerListLine(vgui::Panel *parent, const char *name) : vgui::Panel( parent, name ) { @@ -43,6 +53,9 @@ PlayerListLine::PlayerListLine(vgui::Panel *parent, const char *name) : m_pQuickReportButton = new CBitmapButton( this, "QuickReportButton", "#rd_quick_report_commend_or_report" ); m_pQuickReportButton->AddActionSignalTarget( this ); m_pQuickReportButton->SetCommand( "QuickReportButton" ); + m_pTracePlayerButton1 = new CBitmapButton( this, "TracePlayerButton", " " ); + m_pTracePlayerButton1->AddActionSignalTarget( this ); + m_pTracePlayerButton1->SetCommand( "plTracePlayerButton" ); m_pPlayerLabel = new vgui::Button( this, "PlayerLabel", " " ); m_pPlayerLabel->AddActionSignalTarget( this ); m_pPlayerLabel->SetCommand( "PlayerLabel" ); @@ -102,6 +115,10 @@ void PlayerListLine::ApplySchemeSettings( vgui::IScheme *pScheme ) m_pQuickReportButton->SetImage( CBitmapButton::BUTTON_PRESSED, QUICK_REPORT_BUTTON_ICON, white ); m_pQuickReportButton->SetImage( CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, QUICK_REPORT_BUTTON_ICON, white ); + m_pTracePlayerButton1->SetImage( CBitmapButton::BUTTON_ENABLED, "vgui/briefing/trace_player_icon_off", grey ); + m_pTracePlayerButton1->SetImage( CBitmapButton::BUTTON_PRESSED, "vgui/briefing/trace_player_icon_pressed", white ); + m_pTracePlayerButton1->SetImage( CBitmapButton::BUTTON_ENABLED_MOUSE_OVER, "vgui/briefing/trace_player_icon_mouse_over", white ); + vgui::HFont DefaultFont = pScheme->GetFont( "Default", IsProportional() ); m_pPlayerLabel->SetFont( DefaultFont ); m_pPlayerLabel->SetPaintBackgroundEnabled( false ); @@ -141,6 +158,21 @@ void PlayerListLine::OnCommand( const char *command ) assert_cast< PlayerListPanel * >( GetParent()->GetParent()->GetParent() )->QuickReportClicked( this ); } } + else if ( !Q_stricmp( command, "plTracePlayerButton" ) ) + { + if ( pPlayer ) + { + int playerIndex = pPlayer->entindex(); + if (playerIndex <= 0 || playerIndex >= gpGlobals->maxClients) + { + Msg("Invalid player index %d\n", playerIndex); + return; // Invalid player index + } + // flip the trace state for this player + ToggleTraceColor(playerIndex); + m_pTracePlayerButton1->SetImage(CBitmapButton::BUTTON_ENABLED, (g_nTracePlayer2Color[playerIndex] == 0) ? "vgui/briefing/trace_player_icon_on" : "vgui/briefing/trace_player_icon_off", color32{ 255, 255, 255, 255 }); + } + } else if ( !Q_stricmp( command, "PlayerLabel" ) ) { if ( pPlayer ) @@ -153,36 +185,40 @@ void PlayerListLine::OnCommand( const char *command ) void PlayerListLine::PerformLayout() { - float fScale = (ScreenHeight() / 768.0f); - int top = 6.0f * fScale; - int top_line_height = 16.0f * fScale; - int bottom_line_top = top_line_height + top; - int bottom_line_height = 16.0f * fScale; - - m_pMuteButton->SetBounds( PLAYER_LIST_MUTE_ICON_X * fScale, top, PLAYER_LIST_MUTE_ICON_W * fScale, top_line_height ); - int iQuickReportX, iQuickReportWide; - vgui::surface()->GetTextSize( m_pQuickReportButton->GetFont(), g_pVGuiLocalize->Find( "#rd_quick_report_commend_or_report" ), iQuickReportX, iQuickReportWide ); - iQuickReportWide = bottom_line_height + vgui::Label::Content + iQuickReportX; - iQuickReportX = PLAYER_LIST_QUICK_REPORT_RIGHT_X * fScale - iQuickReportWide; - m_pQuickReportButton->SetBounds( iQuickReportX, bottom_line_top, iQuickReportWide, bottom_line_height ); - m_pQuickReportButton->SetTextInset( bottom_line_height + vgui::Label::Content, 0 ); - m_pQuickReportButton->SetImageBounds( 0, 0, bottom_line_height, bottom_line_height ); - - m_pPlayerLabel-> SetBounds(PLAYER_LIST_PLAYER_X * fScale, top, PLAYER_LIST_PLAYER_W * fScale, top_line_height); - m_pMarinesLabel->SetBounds(PLAYER_LIST_MARINES_X * fScale, top, PLAYER_LIST_MARINES_W * fScale, top_line_height); - m_pFragsLabel-> SetBounds(PLAYER_LIST_FRAGS_X * fScale, top, PLAYER_LIST_FRAGS_W * fScale, top_line_height); - m_pDeathsLabel-> SetBounds(PLAYER_LIST_DEATHS_X * fScale, top, PLAYER_LIST_DEATHS_W * fScale, top_line_height); - m_pPingLabel-> SetBounds(PLAYER_LIST_PING_X * fScale, top, PLAYER_LIST_PING_W * fScale, top_line_height); - m_pLeaderCheck-> SetBounds(PLAYER_LIST_LEADER_CHECK_X * fScale, bottom_line_top, PLAYER_LIST_LEADER_CHECK_W * fScale, bottom_line_height); - m_pKickCheck-> SetBounds(PLAYER_LIST_KICK_CHECK_X * fScale, bottom_line_top, PLAYER_LIST_KICK_CHECK_W * fScale, bottom_line_height); - - for (int i=0;iSetBounds((PLAYER_LIST_KICK_ICON_X + (PLAYER_LIST_KICK_ICON_W * i)) * fScale, bottom_line_top, - PLAYER_LIST_KICK_ICON_W * fScale, bottom_line_height); - m_pLeaderVoteIcon[i]->SetBounds((PLAYER_LIST_LEADER_ICON_X + (PLAYER_LIST_LEADER_ICON_W * i)) * fScale, bottom_line_top, - PLAYER_LIST_LEADER_ICON_W * fScale, bottom_line_height); - } + float fScale = (ScreenHeight() / 768.0f); + int top = 6.0f * fScale; + int top_line_height = 16.0f * fScale; + int bottom_line_top = top_line_height + top; + int bottom_line_height = 16.0f * fScale; + + m_pMuteButton->SetBounds( PLAYER_LIST_MUTE_ICON_X * fScale, top, PLAYER_LIST_MUTE_ICON_W * fScale, top_line_height ); + int iQuickReportX, iQuickReportWide; + vgui::surface()->GetTextSize( m_pQuickReportButton->GetFont(), g_pVGuiLocalize->Find( "#rd_quick_report_commend_or_report" ), iQuickReportX, iQuickReportWide ); + iQuickReportWide = bottom_line_height + vgui::Label::Content + iQuickReportX; + iQuickReportX = PLAYER_LIST_QUICK_REPORT_RIGHT_X * fScale - iQuickReportWide; + m_pQuickReportButton->SetBounds( iQuickReportX, bottom_line_top, iQuickReportWide, bottom_line_height ); + m_pQuickReportButton->SetTextInset( bottom_line_height + vgui::Label::Content, 0 ); + m_pQuickReportButton->SetImageBounds( 0, 0, bottom_line_height, bottom_line_height ); + + int trace_button_size = 20.0f * fScale; + m_pTracePlayerButton1->SetBounds((PLAYER_LIST_MUTE_ICON_X - 2) * fScale, bottom_line_top, trace_button_size, trace_button_size); + //m_pTracePlayerButton1->SetImageBounds( 0, 0, trace_button_size, trace_button_size); + + m_pPlayerLabel-> SetBounds(PLAYER_LIST_PLAYER_X * fScale, top, PLAYER_LIST_PLAYER_W * fScale, top_line_height); + m_pMarinesLabel->SetBounds(PLAYER_LIST_MARINES_X * fScale, top, PLAYER_LIST_MARINES_W * fScale, top_line_height); + m_pFragsLabel-> SetBounds(PLAYER_LIST_FRAGS_X * fScale, top, PLAYER_LIST_FRAGS_W * fScale, top_line_height); + m_pDeathsLabel-> SetBounds(PLAYER_LIST_DEATHS_X * fScale, top, PLAYER_LIST_DEATHS_W * fScale, top_line_height); + m_pPingLabel-> SetBounds(PLAYER_LIST_PING_X * fScale, top, PLAYER_LIST_PING_W * fScale, top_line_height); + m_pLeaderCheck-> SetBounds(PLAYER_LIST_LEADER_CHECK_X * fScale, bottom_line_top, PLAYER_LIST_LEADER_CHECK_W * fScale, bottom_line_height); + m_pKickCheck-> SetBounds(PLAYER_LIST_KICK_CHECK_X * fScale, bottom_line_top, PLAYER_LIST_KICK_CHECK_W * fScale, bottom_line_height); + + for (int i=0;iSetBounds((PLAYER_LIST_KICK_ICON_X + (PLAYER_LIST_KICK_ICON_W * i)) * fScale, bottom_line_top, + PLAYER_LIST_KICK_ICON_W * fScale, bottom_line_height); + m_pLeaderVoteIcon[i]->SetBounds((PLAYER_LIST_LEADER_ICON_X + (PLAYER_LIST_LEADER_ICON_W * i)) * fScale, bottom_line_top, + PLAYER_LIST_LEADER_ICON_W * fScale, bottom_line_height); + } } void PlayerListLine::OnThink() @@ -270,6 +306,20 @@ void PlayerListLine::OnThink() } } } + + RemoveInvalidTracePlayersAndColors(); + C_ASW_Player* pPlayer = ToASW_Player(UTIL_PlayerByIndex(m_iPlayerIndex)); + bool isDeathMatch = ASWDeathmatchMode() && (ASWDeathmatchMode()->IsDeathmatchEnabled() || ASWDeathmatchMode()->IsTeamDeathmatchEnabled()); + if (pPlayer && !pPlayer->IsLocalPlayer() && !pPlayer->IsAnyBot() && !ASWDeathmatchMode()->IsDeathmatchEnabled() && !isDeathMatch) + { + m_pTracePlayerButton1->SetVisible(cl_trace_player_enable.GetBool()); + m_pTracePlayerButton1->SetImage(CBitmapButton::BUTTON_ENABLED, (g_nTracePlayer2Color[pPlayer->entindex()] != 0) ? "vgui/briefing/trace_player_icon_on" : "vgui/briefing/trace_player_icon_off", color32{ 255, 255, 255, 255 }); + } + else + { + m_pTracePlayerButton1->SetVisible(false); + } + UpdateCheckBoxes(); UpdateVoteIcons(); } @@ -320,6 +370,17 @@ void PlayerListLine::UpdateCheckBoxes() m_pKickCheck->SetVisible( pPlayer && pPlayer->CanBeKicked() ); m_pLeaderCheck->SetVisible( pPlayer && pPlayer->CanBeLeader() ); m_pQuickReportButton->SetVisible( pPlayer && !pPlayer->IsAnyBot() && ( rd_debug_quick_report_local_player.GetBool() || !pPlayer->IsLocalPlayer() ) ); + + bool isDeathMatch = ASWDeathmatchMode() && (ASWDeathmatchMode()->IsDeathmatchEnabled() || ASWDeathmatchMode()->IsTeamDeathmatchEnabled()); + if (pPlayer && !pPlayer->IsLocalPlayer() && !pPlayer->IsAnyBot() && !ASWDeathmatchMode()->IsDeathmatchEnabled() && !isDeathMatch) + { + m_pTracePlayerButton1->SetVisible(cl_trace_player_enable.GetBool()); + m_pTracePlayerButton1->SetImage(CBitmapButton::BUTTON_ENABLED, (g_nTracePlayer2Color[pPlayer->entindex()] != 0) ? "vgui/briefing/trace_player_icon_on" : "vgui/briefing/trace_player_icon_off", color32{255, 255, 255, 255}); + } + else + { + m_pTracePlayerButton1->SetVisible(false); + } // make sure our selected/unselected status matches the selected index from our parent PlayerListPanel *pPanel = assert_cast< PlayerListPanel * >( GetParent()->GetParent()->GetParent() ); diff --git a/src/game/client/swarm/vgui/playerlistline.h b/src/game/client/swarm/vgui/playerlistline.h index ae810bd70..54175f3b9 100644 --- a/src/game/client/swarm/vgui/playerlistline.h +++ b/src/game/client/swarm/vgui/playerlistline.h @@ -70,6 +70,7 @@ class PlayerListLine : public vgui::Panel, BaseModUI::IGenericPanelListItem vgui::Button *m_pPlayerLabel; vgui::Label *m_pMarinesLabel; CBitmapButton *m_pQuickReportButton; + CBitmapButton *m_pTracePlayerButton1; vgui::Label *m_pFragsLabel; vgui::Label *m_pDeathsLabel; vgui::Label *m_pPingLabel; diff --git a/src/game/client/swarm/vgui/playerlistpanel.cpp b/src/game/client/swarm/vgui/playerlistpanel.cpp index 8d16d8c98..d6b749626 100644 --- a/src/game/client/swarm/vgui/playerlistpanel.cpp +++ b/src/game/client/swarm/vgui/playerlistpanel.cpp @@ -43,6 +43,7 @@ int g_asw_iPlayerListOpen = 0; ConVar rd_report_voted_players( "rd_report_voted_players", "0", FCVAR_ARCHIVE, "Automatically send a report when voting or muting a player on the player list." ); extern ConVar rd_debug_quick_report_local_player; +extern ConVar cl_trace_player_enable; PlayerListPanel::PlayerListPanel(vgui::Panel *parent, const char *name) : vgui::EditablePanel(parent, name) @@ -111,6 +112,9 @@ PlayerListPanel::PlayerListPanel(vgui::Panel *parent, const char *name) : m_pSettingAutoReportVotes = new CCvarToggleCheckButton( this, "SettingAutoReportVotes", "#rd_reporting_auto_preference", "rd_report_voted_players" ); m_pSettingAutoReportVotes->Reset(); + m_pTracePlayerToggle = new CCvarToggleCheckButton(this, "SettingTracePlayerToggle", "#asw_trace_player_enable", "cl_trace_player_enable"); + m_pTracePlayerToggle->Reset(); + m_pStartSavedCampaignVoteButton->SetButtonTexture("swarm/Briefing/ShadedButton"); m_pStartSavedCampaignVoteButton->SetButtonOverTexture("swarm/Briefing/ShadedButton_over"); @@ -164,6 +168,11 @@ PlayerListPanel::~PlayerListPanel() m_pSettingAutoReportVotes->ApplyChanges(); engine->ClientCmd_Unrestricted( "host_writeconfig\n" ); } + if (m_pTracePlayerToggle->HasBeenModified()) + { + m_pTracePlayerToggle->ApplyChanges(); + engine->ClientCmd_Unrestricted("host_writeconfig\n"); + } } void PlayerListPanel::ApplySchemeSettings(vgui::IScheme *pScheme) @@ -261,9 +270,9 @@ void PlayerListPanel::OnThink() // make sure we have enough line panels per player and that each line knows the index of the player its displaying int iNumPlayersInGame = 0; bool bNeedsLayout = false; - for ( int j = 1; j <= gpGlobals->maxClients; j++ ) - { - if ( g_PR->IsConnected( j ) ) + for (int j = 1; j <= gpGlobals->maxClients; j++) + { + if (g_PR->IsConnected(j)) { iNumPlayersInGame++; while (m_PlayerLine.Count() <= iNumPlayersInGame) @@ -271,10 +280,10 @@ void PlayerListPanel::OnThink() // temp comment m_PlayerLine.AddToTail(new PlayerListLine(this, "PlayerLine")); } - if ( m_PlayerLine.Count() > ( iNumPlayersInGame - 1 ) && m_PlayerLine[ iNumPlayersInGame - 1 ] ) + if (m_PlayerLine.Count() > (iNumPlayersInGame - 1) && m_PlayerLine[iNumPlayersInGame - 1]) { - m_PlayerLine[iNumPlayersInGame-1]->SetVisible(true); - if (m_PlayerLine[iNumPlayersInGame-1]->SetPlayerIndex(j)) + m_PlayerLine[iNumPlayersInGame - 1]->SetVisible(true); + if (m_PlayerLine[iNumPlayersInGame - 1]->SetPlayerIndex(j)) { bNeedsLayout = true; } @@ -284,43 +293,43 @@ void PlayerListPanel::OnThink() m_pTipsLabel->SetText(""); - IMatchSession *pSession = g_pMatchFramework->GetMatchSession(); - if ( pSession ) + IMatchSession* pSession = g_pMatchFramework->GetMatchSession(); + if (pSession) { - KeyValues *pSettings = pSession->GetSessionSettings(); - if ( pSettings ) + KeyValues* pSettings = pSession->GetSessionSettings(); + if (pSettings) { - m_pVisibilityLabel->SetVisible( !Q_stricmp( pSettings->GetString( "options/server" ), "listen") ); - m_pVisibilityButton->SetVisible( engine->IsClientLocalToActiveServer() ); + m_pVisibilityLabel->SetVisible(!Q_stricmp(pSettings->GetString("options/server"), "listen")); + m_pVisibilityButton->SetVisible(engine->IsClientLocalToActiveServer()); const char* tip; - if ( !Q_stricmp( pSettings->GetString( "system/access"), "public" ) ) + if (!Q_stricmp(pSettings->GetString("system/access"), "public")) { - m_pVisibilityLabel->SetText( "#L4D360UI_Lobby_PublicTitle" ); - m_pVisibilityButton->SetText( "#L4D360UI_Lobby_FriendsTitle" ); + m_pVisibilityLabel->SetText("#L4D360UI_Lobby_PublicTitle"); + m_pVisibilityButton->SetText("#L4D360UI_Lobby_FriendsTitle"); tip = "#L4D360UI_Lobby_MakeFriendOnly_Tip"; } else { - m_pVisibilityLabel->SetText( "#L4D360UI_Lobby_FriendsTitle" ); - m_pVisibilityButton->SetText( "#L4D360UI_Lobby_PublicTitle" ); + m_pVisibilityLabel->SetText("#L4D360UI_Lobby_FriendsTitle"); + m_pVisibilityButton->SetText("#L4D360UI_Lobby_PublicTitle"); tip = "#L4D360UI_Lobby_OpenToPublic_Tip"; } - if ( m_pVisibilityButton->IsCursorOver() ) - m_pTipsLabel->SetText( tip ); + if (m_pVisibilityButton->IsCursorOver()) + m_pTipsLabel->SetText(tip); } } else { - m_pVisibilityLabel->SetVisible( false ); - m_pVisibilityButton->SetVisible( false ); + m_pVisibilityLabel->SetVisible(false); + m_pVisibilityButton->SetVisible(false); } //m_pPlayerListScroll->SetScrollBarVisible( IsPC() && iNumPlayersInGame > 6); // hide any extra ones we might have - for (int i=iNumPlayersInGame;iSetVisible(false); } @@ -334,18 +343,18 @@ void PlayerListPanel::OnThink() } bool is_team_game = ASWDeathmatchMode() && ASWDeathmatchMode()->IsTeamDeathmatchEnabled(); - m_pTeam1ScoreLabel->SetVisible( is_team_game ); - m_pTeam2ScoreLabel->SetVisible( is_team_game ); + m_pTeam1ScoreLabel->SetVisible(is_team_game); + m_pTeam2ScoreLabel->SetVisible(is_team_game); - if ( is_team_game ) + if (is_team_game) { - C_Team *alpha_team = GetGlobalTeam( TEAM_ALPHA ); - C_Team *beta_team = GetGlobalTeam( TEAM_BETA ); + C_Team* alpha_team = GetGlobalTeam(TEAM_ALPHA); + C_Team* beta_team = GetGlobalTeam(TEAM_BETA); - if ( alpha_team && beta_team ) + if (alpha_team && beta_team) { - const char *t1_name = alpha_team->Get_Name(); - const char *t2_name = beta_team->Get_Name(); + const char* t1_name = alpha_team->Get_Name(); + const char* t2_name = beta_team->Get_Name(); if (t1_name && t2_name) { @@ -360,30 +369,33 @@ void PlayerListPanel::OnThink() wchar_t t1_wlabel[1024]; wchar_t t2_wlabel[1024]; - g_pVGuiLocalize->ConvertANSIToUnicode( t1_label, t1_wlabel, sizeof(t1_wlabel)); - g_pVGuiLocalize->ConvertANSIToUnicode( t2_label, t2_wlabel, sizeof(t2_wlabel)); + g_pVGuiLocalize->ConvertANSIToUnicode(t1_label, t1_wlabel, sizeof(t1_wlabel)); + g_pVGuiLocalize->ConvertANSIToUnicode(t2_label, t2_wlabel, sizeof(t2_wlabel)); - m_pTeam1ScoreLabel->SetText( t1_wlabel ); - m_pTeam2ScoreLabel->SetText( t2_wlabel ); + m_pTeam1ScoreLabel->SetText(t1_wlabel); + m_pTeam2ScoreLabel->SetText(t2_wlabel); } } else { - Warning( "Cannot get the needed team for displayin in UI \n" ); + Warning("Cannot get the needed team for displayin in UI \n"); } } - C_ASW_Player *pPlayer = C_ASW_Player::GetLocalASWPlayer(); + C_ASW_Player* pPlayer = C_ASW_Player::GetLocalASWPlayer(); bool bShowRestart = pPlayer && ASWGameResource() && ASWGameResource()->GetLeader() == pPlayer; //Msg("bLeader = %d leaderentindex=%d player entindex=%d\n", bLeader, ASWGameResource()->GetLeaderEntIndex(), pPlayer->entindex()); m_pRestartMissionButton->SetVisible(bShowRestart); - m_pLeaderButtonsBackground->SetVisible(bShowRestart); + m_pLeaderButtonsBackground->SetVisible(bShowRestart); UpdateServerName(); if (bNeedsLayout) InvalidateLayout(true); + + bool isDeathMatch = ASWDeathmatchMode() && (ASWDeathmatchMode()->IsDeathmatchEnabled() || ASWDeathmatchMode()->IsTeamDeathmatchEnabled()); + m_pTracePlayerToggle->SetVisible(!isDeathMatch); } void PlayerListPanel::KickClicked( PlayerListLine *pLine ) diff --git a/src/game/client/swarm/vgui/playerlistpanel.h b/src/game/client/swarm/vgui/playerlistpanel.h index 9ed473e26..4d674ea90 100644 --- a/src/game/client/swarm/vgui/playerlistpanel.h +++ b/src/game/client/swarm/vgui/playerlistpanel.h @@ -82,6 +82,7 @@ class PlayerListPanel : public vgui::EditablePanel vgui::Label* m_pCounterLabel; CCvarToggleCheckButton *m_pSettingAutoReportVotes; + CCvarToggleCheckButton* m_pTracePlayerToggle; vgui::DHANDLE m_hQuickReportPanel; char m_szMapName[64]; diff --git a/src/game/shared/swarm/rd_lobby_utils.cpp b/src/game/shared/swarm/rd_lobby_utils.cpp index fdb474a1e..3da361c2e 100644 --- a/src/game/shared/swarm/rd_lobby_utils.cpp +++ b/src/game/shared/swarm/rd_lobby_utils.cpp @@ -798,3 +798,43 @@ bool CReactiveDropServerList::IsHoIAFServerIP( uint32_t ip ) return HoIAF()->IsRankedServerIP( ip ); } #endif + +#ifndef CLIENT_DLL +CON_COMMAND(rd_lobby_suggest_trace_player, "notify server to send a trace player suggestion to all clients.") +{ + if (args.ArgC() < 2) + { + Msg("Usage: rd_lobby_suggest_trace_player \n"); + return; + } + + int iPlayerIndex = atoi(args[1]); + if (iPlayerIndex < 1 || iPlayerIndex > gpGlobals->maxClients) + { + Msg("Invalid playerIndex\n"); + return; + } + + CBasePlayer* pPlayer = UTIL_PlayerByIndex(iPlayerIndex); + if (!pPlayer) + { + Msg("Can't find a player with index <%d>.\n", iPlayerIndex); + return; + } + // Send the message to all players + for (int i = 1; i <= gpGlobals->maxClients; i++) + { + CBasePlayer* pRecipient = UTIL_PlayerByIndex(i); + if (!pRecipient) + continue; + if (pRecipient == pPlayer) + { + ClientPrint(pRecipient, HUD_PRINTTALK, "asw_trace_me_msg_to_self"); + } + else + { + ClientPrint(pRecipient, HUD_PRINTTALK, "asw_trace_me_msg_to_others", pPlayer->GetPlayerName()); + } + } +} +#endif