fix list item options not saving
This commit is contained in:
parent
7ae70c7c16
commit
e853abcd9f
|
@ -146,6 +146,7 @@ public class OptionsOverlay {
|
|||
@Override
|
||||
public void update(Observable o, Object arg) {
|
||||
option.clickListItem((int) arg);
|
||||
overlay.saveOption(option);
|
||||
}
|
||||
});
|
||||
list.show();
|
||||
|
@ -183,7 +184,7 @@ public class OptionsOverlay {
|
|||
|
||||
public boolean mouseReleased(int button, int x, int y) {
|
||||
if (selectedOption != null) {
|
||||
overlay.saveOption(selectedOption, selectedOption.write());
|
||||
overlay.saveOption(selectedOption);
|
||||
}
|
||||
selectedOption = null;
|
||||
if (list.isVisible()) {
|
||||
|
|
|
@ -163,11 +163,11 @@ public class SBOverlay {
|
|||
this.gameObjects = gameObjects;
|
||||
}
|
||||
|
||||
public void saveOption(Options.GameOption option, String value) {
|
||||
public void saveOption(Options.GameOption option) {
|
||||
if (optionsMap[index] == null) {
|
||||
optionsMap[index] = new HashMap<>();
|
||||
}
|
||||
optionsMap[index].put(option, value);
|
||||
optionsMap[index].put(option, option.write());
|
||||
}
|
||||
|
||||
public boolean mousePressed(int button, int x, int y) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user