Changeset 367 for trunk/game/editor


Ignore:
Timestamp:
11/04/09 06:45:01 (10 years ago)
Author:
orlandov
Message:

Ticket #135 - patch by or1andov. Do not write out gfx, xpos and ypos attributes when map editor saves. fixes[s:trac, t:135]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/editor/savers.py

    r366 r367  
    135135                attrib['id'] = inst_id 
    136136 
     137            # if the object has an instance id, write out saved attributes 
    137138            if inst_id is not None and inst_id in loaders.data.objects: 
     139                skip_keys = ['gfx', 'xpos', 'ypos'] 
    138140                for key in loaders.data.objects[inst_id]: 
    139                     if key not in attrib and loaders.data.objects[inst_id][key]: 
    140                         print key 
    141                         attrib[key] = str(loaders.data.objects[inst_id][key]) 
    142                         print key, attrib[key] 
     141                    # set value if we haven't written the key out yet and key 
     142                    # has a value in our attr stash (loaders.data.objects) 
     143                    if key in skip_keys or key in attrib \ 
     144                        or key not in loaders.data.objects[inst_id]: 
     145                        continue 
     146 
     147                    attrib[key] = str(loaders.data.objects[inst_id][key]) 
    143148 
    144149            # the local_loader loader sets object_type as type, we have to 
Note: See TracChangeset for help on using the changeset viewer.