mirror of
https://github.com/amevarashi/RJW-Sexperience.git
synced 2024-08-14 23:54:08 +00:00
Started reusing objects in SexStatusViewModel
This commit is contained in:
parent
4e44d42c4f
commit
5138e11cb2
5 changed files with 128 additions and 109 deletions
|
@ -3,33 +3,69 @@ using Verse;
|
|||
|
||||
namespace RJWSexperience.SexHistory.UI
|
||||
{
|
||||
public readonly struct BarInfo
|
||||
public class BarInfo
|
||||
{
|
||||
public readonly string label;
|
||||
public readonly float fillPercent;
|
||||
public readonly Texture2D fillTexture;
|
||||
public readonly TipSignal tooltip;
|
||||
public readonly string labelRight;
|
||||
public readonly Texture2D border;
|
||||
private string _label;
|
||||
private float _fillPercent;
|
||||
private string _labelRight;
|
||||
|
||||
public string Label
|
||||
{
|
||||
get => _label;
|
||||
set => _label = value.CapitalizeFirst();
|
||||
}
|
||||
public float FillPercent
|
||||
{
|
||||
get => _fillPercent;
|
||||
set => _fillPercent = Mathf.Clamp01(value);
|
||||
}
|
||||
public Texture2D FillTexture { get; set; }
|
||||
public TipSignal Tooltip { get; set; }
|
||||
public string LabelRight
|
||||
{
|
||||
get => _labelRight;
|
||||
set => _labelRight = value.CapitalizeFirst();
|
||||
}
|
||||
public Texture2D Border { get; set; }
|
||||
|
||||
public BarInfo()
|
||||
{
|
||||
_label = "";
|
||||
_fillPercent = 0f;
|
||||
FillTexture = Texture2D.grayTexture;
|
||||
Tooltip = default;
|
||||
_labelRight = "";
|
||||
Border = null;
|
||||
}
|
||||
|
||||
public BarInfo(Texture2D fillTexture)
|
||||
{
|
||||
_label = "";
|
||||
_fillPercent = 0f;
|
||||
FillTexture = fillTexture;
|
||||
Tooltip = default;
|
||||
_labelRight = "";
|
||||
Border = null;
|
||||
}
|
||||
|
||||
public BarInfo(string label, float fillPercent, Texture2D fillTexture, TipSignal tooltip, string labelRight = "", Texture2D border = null)
|
||||
{
|
||||
this.label = label.CapitalizeFirst();
|
||||
this.fillPercent = Mathf.Clamp01(fillPercent);
|
||||
this.fillTexture = fillTexture;
|
||||
this.tooltip = tooltip;
|
||||
this.labelRight = labelRight.CapitalizeFirst();
|
||||
this.border = border;
|
||||
_label = label.CapitalizeFirst();
|
||||
_fillPercent = Mathf.Clamp01(fillPercent);
|
||||
FillTexture = fillTexture;
|
||||
Tooltip = tooltip;
|
||||
_labelRight = labelRight.CapitalizeFirst();
|
||||
Border = border;
|
||||
}
|
||||
|
||||
public BarInfo(string label, float fillPercent, Texture2D fillTexture, string labelRight = "")
|
||||
{
|
||||
this.label = label.CapitalizeFirst();
|
||||
this.fillPercent = Mathf.Clamp01(fillPercent);
|
||||
this.fillTexture = fillTexture;
|
||||
this.tooltip = default;
|
||||
this.labelRight = labelRight.CapitalizeFirst();
|
||||
this.border = null;
|
||||
_label = label.CapitalizeFirst();
|
||||
_fillPercent = Mathf.Clamp01(fillPercent);
|
||||
FillTexture = fillTexture;
|
||||
Tooltip = default;
|
||||
_labelRight = labelRight.CapitalizeFirst();
|
||||
Border = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue