With trunk builds post 4687 revision you can use the following script. It might help a bit with the mission testing. Only SP though...
quicklaunch-sct.tbm
#Conditional Hooks
$State: GS_STATE_MAIN_MENU
$On Frame:
[
-- get mouse and frametime
x = io.getMouseX()
y = io.getMouseY()
time_dif = ba.getFrametime()
-- init the stuff
if init == nil then
-- limits for the replay box
-- br defines the border between the briefing and briefingless links
x_min_replay = 0.325 * gr.getScreenWidth()
x_max_replay = 0.425 * gr.getScreenWidth()
y_min_replay = 0.05 * gr.getScreenHeight()
y_max_replay = 0.125 * gr.getScreenHeight()
y_br_replay = 0.1 * gr.getScreenHeight()
-- limits for the play defined mission
x_min_defined = 0.325 * gr.getScreenWidth()
x_max_defined = 0.425 * gr.getScreenWidth()
y_min_defined = 0.2 * gr.getScreenHeight()
y_max_defined = 0.275 * gr.getScreenHeight()
y_br_defined = 0.25 * gr.getScreenHeight()
-- inits
init = 42
timepress = 0
timestamp = 0
-- !!define the name of the mission here!!
missionname = "SM1-01"
end
-- increment the time
timestamp = timestamp + time_dif
-- Draw boxes - replay
gr.setColor(155, 20, 20, 150)
gr.drawRectangle(x_min_replay, y_min_replay, x_max_replay, y_br_replay, true)
gr.setColor(75, 0, 0, 150)
gr.drawRectangle(x_min_replay, y_br_replay, x_max_replay, y_max_replay, true)
gr.setColor(255, 100, 100)
gr.drawRectangle(x_min_replay+1, y_min_replay+1, x_max_replay-1, y_max_replay-1, false)
-- Draw boxes - defined
gr.setColor(20, 155, 20, 150)
gr.drawRectangle(x_min_defined, y_min_defined, x_max_defined, y_br_defined, true)
gr.setColor(0, 75, 0, 150)
gr.drawRectangle(x_min_defined, y_br_defined, x_max_defined, y_max_defined, true)
gr.setColor(100, 255, 100)
gr.drawRectangle(x_min_defined+1, y_min_defined+1, x_max_defined-1, y_max_defined-1, false)
gr.setColor(255,255,255)
gr.drawString("Replay the mission", x_min_replay+5, y_min_replay+5, x_max_replay-5, y_br_replay-5)
gr.drawString("No briefing", x_min_replay+5, y_br_replay, x_max_replay-5, y_max_replay)
gr.drawString("Play the " .. missionname .. " mission", x_min_defined+5, y_min_defined+5, x_max_defined-5, y_br_defined-5)
gr.drawString("No briefing", x_min_defined+5, y_br_defined, x_max_defined-5, y_max_defined)
-- assuming there is long enough gap between clicks...
if (timestamp >= timepress) then
-- and that mouse cursor is within the box
if ( (y > y_min_defined ) and (y < y_br_defined) and (x > x_min_defined) and (x < x_max_defined) ) then
-- and that left mouse button is pressed
if (io.isMouseButtonDown(MOUSE_LEFT_BUTTON) == true) then
-- do things
timepress = timestamp + 0.5
mn.startMission(missionname)
end
end
if ( (y > y_br_defined ) and (y < y_max_defined) and (x > x_min_defined) and (x < x_max_defined) ) then
-- and that left mouse button is pressed
if (io.isMouseButtonDown(MOUSE_LEFT_BUTTON) == true) then
-- do things
timepress = timestamp + 0.5
mn.startMission(missionname, false)
end
end
if ( (y > y_min_replay ) and (y < y_br_replay) and (x > x_min_replay) and (x < x_max_replay) ) then
-- and that left mouse button is pressed
if (io.isMouseButtonDown(MOUSE_LEFT_BUTTON) == true) then
-- do things
timepress = timestamp + 0.5
mn.startMission(MISSION_REPEAT)
end
end
if ( (y > y_br_replay ) and (y < y_max_replay) and (x > x_min_replay) and (x < x_max_replay) ) then
-- and that left mouse button is pressed
if (io.isMouseButtonDown(MOUSE_LEFT_BUTTON) == true) then
-- do things
timepress = timestamp + 0.5
mn.startMission(MISSION_REPEAT, false)
end
end
end
]
#End