class Swarmy::ServerPicker

Defined in:

swarmy/server_picker.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(screen : Tui::Screen = Tui::Screen.new, servers : Array(Server) = Server.load_all, active : Server | Nil = nil) #

Instance Method Detail

def cursor : Int32 #

Cursor position at startup: 0 ("Local") or the index of the active server + 1.


def run : Server | Nil #

Returns the selected Server, or nil for "Local" / cancel.