Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 26, 2017, 3:40:04 PM (7 years ago)
Author:
rrogge
Message:

Code aufgeraeumt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Dialogue_FS17/data/gui/scripts/Dialogue.lua

    r11433 r11435  
    1 --[[local P = createMenuSheet("Dialogue Window")
    21
    3 function P.onLoad()
    4         P.createWindow()
    5         P.showing = true   
    6 end
    7  function function_name( ... )
    8         -- body
    9  end
    10 
    11 
    12 
    13 
    14 function P.createWindow()
    15    
    16     local question = orxonox.DialogueManager:getInstance():getquestion()
    17     local default = (winMgr:createWindow("DefaultWindow"))
    18     default:setText(question)
    19     default:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
    20     default:setProperty("UnifiedAreaRect", "{{0,0},{0,0},{1,0},{1,0}}")
    21    
    22    
    23 
    24 
    25    
    26 end
    27 local numOptions = DialogueManager:getnumOptions()
    28     local counter = 1
    29     local offset = 0
    30     --create and name buttons while there are still options
    31     while counter <= numOptions do
    32        
    33        
    34     end]]
    352-- Dialogue.lua
    363
     
    5118
    5219function P.onLoad()
    53 
    54         orxout("loading")
    5520    P.wrapper = nil
    5621    P.detailsWindows = {}
     
    6025
    6126function P.onShow()
    62         orxout("showing")
    6327    orxonox.CommandExecutor:execute("setTimeFactor 0")
    6428    P.createInventory()
     
    7438
    7539function P.update()
    76     orxout("UPDATING")
    7740    P.updateInventory()
    7841    if P.showing == false then
     
    10467    detailsButton = winMgr:createWindow("MenuWidgets/Button", "/DetailsButton")
    10568    local a1 = orxonox.DialogueManager:getInstance():getanswers1()
    106     detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.25, 0)))
    107     detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, 575), CEGUI.UDim(0, P.textHeight)))
     69    detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.25, (P.imageHeight-P.textHeight)/2)))
     70    detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0.8, 0), CEGUI.UDim(0, P.textHeight)))
    10871    detailsButton:setText(a1)
    10972    orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name ..".a1Button_clicked")
     
    11275    a2Button = winMgr:createWindow("MenuWidgets/Button", "/a2Button")
    11376    local a2 = orxonox.DialogueManager:getInstance():getanswers2()
    114     a2Button:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.4, 0)))
    115     a2Button:setSize(CEGUI.UVector2(CEGUI.UDim(0, 575), CEGUI.UDim(0, P.textHeight)))
     77    a2Button:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.4, (P.imageHeight-P.textHeight)/2)))
     78    a2Button:setSize(CEGUI.UVector2(CEGUI.UDim(0.8, 0), CEGUI.UDim(0, P.textHeight)))
    11679    a2Button:setText(a2)
    11780    orxonox.GUIManager:subscribeEventHelper(a2Button, "Clicked", P.name ..".a2Button_clicked")
     
    147110        end
    148111    end
    149     orxonox.DialogueManager:getInstance():clean()
     112   
    150113end
    151114
Note: See TracChangeset for help on using the changeset viewer.