mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 12:03:04 +00:00
use box style for scroll view in options
This commit is contained in:
parent
c17559b80b
commit
f28aeeb82a
2 changed files with 11 additions and 1 deletions
|
@ -234,6 +234,12 @@ namespace SanAndreasUnity.UI {
|
|||
}
|
||||
|
||||
|
||||
protected override void OnWindowStart()
|
||||
{
|
||||
base.OnWindowStart();
|
||||
m_scrollViewStyle = GUI.skin.box;
|
||||
}
|
||||
|
||||
protected override void OnWindowGUIBeforeContent ()
|
||||
{
|
||||
s_categories = s_registeredInputs.Select (i => i.category).Distinct ().ToArray ();
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace SanAndreasUnity.UI {
|
|||
|
||||
public bool useScrollView = false;
|
||||
protected Vector2 scrollPos = Vector2.zero;
|
||||
protected GUIStyle m_scrollViewStyle = null;
|
||||
|
||||
protected bool isDraggable = true;
|
||||
public bool IsDraggable { get { return this.isDraggable; } }
|
||||
|
@ -130,6 +131,9 @@ namespace SanAndreasUnity.UI {
|
|||
|
||||
void OnGUI() {
|
||||
|
||||
if (null == m_scrollViewStyle)
|
||||
m_scrollViewStyle = GUI.skin.scrollView;
|
||||
|
||||
if (!m_hasStarted) {
|
||||
m_hasStarted = true;
|
||||
this.WindowStart ();
|
||||
|
@ -196,7 +200,7 @@ namespace SanAndreasUnity.UI {
|
|||
this.OnWindowGUIBeforeContent ();
|
||||
|
||||
if (this.useScrollView)
|
||||
this.scrollPos = GUILayout.BeginScrollView (this.scrollPos);
|
||||
this.scrollPos = GUILayout.BeginScrollView (this.scrollPos, m_scrollViewStyle);
|
||||
|
||||
this.OnWindowGUI ();
|
||||
|
||||
|
|
Loading…
Reference in a new issue