public override bool TryCombine(EditroidAction newerAction) { ModifyObject a = newerAction as ModifyObject; if (a != null && a.change == this.change && CompareItemReference(a)) { newValue = a.newValue; return(true); } return(false); }
public override bool TryCombine(EditroidAction newerAction) { ReorderObjects a = newerAction as ReorderObjects; if (a != null && a.GetItem().Equals(GetItem())) { newIndex = a.newIndex; toFront = a.toFront; return(true); } return(false); }
public override bool TryCombine(EditroidAction newerAction) { EditItemProperty a = newerAction as EditItemProperty; if (a == null || a.prop != prop || a.AffectedMapLocation != AffectedMapLocation || a.item != item) { return(false); } this.newValue = a.newValue; return(true); }
public override bool TryCombine(EditroidAction newerAction) { SetScreenIndex a = newerAction as SetScreenIndex; if (a != null && a.AffectedMapLocation == AffectedMapLocation) { newValue = a.newValue; return(true); } return(false); }
public override bool TryCombine(EditroidAction newerAction) { ChangeColorAttributeTable cat = newerAction as ChangeColorAttributeTable; if (cat != null && cat.AffectedLevel == AffectedLevel && cat.AffectedScreenIndex == AffectedScreenIndex) { newValue = cat.newValue; return(true); } return(false); }
public override bool TryCombine(EditroidAction newerAction) { ChangeMapRoomLevel a = newerAction as ChangeMapRoomLevel; if (a != null && a.AffectedMapLocation == AffectedMapLocation) { newValue = a.newValue; newScreenIndex = a.newScreenIndex; return(true); } return(false); }
public override bool TryCombine(EditroidAction newerAction) { SetMapRoomDisplay a = newerAction as SetMapRoomDisplay; if (a != null && a.AffectedMapLocation == AffectedMapLocation) { newPalValue = a.newPalValue ?? newPalValue; newAnimationValue = a.newAnimationValue ?? newAnimationValue; return(true); } return(false); }
public override bool TryCombine(EditroidAction newerAction) { PasswordDataAction a = newerAction as PasswordDataAction; if (a == null || a.dataIndex != dataIndex) { return(false); } newX = a.newX; newY = a.newY; newValue = a.newValue; return(true); }
public override bool TryCombine(EditroidAction newerAction) { ChangeDoor a = newerAction as ChangeDoor; if (a != null) { if (a.AffectedLevel == AffectedLevel && a.AffectedScreenIndex == AffectedScreenIndex && a.side == side) { this.newType = a.newType; return(true); } } return(false); }
public override bool TryCombine(EditroidAction newerAction) { ModifyCombo action = newerAction as ModifyCombo; if (action != null && action.AffectedLevel == AffectedLevel && action.generation == generation) { foreach (ComboChange c in action.changes) { if (c.newValue != c.oldValue) { changes.Add(c); } } return(true); } return(false); }
internal void NotifyActionOccurred(EditroidAction a) { PasswordDataAction action = a as PasswordDataAction; OverwritePasswordData ow = a as OverwritePasswordData; ////SetItemTilePosition t = a as SetItemTilePosition; ////SetItemRowPosition rowAction = a as SetItemRowPosition; if (action != null) { foreach (WindowlessControl c in Controls) { PasswordEntryControl pc = c as PasswordEntryControl; if (pc != null) { if (pc.Index == action.DataIndex) { pc.UpdateBounds(); } } } } else if (ow != null) { SuspendPaint(); foreach (WindowlessControl c in Controls) { PasswordEntryControl pc = c as PasswordEntryControl; if (pc != null) { pc.UpdateBounds(); } } ResumePaint(); ////} else if (t != null && t.UpdatesPassword) { //// ((PasswordEntryControl)Controls[t.PasswordDataIndex]).UpdateBounds(); ////} else if (rowAction != null) { //// rowAction.ForEachPasswordEntry(delegate(int index) { //// PasswordEntryControl c = Controls[index] as PasswordEntryControl; //// if (c != null) c.UpdateBounds(); //// }); } }
public override bool TryCombine(EditroidAction newerAction) { StructureAction a = newerAction as StructureAction; if (a == null || a.AffectedLevel != AffectedLevel || a.structIndex != structIndex) { return(false); } if (chainedAction == null) { chainedAction = a; return(true); } else { return(chainedAction.TryCombine(newerAction)); } }
public static void PerformAction(EditroidAction a) { mainForm.PerformAction(a); }
internal void NotifyAction(EditroidAction a) { const int normalPaletteMacroIndex = 0; const int altPaletteMacroIndex = 5; var advancedPalAction = a as AdvancedPaletteEdit; if (advancedPalAction != null) { if (advancedPalAction.Level == this.levelData) { bool affectsNormalPals = false; bool affectsAltPal = false; for (int i = 0; i < advancedPalAction.Edits.Count; i++) { int palIndex = advancedPalAction.Edits[i].ppuMacroIndex; if (palIndex == normalPaletteMacroIndex) { affectsNormalPals = true; } if (palIndex == altPaletteMacroIndex) { affectsAltPal = true; } } if (affectsNormalPals) { spritePal.RedrawAll(); bgPal.RedrawAll(); } if (affectsAltPal) { bgPal2.RedrawAll(); spritePal2.RedrawAll(); } } } var palAction = a as SetPaletteColor; if (palAction == null) { return; } if (palAction.AffectedLevel != levelData.Index) { return; } switch (palAction.Type) { case PaletteType.Background: bgPal.RedrawColor(palAction.PaletteIndex, palAction.EntryIndex); break; case PaletteType.AltBackground: bgPal2.RedrawColor(palAction.PaletteIndex, palAction.EntryIndex); break; case PaletteType.Sprite: spritePal.RedrawColor(palAction.PaletteIndex, palAction.EntryIndex); break; case PaletteType.AltSprite: spritePal2.RedrawColor(palAction.PaletteIndex, palAction.EntryIndex); break; case PaletteType.ZeroEntry: spritePal2.RedrawColor(0, 0); spritePal2.RedrawColor(1, 0); spritePal2.RedrawColor(2, 0); spritePal2.RedrawColor(3, 0); spritePal.RedrawColor(0, 0); spritePal.RedrawColor(1, 0); spritePal.RedrawColor(2, 0); spritePal.RedrawColor(3, 0); bgPal.RedrawColor(0, 0); bgPal.RedrawColor(1, 0); bgPal.RedrawColor(2, 0); bgPal.RedrawColor(3, 0); bgPal2.RedrawColor(0, 0); bgPal2.RedrawColor(1, 0); bgPal2.RedrawColor(2, 0); bgPal2.RedrawColor(3, 0); break; } }
internal void NotifyActionOccurred(EditroidAction a) { itemDisplay.NotifyActionOccurred(a); passwordDisplay.NotifyActionOccurred(a); }