public ToggleAlternateMusic(EditroidUndoRedoQueue q, Level level, int screenIndex, bool state) : base(q, level) { this.newState = state; this.oldState = Level.AlternateMusicRooms.Contians((byte)screenIndex); this.screenIndex = screenIndex; }
public ModifyObject(EditroidUndoRedoQueue q, Screen screen, ObjectInstance obj, int newValue, ObjectModification change) : base(q, screen, obj) { this.change = change; this.newValue = newValue; oldValue = GetValue(); }
public AddTileToStructure(EditroidUndoRedoQueue q, Level level, int structIndex, int x, int y, byte tile) : base(q, level, structIndex) { this.x = x; this.y = y; this.tile = tile; initialState = GetStruct().Data.CopyData(); }
public ModifyObject(EditroidUndoRedoQueue q, Screen screen, ObjectInstance obj, Point newLocation) : base(q, screen, obj) { this.change = ObjectModification.Location; // The ROM packs object locations into a single byte. this.newValue = 0xFF & ((newLocation.X & 0x0F) | (newLocation.Y << 4)); oldValue = GetValue(); }
public OverwritePasswordData(EditroidUndoRedoQueue q, byte[] data) : base(q) { newData = data; oldData = new byte[newData.Length]; Array.Copy(q.Rom.data, PasswordData.DataOffset, oldData, 0, oldData.Length); }
public SetPaletteColor(EditroidUndoRedoQueue q, Level level, PaletteType type, int palette, int index, int newValue) : base(q, level) { this.type = type; this.entryIndex = palette * 4 + index; this.newValue = (byte)(newValue & 0xFF); this.oldValue = Palette.GetEntry(entryIndex); }
public SetMapRoomDisplay(EditroidUndoRedoQueue q, Point location, bool?alternatePal, int?animationIndex) : base(q, location) { this.newPalValue = alternatePal; this.newAnimationValue = animationIndex; oldPalValue = q.Editor.MapView.GetAltPal(location.X, location.Y); oldAnimationValue = q.Editor.MapView.GetAnimation(location.X, location.Y); }
public EditItemProperty(EditroidUndoRedoQueue q, Point MapLocation, ItemScreenData screen, ItemData item, ItemProperty prop, int newValue) : base(q, MapLocation) { this.prop = prop; this.item = item; this.screen = screen; this.newValue = newValue; this.oldValue = GetValue(); }
public PasswordDataAction(EditroidUndoRedoQueue q, int dataIndex) : base(q) { this.dataIndex = dataIndex; PasswordDatum data = GetData(); oldX = newX = data.MapX; oldY = newY = data.MapY; oldValue = newValue = data.Item; }
public EditStructTile(EditroidUndoRedoQueue q, Level level, int structIndex, StructTileEdit[] edits) : base(q, level, structIndex) { this.edits = edits; for (int i = 0; i < edits.Length; i++) { var edit = edits[i]; edit.oldValue = GetStruct().Data[edit.x, edit.y]; edits[i] = edit; } }
public ModifyCombo(EditroidUndoRedoQueue q, Level level, int combo, int tile, int newValue) : base(q, level) { generationIndex++; generation = generationIndex; ComboChange change; change.index = (byte)(combo & 0xFF); change.tile = (byte)(tile & 0x03); change.newValue = (byte)(newValue & 0xFF); change.oldValue = Level.Combos[combo].GetByte(tile); changes.Add(change); }
public ChangeMapRoomLevel(EditroidUndoRedoQueue q, Point location, LevelIndex newValue) : base(q, location) { this.newValue = newValue; oldValue = q.Editor.MapView.GetLevel(location.X, location.Y); // Ensure that the screen index will be valid for the new level oldScreenIndex = Queue.Rom.GetScreenIndex(location.X, location.Y); newScreenIndex = Math.Min(oldScreenIndex, q.Rom.GetLevel(newValue).Screens.Count - 1); if (newValue == LevelIndex.None) { newScreenIndex = 0xFF; // ...FF indicates a blank room } }
public ChangeDoor(EditroidUndoRedoQueue q, Screen screen, DoorSide side, DoorType type) : base(q, screen) { this.side = side; this.newType = type; oldType = DoorType.Invalid; foreach (DoorInstance d in Screen.Doors) { if (d.Side == side) { oldType = d.Type; } } }
public ReorderObjects(EditroidUndoRedoQueue q, Screen screen, ObjectInstance obj, bool toFront) : base(q, screen, obj) { if (!(obj is StructInstance)) { throw new ArgumentException("Invalid screen item specified for object reorder.", "obj"); } this.toFront = toFront; oldIndex = Screen.GetIndex(obj); if (toFront) { newIndex = Screen.Structs.Count - 1; } else { newIndex = 0; } }
/// <summary> /// /// </summary> /// <param name="q"></param> /// <param name="l"></param> /// <param name="edit"></param> /// <param name="ppuMacroIndex"></param> /// <param name="newValue"></param> /// <param name="macroByteIndex">Applied only to edits to actual macro data.</param> public AdvancedPaletteEdit(EditroidUndoRedoQueue q, Level l, AdvancedPaletteEditType edit, int ppuMacroIndex, int newValue, int macroByteIndex) : base(q, l) { Edit newEdit; newEdit.editType = edit; newEdit.newValue = newValue; newEdit.ppuMacroIndex = ppuMacroIndex; newEdit.oldValue = GetCurrentValue(edit, ppuMacroIndex, macroByteIndex); newEdit.macroByteIndex = macroByteIndex; edits.Add(newEdit); if (edit != AdvancedPaletteEditType.DataOffset) { var pointer = Level.PalettePointers[ppuMacroIndex]; if (!pointer.IsLevelBank) { throw new InvalidOperationException("Attempted to modify ppu macro data, but the pointer to the data is invalid."); } } }
private AddOrRemoveObject(EditroidUndoRedoQueue q, Screen screen, ObjOperation operation, ObjectInstance data) : base(q, screen) { this.operation = operation; this.obj = data; }
public RemoveStructTile(EditroidUndoRedoQueue q, Level level, int structIndex, int x, int y) : base(q, level, structIndex, new StructTileEdit(x, y, Structure.EmptyTile)) { }
public EditStructTile(EditroidUndoRedoQueue q, Level level, int structIndex, StructTileEdit edit) : base(q, level, structIndex) { edit.oldValue = GetStruct().Data[edit.x, edit.y]; edits = new StructTileEdit[] { edit }; }
public ModifyObject(EditroidUndoRedoQueue q, Screen screen, ObjectInstance obj, bool newValue, ObjectModification change) : this(q, screen, obj, newValue ? -1 : 0, change) { }
public ChangeColorAttributeTable(EditroidUndoRedoQueue q, Screen screen, int newValue) : base(q, screen) { this.newValue = newValue; oldValue = Screen.ColorAttributeTable; }
public AdvancedPaletteEdit(EditroidUndoRedoQueue q, Level l, AdvancedPaletteEditType edit, int ppuMacroIndex, int newValue) : this(q, l, edit, ppuMacroIndex, newValue, -1) { }
public static AddOrRemoveObject RemoveObject(EditroidUndoRedoQueue q, Screen screen, ObjectInstance obj) { return(new AddOrRemoveObject(q, screen, ObjOperation.Remove, obj)); }
public SetScreenIndex(EditroidUndoRedoQueue q, Point mapLocation, int screenIndex) : base(q, mapLocation) { oldValue = Queue.Rom.GetScreenIndex(mapLocation.X, mapLocation.Y); newValue = screenIndex; }
public AddOrRemoveBridge(EditroidUndoRedoQueue q, Screen screen, bool willHaveBridge) : base(q, screen) { newValue = willHaveBridge; oldValue = Screen.HasBridge; }
public StructureAction(EditroidUndoRedoQueue q, Level level, int index) : base(q, level) { this.structIndex = index; }