Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
170746c
Implement team spawn points
et-nik Jan 17, 2021
5012039
Fix codestyle
et-nik Jan 17, 2021
6f719af
Merge branch 'feature-team-spawn'
et-nik Jan 17, 2021
d626045
Server: Add a cvar to toggle team spawns
tmp64 Jan 18, 2021
efe7bcb
Merge branch 'tmp64-master'
et-nik Jan 19, 2021
cdac9ad
Server: Rename mp_use_team_spawns -> mp_teamspawn
tmp64 Jan 19, 2021
984164c
Fix ci artifacts. Add platform type to archive name
et-nik Jan 19, 2021
e21f57d
Merge branch 'ci-artifact-fix'
et-nik Jan 19, 2021
a76c6b2
Add export for some methods and functions
et-nik Jan 24, 2021
07bac76
Merge branch 'feature-team-spawn'
et-nik Jan 24, 2021
b4baf69
Merge branch 'weaponmod-fix'
et-nik Jan 24, 2021
da65de3
Add export for UTIL_PrecacheOtherWeapon
et-nik Jan 24, 2021
a4e8ed6
Merge branch 'weaponmod-fix'
et-nik Jan 24, 2021
a8a2ae8
Merge remote-tracking branch 'origin/master'
et-nik Dec 13, 2024
8ce554b
merge from https://github.com/tmp64/BugfixedHL-Rebased/tree/master
et-nik Dec 13, 2024
3eea547
update source_sdk
et-nik Dec 14, 2024
a0d494f
Merge remote-tracking branch 'upstream/master'
et-nik Oct 11, 2026
d94e7ef
custom scoreboard
et-nik Oct 12, 2026
7a86440
fixes and updates
et-nik Oct 12, 2026
754ae9d
fixes and updates
et-nik Oct 12, 2026
b8229da
fixes and updates
et-nik Oct 12, 2026
04f25be
fixes and updates
et-nik Oct 12, 2026
8466221
fixes and updates
et-nik Oct 12, 2026
1515057
fix score panel icon
et-nik Oct 13, 2026
4880a60
new elements
et-nik Oct 13, 2026
b1979ac
remove html
et-nik Oct 13, 2026
8b29541
code simplification
et-nik Nov 3, 2026
279508e
review
et-nik Nov 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,813 changes: 2,813 additions & 0 deletions docs/scoreboard-protocol.md

Large diffs are not rendered by default.

464 changes: 464 additions & 0 deletions gamedir/addons/amxmodx/scripting/include/bugfixedapi.inc

Large diffs are not rendered by default.

166 changes: 166 additions & 0 deletions gamedir/ui/resource/ClientSchemeBase.res
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,172 @@ Scheme
"custom" "1"
}
}

// HUD elements defined by the server (HudServerPanel)
"HudServerText" // text of HUD elements defined by the server
{
"1"
{
"name" "Verdana"
"tall" "12"
"weight" "600"
"yres" "480 599"
}
"2"
{
"name" "Verdana"
"tall" "13"
"weight" "600"
"yres" "600 767"
}
"3"
{
"name" "Verdana"
"tall" "14"
"weight" "600"
"yres" "768 1023"
"antialias" "1"
}
"4"
{
"name" "Verdana"
"tall" "20"
"weight" "600"
"yres" "1024 1199"
"antialias" "1"
}
"5"
{
"name" "Verdana"
"tall" "24"
"weight" "600"
"yres" "1200 6000"
"antialias" "1"
}
}
"HudServerLarge" // large font of HUD elements
{
"1"
{
"name" "Verdana"
"tall" "16"
"weight" "800"
"yres" "480 599"
}
"2"
{
"name" "Verdana"
"tall" "18"
"weight" "800"
"yres" "600 767"
}
"3"
{
"name" "Verdana"
"tall" "20"
"weight" "800"
"yres" "768 1023"
"antialias" "1"
}
"4"
{
"name" "Verdana"
"tall" "28"
"weight" "800"
"yres" "1024 1199"
"antialias" "1"
}
"5"
{
"name" "Verdana"
"tall" "34"
"weight" "800"
"yres" "1200 6000"
"antialias" "1"
}
}
"HudServerSmall" // small font of HUD elements
{
"1"
{
"name" "Verdana"
"tall" "10"
"weight" "600"
"yres" "480 599"
}
"2"
{
"name" "Verdana"
"tall" "11"
"weight" "600"
"yres" "600 767"
}
"3"
{
"name" "Verdana"
"tall" "12"
"weight" "600"
"yres" "768 1023"
"antialias" "1"
}
"4"
{
"name" "Verdana"
"tall" "16"
"weight" "600"
"yres" "1024 1199"
"antialias" "1"
}
"5"
{
"name" "Verdana"
"tall" "18"
"weight" "600"
"yres" "1200 6000"
"antialias" "1"
}
}
"HudServerHuge" // huge font of HUD elements
{
"1"
{
"name" "Verdana"
"tall" "24"
"weight" "800"
"yres" "480 599"
}
"2"
{
"name" "Verdana"
"tall" "28"
"weight" "800"
"yres" "600 767"
}
"3"
{
"name" "Verdana"
"tall" "32"
"weight" "800"
"yres" "768 1023"
"antialias" "1"
}
"4"
{
"name" "Verdana"
"tall" "44"
"weight" "800"
"yres" "1024 1199"
"antialias" "1"
}
"5"
{
"name" "Verdana"
"tall" "52"
"weight" "800"
"yres" "1200 6000"
"antialias" "1"
}
}
}

//
Expand Down
34 changes: 34 additions & 0 deletions gamedir/ui/resource/language/bugfixedhl_english.utf8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,40 @@
"BHL_Scores_MenuCopySteamID" "Copy SteamID"
"BHL_Scores_MenuCopySteamID64" "Copy SteamID64"

// Scoreboard extension
"BHL_SB_Level" "Level"
"BHL_SB_Weapon" "Weapon"
"BHL_SB_Progress" "Progress"
"BHL_SB_Kills" "Kills"
"BHL_SB_Final" "FINAL"

// HUD element templates (docs/scoreboard-protocol.md, 8.10): keep the placeholders in braces.
// A list of word forms picks one by the number: 2 forms in English, 3 in Russian.
"BHL_HUD_Place" "PLACE {@place} / {@total}"
"BHL_HUD_Overtake" "To pass {@rival:20}: {@pass|# kill|# kills}"
"BHL_HUD_Lead" "Lead: {@lead|# kill|# kills}"
"BHL_HUD_Tied" "Tied"
"BHL_HUD_Waiting" "Waiting for opponents"
"BHL_HUD_Warmup" "WARMUP {@value:time}"
"BHL_HUD_StartIn" "START IN {@value}"

// Weapon names: English in every language, the other files fall back to this one
"BHL_Weapon_crowbar" "Crowbar"
"BHL_Weapon_9mmhandgun" "Glock"
"BHL_Weapon_357" ".357"
"BHL_Weapon_9mmAR" "MP5"
"BHL_Weapon_shotgun" "Shotgun"
"BHL_Weapon_crossbow" "Crossbow"
"BHL_Weapon_bolt" "Crossbow"
"BHL_Weapon_rpg_rocket" "RPG"
"BHL_Weapon_gauss" "Gauss"
"BHL_Weapon_egon" "Egon"
"BHL_Weapon_hornet" "Hornet"
"BHL_Weapon_grenade" "Grenade"
"BHL_Weapon_satchel" "Satchel"
"BHL_Weapon_tripmine" "Tripmine"
"BHL_Weapon_snark" "Snark"

"BHL_Update_Notif_Title" "Update notification"
"BHL_Update_Notif_Text" "A new update has been released."
"BHL_Update_Notif_OldVer" "Your version: "
Expand Down
17 changes: 17 additions & 0 deletions gamedir/ui/resource/language/bugfixedhl_russian.utf8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@
"BHL_Scores_MenuCopySteamID" "Скопировать SteamID"
"BHL_Scores_MenuCopySteamID64" "Скопировать SteamID64"

// Scoreboard extension
"BHL_SB_Level" "Уровень"
"BHL_SB_Weapon" "Оружие"
"BHL_SB_Progress" "Прогресс"
"BHL_SB_Kills" "Убийства"
"BHL_SB_Final" "ФИНАЛ"

// HUD element templates (docs/scoreboard-protocol.md, 8.10): keep the placeholders in braces.
// A list of word forms picks one by the number: 2 forms in English, 3 in Russian.
"BHL_HUD_Place" "МЕСТО {@place} / {@total}"
"BHL_HUD_Overtake" "До обгона {@rival:20}: {@pass|# убийство|# убийства|# убийств}"
"BHL_HUD_Lead" "Отрыв: {@lead|# убийство|# убийства|# убийств}"
"BHL_HUD_Tied" "Вровень"
"BHL_HUD_Waiting" "Ожидание соперников"
"BHL_HUD_Warmup" "РАЗМИНКА {@value:time}"
"BHL_HUD_StartIn" "СТАРТ ЧЕРЕЗ {@value}"

"BHL_Update_Notif_Title" "Уведомление об обновлении"
"BHL_Update_Notif_Text" "Вышло новое обновление."
"BHL_Update_Notif_OldVer" "Ваша версия: "
Expand Down
68 changes: 68 additions & 0 deletions gamedir/ui/scripts/HudLayoutBase.res
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,72 @@
"default_name_color_kill" "OffWhite"
"default_name_color_death" "OffWhite"
}

HudServerPanel
{
"fieldName" "HudServerPanel"
"visible" "1"
"enabled" "1"
"xpos" "0"
"ypos" "0"
"wide" "f0"
"tall" "f0"

// Defaults of the params of HUD elements defined by the server; a param sent by the server wins.
// Sizes are proportional units of a 640x480 screen, alphas are 0-255 and apply to the element color.

// Meter: dots, or a rounded bar with a counter
"dots" "10" // Up to this max the meter is drawn as dots, above it as a bar; 0: always a bar
"dot_size" "7" // Diameter of a dot, height of the bar
"dot_gap" "3" // Distance between dots
"bar_wide" "0" // Length of the bar; 0: the length of "dots" dots (10 for 0 dots)
"counter" "1" // Counter: 0 never, 1 with the bar, 2 always
"counter_gap" "6" // Distance between the meter and the counter
"alpha_empty" "80" // Empty part of the bar
"form" "0" // 0: dots or a bar, 1: a ring of dots with the counter inside

// Strip: a row of cells, the current one framed
"cell_wide" "30" // Width of a cell
"cell_min_wide" "14" // Cells shrink down to this width, then the strip shows a window around the current cell
"cell_tall" "15" // Height of a cell
"cell_gap" "3" // Distance between cells
"icon_padding" "2" // Padding of the icon inside a cell
"max_wide" "300" // Width limit of the strip; 0: the screen width
"alpha_passed" "112" // Cells before the current one
"alpha_current" "48" // Current cell
"alpha_future" "24" // Cells after the current one
"alpha_icon_future" "80" // Icons and texts of the cells after the current one
"frame" "1" // 1: the current cell has a frame
"track" "0" // 1: markers of the other players above the cells they are on

// Icon: a sprite of hud.txt with a text after it
"icon_tall" "0" // Height of the icon; 0: the height of the element font
"icon_gap" "2" // Distance between the icon and the text

// Board: rows of the ranking or of a list
"rows" "3" // Number of rows
"board_mode" "0" // 0: the first rows, 1: also the own row after them, 2: rows around the own row
"row_gap" "2" // Distance between rows
"column_gap" "8" // Distance between columns (TAB characters in the row text)
"fill_alpha" "0" // Bar behind a row by its value
"highlight_alpha" "48" // Plate behind the own row

// Feed: lines of events
"lines" "4" // Number of lines
"life_ms" "5000" // Life of a line when the event doesn't give one
"line_fade_ms" "400" // A line fades in and out over this time
"queue" "0" // 0: the newest lines on top, 1: one line at a time in arrival order
"line_gap" "2" // Distance between lines

// Box: a backdrop of a group of elements
"accent_wide" "0" // Width of the accent bar on the left edge
"radius" "0" // Radius of the corners

// Every kind
"flash_ms" "0" // The color flashes white when the content changes
"fade_ms" "0" // The element fades in and out
"hold_ms" "0" // After it appears or changes the element is shown this long; 0: always
"warn_at" "0" // While the value is at most this, the element has the warn color; 0: off
"warn_pulse_ms" "0" // Period of the alpha pulse while warning; 0: no pulse
}
}
7 changes: 6 additions & 1 deletion src/bugfixedapi_amxx/bhl_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ bool bhl::IsServerApiReady()
return (g_pServerApi != nullptr);
}

bool bhl::IsScoreboardApiReady()
{
return g_pServerApi != nullptr && g_iServerMinor >= SCOREBOARD_API_MINOR;
}

bhl::E_ApiInitResult bhl::InitServerApi()
{
assert(!IsServerApiReady());
Expand Down Expand Up @@ -50,7 +55,7 @@ bhl::E_ApiInitResult bhl::InitServerApi()

// Check version
pIface->GetInterfaceVersion(g_iServerMajor, g_iServerMinor);
if (!(g_iServerMajor == IBUGFIXEDSERVER_MAJOR && g_iServerMinor >= IBUGFIXEDSERVER_MINOR))
if (g_iServerMajor != IBUGFIXEDSERVER_MAJOR)
return E_ApiInitResult::VersionMismatch;

g_pServerApi = pIface;
Expand Down
8 changes: 8 additions & 0 deletions src/bugfixedapi_amxx/bhl_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ enum class E_ApiInitResult
VersionMismatch // GetInterfaceVersion returned incompatible version
};

//! Server API minor version of the IScoreboardExt layout the natives call: older draft builds have another one and would crash (docs/scoreboard-protocol.md, 9.1)
constexpr int SCOREBOARD_API_MINOR = 4;

/**
* @returns pointer to server API or nullptr
*/
Expand All @@ -26,6 +29,11 @@ bhl::IBugfixedServer *serverapi();
*/
bool IsServerApiReady();

/**
* Return true if API is available and has every method of IScoreboardExt (v1.4 or newer).
*/
bool IsScoreboardApiReady();

/**
* Initializes server API.
* Uses functions from interface.h to get API pointer and check the version.
Expand Down
Loading
Loading