From 6dd4729091eb9fa367d8737ecb9eb7e228d26789 Mon Sep 17 00:00:00 2001
From: dymanoid <9433345+dymanoid@users.noreply.github.com>
Date: Sun, 29 Jul 2018 01:22:56 +0200
Subject: [PATCH 1/3] Fix issue caused sliders in mod's configuration to set
wrong positions
---
src/RealTime/UI/CitiesSliderItem.cs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/RealTime/UI/CitiesSliderItem.cs b/src/RealTime/UI/CitiesSliderItem.cs
index 6de687aa..09254ef2 100644
--- a/src/RealTime/UI/CitiesSliderItem.cs
+++ b/src/RealTime/UI/CitiesSliderItem.cs
@@ -69,6 +69,8 @@ public CitiesSliderItem(
valueLabel.name = id + LabelName;
UpdateValueLabel(Value);
}
+
+ Refresh();
}
/// Translates this view item using the specified localization provider.
From f1dbe95317717cae14fdf61b747f56d998293b68 Mon Sep 17 00:00:00 2001
From: dymanoid <9433345+dymanoid@users.noreply.github.com>
Date: Sun, 29 Jul 2018 01:26:02 +0200
Subject: [PATCH 2/3] Decouple UI view items from a direct data object
reference
---
src/RealTime/UI/CitiesCheckBoxItem.cs | 7 ++++---
src/RealTime/UI/CitiesComboBoxItem.cs | 6 +++---
src/RealTime/UI/CitiesSliderItem.cs | 6 +++---
src/RealTime/UI/CitiesViewItem.cs | 12 ++++++------
src/RealTime/UI/CitiesViewItemFactory.cs | 18 +++++++++---------
src/RealTime/UI/IViewItemFactory.cs | 12 ++++++------
6 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/src/RealTime/UI/CitiesCheckBoxItem.cs b/src/RealTime/UI/CitiesCheckBoxItem.cs
index 55a22270..2197a5a6 100644
--- a/src/RealTime/UI/CitiesCheckBoxItem.cs
+++ b/src/RealTime/UI/CitiesCheckBoxItem.cs
@@ -4,6 +4,7 @@
namespace RealTime.UI
{
+ using System;
using System.Reflection;
using ColossalFramework.UI;
using ICities;
@@ -18,13 +19,13 @@ internal sealed class CitiesCheckBoxItem : CitiesViewItem
///
/// The property description that specifies the target property where to store the value.
///
- /// The configuration storage object for the value.
+ /// A method that provides the configuration storage object for the value.
/// Thrown when any argument is null.
///
/// thrown when the is an empty string.
///
- public CitiesCheckBoxItem(UIHelperBase uiHelper, string id, PropertyInfo property, object config)
- : base(uiHelper, id, property, config)
+ public CitiesCheckBoxItem(UIHelperBase uiHelper, string id, PropertyInfo property, Func