Adventure Game Studio

AGS Development => Editor Development => Topic started by: eri0o on Wed 13/11/2024 21:29:43

Title: [SOLVED] editing multiline text in labels in the GUI Editor
Post by: eri0o on Wed 13/11/2024 21:29:43
GitHub PR (https://github.com/adventuregamestudio/ags/pull/2577) | Test Build for Download (https://cirrus-ci.com/task/4693357488766976)

(https://i.ibb.co/k3vz0cP/IMG-6474.png) (https://ibb.co/n3t4fkK)

video (https://private-user-images.githubusercontent.com/2244442/385955808-abffa5c1-3169-4992-aa7b-9fa8d2202592.mp4?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzE1MzQwOTksIm5iZiI6MTczMTUzMzc5OSwicGF0aCI6Ii8yMjQ0NDQyLzM4NTk1NTgwOC1hYmZmYTVjMS0zMTY5LTQ5OTItYWE3Yi05ZmE4ZDIyMDI1OTIubXA0P1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MTExMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDExMTNUMjEzNjM5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OTMyMGMxYmE4ZWMzODBlNGU3NmQwNTYzOWM5MjYwNDZhNzg5NjU5MzcwMzJjNDkzYTFhNjk5OWIzM2UxNzkzYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.iLYk2CCvZI3ULw6f7D9so0eTyXzalYDE7IegAaou9Dk)

Hey, this is a simple change, just wanted to see if people like it or not, if it's bad or is it good. I had the idea after this post here (https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/how-to-create-a-large-gui-that-would-hold-a-lot-of-text/msg636666904/?boardseen#new).

The idea is, if you edit the text of a label, there are three dots in the property grid that clicking it, it shows this very simple multiline text editor. If you click ok or hit ctrl+enter, it confirms and applies the text, or you can cancel to not apply the text change.

Double clicking a label also show it so you can edit the text of the label.

Very minimal feature, let me know what you people think.
Title: Re: [Idea] editing multiline text in labels in the GUI Editor
Post by: Crimson Wizard on Wed 13/11/2024 21:40:53
Re double clicking, GUI editor currently uses double clicking for creating a function for "default control event", I suppose it's better to reserve this action for that. Perhaps editing may be moved to a context menu?
Title: Re: [Idea] editing multiline text in labels in the GUI Editor
Post by: eri0o on Wed 13/11/2024 22:13:01
That could work too, I wonder if there's some shortcut that would make sense too in this case - I wrote the feature in my laptop without mouse, and the right click in the touch pad is a bit bad in it. I think in VS if you hit F4 twice it allows you to edit the label text in the designer, but I was trying to think about something less mystical.
Title: Re: [Idea] editing multiline text in labels in the GUI Editor
Post by: eri0o on Thu 14/11/2024 00:48:34
OK, made an updated version in the PR, that when hitting spacebar goes in edit mode. I also added the right-click context menu entry for it. And also made it possible to edit Button text too.

I also added a character and line count in the bottom of the text editor.

(https://i.ibb.co/f1h96LB/image.png) (https://imgbb.com/)

A build should eventually appear here: https://cirrus-ci.com/task/6169870943911936

I also went ahead and added theme support, so the window should look alright in your screens.
Title: Re: [Idea] editing multiline text in labels in the GUI Editor
Post by: Crimson Wizard on Thu 14/11/2024 10:58:01
Note that Spacebar is used for the panning in the room editor. Although a need to pan or zoom may be a less of a necessity for GUI, but I'd propose we should plan consistent zoom/pan controls in all the editors that edit a "graphical scene".
(...which reminds me, that gui editor still does not support same zoom-into-mouse mechanic as the room editor, nor vertical/horizontal scroll controls.
maybe we should make this consistent.)

EDIT: F2 key is traditionally meant for "edit field" command, applied for lists and tables and alike. For instance, i used it in the Watch Panel to start editing the list item, and it is also used to edit item names in the project explorer.

EDIT2: I see now, F2 is still assigned for "show game statistics" in 3.* editor. It's been fixed to Ctrl+F2 in AGS 4 but never backported. I'd also fix that in 3.6.2, because "show statistics" is a too specific command to have this simple hotkey.

EDIT3: Couple of more alternatives:
- E (for Edit)
- Enter/Return (?) although this may potentially conflict with confirming some operation.
Title: Re: [Idea] editing multiline text in labels in the GUI Editor
Post by: eri0o on Thu 14/11/2024 22:16:23
I went with CTRL + E for the shortcut. A new build is available here

https://cirrus-ci.com/task/4938423255957504

I will let it settle a bit and probably put the PR in for review tomorrow. Just wanted to see if someone would try and mention something.