Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6671


Ignore:
Timestamp:
Apr 1, 2010, 1:52:24 PM (14 years ago)
Author:
rgrieder
Message:

Added Tools.lua and moved 'find' in InitialiseGUI.lua to 'table.findIndex' in Tools.lua.

Location:
code/branches/gamestates2/data
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamestates2/data/gui/scripts/InitialiseGUI.lua

    r6662 r6671  
    7272        cursor:show()
    7373    end
    74 end
    75 
    76 local function find(table, value)
    77     for i, v in ipairs(table) do
    78         if v == value then
    79             return i
    80         end
    81     end
    82     return nil
    8374end
    8475
     
    194185    -- Remove sheet with its tuple from the table
    195186    root:removeChildWindow(sheetTuple.menuSheet.window)
    196     table.remove(activeMenuSheets, find(activeMenuSheets, sheetTuple))
     187    table.remove(activeMenuSheets, table.findIndex(activeMenuSheets, sheetTuple))
    197188    activeMenuSheets[name] = nil
    198189    activeMenuSheets.size = activeMenuSheets.size - 1
Note: See TracChangeset for help on using the changeset viewer.