-
Notifications
You must be signed in to change notification settings - Fork 1
/
ifs_opt_controller_mode.lua
72 lines (62 loc) · 2.16 KB
/
ifs_opt_controller_mode.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--
-- Top page for the options pages hierarchy
ifs_opt_controlmode_vbutton_layout = {
ySpacing = 5,
width = 350,
font = "meu_myriadpro_large",
buttonlist = {
{ tag = "soldier", string = "ifs.Controls.Soldier.title", },
{ tag = "vehicle", string = "ifs.Controls.Vehicle.title", },
{ tag = "flyer", string = "ifs.Controls.Flyer.title", },
{ tag = "jedi", string = "ifs.Controls.Jedi.title", },
{ tag = "turret", string = "ifs.Controls.Turret.title", },
},
title = "ifs.controls.controlmodes",
-- rotY = 40,
}
ifs_opt_contmode = NewIFShellScreen {
nologo = 1,
bAcceptIsSelect = 1,
enterSound = "",
exitSound = "",
bDimBackdrop = 1,
buttons = NewIFContainer {
ScreenRelativeX = 0.5, -- center
ScreenRelativeY = gDefaultButtonScreenRelativeY, -- top
},
Input_Accept = function(this)
-- If base class handled this work, then we're done
if(gShellScreen_fnDefaultInputAccept(this)) then
return
end
ifelm_shellscreen_fnPlaySound(this.acceptSound)
local controlstring = "ifs_opt_controller"
if (gPlatformStr == "PC") then
controlstring = "ifs_opt_pccontrols"
ScriptCB_PushScreen( controlstring )
elseif (this.CurButton == "soldier") then
ScriptCB_SetControlMode(0)
ScriptCB_PushScreen( controlstring )
elseif (this.CurButton == "vehicle") then
ScriptCB_SetControlMode(1)
ScriptCB_PushScreen( controlstring )
elseif (this.CurButton == "flyer") then
ScriptCB_SetControlMode(2)
ScriptCB_PushScreen( controlstring )
elseif (this.CurButton == "jedi") then
ScriptCB_SetControlMode(3)
ScriptCB_PushScreen( controlstring )
elseif (this.CurButton == "turret") then
ScriptCB_SetControlMode(4)
ScriptCB_PushScreen( controlstring )
end
end,
}
if(ScriptCB_GetShellActive() and (gPlatformStr ~= "PC")) then
ifs_opt_controlmode_vbutton_layout.bLeftJustifyButtons = 1
end
ifs_opt_contmode.CurButton = AddVerticalButtons(ifs_opt_contmode.buttons,ifs_opt_controlmode_vbutton_layout)
AddIFScreen(ifs_opt_contmode,"ifs_opt_contmode")
ifs_opt_contmode = DoPostDelete(ifs_opt_contmode)