protected void update_scroll_offset() { int target_y = 16 * Scroll; if (!ManualScroll) { if (Math.Abs(Offset.Y - target_y) <= 16 / 4) { Offset.Y = target_y; } if (Math.Abs(Offset.Y - target_y) <= 16) { Offset.Y = Additional_Math.int_closer((int)Offset.Y, target_y, 16 / 4); } else { Offset.Y = ((int)(Offset.Y + target_y)) / 2; } } if (Offset.Y != target_y && Scrollbar != null) { if (Offset.Y > target_y) { Scrollbar.moving_up(); } else { Scrollbar.moving_down(); } } }
protected void update_scroll_offset() { // come up with a better name for this method //Debug int target_y = this.RowSize * Scroll; if (Math.Abs(Offset.Y - target_y) <= this.RowSize / 4) { Offset.Y = target_y; } if (Math.Abs(Offset.Y - target_y) <= this.RowSize) { Offset.Y = Additional_Math.int_closer((int)Offset.Y, target_y, this.RowSize / 4); } else { Offset.Y = ((int)(Offset.Y + target_y)) / 2; } if (Offset.Y != target_y && Scrollbar != null) { if (Offset.Y > target_y) { Scrollbar.moving_up(); } else { Scrollbar.moving_down(); } } }
protected override void UpdateMenu(bool active) { active &= DataDisplayed; Message.update(); if (Background != null) { Background.update(); } if (Battler != null) { Battler.update(); } if (active) { // Slide offscreen if (Confirming || ChangingSprite) { if (BattlerOffset.X >= this.OffscreenOffset) { if (Confirming) { OnConfirmed(new EventArgs()); } else { RefreshBattler(); } } else { BattlerOffset.X = Additional_Math.int_closer( (int)BattlerOffset.X, this.OffscreenOffset, 12); } } // Slide onscreen else { BattlerOffset.X = Additional_Math.int_closer( (int)BattlerOffset.X, 0, 12); } } active &= !Confirming; int index = Window.index; base.UpdateMenu(active); if (index != Window.index) { ChangeBattler(); } }
protected override void update_ui(bool input) { base.update_ui(input); if (!ManualScroll) { int target_y = 16 * Scroll; if (Math.Abs(ScrollOffset.Y - target_y) <= 4) { ScrollOffset.Y = target_y; } if (Math.Abs(ScrollOffset.Y - target_y) <= 16) { ScrollOffset.Y = Additional_Math.int_closer((int)ScrollOffset.Y, target_y, 4); } else { ScrollOffset.Y = ((int)(ScrollOffset.Y + target_y)) / 2; } } }