Changeset 7801 for code/trunk/data/gui/scripts
- Timestamp:
- Dec 22, 2010, 7:24:24 PM (14 years ago)
- Location:
- code/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/data/gui/scripts/ChatBox-inputonly.lua
r7163 r7801 1 1 -- ChatBox-inputonly.lua 2 2 3 local P = createMenuSheet("ChatBox-inputonly" )3 local P = createMenuSheet("ChatBox-inputonly", true, TriBool.True, TriBool.Dontcare, false) 4 4 return P 5 5 -
code/trunk/data/gui/scripts/ChatBox.lua
r7612 r7801 1 1 -- ChatBox.lua 2 2 3 local P = createMenuSheet("ChatBox" )3 local P = createMenuSheet("ChatBox", true, TriBool.True, TriBool.Dontcare, false) 4 4 5 5 function P.ChatBoxCloseButton_clicked(e) -
code/trunk/data/gui/scripts/GraphicsMenu.lua
r7689 r7801 4 4 5 5 P.buttonList = {} 6 P.schemeList = {"TaharezGreen", "Orxonox"} 6 7 7 8 function P.onShow() … … 97 98 } 98 99 P.buttonList[1] = item 100 101 local dropbox = winMgr:getWindow("orxonox/ThemeDropBox") 102 local scheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_") 103 for k,v in pairs(P.schemeList) do 104 local item = CEGUI.createListboxTextItem(P.schemeList[k]) 105 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 106 CEGUI.toListbox(dropbox):addItem(item) 107 if v == scheme then 108 dropbox:setItemSelectState(item, true) 109 end 110 end 111 112 end 113 114 function P.ThemeDropBox_changed(e) 115 local dropbox = winMgr:getWindow("orxonox/ThemeDropBox") 116 local listbox = CEGUI.toListbox(dropbox) 117 local choice = listbox:getFirstSelectedItem() 118 local index = 0 119 if choice ~= nil then 120 index = listbox:getItemIndex(choice) 121 end 122 orxonox.CommandExecutor:execute("config GUIManager guiScheme_ " .. P.schemeList[index+1]) 99 123 end 100 124 -
code/trunk/data/gui/scripts/InitialiseGUI.lua
r7734 r7801 5 5 winMgr = CEGUI.WindowManager:getSingleton() 6 6 7 local scheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_") 7 8 -- Load all required skins 8 schemeMgr:loadScheme("TaharezGreenLook.scheme")9 --schemeMgr:loadScheme("OrxonoxLook.scheme")9 --schemeMgr:loadScheme("TaharezGreenLook.scheme") 10 schemeMgr:loadScheme(scheme .. "Look.scheme") 10 11 --schemeMgr:loadScheme("TaharezLook.scheme") 11 12 --schemeMgr:loadScheme("WindowsLook.scheme") … … 16 17 -- By loading a different file (if there is) you can change the skin 17 18 -- of the menus or the HUD independently 18 schemeMgr:loadScheme("TaharezGreenMenuWidgets.scheme")19 menuImageSet = "TaharezGreenLook"20 schemeMgr:loadScheme("TaharezGreenHUDWidgets.scheme")21 hudImageSet = "TaharezGreenLook"22 --schemeMgr:loadScheme("OrxonoxLookMenuWidgets.scheme")23 --menuImageSet = "OrxonoxLook"24 --schemeMgr:loadScheme("OrxonoxLookHUDWidgets.scheme")25 --hudImageSet = "OrxonoxLook"19 --schemeMgr:loadScheme("TaharezGreenMenuWidgets.scheme") 20 --menuImageSet = "TaharezGreenLook" 21 --schemeMgr:loadScheme("TaharezGreenHUDWidgets.scheme") 22 --hudImageSet = "TaharezGreenLook" 23 schemeMgr:loadScheme(scheme .. "MenuWidgets.scheme") 24 menuImageSet = scheme .. "Look" 25 schemeMgr:loadScheme(scheme .. "HUDWidgets.scheme") 26 hudImageSet = scheme .. "Look" 26 27 27 28 -- Just a remaining test hack -
code/trunk/data/gui/scripts/MultiplayerMenu.lua
r7732 r7801 6 6 7 7 --joinMode is 1 for choice "LAN" and 2 for "Internet" 8 --initial status 09 P.joinMode = 08 --initial status 1 9 P.joinMode = 1 10 10 11 11 function P.onLoad() … … 33 33 34 34 function P.onShow() 35 P.showServerList()35 --P.showServerList() 36 36 37 37 --indices to iterate through buttonlist 38 38 P.oldindex = -2 39 39 P.index = -1 40 41 if P.joinMode == 1 then 42 local window = winMgr:getWindow("orxonox/MultiplayerLanButton") 43 local button = tolua.cast(window,"CEGUI::RadioButton") 44 button:setSelected(true) 45 end 46 if P.joinMode == 2 then 47 local window = winMgr:getWindow("orxonox/MultiplayerInternetButton") 48 local button = tolua.cast(window,"CEGUI::RadioButton") 49 button:setSelected(true) 50 end 40 51 end 41 52 42 53 function P.LanButton_clicked(e) 54 local we = CEGUI.toWindowEventArgs(e) 55 local button = tolua.cast(we.window,"CEGUI::RadioButton") 43 56 P.joinMode = 1 57 if button:isSelected() == true then 58 P.showServerList() 59 end 44 60 end 45 61 46 62 function P.InternetButton_clicked(e) 63 local we = CEGUI.toWindowEventArgs(e) 64 local button = tolua.cast(we.window,"CEGUI::RadioButton") 47 65 P.joinMode = 2 66 if button:isSelected() == true then 67 P.showServerList() 68 end 48 69 end 49 70 … … 55 76 function P.MultiplayerJoinButton_clicked(e) 56 77 local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem() 57 58 if P.joinMode == 2 then 59 if choice then 60 local client = orxonox.Client:getInstance() 61 local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID() 62 client:setDestination( P.serverList[index][2], 55556 ) 63 else 64 return 65 end 66 orxonox.execute("startClient") 67 hideAllMenuSheets() 78 if choice then 79 local client = orxonox.Client:getInstance() 80 local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID() 81 client:setDestination( P.serverList[index][2], 55556 ) 68 82 else 69 --wait for Sandro's function83 return 70 84 end 71 85 orxonox.execute("startClient") 86 hideAllMenuSheets() 72 87 end 73 88 … … 77 92 78 93 function P.showServerList() 79 local listbox = winMgr:getWindow("orxonox/MultiplayerListbox") 80 CEGUI.toListbox(listbox):resetList() 81 local discovery = orxonox.LANDiscovery:getInstance() 82 discovery:discover() 83 P.serverList = {} 84 local index = 0 85 local servername = "" 86 local serverip = "" 87 while true do 88 servername = discovery:getServerListItemName(index) 89 if servername == "" then 90 break 91 end 92 serverip = discovery:getServerListItemIP(index) 93 if serverip == "" then 94 break 95 end 96 table.insert(P.serverList, {servername, serverip}) 97 index = index + 1 98 end 99 index = 1 100 for k,v in pairs(P.serverList) do 101 local item = CEGUI.createListboxTextItem( v[1] .. ": " .. v[2] ) 102 item:setID(index) 103 index = index + 1 104 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 105 CEGUI.toListbox(listbox):addItem(item) 106 end 94 -- LAN Discovery 95 if P.joinMode == 1 then 96 local listbox = winMgr:getWindow("orxonox/MultiplayerListbox") 97 CEGUI.toListbox(listbox):resetList() 98 local discovery = orxonox.LANDiscovery:getInstance() 99 discovery:discover() 100 P.serverList = {} 101 local index = 0 102 local servername = "" 103 local serverip = "" 104 while true do 105 servername = discovery:getServerListItemName(index) 106 if servername == "" then 107 break 108 end 109 serverip = discovery:getServerListItemIP(index) 110 if serverip == "" then 111 break 112 end 113 table.insert(P.serverList, {servername, serverip}) 114 index = index + 1 115 end 116 index = 1 117 for k,v in pairs(P.serverList) do 118 local item = CEGUI.createListboxTextItem( v[1] .. ": " .. v[2] ) 119 item:setID(index) 120 index = index + 1 121 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 122 CEGUI.toListbox(listbox):addItem(item) 123 end 124 -- WAN Discovery 125 elseif P.joinMode == 2 then 126 local listbox = winMgr:getWindow("orxonox/MultiplayerListbox") 127 CEGUI.toListbox(listbox):resetList() 128 local discovery = orxonox.WANDiscovery:getInstance() 129 cout(0, "discovering.\n" ) 130 discovery:discover() 131 cout(0, "discovered.\n" ) 132 P.serverList = {} 133 local index = 0 134 local servername = "" 135 local serverip = "" 136 while true do 137 servername = discovery:getServerListItemName(index) 138 if servername == "" then 139 break 140 end 141 serverip = discovery:getServerListItemIP(index) 142 if serverip == "" then 143 break 144 end 145 table.insert(P.serverList, {servername, serverip}) 146 index = index + 1 147 end 148 index = 1 149 for k,v in pairs(P.serverList) do 150 local item = CEGUI.createListboxTextItem( v[1] .. ": " .. v[2] ) 151 item:setID(index) 152 index = index + 1 153 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 154 CEGUI.toListbox(listbox):addItem(item) 155 end 156 end 157 107 158 end 108 159
Note: See TracChangeset
for help on using the changeset viewer.