Instructions on a simple Mod: Buttons for zooming in/out

  • We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

C4st1gator

Captain
38 Badges
Nov 16, 2014
328
183
  • Crusader Kings II: Sword of Islam
  • Stellaris
  • Crusader Kings II
  • Magicka
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
  • Stellaris: Synthetic Dawn
  • Stellaris: Nemesis
  • Age of Wonders: Shadow Magic
  • Crusader Kings II: Jade Dragon
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Stellaris: Necroids
  • Cities: Skylines - Mass Transit
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Crusader Kings II: Reapers Due
  • Cities: Skylines - Snowfall
  • Crusader Kings II: Conclave
  • Cities: Skylines - After Dark
  • Crusader Kings II: Horse Lords
  • Magicka 2
  • Crusader Kings II: Way of Life
  • Magicka: Wizard Wars Founder Wizard
  • Cities: Skylines
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:
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?
 

17blue17

Field Marshal
68 Badges
Nov 9, 2003
6.592
379
  • Stellaris: Galaxy Edition
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Europa Universalis III: Collection
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • 500k Club
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Nemesis
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • Heir to the Throne
  • Europa Universalis III Complete
  • Leviathan: Warships
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Victoria 2
  • Victoria 2: A House Divided
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:
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?
For eu4 ( another Paradox game) I know in game buttons are hard coded. I think you can add the button picture but it will not do anything. I suspect it is the same for other paradox games like stellaris. At the same time I think there is a mod on steam relating to a mod menu so maybe something is possible with the menu??? Hopefully someone else can give provide more information.