Module: Sc2::Client::ConfigurableOptions
- Included in:
- Sc2::Client, Sc2::Configuration
- Defined in:
- lib/sc2ai/local_play/client/configurable_options.rb
Overview
Attributes shared by Configuration and Client
Instance Attribute Summary collapse
-
#data_dir ⇒ String?
Override the path to find the data package.
-
#display_mode ⇒ 0, ...
Launch param: -displayMode.
-
#egl_path ⇒ String?
Sets the path the to hardware rendering library.
-
#host ⇒ String?
Sc2 host param on which to listen for connections, default ‘127.0.0.1’.
-
#osmesa_path ⇒ String?
Sets the path the to software rendering library.
-
#temp_dir ⇒ String?
Override the path if you really need to set your own temp dir.
-
#verbose ⇒ Boolean
If set to true, will send param to client.
-
#version ⇒ String?
Version number such as “4.10”.
-
#windowheight ⇒ Integer
pixel height of game window.
-
#windowwidth ⇒ Integer
pixel width of game window.
-
#windowx ⇒ Integer
left position of window if windowed.
-
#windowy ⇒ Integer
top position of window if windowed.
Instance Method Summary collapse
-
#load_default_launch_options ⇒ Object
Resets configurable launch options to their defaults.
Instance Attribute Details
#data_dir ⇒ String?
Override the path to find the data package.
Required if the binary is not in the standard versions folder location.
Launch param: -dataDir ../../
21 22 23 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 21 def data_dir @data_dir end |
#display_mode ⇒ 0, ...
Launch param: -displayMode
66 67 68 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 66 def display_mode @display_mode end |
#egl_path ⇒ String?
Sets the path the to hardware rendering library.
Required for using the rendered interface with hardware rendering
Launch param: -eglpath
Example: /usr/lib/nvidia-384/libEGL.so
50 51 52 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 50 def egl_path @egl_path end |
#host ⇒ String?
Sc2 host param on which to listen for connections, default ‘127.0.0.1’
Launch param: -host 127.0.0.1
12 13 14 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 12 def host @host end |
#osmesa_path ⇒ String?
Sets the path the to software rendering library.
Required for using the rendered interface with software rendering
Launch param: -eglpath
Example: /usr/lib/x86_64-linux-gnu/libOSMesa.so
61 62 63 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 61 def osmesa_path @osmesa_path end |
#temp_dir ⇒ String?
Override the path if you really need to set your own temp dir
Implicit default is /tmp/
Launch param: -tempDir ../../
39 40 41 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 39 def temp_dir @temp_dir end |
#verbose ⇒ Boolean
If set to true, will send param to client.
Enables logging of all protocol requests/responses to std::err.
Launch param: -verbose
30 31 32 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 30 def verbose @verbose end |
#version ⇒ String?
Version number such as “4.10”. Leave blank to use latest
87 88 89 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 87 def version @version end |
#windowheight ⇒ Integer
pixel height of game window
74 75 76 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 74 def windowheight @windowheight end |
#windowwidth ⇒ Integer
pixel width of game window
70 71 72 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 70 def windowwidth @windowwidth end |
#windowx ⇒ Integer
left position of window if windowed
78 79 80 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 78 def windowx @windowx end |
#windowy ⇒ Integer
top position of window if windowed
82 83 84 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 82 def windowy @windowy end |
Instance Method Details
#load_default_launch_options ⇒ Object
Resets configurable launch options to their defaults
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/sc2ai/local_play/client/configurable_options.rb', line 90 def @host = if Paths.wsl? "#{Socket.gethostname}.mshome.net" else "127.0.0.1" # -listen end @display_mode = 0 # -displayMode @windowwidth = nil # -windowwidth @windowheight = nil # -windowheight @windowx = nil # -windowx @windowy = nil # -windowy @verbose = false # -verbose # Linux @data_dir = nil # -dataDir '../../' @temp_dir = nil # -tempDir '/tmp/' @egl_path = nil # -eglpath '/usr/lib/nvidia-384/libEGL.so' @osmesa_path = nil # -osmesapath '/usr/lib/x86_64-linux-gnu/libOSMesa.so' @version = nil # calculates -dataVersion and Base% executable end |