 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.main;
26 import org.jetbrains.annotations.NotNull;
27 import org.jetbrains.annotations.Nullable;
130 public void parse(@NotNull
final String @NotNull [] args) {
135 while (i < args.length) {
136 if ((args[i].equals(
"-r") || args[i].equals(
"--resolution")) && i+1 < args.length) {
139 System.err.println(
"Invalid resolution: "+args[i]);
142 }
else if ((args[i].equals(
"-S") || args[i].equals(
"-s") || args[i].equals(
"--skin")) && i+1 < args.length) {
144 if (
skin.indexOf(
'@') != -1) {
145 System.err.println(
"Invalid skin name: "+
skin);
148 }
else if (args[i].equals(
"-N") || args[i].equals(
"-n") || args[i].equals(
"--no-full-screen")) {
150 }
else if (args[i].equals(
"--full-screen")) {
152 }
else if (args[i].equals(
"--opengl")) {
153 System.setProperty(
"sun.java2d.opengl",
"True");
154 }
else if (args[i].equals(
"--server") && i+1 < args.length) {
156 }
else if (args[i].equals(
"--debug-gui")) {
158 }
else if (args[i].equals(
"--debug-protocol") && i+1 < args.length) {
160 }
else if (args[i].equals(
"--debug-keyboard") && i+1 < args.length) {
162 }
else if (args[i].equals(
"--debug-mouse") && i+1 < args.length) {
164 }
else if (args[i].equals(
"--debug-screen") && i+1 < args.length) {
166 }
else if (args[i].equals(
"--debug-sound") && i+1 < args.length) {
168 }
else if (args[i].equals(
"--tile-size") && i+1 < args.length) {
169 final String tmp = args[++i];
172 }
catch (
final NumberFormatException ignored) {
173 System.err.println(
"Invalid tile size: "+tmp);
177 System.err.println(
"Invalid tile size: "+
tileSize);
180 }
else if (args[i].equals(
"--font-scale-factor") && i+1 < args.length) {
181 final String tmp = args[++i];
184 }
catch (
final NumberFormatException ignored) {
185 System.err.println(
"Invalid font scale factor: "+tmp);
188 if (fontScaleFactor < 0.01 || fontScaleFactor > 100.0) {
192 }
else if (args[i].equals(
"--avoid-copy-area")) {
195 System.out.println();
196 System.out.println(
"Available options:");
197 System.out.println(
" --full-screen : Enable full-screen mode.");
201 System.out.println(
" --resolution <width>x<height>");
202 System.out.println(
" -r <width>x<height>");
203 System.out.println(
" : Resolution to use. [default is maximum not exceeding screen]");
204 System.out.println(
" --skin <skin>");
206 System.out.println(
" -s <skin> : Built-in skin name or skin directory to use.");
207 System.out.println(
" --tile-size <n>: The size of map view tiles in pixels.");
208 System.out.println(
" --font-scale-factor <factor>: The factor for scaling font sizes. Default to 1.0.");
209 System.out.println(
" --avoid-copy-area: Do not copy pixel areas when scrolling the map view.");
210 System.out.println(
" Instead always repaint all map squares.");
211 System.out.println(
" --opengl : Enable the OpenGL rendering pipeline.");
212 System.out.println(
" --server <host>: Select a server to connect to; skips main and metaserver");
213 System.out.println(
" windows.");
214 System.out.println(
" --debug-gui : Enable debugging of GUI elements.");
215 System.out.println(
" --debug-keyboard <log-file>");
216 System.out.println(
" : Log keyboard input.");
217 System.out.println(
" --debug-mouse <log-file>");
218 System.out.println(
" : Log mouse input.");
219 System.out.println(
" --debug-protocol <log-file>");
220 System.out.println(
" : Log messages exchanged with the server.");
221 System.out.println(
" --debug-screen <log-file>");
222 System.out.println(
" : Log messages related to screen resolution.");
223 System.out.println(
" --debug-sound <log-file>");
224 System.out.println(
" : Log messages related to sound.");
225 System.out.println();
226 System.out.println(
"Built-in skin names: ragnorok ragnorok-48px ragnorok-64px.");
Resolution resolution
The resolution to use or.
boolean isAvoidCopyArea()
Returns whether map scrolling is done by copying pixel areas.
Command line argument parser.
String getServer()
Returns the Crossfire server to connect to.
boolean fullScreen
Whether full-screen mode should be enabled.
String skin
The skin name to load.
String getDebugKeyboardFilename()
Returns the filename for keyboard debug logs.
int getTileSize()
Returns the size of a tile in the map view.
static final int DEFAULT_TILE_SIZE
The default size of tiles in the map view in pixels.
String debugKeyboardFilename
The filename for keyboard debug logs or.
boolean debugGui
Enable debugging of GUI elements.
float fontScaleFactor
The scale factor for font sizes.
String getDebugProtocolFilename()
Returns the filename for Crossfire protocol debug logs.
String debugScreenFilename
The filename for screen debug logs or.
float getFontScaleFactor()
Returns the font scale factor.
String debugProtocolFilename
The filename for Crossfire protocol message logs or.
void parse(@NotNull final String @NotNull[] args)
Parse command line arguments.
Information about JXClient's screen/window resolution.
boolean isFullScreen()
Returns whether full-screen mode should be enabled.
String getDebugSoundFilename()
Returns the filename for sound debug logs.
int tileSize
The size of tiles in the map view in pixels.
String debugMouseFilename
The filename for mouse debug logs or.
String getDebugScreenFilename()
Returns the filename for screen debug logs.
String getDebugMouseFilename()
Returns the filename for mouse debug logs.
String server
The Crossfire server to connect to or.
boolean isDebugGui()
Returns whether debugging of GUI elements is enabled.
String getSkin()
Returns the skin name.
Resolution getResolution()
Returns the resolution.
boolean avoidCopyArea
Whether map scrolling is done by copying pixel areas.
static Resolution parse(@NotNull final String str)
Creates a new instance from string representation.
static final String DEFAULT_SKIN
The default skin name.
String debugSoundFilename
The filename for sound debug logs or.