|
|
@ -1,8 +1,7 @@ |
|
|
|
extends "res://scripts/args.gd" |
|
|
|
extends Control |
|
|
|
|
|
|
|
func _ready(): |
|
|
|
randomize() |
|
|
|
_parse_args() |
|
|
|
_gui_setup() |
|
|
|
|
|
|
|
# GUI |
|
|
@ -23,23 +22,6 @@ func _singleplayer(): |
|
|
|
|
|
|
|
# Command line |
|
|
|
|
|
|
|
func _set_up_options(): |
|
|
|
var opts = Options.new() |
|
|
|
opts.set_banner(('A non-violent MOBA inspired by Overwatch and Zineth')) |
|
|
|
opts.add('-singleplayer', false, 'Whether to run singeplayer, starting immediately') |
|
|
|
opts.add('-server', false, 'Whether to run as server') |
|
|
|
opts.add('-matchmaker', false, 'Whether to be the sole matchmaker') |
|
|
|
opts.add('-client', false, 'Immediately connect as client') |
|
|
|
opts.add('-silent', false, 'If the server is not playing, merely serving') |
|
|
|
opts.add('-port', 54672, 'The port to run a server on or connect to') |
|
|
|
opts.add('-hero', 'r', 'Your choice of hero (index)') |
|
|
|
opts.add('-level', 'r', 'Your choice of level (index) - server only!') |
|
|
|
opts.add('-start-game', false, 'Join as a client and immediately start the game') |
|
|
|
opts.add('-ai', true, 'Run this client as AI') |
|
|
|
opts.add('-no-record', true, "Don't record this play for AI later") |
|
|
|
opts.add('-h', false, "Print help") |
|
|
|
return opts |
|
|
|
|
|
|
|
func _option_sel(button_name, option): |
|
|
|
var button = get_node(button_name) |
|
|
|
if option == "r": |
|
|
@ -48,10 +30,6 @@ func _option_sel(button_name, option): |
|
|
|
option = int(option) |
|
|
|
button.select(option) |
|
|
|
|
|
|
|
func _parse_args(): |
|
|
|
var o = _set_up_options() |
|
|
|
o.parse() |
|
|
|
|
|
|
|
# if o.get_value("-silent"): |
|
|
|
# server_playing = false |
|
|
|
# if o.get_value("-hero"): |
|
|
|