b0c83af092
Complete replacement of the tactical-shooter project with the netfox-cs-sample (MIT) — a CS 1.6 inspired multiplayer FPS built with Godot 4 and netfox. ## What's new - Full CS-style gameplay: teams (T/CT), rounds, economy, buy menu - 6 weapons: Knife, Glock, USP, AK-47, M4A1, AWP - Bomb plant/defuse with 2 bombsites - Flashbang & smoke grenades - Proper netfox rollback netcode at 64 tick - Network popup UI for host/join - HUD, crosshair, round timer, scoreboard - All netfox singletons registered as autoloads (works in exported builds) ## Architecture - Listen-server (host from client, no dedicated server binary) - Multiplayer-fps game lives at examples/multiplayer-fps/ - Netfox addons registered as autoloads for exported build compat - Godot 4.7 with Forward+ renderer ## Removed - Old headless-server architecture (client_main, server_main, player.gd, etc.) - Custom netfox bootstrap with ENet fallback - Old ChaffGames FPS template (2,420 lines, 844 KB) - SimulationServer GDExtension stub - Godot-jolt physics (netfox sample uses default Godot physics) - Duplicate weapon_data.gd, anti_cheat.gd, round_manager.gd, etc. - Server browser API Python venv (87 MB) - test_range map and modular assets ## Preserved - Git history - Server config at config/default_server_config.cfg - Windows export preset - Build directory (gitignored) Co-authored-by: naxIO <naxIO@users.noreply.github.com>
54 lines
1.7 KiB
GDScript
54 lines
1.7 KiB
GDScript
@tool
|
|
extends Node
|
|
|
|
func run_test():
|
|
_run(false, Vest.__.ONLY_AUTO)
|
|
|
|
func debug_test():
|
|
_run(true, Vest.__.ONLY_AUTO)
|
|
|
|
func _run(is_debug: bool, only_mode: int) -> void:
|
|
var editor_interface := Vest._get_editor_interface()
|
|
var script_editor := editor_interface.get_script_editor() as ScriptEditor
|
|
|
|
var edited_script := script_editor.get_current_script()
|
|
if not edited_script:
|
|
# TODO: Polyfilled toast mechanism so user can see these warns
|
|
push_warning("No script to run! Open a script in the script editor.")
|
|
return
|
|
|
|
if not _is_ancestor_of(VestTest, edited_script):
|
|
push_warning("Currently open script is not a test! Extend VestTest.")
|
|
return
|
|
|
|
print_verbose("Running test \"%s\"" % [edited_script.resource_path])
|
|
var vest_ui := VestUI._get_ui()
|
|
vest_ui.run_script(edited_script, is_debug, only_mode)
|
|
|
|
func _is_ancestor_of(base_script: Script, script: Script) -> bool:
|
|
for i in range(128): # Prevent runaway loops
|
|
if script == null: break
|
|
if base_script == script: return true
|
|
|
|
script = script.get_base_script()
|
|
return false
|
|
|
|
func _ready():
|
|
var editor := Vest._get_editor_interface()
|
|
editor.get_command_palette().add_command("Run test", "vest/run-test", run_test, "F7")
|
|
editor.get_command_palette().add_command("Debug test", "vest/debug-test", debug_test, "Ctrl+F7")
|
|
|
|
func _exit_tree():
|
|
var editor := Vest._get_editor_interface()
|
|
editor.get_command_palette().remove_command("vest/run-test")
|
|
editor.get_command_palette().remove_command("vest/debug-test")
|
|
|
|
func _shortcut_input(event):
|
|
if event is InputEventKey:
|
|
if event.key_label == KEY_F7 and not event.shift_pressed and event.is_pressed():
|
|
if event.is_command_or_control_pressed():
|
|
debug_test()
|
|
else:
|
|
run_test()
|
|
get_viewport().set_input_as_handled()
|