Changeset 10622 for code/trunk/data/gui/scripts
- Timestamp:
- Oct 4, 2015, 3:45:56 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/data/gui/scripts/MultiplayerMenu.lua
r8858 r10622 70 70 if choice then 71 71 local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID() 72 destination = P.serverList[index][ 2]72 destination = P.serverList[index][1] 73 73 else 74 74 return … … 93 93 local servername = "" 94 94 local serverip = "" 95 local serverrtt = "" 96 local playernumber = "" 95 97 while true do 96 98 servername = discovery:getServerListItemName(index) … … 102 104 break 103 105 end 104 table.insert(P.serverList, {servername, serverip}) 106 --serverrtt = discovery:getServerListItemRTT(index) 107 playernumber = discovery:getServerListItemPlayerNumber(index) 108 109 table.insert(P.serverList, {serverip, servername, playernumber}) 105 110 index = index + 1 106 111 end 107 112 index = 1 108 113 for k,v in pairs(P.serverList) do 109 local item = CEGUI.createListboxTextItem( v[1] .. ": " .. v[2])114 local item = CEGUI.createListboxTextItem("IP: " .. v[1] .. " Name: " .. v[2] .. " Players: " .. v[3]) 110 115 item:setID(index) 111 116 index = index + 1 … … 125 130 local servername = "" 126 131 local serverip = "" 132 local serverrtt = "" 133 local playernumber = "" 127 134 while true do 128 135 servername = discovery:getServerListItemName(index) … … 134 141 break 135 142 end 136 table.insert(P.serverList, {servername, serverip}) 143 --serverrtt = discovery:getServerListItemRTT(index) 144 playernumber = discovery:getServerListItemPlayerNumber(index) 145 146 table.insert(P.serverList, {serverip, servername, playernumber}) 137 147 index = index + 1 138 148 end 139 149 index = 1 140 150 for k,v in pairs(P.serverList) do 141 local item = CEGUI.createListboxTextItem( v[1] .. ": " .. v[2])151 local item = CEGUI.createListboxTextItem("IP: " .. v[1] .. " Name: " .. v[2] .. " Players: " .. v[3]) 142 152 item:setID(index) 143 153 index = index + 1 … … 150 160 151 161 return P 152 -
code/trunk/data/gui/scripts/testscript.lua
r10262 r10622 22 22 -- If it worked, call its "movetoposition" function 23 23 if ctrl ~= nil then 24 -- Move to the starting point at (xl+3000,yl,zl) while looking25 -- at xl,yl,zl over the time span of 3 seconds26 ctrl:eventScheduler("mal", xl+3000,yl,zl, xl,yl,zl, 1, 0)27 24 28 -- From there, perform a rotation around the harvester placed there 29 -- in 100 steps 30 dt = math.pi/100 31 for t = 0,math.pi,dt do 32 xt = math.cos(t) 33 yt = math.sin(t) 34 35 ctrl:eventScheduler("mal", xl+3000*xt, yl+3000*yt, zl, xl, yl, zl, dt, t+0.9) 36 end 37 38 39 -- Update absolute time 40 Tabs = math.pi + 0.9 41 42 43 44 -- Move away again, still looking at the station 45 ctrl:eventScheduler("mal", 0,0,1000, xl,yl,zl, 3, Tabs+0.4) 46 47 48 49 -- Update absolute time 50 Tabs = Tabs + 0.4 + 3 51 52 53 54 55 56 -- Transition the look from (xl,yl,zl) to (3500,0,0) in 3 seconds 57 ctrl:eventScheduler("chl", xl, yl, zl, xr, yr, zr, 2, Tabs+0.2) 58 59 Tabs = Tabs + 2 + 0.2 60 61 ctrl:eventScheduler("mal", xr + 600,yr,zr, xr,yr,zr, 4, Tabs+0) 62 63 Tabs = Tabs + 4 64 65 for t = 0,math.pi,dt do 66 xt = math.cos(t) 67 zt = math.sin(t) 68 69 ctrl:eventScheduler("mal", xr+600*xt, yr, zr+600*zt, xr, yr, zr, dt, Tabs+t) 70 end 71 72 Tabs = Tabs + math.pi 73 74 ctrl:eventScheduler("chl", xr, yr, zr, xl, yl, zl, 3, Tabs+0.2) 75 76 Tabs = Tabs + 3 + 0.2 77 78 ctrl:eventScheduler("mal", xm,ym,zm, xl,yl,zl, 4, Tabs+2.5) 79 25 ctrl:eventScheduler("mal", xl,yl,zl, xl,yl,zl, 2) 26 ctrl:eventScheduler("idle", 1) 27 ctrl:eventScheduler("ral", xl, yl, zl, 3, 3000, 0, math.pi) 28 ctrl:eventScheduler("idle", 1) 29 ctrl:eventScheduler("mal", 0,0,1000, xl,yl,zl, 3) 30 ctrl:eventScheduler("idle", 1) 31 ctrl:eventScheduler("chl", xl, yl, zl, xr, yr, zr, 2) 32 ctrl:eventScheduler("idle", 1) 33 ctrl:eventScheduler("mal", xr + 600,yr,zr, xr,yr,zr, 4) 34 ctrl:eventScheduler("idle", 1) 35 ctrl:eventScheduler("chl", xr, yr, zr, xl, yl, zl, 3) 36 ctrl:eventScheduler("idle", 1) 37 ctrl:eventScheduler("spi", xm,ym,zm, 0,0,0, 4) 38 ctrl:eventScheduler("idle", 1) 80 39 81 40 end 82 83 84 85 -- Output the newctrlid variable we set from the C++ code86 if newctrlid ~= nil then87 orxonox.execute("orxout message test " .. newctrlid)88 end89 90 --orxonox.execute("setPause 1")91 92
Note: See TracChangeset
for help on using the changeset viewer.