Be more reasonable in GuiKeyframeRepository with user inputs, not replacing the keyframeSetList's elements every time the Keyframe Preset's name changes and therefore not calling the Listener which set the nameInput's value every time. This leads to a smoother user experience regarding the nameInput Text Field.

This commit is contained in:
CrushedPixel
2015-07-30 11:00:44 +02:00
parent 62b2e04b85
commit 8d8fa6a835

View File

@@ -226,10 +226,11 @@ public class GuiKeyframeRepository extends GuiScreen implements GuiReplayOverlay
saveOnQuit(); saveOnQuit();
super.keyTyped(typedChar, keyCode); super.keyTyped(typedChar, keyCode);
} }
if(currentKeyframeSet != null) { if(currentKeyframeSet != null && !currentKeyframeSet.getName().equals(nameInput.getText().trim())) {
currentKeyframeSet.setName(nameInput.getText()); currentKeyframeSet.setName(nameInput.getText().trim());
keyframeSetList.replaceElement(keyframeSetList.getSelectionIndex(), currentKeyframeSet);
} }
super.keyTyped(typedChar, keyCode);
} }
private void saveOnQuit() { private void saveOnQuit() {