function CampainButton()
return NoButton("btnCampaign")
end is actually the default behavior in “exbuttons.lua”
Yep, that’s what I had before my “revelation” ^^
NewMenuButton is never a hard coded function. It’s in ui\newui\styles\hwrm_style\controlconstructors.lua
function NewMenuButton(_name, _text, _helptip, _hotkeyID, _layout, _style, _mouseclicked, _visible )
local _buttonLayout
local _buttonStyle
local _buttonvisible
--------------------- Setup Defaults ---------------------
if(_layout == nil) then
_buttonLayout = {
min_WH = { w = INGAMEMENU_BUTTON_WIDTH, h = STD_BUTTON_HEIGHT, wr = "scr", hr = "scr" },
}
else
_buttonLayout = _layout
end
if(_style == nil) then
_buttonStyle = "FEButtonStyle1"
else
_buttonStyle = _style
end
if(_visible == nil) then
_buttonvisible = 1
else
_buttonvisible = _visible
end
--------------------- The actual button constructor ---------------------
local MenuButton = {
type = "TextButton",
name = _name,
buttonStyle = _buttonStyle,
ignored = 1,
helpTip = _helptip,
hotKeyID = _hotkeyID,
visible = _buttonvisible,
Layout = _buttonLayout,
autosize=1,
Text = {
text = _text,
--pixels = (16),
--rel = 500,
},
backgroundColor = { 255, 0, 0, 255 },
onMouseClicked =_mouseclicked,
}
return MenuButton
end
I suppose he was talking about the action of the button in our case, because we don’t know the action associated to the button (_mouseclicked is defined as a nil)
[quote=“506933395, post:44, topic:1217162”]
NewMenuButton is never a hard coded function.
[/quote]Perhaps not, but the functionality of the returned button, based on the “_name” parameter, however, is.
Just for kicks and giggles, I made the following changes to newmainmenu.lua:
NewMenuButton("btnTutorial", "$2602", nil, 0, LAYOUT_MENU_BUTTONS, "FEButtonStyle1", nil),
--CampainButton(),
NewMenuButton("btnBoogers", "Boogers", nil, 0, LAYOUT_MENU_BUTTONS, "FEButtonStyle1_Alert_Chipped", nil),
NewMenuButton("btnCampaign", "$2603", nil, 0, LAYOUT_MENU_BUTTONS, "FEButtonStyle1", nil),
NewMenuButton("btnExtra", "$2606", nil, 0, LAYOUT_MENU_BUTTONS, "FEButtonStyle1", nil),
As I suspected would be the case, the Campaign button did not show up, but the new Boogers button did.
And once again, as suspected, purposefully misspelling “btnCampain” made the button appear, but no mouseclick functionality came with the new button.
I wonder what would happen if we do a copy of the rr_oem campaign (the raider mission) and add a second mission to it ?
Would it show 3 missions in the “extra” tab ? With no differenciation between the two “campaign” ? Would be a good test to do just to check how the “extra” tab manages things
Edit : we’re currently derailing the thread A LOT ^^
No, RR would become a new ‘entry’ for the RR missions - and the next click would show a list of them. The extra missions area detects if the campaign has only 1 mission, and just goes right into it, or treats it as a title-button for it if there are more, and tunnels down to the level list once you click it. I had been pushing for RR to be 3 missions, to show that behavior, but we didn’t go that way.
I have tried that before. You can have a list of campaigns under “extra missions”. Clicking on one opens the list if missions in that campaign (assuming they have been completed).
Edit: @BitVenom got there first!
Edit : we’re currently derailing the thread A LOT ^^
Hah no you aren’t! A lot of nice info is going on here 
+1, Could this potentially also be used for Cataclysm->HW2 NIS format?
It’s already been on my list 
