add changing instead of rewriting string values when using midclick

This commit is contained in:
Daniella / Tove 2024-05-27 05:04:05 +02:00
parent 5f919e4a04
commit 62e09d4f7c
6 changed files with 8 additions and 12 deletions

View file

@ -36,7 +36,7 @@ public class EnumButton extends Component {
public void click(int x, int y, int mouseButton) {
super.click(x, y, mouseButton);
if(mouseButton == 2) {
Set.openQuickSet(Set.addQuickSet(handle), field);
Set.openQuickSet(Set.addQuickSet(handle), field, true);
}
}
}

View file

@ -89,7 +89,7 @@ public class IntSlider extends Component {
public synchronized void click(int x, int y, int mouseButton) {
super.click(x, y, mouseButton);
if(mouseButton == 2) {
Set.openQuickSet(Set.addQuickSet(handle), field);
Set.openQuickSet(Set.addQuickSet(handle), field, false);
return;
}
if(mouseButton == 0) {

View file

@ -87,7 +87,7 @@ public class Slider extends Component {
public synchronized void click(int x, int y, int mouseButton) {
super.click(x, y, mouseButton);
if(mouseButton == 2) {
Set.openQuickSet(Set.addQuickSet(handle), field);
Set.openQuickSet(Set.addQuickSet(handle), field, false);
return;
}
if(mouseButton == 0) {

View file

@ -12,12 +12,12 @@ public class StringButton extends Button {
super(name + ": --UNINIT", new ClickEvent() {
@Override
public void click(Button it) {
((StringButton) it).press();
Set.openQuickSet(Set.addQuickSet(handle), field, false);
}
@Override
public void midClick(Button it) {
this.click(it);
Set.openQuickSet(Set.addQuickSet(handle), field, true);
}
});
this.name = name;
@ -29,8 +29,4 @@ public class StringButton extends Button {
public synchronized void update() {
text = name + ": " + handle.getContent().getString(field);
}
private void press() {
Set.openQuickSet(Set.addQuickSet(handle), field);
}
}

View file

@ -40,7 +40,7 @@ public class ToggleButton extends Component {
public synchronized void click(int x, int y, int mouseButton) {
super.click(x, y, mouseButton);
if(mouseButton == 2) {
Set.openQuickSet(Set.addQuickSet(handle), field);
Set.openQuickSet(Set.addQuickSet(handle), field, false);
return;
}
if(mouseButton == 0) {

View file

@ -25,8 +25,8 @@ public class Set extends Feature {
return n;
}
public static void openQuickSet(int id, String field) {
ChatUtil.openChat(BaseBand.getFeature(Client.class).prefix + "set " + id + " " + field.replace(' ', '_') + " ");
public static void openQuickSet(int id, String field, boolean showCurrent) {
ChatUtil.openChat(BaseBand.getFeature(Client.class).prefix + "set " + id + " " + field.replace(' ', '_') + " " + (showCurrent ? quickSet.get(id).getContent().getString(field) : ""));
}
@Override