public ObjectInstanceEditor(ObjectInstance item) { InitializeComponent(); cxBox.Tag = cxInt; cyBox.Tag = cyInt; rxBox.Tag = rxInt; ryBox.Tag = ryInt; nameEnable.Tag = nameBox; questEnable.Tag = new Control[] { questAdd, questRemove, questList }; tagsEnable.Tag = tagsBox; this.item = item; styleManager.ManagerStyle = UserSettings.applicationStyle; xInput.Value = item.X; yInput.Value = item.Y; zInput.Value = item.Z; rBox.Checked = item.r; pathLabel.Text = Editor.CreateItemDescription(item, "\r\n"); if (item.Name != null) { nameEnable.Checked = true; nameBox.Text = item.Name; } rBox.Checked = item.r; flowBox.Checked = item.flow; SetOptionalInt(rxInt, rxBox, item.rx); SetOptionalInt(ryInt, ryBox, item.ry); SetOptionalInt(cxInt, cxBox, item.cx); SetOptionalInt(cyInt, cyBox, item.cy); if (item.tags == null) tagsEnable.Checked = false; else { tagsEnable.Checked = true; tagsBox.Text = item.tags; } if (item.QuestInfo != null) { questEnable.Checked = true; foreach (ObjectInstanceQuest info in item.QuestInfo) questList.Items.Add(info); } }
public BoardItem CreateInstance(Layer layer, Board board, int x, int y, int z, MapleBool r, MapleBool hide, MapleBool reactor, MapleBool flow, int? rx, int? ry, int? cx, int? cy, string name, string tags, List<ObjectInstanceQuest> questInfo, bool flip, bool beforeAdding, bool parseOffsets) { ObjectInstance instance = new ObjectInstance(this, layer, board, x, y, z, r, hide, reactor, flow, rx, ry, cx, cy, name, tags, questInfo, flip, beforeAdding); if (parseOffsets) ParseOffsets(instance, layer, board, x, y); return instance; }
public override BoardItem CreateInstance(Layer layer, Board board, int x, int y, int z, bool flip, bool beforeAdding) { ObjectInstance instance = new ObjectInstance(this, layer, board, x, y, z, false, false, false, false, null, null, null, null, null, null, null, flip, beforeAdding); ParseOffsets(instance, layer, board, x, y); return instance; }
public void ParseOffsets(ObjectInstance instance, Layer layer, Board board, int x, int y) { List<FootholdAnchor> anchors = new List<FootholdAnchor>(); bool ladder = l0 == "ladder"; if (footholdOffsets != null || footholdFullOffsets != null) { if (!fullFootholdInfo) { foreach (XNA.Point foothold in footholdOffsets) { FootholdAnchor anchor = new FootholdAnchor(board, x + foothold.X, y + foothold.Y, layer.LayerNumber, false); board.BoardItems.FHAnchors.Add(anchor); instance.BindItem(anchor, foothold); anchors.Add(anchor); } CreateFootholdsFromAnchorList(board, anchors); } else { foreach (List<XNA.Point> anchorList in footholdFullOffsets) { foreach (XNA.Point foothold in anchorList) { FootholdAnchor anchor = new FootholdAnchor(board, x + foothold.X, y + foothold.Y, layer.LayerNumber, false); board.BoardItems.FHAnchors.Add(anchor); instance.BindItem(anchor, foothold); anchors.Add(anchor); } CreateFootholdsFromAnchorList(board, anchors); anchors.Clear(); } } } if (chairOffsets != null) foreach (XNA.Point chairPos in chairOffsets) { Chair chair = new Chair(board, x + chairPos.X, y + chairPos.Y, false); board.BoardItems.Chairs.Add(chair); instance.BindItem(chair, chairPos); } /*foreach (XNA.Point rope in ropeOffsets) //second thought: what the f**k is this even good for? rope origins aren't multilined anyway, why add them as board items? { RopeLadderAnchor ropeAnchor = new RopeLadderAnchor(board, x + rope.X, y + rope.Y, layer.LayerNumber, ladder, false); board.BoardItems.RopeAnchors.Add(ropeAnchor); instance.BindItem(ropeAnchor, rope); }*/ }