22 package com.realtime.crossfire.jxclient.main;
26 import org.jetbrains.annotations.NotNull;
27 import org.jetbrains.annotations.Nullable;
129 public void parse(@NotNull
final String[] args) {
134 if (skin.equals(
"com.realtime.crossfire.jxclient.JXCSkinPrelude")) {
139 while (i < args.length) {
140 if ((args[i].equals(
"-r") || args[i].equals(
"--resolution")) && i+1 < args.length) {
142 if (resolution == null) {
143 System.err.println(
"Invalid resolution: "+args[i]);
146 }
else if ((args[i].equals(
"-S") || args[i].equals(
"-s") || args[i].equals(
"--skin")) && i+1 < args.length) {
148 if (skin.indexOf(
'@') != -1) {
149 System.err.println(
"Invalid skin name: "+skin);
152 }
else if (args[i].equals(
"-N") || args[i].equals(
"-n") || args[i].equals(
"--no-full-screen")) {
154 }
else if (args[i].equals(
"--opengl")) {
155 System.setProperty(
"sun.java2d.opengl",
"True");
156 }
else if (args[i].equals(
"--server") && i+1 < args.length) {
158 }
else if (args[i].equals(
"--debug-gui")) {
160 }
else if (args[i].equals(
"--debug-protocol") && i+1 < args.length) {
161 debugProtocolFilename = args[++i];
162 }
else if (args[i].equals(
"--debug-keyboard") && i+1 < args.length) {
163 debugKeyboardFilename = args[++i];
164 }
else if (args[i].equals(
"--debug-mouse") && i+1 < args.length) {
165 debugMouseFilename = args[++i];
166 }
else if (args[i].equals(
"--debug-screen") && i+1 < args.length) {
167 debugScreenFilename = args[++i];
168 }
else if (args[i].equals(
"--debug-sound") && i+1 < args.length) {
169 debugSoundFilename = args[++i];
170 }
else if (args[i].equals(
"--tile-size") && i+1 < args.length) {
171 final String tmp = args[++i];
173 tileSize = Integer.parseInt(tmp);
174 }
catch (
final NumberFormatException ignored) {
175 System.err.println(
"Invalid tile size: "+tmp);
179 System.err.println(
"Invalid tile size: "+tileSize);
182 }
else if (args[i].equals(
"--avoid-copy-area")) {
183 avoidCopyArea =
true;
185 System.out.println(
"");
186 System.out.println(
"Available options:");
187 System.out.println(
" --no-full-screen");
189 System.out.println(
" -n : Disable full-screen mode.");
190 System.out.println(
" --resolution <width>x<height>");
191 System.out.println(
" -r <width>x<height>");
192 System.out.println(
" : Resolution to use. [default is maximum not exceeding screen]");
193 System.out.println(
" --skin <skin>");
195 System.out.println(
" -s <skin> : Skin name to use.");
196 System.out.println(
" --tile-size <n>: The size of map view tiles in pixels.");
197 System.out.println(
" --avoid-copy-area: Do not copy pixel areas when scrolling the map view.");
198 System.out.println(
" Instead always repaint all map squares.");
199 System.out.println(
" --opengl : Enable the OpenGL rendering pipeline.");
200 System.out.println(
" --server <host>: Select a server to connect to; skips main and metaserver");
201 System.out.println(
" windows.");
202 System.out.println(
" --debug-gui : Enable debugging of GUI elements.");
203 System.out.println(
" --debug-keyboard <log-file>");
204 System.out.println(
" : Log keyboard input.");
205 System.out.println(
" --debug-mouse <log-file>");
206 System.out.println(
" : Log mouse input.");
207 System.out.println(
" --debug-protocol <log-file>");
208 System.out.println(
" : Log messages exchanged with the server.");
209 System.out.println(
" --debug-screen <log-file>");
210 System.out.println(
" : Log messages related to screen resolution.");
211 System.out.println(
" --debug-sound <log-file>");
212 System.out.println(
" : Log messages related to sound.");
213 System.out.println(
"");
214 System.out.println(
"Available skins: default, ragnorok.");
222 if (skin.equals(
"default")) {
Resolution resolution
The resolution to use or.
String debugKeyboardFilename
The filename for keyboard debug logs or.
String getDebugMouseFilename()
Returns the filename for mouse debug logs.
static final int DEFAULT_TILE_SIZE
The default size of tiles in the map view in pixels.
String getDebugScreenFilename()
Returns the filename for screen debug logs.
Resolution getResolution()
Returns the resolution.
String debugSoundFilename
The filename for sound debug logs or.
static Resolution parse(@NotNull final String str)
Creates a new instance from string representation.
String getDebugProtocolFilename()
Returns the filename for Crossfire protocol debug logs.
int tileSize
The size of tiles in the map view in pixels.
boolean avoidCopyArea
Whether map scrolling is done by copying pixel areas.
String getDebugSoundFilename()
Returns the filename for sound debug logs.
boolean debugGui
Enable debugging of GUI elements.
boolean isAvoidCopyArea()
Returns whether map scrolling is done by copying pixel areas.
int getTileSize()
Returns the size of a tile in the map view.
Maintains a set of key/value pairs.
boolean isFullScreen()
Returns whether full-screen mode should be enabled.
String skin
The skin name to load or.
String debugProtocolFilename
The filename for Crossfire protocol message logs or.
String getDebugKeyboardFilename()
Returns the filename for keyboard debug logs.
String getSkin()
Returns the skin name.
String debugScreenFilename
The filename for screen debug logs or.
String getServer()
Returns the Crossfire server to connect to.
boolean isDebugGui()
Returns whether debugging of GUI elements is enabled.
Information about JXClient's screen/window resolution.
String server
The Crossfire server to connect to or.
Command line argument parser.
void parse(@NotNull final String[] args)
Parse command line arguments.
String debugMouseFilename
The filename for mouse debug logs or.
boolean fullScreen
The Settings for saving/restoring defaults.
static final String DEFAULT_SKIN
The default skin name.