void UpdateStatus() { view.UpdateStatus(); Widget widget = widgets[view.statusIndex]; game.ResetArea(widget.X, widget.Y, widget.Width, widget.Height); RedrawWidget(widgets[view.statusIndex]); }
void UpdateStatus() { Widget widget = widgets[view.statusIndex]; int oldX = widget.X, oldWidth = widget.Width; int oldY = widget.Y, oldHeight = widget.Height; view.UpdateStatus(); // if old text is smaller than new // TODO: This needs to be better. widgets should keep track of their 'last area'. // and 'RedrawWidget' should also call ResetArea. Widgets should have a bool for if they obscure background or not. game.ResetArea(Math.Min(widget.X, oldX), Math.Min(widget.Y, oldY), Math.Max(widget.Width, oldWidth), Math.Max(widget.Height, oldHeight)); RedrawWidget(widgets[view.statusIndex]); }