public void registerSettingsListener(String name,String option,ISettingsListener listener){
  removeSettingsListener(name,option);
  SettingsListenerInfo info=new SettingsListenerInfo(name,option,listener);
  allListeners.add(info);
  List<ISettingsListener> listenersForKey=listenersByKey.get(option);
  if (listenersForKey == null) {
    listenersForKey=new LinkedList<ISettingsListener>();
    listenersByKey.put(option,listenersForKey);
  }
  listenersForKey.add(listener);
  String value=getProperty(option);
  if (value != null) {
    listener.settingsValueChanged(option,value);
  }
}

public void registerSettingsListener ( String name , String option , ISettingsListener listener ) { removeSettingsListener ( name , option ) ; SettingsListenerInfo info = new SettingsListenerInfo ( name , option , listener ) ; allListeners . add ( info ) ; List < ISettingsListener > listenersForKey = listenersByKey . get ( option ) ; if ( listenersForKey == null ) { listenersForKey = new LinkedList < ISettingsListener > ( ) ; listenersByKey . put ( option , listenersForKey ) ; } listenersForKey . add ( listener ) ; String value = getProperty ( option ) ; if ( value != null ) { listener . settingsValueChanged ( option , value ) ; } }
register a settings listener for a specific option . the settings listener will be called as soon as the option value changes , e . g . when modifying the configuration through the gui , or when loading a game having a patch file defined . the settings listener is also called immediately by this method while registering . only one settings listener can be defined for each name / option combination . this allows to call this method for the same listener multiple times and have it registered only once .
