You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
750 B
30 lines
750 B
package mightypork.gamecore.core.config;
|
|
|
|
|
|
import mightypork.gamecore.input.KeyStroke;
|
|
|
|
|
|
/**
|
|
* Key options - restricted access to {@link Config} for keys
|
|
*/
|
|
public class KeyOpts {
|
|
|
|
public void add(String cfgKey, String dataString)
|
|
{
|
|
add(cfgKey, dataString, null);
|
|
}
|
|
|
|
|
|
/**
|
|
* @param cfgKey key in config file
|
|
* @param dataString string representing the keystroke (format for
|
|
* {@link KeyStroke})
|
|
* @param comment optional comment
|
|
*/
|
|
public void add(String cfgKey, String dataString, String comment)
|
|
{
|
|
final KeyProperty kprop = new KeyProperty(Config.prefixKey(cfgKey), KeyStroke.createFromDataString(dataString), comment);
|
|
Config.strokes.put(Config.prefixKey(cfgKey), kprop);
|
|
Config.cfg.putProperty(kprop);
|
|
}
|
|
}
|
|
|