Skip to content
Snippets Groups Projects
Commit eef3e5cd authored by Haakon Gunleiksrud's avatar Haakon Gunleiksrud
Browse files

#32 Fixed nusic toggle. Now without functional interface

parent 3f64ebfe
Branches ProfileImage
No related tags found
1 merge request!26Resolve "Options-functionality"
...@@ -44,17 +44,7 @@ public class OptionsState extends State { ...@@ -44,17 +44,7 @@ public class OptionsState extends State {
//TODO: Make the functional interfaces work. //TODO: Make the functional interfaces work.
table.row(); table.row();
table.add(makeLabel(musicToggleLabelText,skin)).spaceBottom(spacingOnBottom); table.add(makeLabel(musicToggleLabelText,skin)).spaceBottom(spacingOnBottom);
table.add(makeMusicCheckBox(skin, new checkBoxInterface() { table.add(makeMusicCheckBox(skin)).spaceBottom(spacingOnBottom);
@Override
public boolean handle(Event event) {
new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y){ GameWare.toggleMusic(); }
};
return false;
}
})).spaceBottom(spacingOnBottom);
table.row(); table.row();
table.add(makeLabel(soundEffectToggleLabelText,skin)).spaceBottom(spacingOnBottom).padRight(50); table.add(makeLabel(soundEffectToggleLabelText,skin)).spaceBottom(spacingOnBottom).padRight(50);
...@@ -114,16 +104,14 @@ public class OptionsState extends State { ...@@ -114,16 +104,14 @@ public class OptionsState extends State {
return label; return label;
} }
private CheckBox makeMusicCheckBox(Skin skin, checkBoxInterface obj){ private CheckBox makeMusicCheckBox(Skin skin){
CheckBox musicToggle = new CheckBox("",skin); CheckBox musicToggle = new CheckBox("",skin);
/*
musicToggle.addListener(new ClickListener() { musicToggle.addListener(new ClickListener() {
@Override @Override
public void clicked(InputEvent e, float x, float y){ GameWare.toggleMusic(); } public void clicked(InputEvent e, float x, float y){ GameWare.toggleMusic(); }
}); });
*/
musicToggle.addListener((EventListener) obj);
musicToggle.getImage().setScale(2,2); musicToggle.getImage().setScale(2,2);
musicToggle.toggle();
return musicToggle; return musicToggle;
} }
...@@ -134,6 +122,7 @@ public class OptionsState extends State { ...@@ -134,6 +122,7 @@ public class OptionsState extends State {
public void clicked(InputEvent e, float x, float y){ GameWare.toggleSoundEffects(); } public void clicked(InputEvent e, float x, float y){ GameWare.toggleSoundEffects(); }
}); });
soundEffectToggle.getImage().setScale(2,2); soundEffectToggle.getImage().setScale(2,2);
soundEffectToggle.toggle();
return soundEffectToggle; return soundEffectToggle;
} }
...@@ -148,10 +137,6 @@ public class OptionsState extends State { ...@@ -148,10 +137,6 @@ public class OptionsState extends State {
return darkModeToggle; return darkModeToggle;
} }
public interface checkBoxInterface extends EventListener{
}
private void backBtnClick(){ private void backBtnClick(){
gsm.set(new MenuState(gsm)); gsm.set(new MenuState(gsm));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment