<commit_before>﻿using System.Collections.Generic;
using System.Drawing;
using MonoHaven.Game;
using MonoHaven.UI.Widgets;

namespace MonoHaven.UI.Remote
{
	public class ServerMeter : ServerWidget
	{
		public static ServerWidget Create(ushort id, ServerWidget parent, object[] args)
		{
			var metrics = new List<Metric>();

			var resName = (string)args[0];
			for (int i = 1; i < args.Length; i += 2)
				metrics.Add(new Metric((Color)args[i], (int)args[i + 1]));
			
			var widget = new Meter(parent.Widget);
			widget.Background = App.Resources.GetImage(resName);
			widget.SetMetrics(metrics);
			return new ServerMeter(id, parent, widget);
		}

		private readonly Meter widget;

		public ServerMeter(ushort id, ServerWidget parent, Meter widget)
			: base(id, parent, widget)
		{
			this.widget = widget;
		}

		public override void ReceiveMessage(string message, object[] args)
		{
			if (message == "set")
			{
				var metrics = new List<Metric>();
				for (int i = 0; i < args.Length; i += 2)
					metrics.Add(new Metric((Color)args[i], (int)args[i + 1]));
				widget.SetMetrics(metrics);
			}
			else
				base.ReceiveMessage(message, args);
		}
	}
}<commit_msg>Set tooltips on server meters<commit_after>﻿using System.Collections.Generic;
using System.Drawing;
using MonoHaven.Game;
using MonoHaven.UI.Widgets;

namespace MonoHaven.UI.Remote
{
	public class ServerMeter : ServerWidget
	{
		public static ServerWidget Create(ushort id, ServerWidget parent, object[] args)
		{
			var metrics = new List<Metric>();

			var resName = (string)args[0];
			for (int i = 1; i < args.Length; i += 2)
				metrics.Add(new Metric((Color)args[i], (int)args[i + 1]));
			
			var widget = new Meter(parent.Widget);
			widget.Background = App.Resources.GetImage(resName);
			widget.SetMetrics(metrics);
			return new ServerMeter(id, parent, widget);
		}

		private readonly Meter widget;

		public ServerMeter(ushort id, ServerWidget parent, Meter widget)
			: base(id, parent, widget)
		{
			this.widget = widget;
		}

		public override void ReceiveMessage(string message, object[] args)
		{
			if (message == "set")
			{
				var metrics = new List<Metric>();
				for (int i = 0; i < args.Length; i += 2)
					metrics.Add(new Metric((Color)args[i], (int)args[i + 1]));
				widget.SetMetrics(metrics);
			}
			else if (message == "tt")
			{
				var text = (string)args[0];
				widget.Tooltip = new Tooltip(text);
			}
			else
				base.ReceiveMessage(message, args);
		}
	}
}
{'fraction_non_alphanumeric': 0.13498175922172678, 'fraction_numerical': 0.006080259424402107, 'mean_word_length': 3.692015209125475, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7576615', 'n_tokens_mistral': 957, 'n_tokens_neox': 812, 'n_words': 214}