Yes, it was tested, using both TBP (Inferno) and FS2. Nothing seemed to be obviously broken.
EDIT: Here's my latest version of the script:
#Conditional Hooks
$Application: Freespace 2
$On Game Init: [
--Function to handle a section every frame
section = function(name, event, num, hidden)
if hidden == false then
divsize = 8
xadd = 159
yadd = 35
else
divsize = 256
xadd = 10
yadd = 10
end
--MENU COLOR
local xmargin = gr.getScreenWidth()/divsize
local ymargin = gr.getScreenHeight()/divsize
--Get corner coordinates for this box
local x1 = xmargin
local y1 = ymargin*num
local x2 = x1+xadd
local y2 = y1+yadd
--When the mouse is OVER this section...
if io.getMouseX() > x1 and io.getMouseX() < x2 and io.getMouseY() > y1 and io.getMouseY() < y2 then
if hidden == false then
--Draw the inside box
gr.setColor(0, 255, 0)
gr.drawRectangle(x1+5, y1+5, x2-5, y2-5, false, false)
--Draw the little target lines now
local x = x1+(x2-x1)/2
local y = y1-20
--Top target line
gr.drawLine(x, y, x, y+15)
--Bottom target line
y = y2+10
gr.drawLine(x, y, x, y+15)
--Left target line
x = x1-20
y = y1+17
gr.drawLine(x, y, x+15, y)
--Right target line
x = x2+5
gr.drawLine(x, y, x+15, y)
end
--Handle the button click
if io.isMouseButtonDown(MOUSE_LEFT_BUTTON) then
gr.drawRectangle(x1, y1, x2, y2, false, false)
if event == "GS_EVENT_NEW_CAMPAIGN" or event == "GS_EVENT_OPTIONS_MENU" then
mn.unloadMission()
g_missionLoaded = nil
g_splashScreen = nil
end
ba.postGameEvent(ba.GameEvents[event])
end
end
--Draw the outline
gr.setColor(255, 255, 255)
gr.drawRectangle(x1, y1, x2, y2, false, false)
if hidden == false then
--Draw the name
gr.drawString(name, x1 + ( (x2-x1) - gr.getStringWidth(name) ) / 2, y1+15)
end
end
]
$Application: Freespace 2
$State: GS_STATE_MAIN_MENU
$On State Start: [
logolist = {"43_logo","1610_logo"} --This is a list of logos. Basically the same Logo, only adapted for 4:3 aspect ratio displays and 16:10 ones
shiplist = {"EA Thunderbolt","EA Aurora","EA Badger","EA Tiger","PSI Command Ship","EA Hyperion","EA Omega","EA Warlock","EA Omega-X","Babylon 5 (S1)","MF Sharlin","NR G'Quan","CR Primus"} --Put your ship classes in quotes here
missionlist = {"Mainhall.fs2"} --List of missions to be used
backgroundlist = {"43_mainhall", "1610_mainhall"} --List of backgrounds. Again, divided into 4:3 and 16:10 ones
splashscreen = "2_PreLoad" --Splashscreen displayed while the mission loads
usemission = false --If false, the single- and multiplayer UI will use the same layout. If true, one of the missions defined in the missionlist will play in the background of the single player UI
rotConst = 7 --Modify this to make the ship turn faster to slower
screenWidth = gr.getScreenWidth()
screenHeight = gr.getScreenHeight()
aspectRatio = screenWidth/screenHeight
if aspectRatio == 1.6 then
logo = logolist[2]
background = backgroundlist[2]
else
logo = logolist[1]
background = backgroundlist[1]
end
imgWidth = gr.getImageWidth(logo)
imgHeight = gr.getImageHeight(logo)
renderX1 = 0 --screenWidth * 0.2
renderX2 = screenWidth --* 0.99
renderY1 = 0 --screenHeight * 0.1
renderY2 = screenHeight --* 0.9
rendermidX = (renderX1+renderX2)/2
imageX = 0 --(screenWidth*0.5)-imgWidth/2
imageY = screenHeight - imgHeight
if ts.isCurrentPlayerMulti()==true or usemission==false then
numChoices = table.getn(shiplist)
randomShip = tb.ShipClasses[shiplist[math.random(1,numChoices)]]
shipName = randomShip.Name
init = 42
end
]
+Override: true
$On State End: [
if g_missionLoaded then
mn.unloadMission()
g_missionLoaded = nil
g_splashScreen = nil
end
]
+Override: true
$On Frame: [
if ts.isCurrentPlayerMulti()==true or usemission==false then
--Draw background image
local tex = gr.loadTexture(background)
if tex:isValid() then
gr.drawImage(tex, 0, 0, gr.getScreenWidth(), gr.getScreenHeight())
end
if rotate_pct then
rotate_pct = rotate_pct + rotConst*ba.getFrametime()
if rotate_pct > 100 then
rotate_pct = rotate_pct - 100
end
else
rotate_pct = 40
end
randomShip:renderTechModel(renderX1, renderY1, renderX2, renderY2, rotate_pct)
gr.setColor(255,255,255)
gr.drawString(shipName,rendermidX-gr.getStringWidth(shipName)/2,renderY2)
else
if not g_splashScreen then
--Don't need cursor
io.setCursorHidden(true)
--Draw splash image
local tex = gr.loadTexture(splashscreen)
if tex:isValid() then
gr.drawImage(tex, 0, 0, gr.getScreenWidth(), gr.getScreenHeight())
end
--Draw "Loading..."
gr.setColor(255, 255, 255)
gr.CurrentFont = gr.Fonts['font02']
local loadString = "Loading..."
local x = (gr.getScreenWidth()-gr.getStringWidth(loadString))/2
local y = (gr.getScreenHeight()-gr.CurrentFont.Height)/2
gr.drawString(loadString, x, y)
--Done with splash
gr.CurrentFont = gr.Fonts['font01']
g_splashScreen = true
elseif not g_missionLoaded then
if init2 == nil then
missionName = missionlist[math.random(1,table.getn(missionlist))]
init2 = 42
end
mn.loadMission(missionName)
io.setCursorHidden(false)
g_missionLoaded = true
end
end
if g_missionLoaded then
mn.simulateFrame()
mn.renderFrame()
end
if g_missionLoaded or ts.isCurrentPlayerMulti()==true or usemission==false then
if ts.isCurrentPlayerMulti()==true then
if ts.isPXOEnabled()==true then
section("Multiplayer", "GS_EVENT_PXO", 1, false)
else
section("Multiplayer", "GS_EVENT_MULTI_JOIN_GAME", 1, false)
end
else
section("Ready Room", "GS_EVENT_NEW_CAMPAIGN", 1, false)
end
section("Campaign Room", "GS_EVENT_CAMPAIGN_ROOM", 2, false)
section("Tech Room", "GS_EVENT_TECH_MENU", 3, false)
section("Barracks", "GS_EVENT_BARRACKS_MENU", 4, false)
section("Options", "GS_EVENT_OPTIONS_MENU", 5, false)
section("Exit", "GS_EVENT_QUIT_GAME", 6, false)
section("F3", "GS_EVENT_LAB", 1, true)
end
gr.drawImage(logo, imageX, imageY, gr.getScreenWidth(), gr.getScreenHeight())
]
+Override: true
#End