Suggestions in .gui files
Get suggestions for widget types, keys, sprite names, fonts and values as you type in a .gui file.
When you type in a .gui file, Etch suggests what can come next: a widget type, a key, a
sprite name, a font or a value. The widget types and keys are exactly the ones EU4 1.37.5 reads
at that place. Sprite names, fonts and the order of the list come from your
playset: the game, your mod and the mods it depends on.
Get suggestions
Section titled “Get suggestions”- Open a
.guifile and put the cursor where you want to type. - Start typing, or press Ctrl+Space: a list of suggestions opens.
- Pick one with the arrow keys and press Enter or Tab.
Widget types come first, then keys. In each group, the words your playset’s files use most come first. Next to each one, in grey, Etch says what it is and how often your playset’s files use it.
What Etch suggests where
Section titled “What Etch suggests where”- Inside
guiTypes = { … }: the widget types the game reads there, such aswindowType. Picking one writes the widget with an emptyname = "", and the cursor goes into the quotes. - Inside a widget: the kinds of widget the game creates inside this kind of widget, and the
keys the game reads in it. Inside a
windowType, for example, you geticonTypeandguiButtonType, but alsobrowserType,tooltipandverticalScrollbar, which few files use. Inside acontainerWindowTypeyou getbuttonType, notguiButtonType: the game creates only that one there. A key that takes a block, such asposition, comes with its{ }. After any other key, the suggestions open again for its value. - Inside
if_resolution = { … }:min_width,max_width,min_heightandmax_height, and the widget’s own keys and widgets. - Inside a block such as
position = { … }orsize = { … }: its keys, such asxandy. - After
spriteTypeorquadTextureSprite, and afterbackgroundin alistboxTypeorsmoothListboxType: every sprite name of your playset’s.gfxfiles. Move to a sprite in the list: the box beside it shows its kind (such asframeAnimatedSpriteType), its frames, the.gfxfile that defines it and a small picture of its texture. - After
fontorbuttonFont: the fonts of your playset. Hover over a font name you wrote to see the font, with a sample of its letters (Fonts in .gui and .gfx files). - After
orientation: the nine points the game can anchor a widget to, such as"UPPER_LEFT". In acontainerWindowTypeyou get seven: the game does not takeCENTER_LEFTorCENTER_RIGHTthere. - After a key that takes
yesorno, such asalwaysTransparent:yesandno. - After
formatin a text box:left,center,centreandright. Aftervertical_alignment:top,center,centreandbottom. The game takes both spellings of centre. - After other keys: the values your playset’s files use for that key, when they use only a
few different values, such as
clicksound.
The game reads keys in upper or lower case, so Orientation and orientation are the same
key. Etch writes a key the way your playset’s files write it most, such as listboxType rather
than listBoxType. Sprite names, fonts and the
orientation values are written in quotes, as the game’s files write them. If you already typed
the opening quote, Etch adds only the closing one.
Turn it off
Section titled “Turn it off”Suggestions are on by default. To turn them off, open Settings,
search for etch.editor.completion and clear its checkbox. Do this if another extension already
suggests words in these files and you want only its list.
With CWTools on, its rules may cover the widgets of .gui files. Then the widget types and keys
come from CWTools alone, and Etch suggests only what comes after a key: sprite names, fonts and
the other values above. See
Etch and CWTools in the same file.
What it doesn’t do
Section titled “What it doesn’t do”- A key with many different values, such as
nameortext, gets no value suggestions. Neither does a key whose values are numbers, such asscale. - Inside a widget kind the game does not read at that place, Etch suggests nothing. A warning in the Problems panel marks it while the preview is open.
- It works in
.guifiles only, not in.gfxfiles or scripts. - A sprite or font you add to a
.gfxfile shows up in the suggestions after you save that file.