• 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.

Immortal88

Major
102 Badges
Sep 25, 2012
628
475
  • Sengoku
  • Crusader Kings II
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: The Republic
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Rajas of India
  • Hearts of Iron IV Sign-up
  • Stellaris: Digital Anniversary Edition
  • Tyranny: Gold Edition
  • Tyranny: Archon Edition
  • Tyranny: Archon Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Stellaris Sign-up
  • Stellaris
  • Crusader Kings II: Way of Life
  • Stellaris: Leviathans Story Pack
  • Crusader Kings II: Monks and Mystics
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Prison Architect
  • Crusader Kings Complete
  • Imperator: Rome
  • Europa Universalis IV: Cradle of Civilization
  • Tyranny - Tales from the Tiers
  • Tyranny - Bastards Wound
  • Age of Wonders III
  • Warlock: Master of the Arcane
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV
  • Europa Universalis IV: Dharma
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Crusader Kings II: Holy Fury
  • Shadowrun Returns
  • Teleglitch: Die More Edition
  • Imperator: Rome Deluxe Edition
  • Europa Universalis IV: Golden Century
  • Imperator: Rome Sign Up
  • War of the Roses
  • Age of Wonders: Shadow Magic
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Rule Britannia
  • Magicka: Wizard Wars Founder Wizard
  • Victoria 3 Sign Up
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
I'm trying to write a little shortcut mod that makes dismissing high and low priority messages painless via keybinding.

The problem I'm running into is how to best implement it.

From what I can tell the relevant pieces are all to be found in the interface/menubar.gui file

The relevant passages are as follows

The actual red dismiss button (for both high and low prio, since from what I can tell they are not coded as two separate buttons, because if I assign a shortcut it closes the most recent message in whatever tab I have currently selected):

Code:
guiButtonType =
{
name = "Next"
position = { x=271 y=12 }
quadTextureSprite ="GFX_mw_discard"
clicksound = click_03
shortcut = "???"
}

This button opens or closes the high priority tab
Code:
            guiButtonType =
            {
                name = "HighPriorityTab"
                position = { x = 301 y = 5 }
                quadTextureSprite ="GFX_mw_tab_1"
                clicksound = generic_click_04
                shortcut = "???"
            }

Same as above for low priority tab
Code:
            guiButtonType =
            {
                name = "LowPriorityTab"
                position = { x = 301 y = 76 }
                quadTextureSprite ="GFX_mw_tab_1"
                clicksound = generic_click_04
                shortcut = "???"
            }


Issue #1:
In an ideal world, the optimal solution would probably be to use just one key for high / low prio each. For example, the first press should open the high prio tab and each subsequent keypress of the same shortcut should dismiss the most recent high prio message. Even better, if Shift + ?key and Ctrl + ?key also work.

Now the problem is if I assign the same shortcut = "x" command to both the dismiss and the tab button then pressing it repeatedly only opens and closes the high tab but doesn't delete any messages. Is it somehow possible to override shortcut priority based on if the high prio tab is already open? I was thinking that maybe simply rearranging the order of the code so the "dismiss" button takes precedence over the "open tab" button would be the easiest solution to make that happen but from what little experience I have it seems to me the code is already arranged in that order and I don't know how else to do it.

Issue #2:
I can hardly think of a better dismiss key than the TAB key (since pretty much every other key on that desirable side of the keyboard is already taken) but neither "tab" nor "TAB" work as a legitimate shortcut. How can you figure out what the possible keybindings are actually called (or failing that how can you define completely new ones)?

Edit: To clarify, I added the three " shortcut = "???" " myself and if I put a proper letter shortcut in there it works exactly as you'd expect.
 
Last edited: