[NR-CORE] Fix map edit from not opening

Posts 1–4 of 4 · Page 1 of 1
[NR-CORE] Fix map edit from not opening
First off, for some reason I can't figure out how to get the attribute "MapEditor" so I turned off that permission and made it so all people can access the editor which can simply be done by going to SavedCharactersList.as and changing
Code:
this.canMapEdit_ = _arg1.hasOwnProperty("MapEditor");
to
Code:
this.canMapEdit_ = true;
After that, the only problem with map editor is regions.. Go to RegionChooser.as and just replace it with this
Code:
package com.company.assembleegameclient.mapeditor {
import com.company.assembleegameclient.map.RegionLibrary;

public class RegionChooser extends Chooser {

    public function RegionChooser() {
        var _local_1:XML;
        var _local_2:RegionElement;
        super(Layer.REGION);
        for each (_local_1 in RegionLibrary.xmlLibrary_) {
            _local_2 = new RegionElement(_local_1);
            addElement(_local_2);
        }
    }

}
}
The attribute "MapEditor" comes from parsing the Account element in the Char/List response from the web server. To properly implement it, you could just add a serializable property called "MapEditor" in the Account class in Models.cs and set it however you want (rank, db value, etc). However, if you just want everyone to have access to the editor, the method you posted works as well. Good Job!

Edit: Just realized that this is for NR-CORE. The account class is actually located in Xml.Models.cs. Also, add this in the ToXml method in Account.
Code:
MapEditor ? new XElement("MapEditor", "") : null,
This just adds the MapEditor property into the Char/List response. You also don't have to make the property serializable.
Quote Originally Posted by Roation View Post
The attribute "MapEditor" comes from parsing the Account element in the Char/List response from the web server. To properly implement it, you could just add a serializable property called "MapEditor" in the Account class in Models.cs and set it however you want (rank, db value, etc). However, if you just want everyone to have access to the editor, the method you posted works as well. Good Job!

Edit: Just realized that this is for NR-CORE. The account class is actually located in Xml.Models.cs. Also, add this in the ToXml method in Account.
Code:
MapEditor ? new XElement("MapEditor", "") : null,
This just adds the MapEditor property into the Char/List response. You also don't have to make the property serializable.
Thanks for that, I knew how it worked I was just too lazy to fix it but that's not what this tut is about anyways XD
good tutorial +1 respect point xdd
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Talk with us