Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7961 for code/branches


Ignore:
Timestamp:
Feb 25, 2011, 5:02:13 AM (14 years ago)
Author:
rgrieder
Message:

Restored compatibility of our Lua code with CEGUI:
Some functions were renamed. I've done so too and added an alias at initialisation for older versions.
Caution: Credits and Quest menu don't yet work because CEGUI 0.7 has less Font functionality.

Location:
code/branches/kicklib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib/data/gui/scripts/GUITools.lua

    r7922 r7961  
    3131
    3232    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel())
    33     local height = window:getFont():getLineSpacing() + window:getUnclippedPixelRect():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight()
    34     local width =  window:getFont():getTextExtent(window:getText()) + window:getUnclippedPixelRect():getWidth() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getWidth()
     33    local height = window:getFont():getLineSpacing() + window:getUnclippedOuterRect():getHeight() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getHeight()
     34    local width =  window:getFont():getTextExtent(window:getText()) + window:getUnclippedOuterRect():getWidth() - lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window):getWidth()
    3535
    3636    table.insert(size, height)
     
    4040
    4141function getScrollingStepSize(window)
    42     local height = window:getUnclippedPixelRect():getHeight()
    43     local maxHeight = CEGUI.System:getSingleton():getGUISheet():getUnclippedPixelRect():getHeight()
     42    local height = window:getUnclippedOuterRect():getHeight()
     43    local maxHeight = CEGUI.System:getSingleton():getGUISheet():getUnclippedOuterRect():getHeight()
    4444    local ratio = height/maxHeight
    4545    return 0.008*ratio/0.3204
     
    4949    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel())
    5050    local formattedArea = lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window)
    51     local frameHeight = window:getUnclippedPixelRect():getHeight() - formattedArea:getHeight()
     51    local frameHeight = window:getUnclippedOuterRect():getHeight() - formattedArea:getHeight()
    5252    local lines = window:getFont():getFormattedLineCount(window:getText(), formattedArea, CEGUI.WordWrapLeftAligned)
    5353    local height = lines * window:getFont():getLineSpacing() + frameHeight
  • code/branches/kicklib/data/gui/scripts/InitialiseGUI.lua

    r7801 r7961  
    77local scheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_")
    88-- Load all required skins
    9 --schemeMgr:loadScheme("TaharezGreenLook.scheme")
    10 schemeMgr:loadScheme(scheme .. "Look.scheme")
    11 --schemeMgr:loadScheme("TaharezLook.scheme")
    12 --schemeMgr:loadScheme("WindowsLook.scheme")
    13 --schemeMgr:loadScheme("VanillaLook.scheme")
    14 --schemeMgr:loadScheme("SleekSpaceLook.scheme")
     9--schemeMgr:create("TaharezGreenLook.scheme")
     10schemeMgr:create(scheme .. "Look.scheme")
     11--schemeMgr:create("TaharezLook.scheme")
     12--schemeMgr:create("WindowsLook.scheme")
     13--schemeMgr:create("VanillaLook.scheme")
     14--schemeMgr:create("SleekSpaceLook.scheme")
    1515
    1616-- Connect skin specific window types with our own window types
    1717-- By loading a different file (if there is) you can change the skin
    1818-- of the menus or the HUD independently
    19 --schemeMgr:loadScheme("TaharezGreenMenuWidgets.scheme")
     19--schemeMgr:create("TaharezGreenMenuWidgets.scheme")
    2020--menuImageSet = "TaharezGreenLook"
    21 --schemeMgr:loadScheme("TaharezGreenHUDWidgets.scheme")
     21--schemeMgr:create("TaharezGreenHUDWidgets.scheme")
    2222--hudImageSet = "TaharezGreenLook"
    23 schemeMgr:loadScheme(scheme .. "MenuWidgets.scheme")
     23schemeMgr:create(scheme .. "MenuWidgets.scheme")
    2424menuImageSet = scheme .. "Look"
    25 schemeMgr:loadScheme(scheme .. "HUDWidgets.scheme")
     25schemeMgr:create(scheme .. "HUDWidgets.scheme")
    2626hudImageSet = scheme .. "Look"
    2727
    2828-- Just a remaining test hack
    29 schemeMgr:loadScheme("OrxonoxGUIScheme.scheme")
     29schemeMgr:create("OrxonoxGUIScheme.scheme")
    3030
    3131local system = CEGUI.System:getSingleton()
  • code/branches/kicklib/data/gui/scripts/NotificationLayer.lua

    r7927 r7961  
    484484    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(queue:getLookNFeel())
    485485    local formattedArea = lookAndFeel:getNamedArea("ItemRenderingArea"):getArea():getPixelRect(queue)
    486     local frameHeight = queue:getUnclippedPixelRect():getHeight() - formattedArea:getHeight()
     486    local frameHeight = queue:getUnclippedOuterRect():getHeight() - formattedArea:getHeight()
    487487    listbox:removeItem(item)
    488488    return frameHeight + singleItemHeight*size
  • code/branches/kicklib/src/libraries/core/GUIManager.cc

    r7960 r7961  
    173173#if CEGUI_VERSION_MAJOR < 1 && CEGUI_VERSION_MINOR < 7
    174174        guiSystem_ = new System(guiRenderer_, resourceProvider_, 0, scriptModule_);
     175        // Add functions that have been renamed in newer versions
     176        luaState_->doString("CEGUI.SchemeManager.create = CEGUI.SchemeManager.loadScheme");
     177        luaState_->doString("CEGUI.Window.getUnclippedOuterRect = CEGUI.Window.getUnclippedPixelRect");
    175178#else
    176179        guiSystem_ = &System::create(*guiRenderer_, resourceProvider_, 0, imageCodec_, scriptModule_);
Note: See TracChangeset for help on using the changeset viewer.