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):
This button opens or closes the high priority tab
Same as above for low priority tab
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.
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: