Greetings, fellow star travellers. A thing I found odd in Stellaris is, that we don't have an alternative means of zooming in or out.
This is inconvenient for those, who rely on a trackpad, so I thought of the typical solution Paradox employs in the other games: A set of two buttons set on the main user interface, through which you can trigger a zoom in/zoom out action.
That is pretty neat, but the explanation on the Wiki for interface modding is unclear in some aspects, particularly the magic words to refer to zoom-in and zoom-out events.
From what I understand I'd need to add two files to SteamLibrary/steamapps/common/Stellaris/interface/ or rather the mod folder, which replicates Stellaris's file structure and adds them where appropriate. These can be called zoom.gfx and zoom.gui.
The GUI file may look something like this:
Since the GFX file is about sprites and visuals, I may even be able to get by with the GUI file at first. I can even add a shortcut in the GUI file for easy zooming using the keyboard.
As for GFX, I only want a ’+' or '-' on the button itself, which I already found in Stellaris/gfx/interface/buttons/ as GFX_topbar_date_plus.dds and GFX_topbar_date_minus.dds respectively. If I'm feeling particularly daring, I can maybe add a tooltip, that explains their purpose. That shouldn't be too hard. A localisation string placeholder can be filled with life over in the localization folder using YML.
Back on the button front, I still need to find a way to make a UI element do something. Specifically find the appropriate action.
I'm pointed towards Stellaris/common/button_effects folder for scriptable buttons of the effectButtonType, which is nice, but I'm positive, that the intended effect already exists and I only need a reference to a hardcoded action. This can be done using the buttonType as opposed to the effectButtonType, which would be preferable, since I don't have to mess with the common folder, altering the checksum.
The game files have been less than forthcoming, or I'm missing something obvious, so I'm asking the modding community.
How does a Stellaris developer make a button do its magic?
This is inconvenient for those, who rely on a trackpad, so I thought of the typical solution Paradox employs in the other games: A set of two buttons set on the main user interface, through which you can trigger a zoom in/zoom out action.
That is pretty neat, but the explanation on the Wiki for interface modding is unclear in some aspects, particularly the magic words to refer to zoom-in and zoom-out events.
From what I understand I'd need to add two files to SteamLibrary/steamapps/common/Stellaris/interface/ or rather the mod folder, which replicates Stellaris's file structure and adds them where appropriate. These can be called zoom.gfx and zoom.gui.
The GUI file may look something like this:
Code:
buttonType = {
name = "camera_zoom_out"
quadTextureSprite = "GFX_topbar_date_minus"
position = { x= 128 y = 1024 }
clicksound = interface
oversound = no_sound
}
buttonType = {
name = "camera_zoom_in"
quadTextureSprite = "GFX_topbar_date_plus"
position = { x= 96 y = 1024 }
clicksound = interface
oversound = no_sound
}
Since the GFX file is about sprites and visuals, I may even be able to get by with the GUI file at first. I can even add a shortcut in the GUI file for easy zooming using the keyboard.
As for GFX, I only want a ’+' or '-' on the button itself, which I already found in Stellaris/gfx/interface/buttons/ as GFX_topbar_date_plus.dds and GFX_topbar_date_minus.dds respectively. If I'm feeling particularly daring, I can maybe add a tooltip, that explains their purpose. That shouldn't be too hard. A localisation string placeholder can be filled with life over in the localization folder using YML.
Back on the button front, I still need to find a way to make a UI element do something. Specifically find the appropriate action.
I'm pointed towards Stellaris/common/button_effects folder for scriptable buttons of the effectButtonType, which is nice, but I'm positive, that the intended effect already exists and I only need a reference to a hardcoded action. This can be done using the buttonType as opposed to the effectButtonType, which would be preferable, since I don't have to mess with the common folder, altering the checksum.
The game files have been less than forthcoming, or I'm missing something obvious, so I'm asking the modding community.
How does a Stellaris developer make a button do its magic?