feat(battle-engine): full Unity/VFX/god-object shims + expanded copy closure (2570 files)
Authored Unity primitive/object-model shim, VFX layer (control-flow-preserving, InstantVfx never invokes its action -- headless suppression), god-object stubs (GameMgr/EffectMgr/UIManager with faithfully-extracted nested enums), View/UI/Touch tree, LitJson+BetterList+Tuple copied, third-party stubs. Discovered Roslyn header-error masking: fixing class-header type errors unmasks body references, so the true copy closure is ~2570 files (was 782 under masking). Errors: masked-25720 -> 268; our shim files compile clean. Remaining: ~50 residual shim/external types, 24 NGUI UI-base overrides, static-type fixes, plus likely 1-2 more unmask waves.
This commit is contained in:
121
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemButton.cs
Normal file
121
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemButton.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Dialog.Setting;
|
||||
|
||||
public class ItemButton : Item
|
||||
{
|
||||
[SerializeField]
|
||||
private UISprite _sprite;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _button;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _label;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _spriteOnButton;
|
||||
|
||||
[SerializeField]
|
||||
private BoxCollider _collider;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _separatorLineObj;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _subLabel;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_label.text = string.Empty;
|
||||
_separatorLineObj.SetActive(value: false);
|
||||
}
|
||||
|
||||
public void SetSpritePos(Vector3 localPos)
|
||||
{
|
||||
_sprite.transform.localPosition = localPos;
|
||||
}
|
||||
|
||||
public void SetLabelPos(Vector3 localPos)
|
||||
{
|
||||
_label.transform.localPosition = localPos;
|
||||
}
|
||||
|
||||
public void SetSubLabelPos(Vector3 localPos)
|
||||
{
|
||||
_subLabel.transform.localPosition = localPos;
|
||||
}
|
||||
|
||||
public void SetValue(string text)
|
||||
{
|
||||
_label.text = text;
|
||||
}
|
||||
|
||||
public void SetSubLabelText(string text)
|
||||
{
|
||||
_subLabel.text = text;
|
||||
}
|
||||
|
||||
public string GetValue()
|
||||
{
|
||||
return _label.text;
|
||||
}
|
||||
|
||||
public void SetSpriteName(string spriteName, bool isMakePixelPerfect, bool isCollisionResize)
|
||||
{
|
||||
_sprite.spriteName = spriteName;
|
||||
_button.normalSprite = spriteName;
|
||||
if (isMakePixelPerfect)
|
||||
{
|
||||
_sprite.MakePixelPerfect();
|
||||
}
|
||||
if (isCollisionResize)
|
||||
{
|
||||
_collider.size = new Vector3(_sprite.width, _sprite.height);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetSpriteNameOnPress(string spriteName)
|
||||
{
|
||||
_button.pressedSprite = spriteName;
|
||||
}
|
||||
|
||||
public void SetSpriteOnButtonName(string spriteName, bool isMakePixelPerfect)
|
||||
{
|
||||
_spriteOnButton.spriteName = spriteName;
|
||||
if (isMakePixelPerfect)
|
||||
{
|
||||
_spriteOnButton.MakePixelPerfect();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetSpriteOnButtonPos(Vector3 localPos)
|
||||
{
|
||||
_spriteOnButton.transform.localPosition = localPos;
|
||||
}
|
||||
|
||||
public void SetActive_SpriteOnButton(bool isActive)
|
||||
{
|
||||
if (_spriteOnButton.gameObject.activeSelf != isActive)
|
||||
{
|
||||
_spriteOnButton.gameObject.SetActive(isActive);
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddChangeCallback(EventDelegate.Callback callback)
|
||||
{
|
||||
EventDelegate.Add(_button.onClick, callback);
|
||||
}
|
||||
|
||||
public override void SetActive_SeparatorLine(bool isActive)
|
||||
{
|
||||
_separatorLineObj.SetActive(isActive);
|
||||
}
|
||||
|
||||
public void SetToGrey(bool isGrey)
|
||||
{
|
||||
UIManager.SetObjectToGrey(base.gameObject, isGrey);
|
||||
UIManager.SetObjectToGrey(_separatorLineObj, b: false);
|
||||
_button.enabled = !isGrey;
|
||||
}
|
||||
}
|
||||
52
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemGrid.cs
Normal file
52
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemGrid.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Dialog.Setting;
|
||||
|
||||
public class ItemGrid : Item
|
||||
{
|
||||
[SerializeField]
|
||||
private UIGrid _grid;
|
||||
|
||||
public UIGrid GetUIGrid()
|
||||
{
|
||||
return _grid;
|
||||
}
|
||||
|
||||
public void SetArangement(UIGrid.Arrangement arrangement)
|
||||
{
|
||||
_grid.arrangement = arrangement;
|
||||
}
|
||||
|
||||
public UIGrid.Arrangement GetArrangement()
|
||||
{
|
||||
return _grid.arrangement;
|
||||
}
|
||||
|
||||
public void SetCellWidth(float width)
|
||||
{
|
||||
_grid.cellWidth = width;
|
||||
}
|
||||
|
||||
public float GetCellWidth()
|
||||
{
|
||||
return _grid.cellWidth;
|
||||
}
|
||||
|
||||
public void SetCellHeight(float height)
|
||||
{
|
||||
_grid.cellHeight = height;
|
||||
}
|
||||
|
||||
public float GetCellHeight()
|
||||
{
|
||||
return _grid.cellHeight;
|
||||
}
|
||||
|
||||
public override void AddChangeCallback(EventDelegate.Callback callback)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SetActive_SeparatorLine(bool isActive)
|
||||
{
|
||||
}
|
||||
}
|
||||
40
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemLabel.cs
Normal file
40
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemLabel.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Dialog.Setting;
|
||||
|
||||
public class ItemLabel : Item
|
||||
{
|
||||
[SerializeField]
|
||||
private SettingBase _parant;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _label;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _separatorLineObj;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_label.text = string.Empty;
|
||||
_separatorLineObj.SetActive(value: false);
|
||||
}
|
||||
|
||||
public void SetValue(string text)
|
||||
{
|
||||
_label.text = text;
|
||||
}
|
||||
|
||||
public string GetValue()
|
||||
{
|
||||
return _label.text;
|
||||
}
|
||||
|
||||
public override void AddChangeCallback(EventDelegate.Callback callback)
|
||||
{
|
||||
}
|
||||
|
||||
public override void SetActive_SeparatorLine(bool isActive)
|
||||
{
|
||||
_separatorLineObj.SetActive(isActive);
|
||||
}
|
||||
}
|
||||
305
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemSelect.cs
Normal file
305
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemSelect.cs
Normal file
@@ -0,0 +1,305 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Dialog.Setting;
|
||||
|
||||
public class ItemSelect : Item
|
||||
{
|
||||
[SerializeField]
|
||||
private UILabel _title;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _state;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _separatorLineObj;
|
||||
|
||||
[SerializeField]
|
||||
private UIButton _button;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _list;
|
||||
|
||||
[SerializeField]
|
||||
private UITable _table;
|
||||
|
||||
[SerializeField]
|
||||
private BoxCollider _listCollider;
|
||||
|
||||
private EventDelegate.Callback _onClick;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _resolutionItem;
|
||||
|
||||
[SerializeField]
|
||||
private UIPanel _panel;
|
||||
|
||||
private string _currentValue;
|
||||
|
||||
private const int BOTTOM_PADDING = -10;
|
||||
|
||||
private const int NORMAL_ITEM_SIZE = 188;
|
||||
|
||||
private Color _originalColor;
|
||||
|
||||
private const int PANEL_DEPTH_CLOSE = 30;
|
||||
|
||||
private const int PANEL_DEPTH_OPEN = 50;
|
||||
|
||||
private UIScrollView _parentScrollView;
|
||||
|
||||
private List<string> _possibleValues;
|
||||
|
||||
private List<GameObject> _items;
|
||||
|
||||
private const int DIRECTION_UP_TABLE_POSITION = 14;
|
||||
|
||||
private const int DIRECTION_UP_LIST_POSITION = 12;
|
||||
|
||||
public bool _isOpenDirectionUp;
|
||||
|
||||
public List<string> PossibleValues => _possibleValues;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_button.onClick.Add(new EventDelegate(delegate
|
||||
{
|
||||
if (_list.activeSelf)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
|
||||
}
|
||||
SetListVisible(!_list.activeSelf);
|
||||
}));
|
||||
UIEventListener.Get(_listCollider.gameObject).onPress = delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL);
|
||||
SetListVisible(b: false);
|
||||
};
|
||||
}
|
||||
|
||||
public void SetPossibleResolutionValues(List<string> possibleValues, bool resizeListSprite)
|
||||
{
|
||||
for (int i = 0; i < possibleValues.Count; i++)
|
||||
{
|
||||
GameObject o = NGUITools.AddChild(_table.gameObject, _resolutionItem);
|
||||
string str = possibleValues[i];
|
||||
string[] array = str.Split('×');
|
||||
o.transform.Find("width").gameObject.GetComponent<UILabel>().text = array[0];
|
||||
o.transform.Find("height").gameObject.GetComponent<UILabel>().text = array[1];
|
||||
o.SetActive(value: true);
|
||||
if ((bool)_parentScrollView)
|
||||
{
|
||||
o.AddMissingComponent<UIDragScrollView>().scrollView = _parentScrollView;
|
||||
}
|
||||
if (resizeListSprite && i == possibleValues.Count - 1)
|
||||
{
|
||||
UISprite component = _list.GetComponent<UISprite>();
|
||||
component.bottomAnchor.target = o.transform;
|
||||
component.bottomAnchor.relative = 0f;
|
||||
component.bottomAnchor.absolute = -10;
|
||||
}
|
||||
_originalColor = o.GetComponentInChildren<UISprite>().color;
|
||||
UIEventListener.Get(o).onHover = delegate(GameObject g, bool b)
|
||||
{
|
||||
o.GetComponentInChildren<UISprite>().enabled = b;
|
||||
};
|
||||
UIEventListener.Get(o).onClick = delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
|
||||
o.GetComponentInChildren<UISprite>().enabled = false;
|
||||
SetListVisible(b: false);
|
||||
SetResolutionValue(str);
|
||||
if (_onClick != null)
|
||||
{
|
||||
_onClick();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public void SetPossibleIdValues(List<string> possibleValues, bool resizeListSprite)
|
||||
{
|
||||
SetPossibleValues(possibleValues, resizeListSprite, (string s) => Data.SystemText.Get(s));
|
||||
}
|
||||
|
||||
public void SetPossibleValues(List<string> possibleValues, bool resizeListSprite, Func<string, string> textChange = null)
|
||||
{
|
||||
if (_possibleValues != null)
|
||||
{
|
||||
_possibleValues.Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
_possibleValues = new List<string>();
|
||||
}
|
||||
if (_items != null)
|
||||
{
|
||||
foreach (GameObject item in _items)
|
||||
{
|
||||
UnityEngine.Object.Destroy(item);
|
||||
}
|
||||
_items.Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
_items = new List<GameObject>();
|
||||
}
|
||||
List<string> list = new List<string>(possibleValues);
|
||||
if (_isOpenDirectionUp)
|
||||
{
|
||||
list.Reverse();
|
||||
}
|
||||
for (int i = 0; i < list.Count; i++)
|
||||
{
|
||||
if (string.IsNullOrEmpty(list[i]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
GameObject o = NGUITools.AddChild(_table.gameObject, _resolutionItem);
|
||||
_items.Add(o);
|
||||
string str = list[i];
|
||||
if (textChange != null)
|
||||
{
|
||||
str = textChange(str);
|
||||
}
|
||||
_possibleValues.Add(str);
|
||||
o.transform.Find("width").gameObject.SetActive(value: false);
|
||||
o.transform.Find("height").gameObject.SetActive(value: false);
|
||||
UILabel component = o.transform.Find("center").gameObject.GetComponent<UILabel>();
|
||||
component.width = 188;
|
||||
component.text = str;
|
||||
o.SetActive(value: true);
|
||||
if ((bool)_parentScrollView)
|
||||
{
|
||||
o.AddMissingComponent<UIDragScrollView>().scrollView = _parentScrollView;
|
||||
}
|
||||
_originalColor = o.GetComponentInChildren<UISprite>().color;
|
||||
UIEventListener.Get(o).onHover = delegate(GameObject g, bool b)
|
||||
{
|
||||
o.GetComponentInChildren<UISprite>().enabled = b;
|
||||
};
|
||||
UIEventListener.Get(o).onClick = delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
|
||||
o.GetComponentInChildren<UISprite>().enabled = false;
|
||||
SetListVisible(b: false);
|
||||
SetValue(str);
|
||||
if (_onClick != null)
|
||||
{
|
||||
_onClick();
|
||||
}
|
||||
};
|
||||
}
|
||||
if (_isOpenDirectionUp)
|
||||
{
|
||||
_possibleValues.Reverse();
|
||||
}
|
||||
if (resizeListSprite && _items.Count > 0)
|
||||
{
|
||||
GameObject gameObject = _items[_items.Count - 1];
|
||||
UISprite component2 = _list.GetComponent<UISprite>();
|
||||
if (_isOpenDirectionUp)
|
||||
{
|
||||
component2.topAnchor.target = gameObject.transform;
|
||||
component2.topAnchor.relative = 1f;
|
||||
component2.topAnchor.absolute = 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
component2.bottomAnchor.target = gameObject.transform;
|
||||
component2.bottomAnchor.relative = 0f;
|
||||
component2.bottomAnchor.absolute = -10;
|
||||
}
|
||||
}
|
||||
if (_isOpenDirectionUp)
|
||||
{
|
||||
_table.GetComponent<UIWidget>().pivot = UIWidget.Pivot.BottomLeft;
|
||||
Vector3 localPosition = _table.transform.localPosition;
|
||||
localPosition.y = 14f;
|
||||
_table.transform.localPosition = localPosition;
|
||||
_table.direction = UITable.Direction.Up;
|
||||
_list.GetComponent<UIWidget>().pivot = UIWidget.Pivot.Bottom;
|
||||
Vector3 localPosition2 = _list.transform.localPosition;
|
||||
localPosition2.y = 12f;
|
||||
_list.transform.localPosition = localPosition2;
|
||||
}
|
||||
_table.repositionNow = true;
|
||||
_list.GetComponent<UISprite>().ResetAndUpdateAnchors();
|
||||
}
|
||||
|
||||
private void SetListVisible(bool b)
|
||||
{
|
||||
_list.SetActive(b);
|
||||
_listCollider.enabled = b;
|
||||
_panel.depth = (b ? 50 : 30);
|
||||
UISprite component = _list.GetComponent<UISprite>();
|
||||
component.ResetAndUpdateAnchors();
|
||||
component.gameObject.SetActive(b);
|
||||
}
|
||||
|
||||
public void SetResolutionValue(string value)
|
||||
{
|
||||
_currentValue = value;
|
||||
string[] array = value.Split('×');
|
||||
_state.transform.Find("width").gameObject.GetComponent<UILabel>().text = array[0];
|
||||
_state.transform.Find("height").gameObject.GetComponent<UILabel>().text = array[1];
|
||||
}
|
||||
|
||||
public void SetValue(string value)
|
||||
{
|
||||
_currentValue = value;
|
||||
_state.transform.Find("width").gameObject.SetActive(value: false);
|
||||
_state.transform.Find("height").gameObject.SetActive(value: false);
|
||||
UILabel component = _state.transform.Find("center").gameObject.GetComponent<UILabel>();
|
||||
component.width = 188;
|
||||
component.text = value;
|
||||
}
|
||||
|
||||
public string GetValue()
|
||||
{
|
||||
return _currentValue;
|
||||
}
|
||||
|
||||
public void SetTitleLabel(string title)
|
||||
{
|
||||
_title.text = title;
|
||||
}
|
||||
|
||||
public override void AddChangeCallback(EventDelegate.Callback callback)
|
||||
{
|
||||
_onClick = (EventDelegate.Callback)Delegate.Combine(_onClick, callback);
|
||||
}
|
||||
|
||||
public override void SetActive_SeparatorLine(bool isActive)
|
||||
{
|
||||
_separatorLineObj.SetActive(isActive);
|
||||
}
|
||||
|
||||
public void SetTitleTextLocalPos(Vector3 localPos)
|
||||
{
|
||||
_title.transform.localPosition = localPos;
|
||||
}
|
||||
|
||||
public void SetToGrey(bool b)
|
||||
{
|
||||
UIManager.SetObjectToGrey(base.gameObject, b);
|
||||
UIManager.SetObjectToGrey(_separatorLineObj, b: false);
|
||||
UISprite[] componentsInChildren = _table.GetComponentsInChildren<UISprite>(includeInactive: true);
|
||||
for (int i = 0; i < componentsInChildren.Length; i++)
|
||||
{
|
||||
componentsInChildren[i].color = _originalColor;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetScrollView(UIScrollView view)
|
||||
{
|
||||
_listCollider.gameObject.AddMissingComponent<UIDragScrollView>().scrollView = view;
|
||||
_parentScrollView = view;
|
||||
_button.gameObject.AddMissingComponent<UIDragScrollView>().scrollView = view;
|
||||
}
|
||||
}
|
||||
116
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemSlider.cs
Normal file
116
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemSlider.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Dialog.Setting;
|
||||
|
||||
public class ItemSlider : Item
|
||||
{
|
||||
[SerializeField]
|
||||
private SettingBase m_parant;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_titleLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_valueLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UISlider m_slider;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite m_foregroundSprite;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _foregroundEdgeSprite;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite m_thumbSprite;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject m_separatorLineObj;
|
||||
|
||||
private const string FOREGROUND_ON_SPRITE_NAME = "gauge_blue_bottom";
|
||||
|
||||
private const string FOREGROUND_OFF_SPRITE_NAME = "gauge_gray_bottom";
|
||||
|
||||
private const string FOREGROUND_EDGE_ON_SPRITE_NAME = "gauge_blue_edge";
|
||||
|
||||
private const string FOREGROUND_EDGE_OFF_SPRITE_NAME = "gauge_gray_edge";
|
||||
|
||||
private const string THUMB_ON_SPRITE_NAME = "btn_gauge_on";
|
||||
|
||||
private const string THUMB_OFF_SPRITE_NAME = "btn_gauge_off";
|
||||
|
||||
private bool m_isPlaySe;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
m_titleLabel.text = string.Empty;
|
||||
m_valueLabel.text = string.Empty;
|
||||
m_separatorLineObj.SetActive(value: false);
|
||||
AddChangeCallback(delegate
|
||||
{
|
||||
string text = Mathf.CeilToInt(m_slider.value * 10f).ToString();
|
||||
bool flag = m_valueLabel.text != text;
|
||||
m_valueLabel.text = text;
|
||||
if (m_isPlaySe)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BAR_SLIDE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_isPlaySe = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void SetValue(float value)
|
||||
{
|
||||
m_slider.value = value;
|
||||
m_isPlaySe = false;
|
||||
}
|
||||
|
||||
public float GetValue()
|
||||
{
|
||||
return m_slider.value;
|
||||
}
|
||||
|
||||
public void SetTitleLabel(string title)
|
||||
{
|
||||
m_titleLabel.text = title;
|
||||
}
|
||||
|
||||
public void SetLooks(bool isOn)
|
||||
{
|
||||
m_foregroundSprite.spriteName = (isOn ? "gauge_blue_bottom" : "gauge_gray_bottom");
|
||||
_foregroundEdgeSprite.spriteName = (isOn ? "gauge_blue_edge" : "gauge_gray_edge");
|
||||
m_thumbSprite.spriteName = (isOn ? "btn_gauge_on" : "btn_gauge_off");
|
||||
}
|
||||
|
||||
public override void AddChangeCallback(EventDelegate.Callback callback)
|
||||
{
|
||||
EventDelegate.Add(m_slider.onChange, callback);
|
||||
}
|
||||
|
||||
public void AddDragFinishedCallback(UIProgressBar.OnDragFinished callback)
|
||||
{
|
||||
UISlider slider = m_slider;
|
||||
slider.onDragFinished = (UIProgressBar.OnDragFinished)Delegate.Combine(slider.onDragFinished, callback);
|
||||
}
|
||||
|
||||
public override void SetActive_SeparatorLine(bool isActive)
|
||||
{
|
||||
m_separatorLineObj.SetActive(isActive);
|
||||
}
|
||||
|
||||
public void SetScrollView(UIScrollView view)
|
||||
{
|
||||
UIDragScrollView componentInChildren = m_slider.gameObject.GetComponentInChildren<UIDragScrollView>();
|
||||
componentInChildren.enabled = true;
|
||||
componentInChildren._dragEnabled = false;
|
||||
componentInChildren.scrollView = view;
|
||||
}
|
||||
}
|
||||
232
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemToggle.cs
Normal file
232
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/ItemToggle.cs
Normal file
@@ -0,0 +1,232 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Dialog.Setting;
|
||||
|
||||
public class ItemToggle : Item
|
||||
{
|
||||
[SerializeField]
|
||||
private SettingBase m_parant;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_titleLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel _subTextLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UILabel m_stateLabel;
|
||||
|
||||
[SerializeField]
|
||||
private UIToggle m_toggle;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject m_separatorLineObj;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _spriteON;
|
||||
|
||||
[SerializeField]
|
||||
private UISprite _spriteOFF;
|
||||
|
||||
[SerializeField]
|
||||
private BoxCollider _collider;
|
||||
|
||||
private string m_OnText;
|
||||
|
||||
private string m_OffText;
|
||||
|
||||
private bool m_isPlaySe;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
m_titleLabel.text = string.Empty;
|
||||
if (m_stateLabel != null)
|
||||
{
|
||||
m_stateLabel.text = string.Empty;
|
||||
}
|
||||
if (m_separatorLineObj != null)
|
||||
{
|
||||
m_separatorLineObj.SetActive(value: false);
|
||||
}
|
||||
_collider = m_toggle.GetComponent<BoxCollider>();
|
||||
if (_subTextLabel != null)
|
||||
{
|
||||
_subTextLabel.gameObject.SetActive(value: false);
|
||||
_subTextLabel.text = string.Empty;
|
||||
}
|
||||
AddChangeCallback(delegate
|
||||
{
|
||||
UpdateStateLabel();
|
||||
if (m_isPlaySe)
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(m_toggle.value ? Se.TYPE.SYS_TOGGLE_ON : Se.TYPE.SYS_TOGGLE_OFF);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_isPlaySe = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void SetValue(bool value, bool isDisablePlayse = true)
|
||||
{
|
||||
m_toggle.value = value;
|
||||
if (isDisablePlayse)
|
||||
{
|
||||
m_isPlaySe = false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetValue()
|
||||
{
|
||||
return m_toggle.value;
|
||||
}
|
||||
|
||||
public void SetTitleLabel(string title)
|
||||
{
|
||||
m_titleLabel.text = title;
|
||||
}
|
||||
|
||||
public void SetSutTextLabel(string text)
|
||||
{
|
||||
_subTextLabel.gameObject.SetActive(value: true);
|
||||
_subTextLabel.text = text;
|
||||
}
|
||||
|
||||
public void SetStateText(string onText, string offText)
|
||||
{
|
||||
m_OnText = onText;
|
||||
m_OffText = offText;
|
||||
UpdateStateLabel();
|
||||
}
|
||||
|
||||
public void SetActive_StateText(bool isActive)
|
||||
{
|
||||
m_stateLabel.gameObject.SetActive(isActive);
|
||||
}
|
||||
|
||||
public void SetTitleTextLocalPos(Vector3 localPos)
|
||||
{
|
||||
m_titleLabel.transform.localPosition = localPos;
|
||||
}
|
||||
|
||||
public void SetStateTextLocalPos(Vector3 localPos)
|
||||
{
|
||||
m_stateLabel.transform.localPosition = localPos;
|
||||
}
|
||||
|
||||
public void SetToggleLocalPos(Vector3 localPos)
|
||||
{
|
||||
m_toggle.transform.localPosition = localPos;
|
||||
}
|
||||
|
||||
private void UpdateStateLabel()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(m_OnText) && !string.IsNullOrEmpty(m_OffText))
|
||||
{
|
||||
m_stateLabel.text = (m_toggle.value ? m_OnText : m_OffText);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetToggleLooks(bool isNormal)
|
||||
{
|
||||
UIManager.SetObjectToGrey(m_toggle.gameObject, !isNormal);
|
||||
bool value = GetValue();
|
||||
SetValue(!value, isDisablePlayse: false);
|
||||
SetValue(value, isDisablePlayse: false);
|
||||
_collider.enabled = isNormal;
|
||||
}
|
||||
|
||||
public void SetLabelLooks(bool isNormal)
|
||||
{
|
||||
UIManager.SetObjectToGrey(m_stateLabel.gameObject, !isNormal);
|
||||
UIManager.SetObjectToGrey(m_titleLabel.gameObject, !isNormal);
|
||||
}
|
||||
|
||||
public void SetSpriteONName(string spriteName, bool isMakePixelPerfect, bool isCollisionResize)
|
||||
{
|
||||
_spriteON.spriteName = spriteName;
|
||||
if (isMakePixelPerfect)
|
||||
{
|
||||
_spriteON.MakePixelPerfect();
|
||||
}
|
||||
if (isCollisionResize)
|
||||
{
|
||||
_collider.size = new Vector3(_spriteON.width, _spriteON.height);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetSpriteOFFName(string spriteName, bool isMakePixelPerfect, bool isCollisionResize)
|
||||
{
|
||||
_spriteOFF.spriteName = spriteName;
|
||||
if (isMakePixelPerfect)
|
||||
{
|
||||
_spriteOFF.MakePixelPerfect();
|
||||
}
|
||||
if (isCollisionResize)
|
||||
{
|
||||
_collider.size = new Vector3(_spriteOFF.width, _spriteOFF.height);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetButtonEnable(bool isEnable)
|
||||
{
|
||||
UIButton component = m_toggle.GetComponent<UIButton>();
|
||||
if (null != component && component.enabled != isEnable)
|
||||
{
|
||||
component.enabled = isEnable;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetValidator(UIToggle.Validate validator)
|
||||
{
|
||||
m_toggle.validator = validator;
|
||||
}
|
||||
|
||||
public override void AddChangeCallback(EventDelegate.Callback callback)
|
||||
{
|
||||
EventDelegate.Add(m_toggle.onChange, callback);
|
||||
}
|
||||
|
||||
public void ClearChangeCallback()
|
||||
{
|
||||
m_toggle.onChange.Clear();
|
||||
}
|
||||
|
||||
public void AddChangeCallback(EventDelegate callback)
|
||||
{
|
||||
m_toggle.onChange.Add(callback);
|
||||
}
|
||||
|
||||
public override void SetActive_SeparatorLine(bool isActive)
|
||||
{
|
||||
m_separatorLineObj.SetActive(isActive);
|
||||
}
|
||||
|
||||
public void SetScrollView(UIScrollView view)
|
||||
{
|
||||
_collider.gameObject.AddMissingComponent<UIDragScrollView>().scrollView = view;
|
||||
}
|
||||
|
||||
public void SetToggleEnable(bool isEnable)
|
||||
{
|
||||
if (!(m_toggle != null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_toggle.enabled = isEnable;
|
||||
if (isEnable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
TweenColor[] componentsInChildren = m_toggle.GetComponentsInChildren<TweenColor>();
|
||||
if (componentsInChildren != null)
|
||||
{
|
||||
TweenColor[] array = componentsInChildren;
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
array[i].enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
688
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/SettingBase.cs
Normal file
688
SVSim.BattleEngine/Engine/Wizard.Dialog.Setting/SettingBase.cs
Normal file
@@ -0,0 +1,688 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Wizard.Dialog.Setting;
|
||||
|
||||
public class SettingBase : MonoBehaviour
|
||||
{
|
||||
public enum Type
|
||||
{
|
||||
NORMAL,
|
||||
SCENARIO,
|
||||
VIDEOHOSTING_SETTING_RECORD,
|
||||
VIDEOHOSTING_SETTING_PUBLISH,
|
||||
VIDEOHOSTING_MENU_RECORD,
|
||||
VIDEOHOSTING_MENU_PUBLISH
|
||||
}
|
||||
|
||||
public enum ID
|
||||
{
|
||||
SOUND,
|
||||
BGM,
|
||||
SE,
|
||||
VOICE,
|
||||
MOVIE_SUBTITLES,
|
||||
BATTLE_EFFECT_DISPLAY,
|
||||
LEADER_ANIMATION_DISPLAY,
|
||||
PREDICTION_ICONS_DISPLAY,
|
||||
TURN_END_CONFIRM,
|
||||
TURN_END_WITHOUT_USING_HERO_SKILL_CONFIRM,
|
||||
EVOLVE_CONFIRM,
|
||||
FIXEDUSE_COST_INFO,
|
||||
OPPONENT_MESSAGE_DISPLAY,
|
||||
OPPONENT_SHOW_DEFAULT_SKIN,
|
||||
SHOW_FOIL_CARD_ANIMATION,
|
||||
SELECT_WSS,
|
||||
SELECT_IPV6,
|
||||
PURCHASE_ALERT,
|
||||
SCREEN_FIX,
|
||||
INVITATION_FRIEND_ROOM,
|
||||
INVITATION_IN_BATTLE,
|
||||
INVITATION_IN_OFFLINE,
|
||||
RECEIVED_FRIEND_APPLY,
|
||||
SHOW_PANEL_ALWAYS,
|
||||
SHOW_SIDE_LOG,
|
||||
SHOW_FUSION_CARD_PLAY_DIALOG,
|
||||
AUTO_MESSAGE,
|
||||
SIMPLE_STAGE,
|
||||
COLLABORATION_SOUND,
|
||||
USE_STAGE_SELECT,
|
||||
STAGE_SELECT,
|
||||
ENEMYNAME_DISPLAY,
|
||||
RECORD_MODE,
|
||||
RECORD_UPLOAD,
|
||||
RECORD_WATCH,
|
||||
RECORD_PAUSE,
|
||||
RECORD_RESUME,
|
||||
RECORD_STOP,
|
||||
RECORD_FACECAMERA,
|
||||
RECORD_MICROPHONE,
|
||||
RECORD_MICROPHONE_GAIN,
|
||||
RECORD_PAUSE_IN_MENU,
|
||||
RECORD_BUTTON_GRID,
|
||||
PUBLISH_MODE,
|
||||
PLAY_SOUND_IN_BG,
|
||||
FULLSCREEN,
|
||||
RESOLUTION,
|
||||
FPS,
|
||||
QRCode,
|
||||
MOUSE_CONTROL,
|
||||
MOUSE_SHORTCUT_PLAY,
|
||||
MOUSE_SHORTCUT_EVOLUTION,
|
||||
MOUSE_SHORTCUT_DETAIL,
|
||||
BATTLE_DETAIL_PANEL_SIZE,
|
||||
SHOW_DETAIL_LEFT_AND_RIGHT,
|
||||
KEYBOARD_CONTROL,
|
||||
KEYBOARD_SHORTCUT_EVOLUTION,
|
||||
KEYBOARD_SHORTCUT_SPACE,
|
||||
PLAY_BGM_ON_OTHER_BGM,
|
||||
BATTLE_PASS_SHOW_RESULT
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private GameObject m_scrollView;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject m_itemToggle;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject m_itemSlider;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject m_itemGrid;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject m_itemLabel;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject m_itemButton;
|
||||
|
||||
[SerializeField]
|
||||
private GameObject _itemSelect;
|
||||
|
||||
protected static readonly Vector3 CHILD_STATE_LABEL_POS = new Vector3(-297f, 0f, 0f);
|
||||
|
||||
private Dictionary<ID, Item> m_dicItems = new Dictionary<ID, Item>();
|
||||
|
||||
private Type m_type;
|
||||
|
||||
private const string VOICE_NAME = "vo_test_01";
|
||||
|
||||
protected DialogBase _dialogObject;
|
||||
|
||||
private static readonly Vector3 PUBLISHMODE_STATELABEL_POS = new Vector3(80f, 0f, 0f);
|
||||
|
||||
private static readonly Vector3 PUBLISHMODE_TOGGLE_POS = new Vector3(275f, 0f, 0f);
|
||||
|
||||
private static readonly Vector3 RECORDMODE_STATELABEL_POS = new Vector3(80f, 0f, 0f);
|
||||
|
||||
private static readonly Vector3 RECORDMODE_TOGGLE_POS = new Vector3(275f, 0f, 0f);
|
||||
|
||||
private static readonly Vector3 SPRITE_POS_RECORD_PLAYPAUSE = new Vector3(-93f, 0f, 0f);
|
||||
|
||||
private static readonly Vector3 SPRITE_POS_RECORD_STOP = new Vector3(-93f, 0f, 0f);
|
||||
|
||||
private static readonly Vector3 LABEL_POS_RECORD_PLAYPAUSE = new Vector3(20f, 0f, 0f);
|
||||
|
||||
private static readonly Vector3 LABEL_POS_RECORD_STOP = new Vector3(20f, 0f, 0f);
|
||||
|
||||
protected GameObject SingleTabRoot => m_scrollView;
|
||||
|
||||
public static DialogBase CreateDialog(Type type = Type.NORMAL)
|
||||
{
|
||||
SettingBase settingBase = null;
|
||||
settingBase = ((type != Type.NORMAL) ? Object.Instantiate(UIManager.GetInstance().SettingPrefab) : Object.Instantiate(UIManager.GetInstance().OptionSettingPrefab));
|
||||
settingBase.Create(type);
|
||||
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
|
||||
dialogBase.SetSize(DialogBase.Size.M);
|
||||
dialogBase.SetTitleLabel(Data.SystemText.Get("OtherTop_0003"));
|
||||
dialogBase.SetObj(settingBase.gameObject, settingBase.transform.localPosition);
|
||||
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
|
||||
settingBase.SettingDialogObject(dialogBase);
|
||||
return dialogBase;
|
||||
}
|
||||
|
||||
public void SettingDialogObject(DialogBase dialog)
|
||||
{
|
||||
_dialogObject = dialog;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().LoadVoice("vo_test_01");
|
||||
}
|
||||
|
||||
public virtual void Create()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Create(Type type)
|
||||
{
|
||||
m_type = type;
|
||||
Create();
|
||||
if (m_type != Type.NORMAL)
|
||||
{
|
||||
if (m_type == Type.SCENARIO)
|
||||
{
|
||||
CreateToggle_AutoMessage(isDispSeparatorLine: true);
|
||||
CreateToggle_MovieSubtitles(isDispSeparatorLine: true, m_scrollView.gameObject);
|
||||
CreateSoundItem(m_scrollView.gameObject);
|
||||
}
|
||||
else if (m_type == Type.VIDEOHOSTING_SETTING_RECORD)
|
||||
{
|
||||
CreateVideoHostingSettingRecord();
|
||||
}
|
||||
else if (m_type == Type.VIDEOHOSTING_SETTING_PUBLISH)
|
||||
{
|
||||
CreateVideoHostingSettingPublish();
|
||||
}
|
||||
else if (m_type == Type.VIDEOHOSTING_MENU_RECORD)
|
||||
{
|
||||
CreateVideoHostingMenuRecord();
|
||||
}
|
||||
else if (m_type == Type.VIDEOHOSTING_MENU_PUBLISH)
|
||||
{
|
||||
CreateVideoHostingMenuPublish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void ResetScroll()
|
||||
{
|
||||
m_scrollView.GetComponent<UIScrollView>().ResetPosition();
|
||||
}
|
||||
|
||||
protected virtual void OnDestroy()
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().UnloadVoice("vo_test_01");
|
||||
}
|
||||
|
||||
protected void CreateSoundItem(GameObject parent)
|
||||
{
|
||||
ItemToggle soundToggle = CreateToggle_Sound(isDispSeparatorLine: true, parent);
|
||||
ItemSlider bgmSlider = AddSlider_BGM(isDispSeparatorLine: false, parent);
|
||||
ItemSlider seSlider = AddSlider_SE(isDispSeparatorLine: false, parent);
|
||||
ItemSlider voiceSlider = AddSlider_Voice(isDispSeparatorLine: true, parent);
|
||||
soundToggle.AddChangeCallback(delegate
|
||||
{
|
||||
bool value = soundToggle.GetValue();
|
||||
bgmSlider.SetLooks(value);
|
||||
seSlider.SetLooks(value);
|
||||
voiceSlider.SetLooks(value);
|
||||
});
|
||||
}
|
||||
|
||||
public Item FindItem(ID id)
|
||||
{
|
||||
if (!m_dicItems.ContainsKey(id))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return m_dicItems[id];
|
||||
}
|
||||
|
||||
protected ItemToggle CreateToggle(ID id, bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
ItemToggle component = NGUITools.AddChild(parent, m_itemToggle).GetComponent<ItemToggle>();
|
||||
component.SetScrollView(m_scrollView.GetComponent<UIScrollView>());
|
||||
component.name = id.ToString();
|
||||
component.SetActive_SeparatorLine(isDispSeparatorLine);
|
||||
m_dicItems.Add(id, component);
|
||||
return component;
|
||||
}
|
||||
|
||||
protected ItemSlider CreateSlider(ID id, bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
ItemSlider component = NGUITools.AddChild(parent, m_itemSlider).GetComponent<ItemSlider>();
|
||||
component.SetScrollView(m_scrollView.GetComponent<UIScrollView>());
|
||||
component.name = id.ToString();
|
||||
component.SetActive_SeparatorLine(isDispSeparatorLine);
|
||||
m_dicItems.Add(id, component);
|
||||
return component;
|
||||
}
|
||||
|
||||
protected ItemGrid CreateGrid(ID id, bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
ItemGrid component = NGUITools.AddChild(parent, m_itemGrid).GetComponent<ItemGrid>();
|
||||
component.name = id.ToString();
|
||||
component.SetActive_SeparatorLine(isDispSeparatorLine);
|
||||
m_dicItems.Add(id, component);
|
||||
return component;
|
||||
}
|
||||
|
||||
protected ItemButton CreateButton(ID id, bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
ItemButton component = NGUITools.AddChild(parent, m_itemButton).GetComponent<ItemButton>();
|
||||
component.name = id.ToString();
|
||||
component.SetActive_SeparatorLine(isDispSeparatorLine);
|
||||
m_dicItems.Add(id, component);
|
||||
return component;
|
||||
}
|
||||
|
||||
private ItemLabel CreateLabel(ID id, bool isDispSeparatorLine)
|
||||
{
|
||||
ItemLabel component = NGUITools.AddChild(m_scrollView, m_itemLabel).GetComponent<ItemLabel>();
|
||||
component.name = id.ToString();
|
||||
component.SetActive_SeparatorLine(isDispSeparatorLine);
|
||||
m_dicItems.Add(id, component);
|
||||
return component;
|
||||
}
|
||||
|
||||
protected ItemSelect CreateSelect(ID id, bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
ItemSelect component = NGUITools.AddChild(parent, _itemSelect).GetComponent<ItemSelect>();
|
||||
component.SetScrollView(m_scrollView.GetComponent<UIScrollView>());
|
||||
component.name = id.ToString();
|
||||
component.SetActive_SeparatorLine(isDispSeparatorLine);
|
||||
m_dicItems.Add(id, component);
|
||||
return component;
|
||||
}
|
||||
|
||||
protected ItemToggle CreateToggle_ScreenFix(bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
ItemToggle item = CreateToggle(ID.SCREEN_FIX, isDispSeparatorLine, parent);
|
||||
item.SetTitleLabel(systemText.Get("OtherConfig_0011"));
|
||||
item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.DEVICE_ORIENTATION));
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.DEVICE_ORIENTATION, item.GetValue());
|
||||
UIManager.GetInstance().SetDeviceOrientation();
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
protected ItemToggle CreateToggle_MovieSubtitles(bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
ItemToggle item = CreateToggle(ID.MOVIE_SUBTITLES, isDispSeparatorLine, parent);
|
||||
item.SetTitleLabel(Data.SystemText.Get("OtherConfig_0063"));
|
||||
item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.MOVIE_SUBTITLES));
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.MOVIE_SUBTITLES, item.GetValue());
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private ItemToggle CreateToggle_Sound(bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
ItemToggle item = CreateToggle(ID.SOUND, isDispSeparatorLine, parent);
|
||||
item.SetTitleLabel(systemText.Get("OtherConfig_0017"));
|
||||
item.SetValue(!PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.SOUND_MUTE));
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
bool flag = !item.GetValue();
|
||||
PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.SOUND_MUTE, flag);
|
||||
GameMgr.GetIns().GetSoundMgr().AllMute(flag);
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private ItemSlider AddSlider_BGM(bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr();
|
||||
ItemSlider item = CreateSlider(ID.BGM, isDispSeparatorLine, parent);
|
||||
item.SetTitleLabel(systemText.Get("OtherConfig_0001"));
|
||||
item.SetValue(soundMgr.GetBgmVolume());
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
float value = item.GetValue();
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.BGM_VOLUME, value);
|
||||
soundMgr.SetBgmVolume(value);
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private ItemSlider AddSlider_SE(bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr();
|
||||
ItemSlider item = CreateSlider(ID.SE, isDispSeparatorLine, parent);
|
||||
item.SetTitleLabel(systemText.Get("OtherConfig_0002"));
|
||||
item.SetValue(soundMgr.GetSeVolume());
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
float value = item.GetValue();
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.SE_VOLUME, value);
|
||||
soundMgr.SetSeVolume(value);
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private ItemSlider AddSlider_Voice(bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
SoundMgr soundMgr = GameMgr.GetIns().GetSoundMgr();
|
||||
ItemSlider item = CreateSlider(ID.VOICE, isDispSeparatorLine, parent);
|
||||
item.SetTitleLabel(systemText.Get("OtherConfig_0003"));
|
||||
item.SetValue(soundMgr.GetVoiceVolume());
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
float value = item.GetValue();
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.VOICE_VOLUME, value);
|
||||
soundMgr.SetVoiceVolume(value);
|
||||
});
|
||||
item.AddDragFinishedCallback(delegate
|
||||
{
|
||||
soundMgr.PlayVoiceScenario("vo_test_01");
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private ItemToggle CreateToggle_AutoMessage(bool isDispSeparatorLine)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
ItemToggle item = CreateToggle(ID.AUTO_MESSAGE, isDispSeparatorLine, m_scrollView.gameObject);
|
||||
item.SetTitleLabel(systemText.Get("OtherConfig_0014"));
|
||||
item.SetValue(PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.AUTO_MESSAGE));
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
PlayerPrefsWrapper.SetBool(PlayerPrefsWrapper.AUTO_MESSAGE, item.GetValue());
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private void CreateVideoHostingSettingRecord()
|
||||
{
|
||||
}
|
||||
|
||||
private void CreateVideoHostingSettingPublish()
|
||||
{
|
||||
}
|
||||
|
||||
private void CreateVideoHostingMenuRecord()
|
||||
{
|
||||
}
|
||||
|
||||
private void CreateVideoHostingMenuPublish()
|
||||
{
|
||||
}
|
||||
|
||||
private void CreateSetting_Publish_NicoNico()
|
||||
{
|
||||
CreateToggle_PublishMode(isDispSeparatorLine: true);
|
||||
CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true);
|
||||
}
|
||||
|
||||
private void CreateSetting_Record_NicoNico()
|
||||
{
|
||||
CreateToggle_RecordMode(isDispSeparatorLine: true);
|
||||
CreateToggle_RecordFaceCamera(isDispSeparatorLine: true);
|
||||
CreateToggle_RecordMicrophone(isDispSeparatorLine: true);
|
||||
CreateToggle_RecordPauseInMenu(isDispSeparatorLine: true);
|
||||
CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true);
|
||||
}
|
||||
|
||||
private void CreateMenu_Record_NicoNico_iOS()
|
||||
{
|
||||
ItemGrid itemGrid = CreateGrid_RecordButton(isDispSeparatorLine: true);
|
||||
CreateButton_RecordPlayPause(isDispSeparatorLine: false, itemGrid.GetUIGrid().gameObject);
|
||||
CreateButton_RecordStop(isDispSeparatorLine: false, itemGrid.GetUIGrid().gameObject);
|
||||
CreateToggle_RecordPauseInMenu(isDispSeparatorLine: true);
|
||||
CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true);
|
||||
CreateSlider_RecordMicrophoneGain(isDispSeparatorLine: false);
|
||||
}
|
||||
|
||||
private void CreateSetting_Record_EveryPlay_iOS()
|
||||
{
|
||||
CreateToggle_RecordMode(isDispSeparatorLine: true);
|
||||
CreateToggle_RecordFaceCamera(isDispSeparatorLine: true);
|
||||
CreateToggle_RecordMicrophone(isDispSeparatorLine: true);
|
||||
CreateToggle_RecordPauseInMenu(isDispSeparatorLine: true);
|
||||
CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true);
|
||||
}
|
||||
|
||||
private void CreateSetting_Record_EveryPlay_Android()
|
||||
{
|
||||
CreateToggle_RecordMode(isDispSeparatorLine: true);
|
||||
CreateToggle_RecordPauseInMenu(isDispSeparatorLine: true);
|
||||
CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true);
|
||||
}
|
||||
|
||||
private void CreateMenu_Record_EveryPlay_iOS()
|
||||
{
|
||||
ItemGrid itemGrid = CreateGrid_RecordButton(isDispSeparatorLine: true);
|
||||
CreateButton_RecordPlayPause(isDispSeparatorLine: false, itemGrid.GetUIGrid().gameObject);
|
||||
CreateButton_RecordStop(isDispSeparatorLine: false, itemGrid.GetUIGrid().gameObject);
|
||||
CreateToggle_RecordPauseInMenu(isDispSeparatorLine: true);
|
||||
CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true);
|
||||
}
|
||||
|
||||
private void CreateMenu_Record_EveryPlay_Android()
|
||||
{
|
||||
ItemGrid itemGrid = CreateGrid_RecordButton(isDispSeparatorLine: true);
|
||||
CreateButton_RecordPlayPause(isDispSeparatorLine: false, itemGrid.GetUIGrid().gameObject);
|
||||
CreateButton_RecordStop(isDispSeparatorLine: false, itemGrid.GetUIGrid().gameObject);
|
||||
CreateToggle_RecordPauseInMenu(isDispSeparatorLine: true);
|
||||
CreateToggle_EnemyNameDisplay(isDispSeparatorLine: true);
|
||||
}
|
||||
|
||||
private ItemToggle CreateToggle_EnemyNameDisplay(bool isDispSeparatorLine)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
ItemToggle item = CreateToggle(ID.ENEMYNAME_DISPLAY, isDispSeparatorLine, SingleTabRoot);
|
||||
item.SetTitleLabel(systemText.Get("VideoHosting_0013"));
|
||||
item.SetTitleTextLocalPos(CHILD_STATE_LABEL_POS);
|
||||
item.SetButtonEnable(isEnable: false);
|
||||
item.SetValue(VideoHostingUtil.GetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.EnemyNameDisplay));
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
VideoHostingUtil.SetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.EnemyNameDisplay, item.GetValue());
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private ItemToggle CreateToggle_RecordMode(bool isDispSeparatorLine)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
ItemToggle item = CreateToggle(ID.RECORD_MODE, isDispSeparatorLine, SingleTabRoot);
|
||||
item.SetTitleLabel(systemText.Get("VideoHosting_0006"));
|
||||
item.SetStateText(systemText.Get("VideoHosting_0010"), systemText.Get("VideoHosting_0011"));
|
||||
item.SetActive_StateText(isActive: true);
|
||||
item.SetButtonEnable(isEnable: false);
|
||||
item.SetToggleLocalPos(RECORDMODE_TOGGLE_POS);
|
||||
item.SetStateTextLocalPos(RECORDMODE_STATELABEL_POS);
|
||||
item.SetSpriteONName("btn_check_03_on", isMakePixelPerfect: true, isCollisionResize: true);
|
||||
item.SetSpriteOFFName("btn_check_03_off", isMakePixelPerfect: true, isCollisionResize: true);
|
||||
item.SetValue(VideoHostingUtil.GetRecordModeEnable());
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
bool value = item.GetValue();
|
||||
VideoHostingUtil.SetRecordModeEnable(value);
|
||||
if (value)
|
||||
{
|
||||
VideoHostingUtil.SetPublishModeEnable(isEnable: false);
|
||||
}
|
||||
_SetItemToggleLooks(ID.RECORD_FACECAMERA, value);
|
||||
_SetItemToggleLooks(ID.RECORD_MICROPHONE, value);
|
||||
_SetItemToggleLooks(ID.ENEMYNAME_DISPLAY, value);
|
||||
_SetItemToggleLooks(ID.RECORD_PAUSE_IN_MENU, value);
|
||||
VideoHostingUtil.CheckAndCreateHUD(VideoHostingUtil.HUDScene.Home);
|
||||
UpdateRecordingFaceCameraStatus();
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private ItemButton CreateButton_RecordPlayPause(bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
ItemButton item = CreateButton(ID.RECORD_PAUSE, isDispSeparatorLine, parent);
|
||||
item.SetSpriteName("btn_common_04_m_off", isMakePixelPerfect: true, isCollisionResize: true);
|
||||
item.SetSpriteNameOnPress("btn_common_04_m_on");
|
||||
item.SetActive_SpriteOnButton(isActive: true);
|
||||
ChangeSpriteNameRecordPlayPause(item);
|
||||
item.SetLabelPos(LABEL_POS_RECORD_PLAYPAUSE);
|
||||
item.SetSpriteOnButtonPos(SPRITE_POS_RECORD_PLAYPAUSE);
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecording() && !SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecordingPause())
|
||||
{
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.PauseRecording();
|
||||
}
|
||||
else
|
||||
{
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.ResumeRecording();
|
||||
UIManager.GetInstance().CloseLatestDialog();
|
||||
}
|
||||
ChangeSpriteNameRecordPlayPause(item);
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private void ChangeSpriteNameRecordPlayPause(ItemButton item)
|
||||
{
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecording() && !SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecordingPause())
|
||||
{
|
||||
item.SetValue(Data.SystemText.Get("VideoHosting_0030"));
|
||||
item.SetSpriteOnButtonName("icon_button_rec_stop", isMakePixelPerfect: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.SetValue(Data.SystemText.Get("VideoHosting_0031"));
|
||||
item.SetSpriteOnButtonName("icon_button_rec_resume", isMakePixelPerfect: true);
|
||||
}
|
||||
}
|
||||
|
||||
private ItemButton CreateButton_RecordStop(bool isDispSeparatorLine, GameObject parent)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
ItemButton itemButton = CreateButton(ID.RECORD_STOP, isDispSeparatorLine, parent);
|
||||
itemButton.SetValue(systemText.Get("VideoHosting_0020"));
|
||||
itemButton.SetSpriteName("btn_common_02_m_off", isMakePixelPerfect: true, isCollisionResize: true);
|
||||
itemButton.SetSpriteNameOnPress("btn_common_02_m_on");
|
||||
itemButton.SetSpriteOnButtonName("icon_button_rec_end", isMakePixelPerfect: true);
|
||||
itemButton.SetActive_SpriteOnButton(isActive: true);
|
||||
itemButton.SetLabelPos(LABEL_POS_RECORD_STOP);
|
||||
itemButton.SetSpriteOnButtonPos(SPRITE_POS_RECORD_STOP);
|
||||
itemButton.AddChangeCallback(delegate
|
||||
{
|
||||
if (SingletonMonoBehaviour<VideoHostingManager>.instance.IsRecording())
|
||||
{
|
||||
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_DECIDE);
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.StopRecording();
|
||||
VideoHostingUtil.CreateDialogStopRecording(VideoHostingUtil.CheckHUDSceneUploadEnable(VideoHostingUtil.GetHUDScene()), isTimeOut: false);
|
||||
UIManager.GetInstance().GetVideoHostingHUD().CloseSettingMenuDialog();
|
||||
}
|
||||
});
|
||||
return itemButton;
|
||||
}
|
||||
|
||||
private ItemToggle CreateToggle_RecordFaceCamera(bool isDispSeparatorLine)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
ItemToggle item = CreateToggle(ID.RECORD_FACECAMERA, isDispSeparatorLine, SingleTabRoot);
|
||||
item.SetTitleLabel(systemText.Get("VideoHosting_0015"));
|
||||
item.SetTitleTextLocalPos(CHILD_STATE_LABEL_POS);
|
||||
item.SetButtonEnable(isEnable: false);
|
||||
item.SetValue(VideoHostingUtil.GetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.UseRecordingFaceCamera));
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
VideoHostingUtil.SetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.UseRecordingFaceCamera, item.GetValue());
|
||||
UpdateRecordingFaceCameraStatus();
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private ItemToggle CreateToggle_RecordMicrophone(bool isDispSeparatorLine)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
ItemToggle item = CreateToggle(ID.RECORD_MICROPHONE, isDispSeparatorLine, SingleTabRoot);
|
||||
item.SetTitleLabel(systemText.Get("VideoHosting_0016"));
|
||||
item.SetTitleTextLocalPos(CHILD_STATE_LABEL_POS);
|
||||
item.SetButtonEnable(isEnable: false);
|
||||
item.SetValue(VideoHostingUtil.GetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.UseRecordingMicrophone));
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
VideoHostingUtil.SetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.UseRecordingMicrophone, item.GetValue());
|
||||
UpdateRecordingFaceCameraStatus();
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private void UpdateRecordingFaceCameraStatus()
|
||||
{
|
||||
bool isEnableCamera = VideoHostingUtil.GetRecordModeEnable() && VideoHostingUtil.GetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.UseRecordingFaceCamera);
|
||||
bool isEnableMicrophone = VideoHostingUtil.GetRecordModeEnable() && VideoHostingUtil.GetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.UseRecordingMicrophone);
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.SetRecordingFaceCameraMicrophoneStatus(isEnableCamera, isEnableMicrophone);
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.SetFaceCameraWindowVisible(isVisible: false);
|
||||
}
|
||||
|
||||
private ItemSlider CreateSlider_RecordMicrophoneGain(bool isDispSeparatorLine)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
ItemSlider item = CreateSlider(ID.RECORD_MICROPHONE_GAIN, isDispSeparatorLine, SingleTabRoot);
|
||||
item.SetTitleLabel(systemText.Get("VideoHosting_0033"));
|
||||
item.SetLooks(isOn: true);
|
||||
item.SetValue(PlayerPrefsWrapper.GetValue(PlayerPrefsWrapper.VIDEOHOSTING_MICROPHONE_GAIN));
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
float value = item.GetValue();
|
||||
PlayerPrefsWrapper.SetValue(PlayerPrefsWrapper.VIDEOHOSTING_MICROPHONE_GAIN, value);
|
||||
SingletonMonoBehaviour<VideoHostingManager>.instance.SetRecordingMicrophoneGain(value);
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private ItemToggle CreateToggle_RecordPauseInMenu(bool isDispSeparatorLine)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
ItemToggle item = CreateToggle(ID.RECORD_PAUSE_IN_MENU, isDispSeparatorLine, SingleTabRoot);
|
||||
item.SetTitleLabel(systemText.Get("VideoHosting_0017"));
|
||||
item.SetTitleTextLocalPos(CHILD_STATE_LABEL_POS);
|
||||
item.SetButtonEnable(isEnable: false);
|
||||
item.SetValue(VideoHostingUtil.GetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.RecordPauseInMenu));
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
VideoHostingUtil.SetOptionFlagFromPlayerPrefs(VideoHostingUtil.Option.RecordPauseInMenu, item.GetValue());
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private ItemGrid CreateGrid_RecordButton(bool isDispSeparatorLine)
|
||||
{
|
||||
ItemGrid itemGrid = CreateGrid(ID.RECORD_BUTTON_GRID, isDispSeparatorLine, m_scrollView);
|
||||
itemGrid.SetArangement(UIGrid.Arrangement.Horizontal);
|
||||
itemGrid.SetCellWidth(300f);
|
||||
return itemGrid;
|
||||
}
|
||||
|
||||
private ItemToggle CreateToggle_PublishMode(bool isDispSeparatorLine)
|
||||
{
|
||||
SystemText systemText = Data.SystemText;
|
||||
ItemToggle item = CreateToggle(ID.PUBLISH_MODE, isDispSeparatorLine, SingleTabRoot);
|
||||
item.SetTitleLabel(systemText.Get("VideoHosting_0009"));
|
||||
item.SetStateText(systemText.Get("VideoHosting_0010"), systemText.Get("VideoHosting_0011"));
|
||||
item.SetActive_StateText(isActive: true);
|
||||
item.SetButtonEnable(isEnable: false);
|
||||
item.SetToggleLocalPos(PUBLISHMODE_TOGGLE_POS);
|
||||
item.SetStateTextLocalPos(PUBLISHMODE_STATELABEL_POS);
|
||||
item.SetSpriteONName("btn_check_03_on", isMakePixelPerfect: true, isCollisionResize: true);
|
||||
item.SetSpriteOFFName("btn_check_03_off", isMakePixelPerfect: true, isCollisionResize: true);
|
||||
item.SetValue(VideoHostingUtil.GetPublishModeEnable());
|
||||
item.AddChangeCallback(delegate
|
||||
{
|
||||
bool value = item.GetValue();
|
||||
VideoHostingUtil.SetPublishModeEnable(value);
|
||||
if (value)
|
||||
{
|
||||
VideoHostingUtil.SetRecordModeEnable(isEnable: false);
|
||||
UpdateRecordingFaceCameraStatus();
|
||||
}
|
||||
_SetItemToggleLooks(ID.ENEMYNAME_DISPLAY, value);
|
||||
VideoHostingUtil.CheckAndCreateHUD(VideoHostingUtil.HUDScene.Home);
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
protected void _SetItemToggleLooks(ID id, bool isNormal)
|
||||
{
|
||||
ItemToggle itemToggle = FindItem(id) as ItemToggle;
|
||||
if (!(null == itemToggle))
|
||||
{
|
||||
itemToggle.SetToggleLooks(isNormal);
|
||||
itemToggle.SetLabelLooks(isNormal);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user