1
-- (c) Copyright 2010 by Stratagus team
3
Load("scripts/widgets.lua")
4
Load("scripts/menus/options.lua")
5
Load("scripts/menus/credits.lua")
6
Load("scripts/menus/games.lua")
8
-- Default configurations -------
9
Widget:setGlobalFont(Fonts["stratagus-menu"])
11
-- Define the different menus ----------
13
local function BuildProgramStartMenu()
14
-- war1gus.playlist = { "music/Orc Briefing.ogg" }
16
if not (IsMusicPlaying()) then
17
PlayMusic("music/Orc Briefing.ogg")
20
local menu = StratagusMenu()
21
local offx = (Video.Width - 640) / 2
22
local offy = (Video.Height - 480) / 2
24
local currentGame = "";
26
if (stratagus.preferences.CurrentGame ~= nil) then
28
currentGame = stratagus.preferences.CurrentGame
31
menu:addLabel("Stratagus V" .. GetStratagusVersion() .. " " .. GetStratagusHomepage(), offx + 320, offy + 390 + 18*1)
32
menu:addLabel("Copyright (c) 1998-2011 by The Stratagus Project", offx + 320, offy + 390 + 18*4)
34
menu:addFullButton("Select ~!Game", "g", offx + 208, offy + 104 + 36*1, function() RunGamesMenu(); menu:stop(1) end)
35
local playbutton = menu:addFullButton("~!Play " .. currentGame, "p", offx + 208, offy + 104 + 36*2, function() Load(stratagus.preferences.CurrentGame); menu:stop(0); end)
37
menu:addFullButton("Preference ~!Options", "o", offx + 208, offy + 104 + 36*4, function() stratagus.RunPreferencesOptionsMenu(); menu:stop(1) end)
38
menu:addFullButton("~!Sound Options", "s", offx + 208, offy + 104 + 36*5, function() RunSoundOptionsMenu(); menu:stop(1) end)
39
menu:addFullButton("~!Video Options", "v", offx + 208, offy + 104 + 36*6, function() RunVideoOptionsMenu(); menu:stop(1) end)
40
menu:addFullButton("S~!how Credits", "h", offx + 208, offy + 104 + 36*7, RunShowCreditsMenu)
41
menu:addFullButton("E~!xit Program", "x", offx + 208, offy + 104 + 36*9, function() menu:stop() end)
43
playbutton:setEnabled(stratagus.preferences.CurrentGame ~= nil)
48
function stratagus.RunProgramStartMenu()
51
while continue == 1 do
52
continue = BuildProgramStartMenu(menu)
58
stratagus.RunProgramStartMenu()