Problem
File StyleMenuBuilder.kt — getStyleCategories (lines 90, 130–155) and currentLoadedStyle (lines 331–337)
double-fire bug. getStyleCategories attaches Alt+1–9 accelerators to the first nine menu items whose parent category/subcategory matches the current loadout. When a nested loadout is active, those per-item menu accelerators and the Alt+1–8 Display filter in addLoadoutListener both fire on the same keystroke, applying the style twice.
Fix remove the per-item accelerator logic entirely; every menu item uses accelerator 0. The Alt+1–8 Display filter becomes the single apply mechanism.
// before (relevant excerpt)
var cont = 1
...
id = id.substring(id.lastIndexOf('/') + 1)
val myCurrentLoadout = BBIni.propertyFileManager.getProperty(CURRENT_STYLE_LOADOUT_CATEGORY, "")
//TODO: Re-add shortcut functionality
//puttting shortcut in menu
val tempComp: String = if (myCurrentLoadout.contains("/")) "$cat/$afterCat" else if (afterCat == id) cat else "$cat/$afterCat"
if (myCurrentLoadout == tempComp && cont <= 9) {
subMenu!!.addItem(
lhb[style.name], SWT.ALT + '0'.code + cont
) { e: BBSelectionData -> onStyleSelect.accept(BBStyleSelection(style, e.widget)) }
cont++
} else {
subMenu!!.addItem(
lhb[style.name], 0
) { e: BBSelectionData -> onStyleSelect.accept(BBStyleSelection(style, e.widget)) }
}
// after (relevant excerpt)
val styles = styleDefs.styles
...
// Styles are applied with Alt+1-8 from the addLoadoutListener filter keyed to the
// current style loadout, so menu items carry no per-item Alt accelerators
subMenu!!.addItem(
lhb[style.name], 0
) { e: BBSelectionData -> onStyleSelect.accept(BBStyleSelection(style, e.widget)) }
Problem
File
StyleMenuBuilder.kt—getStyleCategories(lines 90, 130–155) andcurrentLoadedStyle(lines 331–337)double-fire bug.
getStyleCategoriesattachesAlt+1–9 accelerators to the first nine menu items whose parent category/subcategory matches the current loadout. When a nested loadout is active, those per-item menu accelerators and theAlt+1–8 Display filter inaddLoadoutListenerboth fire on the same keystroke, applying the style twice.Fix remove the per-item accelerator logic entirely; every menu item uses accelerator
0. TheAlt+1–8 Display filter becomes the single apply mechanism.