[6206] | 1 | -- GraphicsMenu.lua |
---|
| 2 | |
---|
| 3 | BasicGUI = require("BasicGUI") |
---|
| 4 | local P = BasicGUI:new() --inherit everything from the gui package |
---|
| 5 | if _REQUIREDNAME == nil then |
---|
| 6 | GraphicsMenu = P |
---|
| 7 | else |
---|
| 8 | _G[_REQUIREDNAME] = P |
---|
| 9 | end |
---|
| 10 | |
---|
| 11 | P.filename = "GraphicsMenu" |
---|
| 12 | P.layoutString = "GraphicsMenu.layout" |
---|
| 13 | |
---|
| 14 | function P:init() |
---|
| 15 | dropdown = winMgr:getWindow("orxonox/ResolutionCombobox") |
---|
| 16 | local resolutionList = {} |
---|
| 17 | table.insert(resolutionList, "800 x 600 (4:3)") |
---|
| 18 | table.insert(resolutionList, "1024 x 640 (16:10)") |
---|
| 19 | table.insert(resolutionList, "1024 x 768 (4:3)") |
---|
| 20 | table.insert(resolutionList, "1280 x 800 (16:10)") |
---|
| 21 | table.insert(resolutionList, "1280 x 960 (4:3)") |
---|
| 22 | table.insert(resolutionList, "1440 x 900 (16:10)") |
---|
| 23 | table.insert(resolutionList, "1600 x 1200 (4:3)") |
---|
| 24 | table.insert(resolutionList, "1680 x 1050 (16:10)") |
---|
| 25 | for k,v in pairs(resolutionList) do |
---|
| 26 | item = CEGUI.createListboxTextItem(v) |
---|
| 27 | item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush") |
---|
| 28 | CEGUI.toCombobox(dropdown):addItem(item) |
---|
| 29 | end |
---|
| 30 | local scrollbar_active = false |
---|
| 31 | end |
---|
| 32 | |
---|
| 33 | function P.GraphicsResolutionCombobox_changed(e) |
---|
| 34 | -- resolution |
---|
| 35 | debug("event: resolution") |
---|
| 36 | end |
---|
| 37 | |
---|
| 38 | function P.GraphicsBrightnessScrollbar_changed(e) |
---|
| 39 | if scrollbar_active == false then |
---|
| 40 | -- brightness |
---|
| 41 | debug("event: brightness") |
---|
| 42 | end |
---|
| 43 | end |
---|
| 44 | |
---|
| 45 | function P.GraphicsBrightnessScrollbar_started(e) |
---|
| 46 | scrollbar_active = true |
---|
| 47 | end |
---|
| 48 | |
---|
| 49 | function P.GraphicsBrightnessScrollbar_ended(e) |
---|
| 50 | -- brightness |
---|
| 51 | debug("event: brightness") |
---|
| 52 | scrollbar_active = false |
---|
| 53 | end |
---|
| 54 | |
---|
| 55 | function P.GraphicsFullscreenCheckbox_clicked(e) |
---|
| 56 | -- fullscreen |
---|
| 57 | debug("event: fullscreen") |
---|
| 58 | end |
---|
| 59 | |
---|
| 60 | function P.GraphicsBackButton_clicked(e) |
---|
| 61 | hideGUI(P.filename) |
---|
| 62 | end |
---|
| 63 | |
---|
| 64 | return P |
---|
| 65 | |
---|