Page 1 of 1

[Solved] Rich text input assistant GUI

Posted: Thu Jul 25, 2019 10:13 pm
by Schallfalke
My main use would be using icons in station names (e.g., "Copper ore unload", "Copper ore load 1", etc.). Replacing those text with icons (as rich text) would be nice and quick to look up. Another use could be typing those rich text into chat.

I expect the following features to be in the mod (main directions, but can be adjusted if needed):
  1. A small main GUI on the side (or movable), with clickable icon categories (item, fluid, signal) buttons/checkboxes.
  2. When an icon category is selected, a new panel (either new pop-up or just within main GUI) having all available icons shown as buttons. Somehow look like the player crafting menu, or chart tag icon selection.
  3. A text field in the main GUI. When one of the above icon button is pressed, the mod generates the corresponding rich text in this text field.
  4. If possible, clicking those icon buttons will "automatically" copy the rich text to clipboard directly. (Does this operation exist in Factorio?)
  5. The generated text can then be pasted by player, into the station name input field or chat.
Wonder if any modder willing to make that? Thanks in advance. :)

PS: I am a modder myself, but I am very unfamiliar with GUI in Factorio. And I don't know how to handle potential out of sync problem (caused by GUI) in multiplayer game. So I would leave this whole idea to expert modder(s).

Solution:
LuziferSenpai has kindly created mod Rich Text Helper. Check it out!

Re: Rich text input assistant GUI

Posted: Fri Jul 26, 2019 7:22 pm
by darkfrei
Like this GUI?
Image
This GUI is from Creative Chests

Re: Rich text input assistant GUI

Posted: Fri Jul 26, 2019 9:07 pm
by slippycheeze
Schallfalke wrote: Thu Jul 25, 2019 10:13 pm PS: I am a modder myself, but I am very unfamiliar with GUI in Factorio. And I don't know how to handle potential out of sync problem (caused by GUI) in multiplayer game. So I would leave this whole idea to expert modder(s).
The good news is that this requires absolutely no saved state. Everything is purely local, both in the GUI, and in copying to the clipboard. So long as you don't do anything other than provide the string there is no potential for sync issues.

OTOH, you can't access the clipboard through the Lua API so far as I can tell. That you would need to make a feature request for.

Re: Rich text input assistant GUI

Posted: Sat Jul 27, 2019 3:49 pm
by Schallfalke
darkfrei wrote: Fri Jul 26, 2019 7:22 pm Like this GUI?
Image
This GUI is from Creative Chests
Yes, somehow like that, although I prefer it to be categorized and smaller (thus it can be side-by-side with the station name input box). The vanilla map chart tag selection menu have the right tabs and size.
Tag GUI.png
Tag GUI.png (149.45 KiB) Viewed 3927 times
slippycheeze wrote: Fri Jul 26, 2019 9:07 pm
Schallfalke wrote: Thu Jul 25, 2019 10:13 pm PS: I am a modder myself, but I am very unfamiliar with GUI in Factorio. And I don't know how to handle potential out of sync problem (caused by GUI) in multiplayer game. So I would leave this whole idea to expert modder(s).
The good news is that this requires absolutely no saved state. Everything is purely local, both in the GUI, and in copying to the clipboard. So long as you don't do anything other than provide the string there is no potential for sync issues.

OTOH, you can't access the clipboard through the Lua API so far as I can tell. That you would need to make a feature request for.
Good information. So I can consider doing this myself, if and only if no one else are interested to do this. Someone will probably make this already, while I will need time to learn the GUI-related functions.
Manual copy & paste is good enough for me. Maybe can request the Lua API support and update in the future, after that is done.

Re: Rich text input assistant GUI

Posted: Sun Sep 01, 2019 3:26 am
by LuziferSenpai
Is in WORK!

Re: Rich text input assistant GUI

Posted: Sun Sep 01, 2019 5:32 pm
by Schallfalke
LuziferSenpai wrote: Sun Sep 01, 2019 3:26 am Is in WORK!
Thanks! Looking forward to it. :)

Re: Rich text input assistant GUI

Posted: Thu Sep 19, 2019 1:43 pm
by LuziferSenpai
Schallfalke wrote: Sun Sep 01, 2019 5:32 pm
LuziferSenpai wrote: Sun Sep 01, 2019 3:26 am Is in WORK!
Thanks! Looking forward to it. :)
https://mods.factorio.com/mod/Rich_Text_Helper

Re: Rich text input assistant GUI

Posted: Thu Sep 19, 2019 2:30 pm
by mrvn
LuziferSenpai wrote: Thu Sep 19, 2019 1:43 pm
Schallfalke wrote: Sun Sep 01, 2019 5:32 pm
LuziferSenpai wrote: Sun Sep 01, 2019 3:26 am Is in WORK!
Thanks! Looking forward to it. :)
https://mods.factorio.com/mod/Rich_Text_Helper
I often name my station by the recipe the satelite factory runs and the inputs or results. It would be nice if one could copy&paste from an assembler into the GUI or drop a blueprint of an assembler into the GUI and get a rich text matching
a) the recipe name
b) the inputs of the recipe
c) the result of the recipe

Re: Rich text input assistant GUI

Posted: Thu Sep 19, 2019 2:46 pm
by LuziferSenpai
I can work on that, but pls write something like that inside my Github ;)

Re: Rich text input assistant GUI

Posted: Wed Sep 25, 2019 8:42 pm
by Schallfalke
LuziferSenpai wrote: Thu Sep 19, 2019 1:43 pm
Schallfalke wrote: Sun Sep 01, 2019 5:32 pm
LuziferSenpai wrote: Sun Sep 01, 2019 3:26 am Is in WORK!
Thanks! Looking forward to it. :)
https://mods.factorio.com/mod/Rich_Text_Helper
Thanks for your work!
Too bad I did not notice it earlier!

Briefly tested, and your mod achieved what I wanted. :D