Skip to content

Commit

Permalink
remember show advanced
Browse files Browse the repository at this point in the history
kianzarrin committed Apr 17, 2022
1 parent 76fb5b2 commit d528dd9
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions NodeController/GUI/Panel/CollapsorButton.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
namespace NodeController.GUI {
using ColossalFramework;
using ColossalFramework.UI;
using KianCommons.UI;
using System.Collections;
using UnityEngine;

public class CollapsorButton : UIButton {
UIPanel targetPanel_;
private static SavedBool showAdvanced_ = new SavedBool("ShowAdvanced", Settings.FileName, false, true);
private UIPanel targetPanel_;

public override void Awake() {
base.Awake();
name = GetType().FullName;
@@ -32,18 +35,22 @@ public override void Awake() {

public void SetTarget(UIPanel panel) {
targetPanel_ = panel;
targetPanel_.Hide();
if (!showAdvanced_.value) {
targetPanel_.Hide();
}
}
public void Collapse() {
targetPanel_.Hide();
text = text.Replace("▲", "▼");
GetComponentInParent<UIPanelBase>().Refresh();
showAdvanced_.value = false;
}

public void Open() {
targetPanel_.Show();
text = text.Replace("▼", "▲");
GetComponentInParent<UIPanelBase>().Refresh();
showAdvanced_.value = true;
}

protected override void OnClick(UIMouseEventParameter p) {
2 changes: 1 addition & 1 deletion NodeController/NodeController.csproj
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
<Product>NodeController</Product>
<Copyright>Copyright © 2020</Copyright>
<Deterministic>false</Deterministic>
<AssemblyVersion>2.6.2.*</AssemblyVersion>
<AssemblyVersion>2.6.3.*</AssemblyVersion>
<FileAlignment>512</FileAlignment>
<LangVersion>latest</LangVersion>
<DebugType>full</DebugType>

0 comments on commit d528dd9

Please sign in to comment.