Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 24, 2018, 3:09:05 AM (7 years ago)
Author:
landauf
Message:

migrated all ingame menus to cegui 0.8

Location:
code/branches/cegui0.8_ogre1.9/data/gui/scripts
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cegui0.8_ogre1.9/data/gui/scripts/Dialog.lua

    r11783 r11806  
    3232   
    3333   
    34     local personfield = winMgr:getWindow("orxonox/Dialog/Person")
     34    local personfield = P.window:getChild("Options/Person")
    3535    local person = manager:getPerson()
    3636    personfield:setText(person)
    3737
    38     local questionfield = winMgr:getWindow("orxonox/Dialog/Question")
     38    local questionfield = P.window:getChild("Options/QuestionWrapper/QuestionPane/Question")
    3939    local question = manager:getQuestion()
    4040    questionfield:setText(question)
    4141
    42     local listboxwindow = winMgr:getWindow("orxonox/AnsListbox")
     42    local listboxwindow = P.window:getChild("Options/AnsListbox")
    4343    CEGUI.toListbox(listboxwindow):resetList()
    4444
     
    5252    for k,v in pairs(ansList) do
    5353        item = CEGUI.createListboxTextItem(v)
    54         item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
     54        item:setSelectionBrushImage(menuImageSet .. "/MultiListSelectionBrush")
    5555        CEGUI.toListbox(listboxwindow):addItem(item)
    5656    end
     
    6161    manager:update(P.choice)
    6262
    63     local questionfield = winMgr:getWindow("orxonox/Dialog/Question")
     63    local questionfield = P.window:getChild("Options/QuestionWrapper/QuestionPane/Question")
    6464    local question = manager:getQuestion()
    6565    questionfield:setText(question)
    6666
    67     local listboxwindow = winMgr:getWindow("orxonox/AnsListbox")
     67    local listboxwindow = P.window:getChild("Options/AnsListbox")
    6868    listboxwindow:resetList()
    6969
     
    7777    for k,v in pairs(ansList) do
    7878        item = CEGUI.createListboxTextItem(v)
    79         item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
     79        item:setSelectionBrushImage(menuImageSet .. "/MultiListSelectionBrush")
    8080        CEGUI.toListbox(listboxwindow):addItem(item)
    8181    end
     
    8585
    8686function P.answer_changed(e)    --wird aufgerufen falls Auswahl geaendert wird und setzt enstprechenden Indexparameter 
    87     listboxwindow = winMgr:getWindow("orxonox/AnsListbox")
     87    listboxwindow = P.window:getChild("Options/AnsListbox")
    8888    selection = listboxwindow:getFirstSelectedItem()
    8989    if selection ~= nil then
  • code/branches/cegui0.8_ogre1.9/data/gui/scripts/DockingDialog.lua

    r11795 r11806  
    99     --button are arranged in a 1x2 matrix
    1010    P:setButton(1, 1, {
    11             ["button"] = winMgr:getWindow("orxonox/Docking/DockButton"),
     11            ["button"] = P.window:getChild("DockButton"),
    1212            ["callback"]  = P.dockButton_clicked
    1313    })
    1414
    1515    P:setButton(1, 2, {
    16             ["button"] = winMgr:getWindow("orxonox/Docking/CancelButton"),
     16            ["button"] = P.window:getChild("CancelButton"),
    1717            ["callback"]  = P.cancelButton_clicked
    1818    })
     
    3737    end
    3838
    39     local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/Docking/Docks"))
     39    local listbox = CEGUI.toListbox(P.window:getChild("Title/Docks"))
    4040    listbox:resetList()
    4141
     
    5151
    5252function P.dockButton_clicked(e)
    53     local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/Docking/Docks"))
     53    local listbox = CEGUI.toListbox(P.window:getChild("Title/Docks"))
    5454    local choice = listbox:getFirstSelectedItem()
    5555    if choice ~= nil then
  • code/branches/cegui0.8_ogre1.9/data/gui/scripts/InGameMenu.lua

    r11052 r11806  
    99    --button are arranged in a 5x1 matrix, the left lower item is nil
    1010    P:setButton(1, 1, {
    11             ["button"] = winMgr:getWindow("orxonox/InGameMenu_ReturnButton"),
     11            ["button"] = P.window:getChild("InGameMenu_ReturnButton"),
    1212            ["callback"]  = P.button_return_clicked
    1313    })
    1414
    1515    P:setButton(2, 1, {
    16             ["button"] = winMgr:getWindow("orxonox/InGameMenu_ReloadLevelButton"),
     16            ["button"] = P.window:getChild("InGameMenu_ReloadLevelButton"),
    1717            ["callback"]  = P.button_reloadLevel_clicked
    1818    })
    1919
    2020    P:setButton(3, 1, {
    21             ["button"] = winMgr:getWindow("orxonox/InGameMenu_MainMenuButton"),
     21            ["button"] = P.window:getChild("InGameMenu_MainMenuButton"),
    2222            ["callback"]  = P.button_mainmenu_clicked
    2323    })
    2424
    2525    P:setButton(4, 1, {
    26             ["button"] = winMgr:getWindow("orxonox/InGameMenu_SettingsButton"),
     26            ["button"] = P.window:getChild("InGameMenu_SettingsButton"),
    2727            ["callback"]  = P.button_settings_clicked
    2828    })
    2929
    3030    P:setButton(5, 1, {
    31             ["button"] = winMgr:getWindow("orxonox/InGameMenu_QuitButton"),
     31            ["button"] = P.window:getChild("InGameMenu_QuitButton"),
    3232            ["callback"]  = P.button_quit_clicked
    3333    })
  • code/branches/cegui0.8_ogre1.9/data/gui/scripts/PickupInventory.lua

    r11795 r11806  
    4343            local pickup = P.detailPickups[k]
    4444            if pickup ~= nil and pickup ~= 0 then
    45                 local useButton = winMgr:getWindow("orxonox/PickupInventory/Details" .. k .. "/UseButton")
    46                 local dropButton = winMgr:getWindow("orxonox/PickupInventory/Details" .. k .. "/DropButton")
     45                local useButton = P.window:getChild("Details" .. k .. "/Wrapper/UseButton")
     46                local dropButton = P.window:getChild("Details" .. k .. "/Wrapper/DropButton")
    4747                if orxonox.PickupManager:getInstance():isValidPickup(pickup.pickup) == false then
    4848                    useButton:setEnabled(false)
     
    8383    local pickupManager = orxonox.PickupManager:getInstance()
    8484   
    85     local root = winMgr:getWindow("orxonox/PickupInventory/Inventory")
    86     P.wrapper = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/PickupInventory/Inventory/Wrapper")
    87     P.wrapper:setSize(CEGUI.UVector2(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))
    88     root:addChildWindow(P.wrapper)
     85    local root = P.window:getChild("PickupInventory/Wrapper/Inventory")
     86    P.wrapper = winMgr:createWindow("MenuWidgets/ScrollablePane", "Wrapper")
     87    P.wrapper:setSize(CEGUI.USize(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))
     88    root:addChild(P.wrapper)
    8989   
    9090    P.pickupsList = {}
     
    9898        local window = P.createPickupEntry(counter, pickup)
    9999        window:setYPosition(CEGUI.UDim(0,offset))
    100         offset = offset + window:getHeight():asAbsolute(1)
    101         P.wrapper:addChildWindow(window)
     100        offset = offset + P.imageHeight
     101        P.wrapper:addChild(window)
    102102        counter = counter + 1
    103103    end
     
    108108    local representation = orxonox.PickupManager:getInstance():getRepresentation(pickup.representationName)
    109109
    110     local name = "orxonox/PickupInventory/Box/Pickup" .. index
     110    local name = "Pickup" .. index
    111111
    112112    local item = winMgr:createWindow("MenuWidgets/StaticText", name)
    113     item:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0), CEGUI.UDim(0, P.imageHeight)))
     113    item:setSize(CEGUI.USize(CEGUI.UDim(1, 0), CEGUI.UDim(0, P.imageHeight)))
    114114    item:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0)))
    115115
    116     local image = winMgr:createWindow("MenuWidgets/StaticImage", name .. "/Image")
     116    local image = winMgr:createWindow("MenuWidgets/StaticImage", "Image")
    117117    image:setProperty("Image", "PickupInventory/" .. representation:getInventoryRepresentation())
    118118    image:setProperty("BackgroundEnabled", "set:False")
    119119    image:setProperty("FrameEnabled", "set:True")
    120     image:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.imageHeight), CEGUI.UDim(0, P.imageHeight)))
    121     item:addChildWindow(image)
    122 
    123     local title = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Title")
     120    image:setSize(CEGUI.USize(CEGUI.UDim(0, P.imageHeight), CEGUI.UDim(0, P.imageHeight)))
     121    item:addChild(image)
     122
     123    local title = winMgr:createWindow("MenuWidgets/StaticText", "Title")
    124124    title:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.imageHeight+5), CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
    125     title:setSize(CEGUI.UVector2(CEGUI.UDim(0.3, 0), CEGUI.UDim(0, P.textHeight)))
     125    title:setSize(CEGUI.USize(CEGUI.UDim(0.3, 0), CEGUI.UDim(0, P.textHeight)))
    126126    title:setText(representation:getPickupName())
    127127    title:setProperty("FrameEnabled", "set:False")
    128     item:addChildWindow(title)
    129 
    130     local useButton = winMgr:createWindow("MenuWidgets/Button", name .. "/UseButton")
     128    item:addChild(title)
     129
     130    local useButton = winMgr:createWindow("MenuWidgets/Button", "UseButton")
    131131    useButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+10),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
    132     useButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     132    useButton:setSize(CEGUI.USize(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
    133133    if pickup.inUse == false then
    134134        useButton:setText("use")
     
    143143    end
    144144    orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseUnuseButton_clicked")
    145     item:addChildWindow(useButton)
    146 
    147     local dropButton = winMgr:createWindow("MenuWidgets/Button", name .. "/DropButton")
     145    item:addChild(useButton)
     146
     147    local dropButton = winMgr:createWindow("MenuWidgets/Button", "DropButton")
    148148    dropButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+15+P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
    149     dropButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     149    dropButton:setSize(CEGUI.USize(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
    150150    dropButton:setText("drop")
    151151    orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.name .. ".InventoryDropButton_clicked")
    152     item:addChildWindow(dropButton)
    153 
    154     local detailsButton = winMgr:createWindow("MenuWidgets/Button", name .. "/DetailsButton")
     152    item:addChild(dropButton)
     153
     154    local detailsButton = winMgr:createWindow("MenuWidgets/Button", "DetailsButton")
    155155    detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+20+2*P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
    156     detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     156    detailsButton:setSize(CEGUI.USize(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
    157157    detailsButton:setText("details")
    158158    orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name .. ".InventoryDetailsButton_clicked")
    159     item:addChildWindow(detailsButton)
     159    item:addChild(detailsButton)
    160160
    161161    return item
     
    180180function P.windowToPickupHelper(e)
    181181    local we = CEGUI.toWindowEventArgs(e)
    182     local name = we.window:getName()
     182    local name = we.window:getNamePath()
    183183
    184184    local match = string.gmatch(name, "%d+")
     
    193193
    194194    local index = P.getNewDetailNumber()
    195     local name = "orxonox/PickupInventory/Details" .. index
     195    local name = "Details" .. index
    196196   
    197197    local window = winMgr:createWindow("MenuWidgets/FrameWindow", name)
    198     window:setSize(CEGUI.UVector2(CEGUI.UDim(0.5,0),CEGUI.UDim(0.4,0)))
     198    window:setSize(CEGUI.USize(CEGUI.UDim(0.5,0),CEGUI.UDim(0.4,0)))
    199199    orxonox.GUIManager:subscribeEventHelper(window, "CloseClicked", P.name .. ".closeDetailWindow")
    200200   
    201     local root = winMgr:getWindow("orxonox/PickupInventory/Background")
    202     root:addChildWindow(window)
    203    
    204     local wrapper = winMgr:createWindow("DefaultWindow", name .. "/Wrapper")
    205     wrapper:setSize(CEGUI.UVector2(CEGUI.UDim(1, -20),CEGUI.UDim(1, -50)))
     201    P.window:addChild(window)
     202   
     203    local wrapper = winMgr:createWindow("DefaultWindow", "Wrapper")
     204    wrapper:setSize(CEGUI.USize(CEGUI.UDim(1, -20),CEGUI.UDim(1, -50)))
    206205    wrapper:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 10),CEGUI.UDim(0, 40)))
    207     window:addChildWindow(wrapper)
    208    
    209     local title = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Title")
     206    window:addChild(wrapper)
     207   
     208    local title = winMgr:createWindow("MenuWidgets/StaticText", "Title")
    210209    title:setText(representation:getPickupName())
    211210    title:setHeight(CEGUI.UDim(0, P.textHeight))
    212211    title:setProperty("FrameEnabled", "set:False")
    213212    title:setProperty("BackgroundEnabled", "set:False")
    214     wrapper:addChildWindow(title)
    215    
    216     local image = winMgr:createWindow("MenuWidgets/StaticImage", name .. "/Image")
     213    wrapper:addChild(title)
     214   
     215    local image = winMgr:createWindow("MenuWidgets/StaticImage", "Image")
    217216    image:setProperty("Image", "PickupInventory/" .. representation:getInventoryRepresentation())
    218217    image:setProperty("BackgroundEnabled", "set:False")
    219218    image:setProperty("FrameEnabled", "set:True")
    220     image:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.detailImageSize), CEGUI.UDim(0, P.detailImageSize)))
     219    image:setSize(CEGUI.USize(CEGUI.UDim(0, P.detailImageSize), CEGUI.UDim(0, P.detailImageSize)))
    221220    image:setYPosition(CEGUI.UDim(0, P.textHeight + 5))
    222     wrapper:addChildWindow(image)
    223    
    224     local box = winMgr:createWindow("MenuWidgets/ScrollablePane", name .. "/Description")
    225     box:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -1*(P.detailImageSize + 10)),CEGUI.UDim(1, -(P.textHeight + 5 + P.textHeight + 20))))
     221    wrapper:addChild(image)
     222   
     223    local box = winMgr:createWindow("MenuWidgets/ScrollablePane", "Description")
     224    box:setSize(CEGUI.USize(CEGUI.UDim(1.0, -1*(P.detailImageSize + 10)),CEGUI.UDim(1, -(P.textHeight + 5 + P.textHeight + 20))))
    226225    box:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.detailImageSize + 10),CEGUI.UDim(0, P.textHeight + 5)))
    227     local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Text")
     226    local description = winMgr:createWindow("MenuWidgets/StaticText", "Text")
    228227    description:setText(representation:getPickupDescription())
    229228    description:setProperty("HorzFormatting", "WordWrapLeftAligned")
    230229    description:setProperty("VertFormatting", "TopAligned")
    231     box:addChildWindow(description)
    232     wrapper:addChildWindow(box)
    233 
    234     local useButton = winMgr:createWindow("MenuWidgets/Button", name .. "/UseButton")
     230    box:addChild(description)
     231    wrapper:addChild(box)
     232
     233    local useButton = winMgr:createWindow("MenuWidgets/Button", "UseButton")
    235234    useButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.detailImageSize+10),CEGUI.UDim(1, -40)))
    236     useButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     235    useButton:setSize(CEGUI.USize(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
    237236    if pickup.inUse == false then
    238237        useButton:setText("use")
     
    247246    end
    248247    orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseUnuseDetailButton_clicked")
    249     wrapper:addChildWindow(useButton)
    250    
    251     local dropButton = winMgr:createWindow("MenuWidgets/Button", name .. "/DropButton")
     248    wrapper:addChild(useButton)
     249   
     250    local dropButton = winMgr:createWindow("MenuWidgets/Button", "DropButton")
    252251    dropButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.detailImageSize+10+P.buttonWidth+10),CEGUI.UDim(1, -40)))
    253     dropButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     252    dropButton:setSize(CEGUI.USize(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
    254253    dropButton:setText("drop")
    255254    orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.name .. ".InventoryDropDetailButton_clicked")
    256     wrapper:addChildWindow(dropButton)
     255    wrapper:addChild(dropButton)
    257256
    258257    P.detailsWindows[index] = window
     
    311310    --Get some numbers from the window
    312311    local we = CEGUI.toWindowEventArgs(e)
    313     local name = we.window:getName()
     312    local name = we.window:getNamePath()
    314313    local match = string.gmatch(name, "%d+")
    315314    local detailNr = tonumber(match())
  • code/branches/cegui0.8_ogre1.9/data/gui/scripts/QuestGUI.lua

    r11795 r11806  
    4040-- selectQuest is a pointer to a quest that should be selected, if it is nil the first quest is selected.
    4141function P.loadQuestsList(selectQuest)
    42     local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/QuestsList"))
     42    local list = CEGUI.toListbox(P.window:getChild("MainWindow/LeftPanel/QuestsList"))
    4343    P.clearQuestList()
    4444
     
    124124        -- Load title and description
    125125        local description = P.questManager:getDescription(quest)
    126         local titleWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Title")
     126        local titleWindow = P.window:getChild("MainWindow/Title")
    127127        titleWindow:setText(description:getTitle())
    128         local descriptionWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Description")
     128        local descriptionWindow = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/Description")
    129129        descriptionWindow:setText(description:getDescription())
    130         descriptionWindow:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0)))
     130        descriptionWindow:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0)))
    131131        descriptionWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, P.borderSize)))
    132132        local height = getStaticTextWindowHeight(descriptionWindow)
     
    135135
    136136        -- Load subquests
    137         local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/Quest/SubquestsList"))
     137        local list = CEGUI.toListbox(P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/SubquestsList"))
    138138        local numQuests = P.questManager:getNumSubQuests(quest, P.player)
    139139        local i = 0
     
    150150            height = height+P.frameHeigth
    151151        end
    152         list:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, height)))
     152        list:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, height)))
    153153        list:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, offset)))
    154154        offset = offset + height + P.borderSize
    155155
    156156        -- Load hints
    157         local hintsWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Hints")
     157        local hintsWindow = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/Hints")
    158158        hintsWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, offset)))
    159         hintsWindow:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, 0)))
     159        hintsWindow:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, 0)))
    160160        height = P.titleHeight
    161161        local numHints = P.questManager:getNumHints(quest, P.player)
     
    173173
    174174        -- Set the size of the wrapper
    175         local window = winMgr:getWindow("orxonox/QuestGUI/Quest/Wrapper")
    176         window:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize-P.scrollbarWidth), CEGUI.UDim(0,offset+P.borderSize)))
     175        local window = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper")
     176        window:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize-P.scrollbarWidth), CEGUI.UDim(0,offset+P.borderSize)))
    177177    end
    178178end
     
    181181function P.clearQuest()
    182182    -- clear title
    183     local titleWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Title")
     183    local titleWindow = P.window:getChild("MainWindow/Title")
    184184    titleWindow:setText("no Quests")
    185185
    186186    -- clear description
    187     local descriptionWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Description")
     187    local descriptionWindow = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/Description")
    188188    descriptionWindow:setText("There is currently no quest that can be displayed.")
    189189
    190190    -- clear list fo subquests
    191     local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/Quest/SubquestsList"))
     191    local list = CEGUI.toListbox(P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/SubquestsList"))
    192192    list:resetList()
    193193    list:setHeight(CEGUI.UDim(0, 0))
     
    195195
    196196    -- clear hints
    197     local hints = winMgr:getWindow("orxonox/QuestGUI/Quest/Hints")
     197    local hints = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/Hints")
    198198    local numChildren = hints:getChildCount()-2 -- TODO: HACK
    199199    local i = 0
    200200    while i < numChildren do
    201         local hint = hints:getChild("orxonox/QuestGUI/Quest/Hints/" .. i)
     201        local hint = hints:getChild("" .. i)
    202202        if hint ~= nil then
    203             hints:removeChildWindow(hint)
     203            hints:removeChild(hint)
    204204            winMgr:destroyWindow(hint)
    205205        end
    206206        i = i+1
    207207    end
    208     hints:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.scrollbarWidth-P.borderSize), CEGUI.UDim(0, 0)))
     208    hints:setSize(CEGUI.USize(CEGUI.UDim(1, -P.scrollbarWidth-P.borderSize), CEGUI.UDim(0, 0)))
    209209end
    210210
    211211-- Clear the quests list
    212212function P.clearQuestList()
    213     local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/QuestsList"))
     213    local list = CEGUI.toListbox(P.window:getChild("MainWindow/LeftPanel/QuestsList"))
    214214    list:resetList()
    215215    P.quests = {}
     
    253253function P.insertHint(hintsWindow, hint, index, offset)
    254254    -- Create the window for the hint.
    255     local window = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/QuestGUI/Quest/Hints/" .. index)
     255    local window = winMgr:createWindow("MenuWidgets/StaticText", "" .. index)
    256256    window:setProperty("HorzFormatting", "WordWrapLeftAligned")
    257257    window:setProperty("VertFormatting", "TopAligned")
    258258    window:setProperty("FrameEnabled", "false")
    259259    window:setID(index)
    260     hintsWindow:addChildWindow(window)
     260    hintsWindow:addChild(window)
    261261    local description = P.questManager:getDescription(hint)
    262262    window:setText(description:getDescription())
    263     window:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0)))
     263    window:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0)))
    264264    local height = getStaticTextWindowHeight(window)
    265265    window:setHeight(CEGUI.UDim(0, height))
     
    286286-- Change to a new quest.
    287287function P.changeQuest_clicked(e)
    288     local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/QuestsList"))
     288    local list = CEGUI.toListbox(P.window:getChild("MainWindow/LeftPanel/QuestsList"))
    289289    local choice = list:getFirstSelectedItem()
    290290    if choice ~= nil then
     
    299299-- Change to a new subquest.
    300300function P.changeToSubquest_clicked(e)
    301     local list = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/Quest/SubquestsList"))
    302     local questsList = CEGUI.toListbox(winMgr:getWindow("orxonox/QuestGUI/QuestsList"))
     301    local list = CEGUI.toListbox(P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/SubquestsList"))
     302    local questsList = CEGUI.toListbox(P.window:getChild("MainWindow/LeftPanel/QuestsList"))
    303303    local choice = list:getFirstSelectedItem()
    304304    if choice ~= nil then
     
    328328
    329329    local questWindow = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/QuestGUI/Quests")
    330     questWindow:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0),CEGUI.UDim(1, 0)))
     330    questWindow:setSize(CEGUI.USize(CEGUI.UDim(1, 0),CEGUI.UDim(1, 0)))
    331331
    332332    -- Iterate through all root-quests.
     
    348348    node:setText(orxonox.QuestManager:getInstance():getDescription(parent):getTitle())
    349349    node:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.indentWidth*depth), CEGUI.UDim(0, P.buttonHeight*index)))
    350     node:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.indentWidth*depth-P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight)))
     350    node:setSize(CEGUI.USize(CEGUI.UDim(1, -P.indentWidth*depth-P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight)))
    351351    orxonox.GUIManager:subscribeEventHelper(node, "Clicked", P.name .. ".openDetails_clicked")
    352     root:addChildWindow(node)
     352    root:addChild(node)
    353353   
    354354    table.insert(P.quests, parent)
     
    389389    --Get some numbers from the window
    390390    local we = CEGUI.toWindowEventArgs(e)
    391     local name = we.window:getName()
     391    local name = we.window:getNamePath()
    392392    local match = string.gmatch(name, "%d+")
    393393    local questNr = tonumber(match())
     
    397397
    398398    local details = winMgr:createWindow("MenuWidgets/FrameWindow", name)
    399     details:setSize(CEGUI.UVector2(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0)))
     399    details:setSize(CEGUI.USize(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0)))
    400400    details:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0), CEGUI.UDim(0.1, 0)))
    401401    details:setText(orxonox.QuestManager:getInstance():getDescription(quest):getTitle())
     
    408408    name = name .. "/Scrollable"
    409409    local window = winMgr:createWindow("MenuWidgets/ScrollablePane", name)
    410     window:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight)))
     410    window:setSize(CEGUI.USize(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight)))
    411411    window:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderWidth), CEGUI.UDim(0, P.titleHeight)))
    412     details:addChildWindow(window)
     412    details:addChild(window)
    413413
    414414    local offset = 0
    415415
    416416    local status = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Status")
    417     window:addChildWindow(status)
     417    window:addChild(status)
    418418    status:setProperty("HorzFormatting", "WordWrapLeftAligned")
    419419    status:setProperty("VertFormatting", "TopAligned")
     
    426426    end
    427427    status:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
    428     status:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     428    status:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
    429429    local height = getStaticTextWindowHeight(status)
    430430    status:setHeight(CEGUI.UDim(0, height))
     
    432432
    433433    local descriptionTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Title")
    434     window:addChildWindow(descriptionTitle)
    435     descriptionTitle:setProperty("HorzFormatting", "HorzCentred")
     434    window:addChild(descriptionTitle)
     435    descriptionTitle:setProperty("HorzFormatting", "CentreAligned")
    436436    descriptionTitle:setProperty("VertFormatting", "TopAligned")
    437437    descriptionTitle:setText("Description:")
    438438    descriptionTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
    439     descriptionTitle:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     439    descriptionTitle:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
    440440    height = getStaticTextWindowHeight(descriptionTitle)
    441441    descriptionTitle:setHeight(CEGUI.UDim(0, height))
     
    443443
    444444    local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description")
    445     window:addChildWindow(description)
     445    window:addChild(description)
    446446    description:setProperty("HorzFormatting", "WordWrapLeftAligned")
    447447    description:setProperty("VertFormatting", "TopAligned")
    448448    description:setText(orxonox.QuestManager:getInstance():getDescription(quest):getDescription())
    449449    description:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
    450     description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     450    description:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
    451451    height = getStaticTextWindowHeight(description)
    452452    description:setHeight(CEGUI.UDim(0, height))
     
    457457    if numHints > 0 then
    458458        local hintsTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Hints/Title")
    459         window:addChildWindow(hintsTitle)
    460         hintsTitle:setProperty("HorzFormatting", "HorzCentred")
     459        window:addChild(hintsTitle)
     460        hintsTitle:setProperty("HorzFormatting", "CentreAligned")
    461461        hintsTitle:setProperty("VertFormatting", "TopAligned")
    462462        hintsTitle:setText("Hints:")
    463463        hintsTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
    464         hintsTitle:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     464        hintsTitle:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
    465465        height = getStaticTextWindowHeight(hintsTitle)
    466466        hintsTitle:setHeight(CEGUI.UDim(0, height))
     
    475475        node:setText(orxonox.QuestManager:getInstance():getDescription(hint):getTitle())
    476476        node:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
    477         node:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight)))
    478         window:addChildWindow(node)
     477        node:setSize(CEGUI.USize(CEGUI.UDim(1, -P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight)))
     478        window:addChild(node)
    479479        offset = offset + P.buttonHeight
    480480
     
    483483    end
    484484
    485     local window = winMgr:getWindow("orxonox/QuestGUI/Background")
    486     window:addChildWindow(details)
     485    local window = P.window:getChild("orxonox/QuestGUI/Background")
     486    window:addChild(details)
    487487end
    488488
     
    499499function P.closeDetails_clicked(e)
    500500    local we = CEGUI.toWindowEventArgs(e)
    501     local name = we.window:getName()
     501    local name = we.window:getNamePath()
    502502    local match = string.gmatch(name, "%d+")
    503503    match()
     
    511511    --Get some numbers from the window
    512512    local we = CEGUI.toWindowEventArgs(e)
    513     local name = we.window:getName()
     513    local name = we.window:getNamePath()
    514514    local match = string.gmatch(name, "%d+")
    515515    match()
     
    521521
    522522    local details = winMgr:createWindow("MenuWidgets/FrameWindow", name)
    523     details:setSize(CEGUI.UVector2(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0)))
     523    details:setSize(CEGUI.USize(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0)))
    524524    details:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0), CEGUI.UDim(0.1, 0)))
    525525    details:setText(orxonox.QuestManager:getInstance():getDescription(hint):getTitle())
     
    532532    name = name .. "/Scrollable"
    533533    local window = winMgr:createWindow("MenuWidgets/ScrollablePane", name)
    534     window:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight)))
     534    window:setSize(CEGUI.USize(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight)))
    535535    window:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderWidth), CEGUI.UDim(0, P.titleHeight)))
    536     details:addChildWindow(window)
     536    details:addChild(window)
    537537
    538538    local offset = 0
    539539   
    540540    local descriptionTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Title")
    541     window:addChildWindow(descriptionTitle)
    542     descriptionTitle:setProperty("HorzFormatting", "HorzCentred")
     541    window:addChild(descriptionTitle)
     542    descriptionTitle:setProperty("HorzFormatting", "CentreAligned")
    543543    descriptionTitle:setProperty("VertFormatting", "TopAligned")
    544544    descriptionTitle:setText("Description:")
    545545    descriptionTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
    546     descriptionTitle:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     546    descriptionTitle:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
    547547    height = getStaticTextWindowHeight(descriptionTitle)
    548548    descriptionTitle:setHeight(CEGUI.UDim(0, height))
     
    550550
    551551    local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description")
    552     window:addChildWindow(description)
     552    window:addChild(description)
    553553    description:setProperty("HorzFormatting", "WordWrapLeftAligned")
    554554    description:setProperty("VertFormatting", "TopAligned")
    555555    description:setText(orxonox.QuestManager:getInstance():getDescription(hint):getDescription())
    556556    description:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
    557     description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     557    description:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
    558558    height = getStaticTextWindowHeight(description)
    559559    description:setHeight(CEGUI.UDim(0, height))
    560560
    561     local window = winMgr:getWindow("orxonox/QuestGUI/Background")
    562     window:addChildWindow(details)
     561    local window = P.window:getChild("orxonox/QuestGUI/Background")
     562    window:addChild(details)
    563563end
    564564
    565565function P.closeHintDetails_clicked(e)
    566566    local we = CEGUI.toWindowEventArgs(e)
    567     local name = we.window:getName()
     567    local name = we.window:getNamePath()
    568568    local match = string.gmatch(name, "%d+")
    569569    match()
  • code/branches/cegui0.8_ogre1.9/data/gui/scripts/UndockingDialog.lua

    r11795 r11806  
    99     --button are arranged in a 1x2 matrix
    1010    P:setButton(1, 1, {
    11             ["button"] = winMgr:getWindow("orxonox/Undocking/DockButton"),
     11            ["button"] = P.window:getChild("DockButton"),
    1212            ["callback"]  = P.undockButton_clicked
    1313    })
    1414
    1515    P:setButton(1, 2, {
    16             ["button"] = winMgr:getWindow("orxonox/Undocking/CancelButton"),
     16            ["button"] = P.window:getChild("CancelButton"),
    1717            ["callback"]  = P.cancelButton_clicked
    1818    })
     
    3737    end
    3838
    39     local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/Undocking/Docks"))
     39    local listbox = CEGUI.toListbox(P.window:getChild("Title/Docks"))
    4040    listbox:resetList()
    4141
     
    5151
    5252function P.undockButton_clicked(e)
    53     local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/Undocking/Docks"))
     53    local listbox = CEGUI.toListbox(P.window:getChild("Title/Docks"))
    5454    local choice = listbox:getFirstSelectedItem()
    5555    if choice ~= nil then
Note: See TracChangeset for help on using the changeset viewer.