View Issue Details

IDProjectCategoryView StatusLast Update
0005051Multi Theft Auto : San AndreasScriptingpublic2012-02-06 06:36
Reporter50pAssigned Tokevuwk 
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Product Version 
Target Version1.3.1Fixed in Version1.3 
Summary0005051: Add optional "type" parameter to getElementChildren to get children of specified type
Description

This can be useful and quicker easier to do for loops.

Currently:

elements = getElementChildren( element )
for i, elem in pairs( elements ) do
if getElementType( elem ) == "type" then
--- this is what we needed
end
end

Would be easier like the following:

elements = getElementChildren( element, "type" )
for i, elem in pairs( elements ) do
--- this is what we needed
end

TagsNo tags attached.

Relationships

child of 0003344 closed New Feature Requests Requested features tracker 

Activities

aru

2009-10-11 05:52

administrator   ~~0010678

Reopening as this could be a valid future enhancement for the following reasons:

  1. getElementType() comparison would be very slow in a large loop and is not a viable solution.
  2. Using getElementsByType( "type", parentElement ) would result in returning all the elements regardless of tree depth.

Suggesting one of the following:

  1. Add an optional type parameter for getElementChildren
  2. Add an optional depth parameter to getElementsByType

kevuwk

2012-01-26 18:41

administrator   ~~0015827

optional argument added to getElementChildren

ccw

2012-02-06 06:36

administrator   ~~0015949

Fixed in http://code.google.com/p/mtasa-blue/source/detail?r=3750

Issue History

Date Modified Username Field Change