Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions source/funkin/editors/ui/UITextBox.hx
Original file line number Diff line number Diff line change
Expand Up @@ -201,32 +201,41 @@ class UITextBox extends UISliceSprite implements IUIFocusable {
case END:
position = label.text.length;
case V:
UIState.playEditorSound(Flags.DEFAULT_EDITOR_PASTE_SOUND);
// Hey lj here, fixed copying because before we checked if the modifier was left or right ctrl
// but somehow it gave a int outside of the KeyModifier's range :sob:
// apparently there is a boolean that just checks for you. yw :D

// if we are not holding ctrl, ignore
if (!modifier.ctrlKey)
if (!modifier.ctrlKey) {
UIState.playEditorSound(Flags.DEFAULT_EDITOR_TEXTTYPE_SOUND);
return;
}

UIState.playEditorSound(Flags.DEFAULT_EDITOR_PASTE_SOUND);

// we pasting
var data:String = Clipboard.generalClipboard.getData(TEXT_FORMAT);
if (data != null)
onTextInput(data);
case C:
UIState.playEditorSound(Flags.DEFAULT_EDITOR_COPY_SOUND);
// if we are not holding ctrl, ignore
if (!modifier.ctrlKey)
if (!modifier.ctrlKey) {
UIState.playEditorSound(Flags.DEFAULT_EDITOR_TEXTTYPE_SOUND);
return;
}

UIState.playEditorSound(Flags.DEFAULT_EDITOR_COPY_SOUND);

// copying
Clipboard.generalClipboard.setData(TEXT_FORMAT, label.text);
case X:
UIState.playEditorSound(Flags.DEFAULT_EDITOR_CUT_SOUND);

// if we are not holding ctrl, ignore
if (!modifier.ctrlKey)
if (!modifier.ctrlKey) {
UIState.playEditorSound(Flags.DEFAULT_EDITOR_TEXTTYPE_SOUND);
return;
}

UIState.playEditorSound(Flags.DEFAULT_EDITOR_CUT_SOUND);

// cutting
Clipboard.generalClipboard.setData(TEXT_FORMAT, label.text);
Expand Down