protected override void SetUIParams(AnimationSubtype subtype) { var uiParams = UIParams.Default; switch (subtype) { case AnimationSubtype.FromBottom: uiParams.TranslationY = (float)ScreenSize.Height; break; case AnimationSubtype.FromTop: uiParams.TranslationY = -(float)ScreenSize.Height; break; case AnimationSubtype.Default: case AnimationSubtype.FromLeft: uiParams.TranslationX = -(float)ScreenSize.Width; break; case AnimationSubtype.FromRight: uiParams.TranslationX = (float)ScreenSize.Width; break; } StartUIForAppearingPageWhenPush = EndUIForDisappearingPageWhenPop = uiParams; StartUIForAppearingPageWhenPop = EndUIForDisappearingPageWhenPush = UIParams.InvertTranslation(uiParams); }
// Token: 0x0600031E RID: 798 RVA: 0x00019024 File Offset: 0x00017224 private void updateUI(UIParams uiparams) { this.labelWidth = uiparams.colorRect.width * 0.2f; this.sliderMargin = (float)uiparams.margin * 4.5f; this.buttonMargin = (float)uiparams.margin * 3f; this.sliderInputWidth = uiparams.lStyleS.CalcSize(new GUIContent("zzzzzzzz")).x; this.optInputWidth = GUILayout.Width(this.sliderInputWidth); this.optItemHeight = GUILayout.Height((float)uiparams.itemHeight); this.optCodeWidth = GUILayout.Width(uiparams.textStyleSC.CalcSize(new GUIContent("#DDDDDD")).x); if (this.optCPWidth == null) { this.optCPWidth = GUILayout.Width(17f); } this.textColor = uiparams.textStyleSC.normal.textColor; this.bWidthOpt = GUILayout.Width(this.bStyleSS.CalcSize(new GUIContent("x")).x); this.bWidthWOpt = GUILayout.Width(this.bStyleSS.CalcSize(new GUIContent("xx")).x); this.bWidthTOpt = GUILayout.Width(this.bStyleSS.CalcSize(new GUIContent("xxx")).x); this.bStyleSS.normal.textColor = uiparams.bStyleSC.normal.textColor; this.bStyleSS.alignment = TextAnchor.MiddleCenter; this.bStyleSS.fontSize = uiparams.fontSizeSS; this.bStyleSS.contentOffset = new Vector2(0f, 1f); this.bStyleSS.margin.left = 1; this.bStyleSS.margin.right = 1; this.bStyleSS.padding.left = 1; this.bStyleSS.padding.right = 1; this.iconStyleSS.normal.textColor = uiparams.lStyleS.normal.textColor; this.iconStyleSS.alignment = TextAnchor.MiddleCenter; this.iconStyleSS.fontSize = uiparams.fontSizeSS; this.iconStyleSS.contentOffset = new Vector2(0f, 1f); this.iconStyleSS.margin.left = 0; this.iconStyleSS.margin.right = 0; this.iconStyleSS.padding.left = 1; this.iconStyleSS.padding.right = 1; }
protected override void SetUIParams(AnimationSubtype subType) { var firstUIParams = new UIParams(ScreenSize, AlphaParam); var secondUIParams = new UIParams(ScreenSize, AlphaParam); switch (subType) { case AnimationSubtype.Default: case AnimationSubtype.FromLeft: firstUIParams.RotationY = -Angle; secondUIParams.RotationY = Angle; break; case AnimationSubtype.FromRight: firstUIParams.RotationY = Angle; secondUIParams.RotationY = -Angle; break; case AnimationSubtype.FromTop: firstUIParams.RotationX = Angle; secondUIParams.RotationX = -Angle; break; case AnimationSubtype.FromBottom: firstUIParams.RotationX = -Angle; secondUIParams.RotationX = Angle; break; } StartUIForAppearingPageWhenPush = EndUIForDisappearingPageWhenPop = firstUIParams; EndUIForDisappearingPageWhenPush = StartUIForAppearingPageWhenPop = secondUIParams; }
public static void Init(UIParams uiparams) { if (uiParams == null) { uiParams = uiparams; uiParams.Add(updateUI); InitUIParams(uiparams); } }
public static void Init(UIParams uiparams) { TextureModifier.uiParams = uiparams; if (uiParams == null) { uiParams = uiparams; uiParams.Add(updateUI); InitUIParams(uiparams); } }
private void OnAnimation(UIView toView, UIView fromView, CGRect toViewFrame, UIParams endParamsForFromView, UIParams endParamsForToView, bool reverse) { toView.SetUIParams(endParamsForToView, reverse); fromView.SetUIParams(endParamsForFromView, reverse); if (Animation.Type == AnimationType.Rotate) { toView.Frame = toViewFrame; } }
public BSMLParserParams Parse(XmlNode parentNode, GameObject parent, object host = null) { BSMLParserParams parserParams = new BSMLParserParams(); parserParams.host = host; if (host != null) { foreach (MethodInfo methodInfo in host.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) { UIAction uiaction = methodInfo.GetCustomAttributes(typeof(UIAction), true).FirstOrDefault() as UIAction; if (uiaction != null) { parserParams.actions.Add(uiaction.id, new BSMLAction(host, methodInfo)); } } foreach (FieldInfo fieldInfo in host.GetType().GetFields(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) { UIValue uivalue = fieldInfo.GetCustomAttributes(typeof(UIValue), true).FirstOrDefault() as UIValue; if (uivalue != null) { parserParams.values.Add(uivalue.id, new BSMLFieldValue(host, fieldInfo)); } UIParams uiParams = fieldInfo.GetCustomAttributes(typeof(UIParams), true).FirstOrDefault() as UIParams; if (uiParams != null) { fieldInfo.SetValue(host, parserParams); } } foreach (PropertyInfo propertyInfo in host.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) { UIValue uivalue = propertyInfo.GetCustomAttributes(typeof(UIValue), true).FirstOrDefault() as UIValue; if (uivalue != null) { parserParams.values.Add(uivalue.id, new BSMLPropertyValue(host, propertyInfo)); } } } foreach (XmlNode node in parentNode.ChildNodes) { HandleNode(node, parent, parserParams); } foreach (KeyValuePair <string, BSMLAction> action in parserParams.actions.Where(x => x.Key.StartsWith(SUBSCRIVE_EVENT_ACTION_PREFIX))) { parserParams.AddEvent(action.Key.Substring(1), delegate { action.Value.Invoke(); }); } parserParams.EmitEvent("post-parse"); return(parserParams); }
// Token: 0x0600030B RID: 779 RVA: 0x00018A28 File Offset: 0x00016C28 private void updateUI(UIParams uiparams) { this.optItemHeight = GUILayout.Height((float)uiparams.itemHeight); this.bStyleLeft.fontStyle = uiparams.lStyleC.fontStyle; this.bStyleLeft.fontSize = uiparams.fontSize; this.bStyleLeft.normal.textColor = uiparams.lStyleC.normal.textColor; this.bStyleLeft.alignment = TextAnchor.MiddleLeft; this.bStyleCenter.fontStyle = uiparams.lStyleC.fontStyle; this.bStyleCenter.fontSize = uiparams.fontSize; this.bStyleCenter.normal.textColor = uiparams.lStyleC.normal.textColor; this.bStyleCenter.alignment = TextAnchor.MiddleCenter; }
private static void InitUIParams(UIParams uiparam) { // 背景設定 inboxStyle.normal.background = new Texture2D(1, 1); var color = new Color(0.3f, 0.3f, 0.3f, 0.3f); var colorArray = inboxStyle.normal.background.GetPixels(); for(int i=0; i<colorArray.Length; i++) { colorArray[i] = color; } inboxStyle.normal.background.SetPixels(colorArray); inboxStyle.normal.background.Apply(); inboxStyle.padding.left = inboxStyle.padding.right = 2; }
public void SetUIParams(UIParams uiParams) { var pivotPoint = uiParams.GetPivotPoint(); pageContainer.PivotX = (float)pivotPoint.X; pageContainer.PivotY = (float)pivotPoint.Y; pageContainer.Alpha = uiParams.Alpha; pageContainer.ScaleX = uiParams.ScaleX; pageContainer.ScaleY = uiParams.ScaleY; pageContainer.RotationX = uiParams.RotationX; pageContainer.RotationY = uiParams.RotationY; pageContainer.Rotation = uiParams.RotationZ; pageContainer.TranslationX = uiParams.TranslationX; pageContainer.TranslationY = uiParams.TranslationY; }
private void updateUI(UIParams uiparams) { // 幅の28% optItemHeight = GUILayout.Height(uiparams.itemHeight); bStyleLeft.fontStyle = uiparams.lStyleC.fontStyle; bStyleLeft.fontSize = uiparams.fontSize; bStyleLeft.normal.textColor = uiparams.lStyleC.normal.textColor; bStyleLeft.alignment = TextAnchor.MiddleLeft; bStyleCenter.fontStyle = uiparams.lStyleC.fontStyle; bStyleCenter.fontSize = uiparams.fontSize; bStyleCenter.normal.textColor = uiparams.lStyleC.normal.textColor; bStyleCenter.alignment = TextAnchor.MiddleCenter; }
internal static void SetUIParams(this UIView view, UIParams uiParams, bool isPop) { view.Alpha = uiParams.Alpha; var transform = CATransform3D.Identity; transform = transform.Scale(uiParams.ScaleX, uiParams.ScaleY, 1); transform = transform.Translate(uiParams.TranslationX, uiParams.TranslationY, 0); transform = transform.Rotate(DegreesToRadiansConversion(uiParams.RotationX), 0, 1, 0); transform = transform.Rotate(DegreesToRadiansConversion(uiParams.RotationY), 0, 1, 0); transform = transform.Rotate(DegreesToRadiansConversion(uiParams.RotationZ), 0, 0, 1); view.Layer.Transform = transform; if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { if (isPop) { view.Frame = new CGRect(uiParams.TranslationX + view.Frame.X, uiParams.TranslationY + view.Frame.Y, view.Frame.Width, view.Frame.Height); } } }
public ViewPropertyAnimator GetDroidAnimation(IPageAnimation animation, UIParams uiParams, Action onEndHandler, bool isPop) { var animatorListener = new GenericAnimatorListener(); if (onEndHandler != null) { animatorListener.OnEnd = animatorListener.OnCancel = a => onEndHandler(); } var anim = pageContainer.Animate().Alpha(uiParams.Alpha).SetDuration(GetDuration(animation.Duration)). ScaleX(uiParams.ScaleX).ScaleY(uiParams.ScaleY). Rotation(uiParams.RotationZ).RotationX(uiParams.RotationX).RotationY(uiParams.RotationY). TranslationX(uiParams.TranslationX).TranslationY(uiParams.TranslationY). SetListener(animatorListener); if (animation.BounceEffect) { anim.SetInterpolator(isPop ? _accelerateInterpolator : _bounceInterpolator); } return(anim); }
private void updateUI(UIParams uiparams) { // 幅の28% labelWidth = uiparams.colorRect.width * 0.2f; sliderMargin = uiparams.margin * 4.5f; // GUILayout.Space(uiParams.FixPx(7)); buttonMargin = uiparams.margin * 3f; sliderInputWidth = uiparams.lStyleS.CalcSize(new GUIContent("zzzzzzzz")).x; // 最大8文字分の幅 optInputWidth = GUILayout.Width(sliderInputWidth); optItemHeight = GUILayout.Height(uiparams.itemHeight); optCodeWidth = GUILayout.Width(uiparams.textStyleSC.CalcSize(new GUIContent("#DDDDDD")).x); if (optCPWidth == null) { optCPWidth = GUILayout.Width(17); } textColor = uiparams.textStyleSC.normal.textColor; bWidthOpt = GUILayout.Width(bStyleSS.CalcSize(new GUIContent("x")).x); //GUILayout.Width(baseWidth*0.8f); bWidthWOpt = GUILayout.Width(bStyleSS.CalcSize(new GUIContent("xx")).x); //baseWidth*1.2f); bWidthTOpt = GUILayout.Width(bStyleSS.CalcSize(new GUIContent("xxx")).x); //baseWidth*1.6f); bStyleSS.normal.textColor = uiparams.bStyleSC.normal.textColor; bStyleSS.alignment = TextAnchor.MiddleCenter; bStyleSS.fontSize = uiparams.fontSizeSS; bStyleSS.contentOffset = new Vector2(0, 1); bStyleSS.margin.left = 1; bStyleSS.margin.right = 1; bStyleSS.padding.left = 1; bStyleSS.padding.right = 1; iconStyleSS.normal.textColor = uiparams.lStyleS.normal.textColor; iconStyleSS.alignment = TextAnchor.MiddleCenter; iconStyleSS.fontSize = uiparams.fontSizeSS; iconStyleSS.contentOffset = new Vector2(0, 1); iconStyleSS.margin.left = 0; iconStyleSS.margin.right = 0; iconStyleSS.padding.left = 1; iconStyleSS.padding.right = 1; }
// Token: 0x06000309 RID: 777 RVA: 0x0001898C File Offset: 0x00016B8C public CheckboxHelper(UIParams uiparams) { this.uiParams = uiparams; this.uiParams.Add(new Action <UIParams>(this.updateUI)); }
public ACCSaveMenuView(UIParams up) { Init(up); }
private static void InitUIParams(UIParams uiparam) { }
public CheckboxHelper(UIParams uiparams) { uiParams = uiparams; uiParams.Add(updateUI); }
public WifiReceiver(UIParams ui) : base(ui) { }
public BSMLParserParams Parse(XmlNode parentNode, GameObject parent, object host = null) { BSMLParserParams parserParams = new BSMLParserParams(); parserParams.host = host; FieldAccessOption fieldAccessOptions = FieldAccessOption.Auto; PropertyAccessOption propertyAccessOptions = PropertyAccessOption.Auto; MethodAccessOption methodAccessOptions = MethodAccessOption.Auto; HostOptionsAttribute hostOptions = host?.GetType().GetCustomAttribute <HostOptionsAttribute>(); if (hostOptions != null) { fieldAccessOptions = hostOptions.FieldAccessOption; propertyAccessOptions = hostOptions.PropertyAccessOption; methodAccessOptions = hostOptions.MethodAccessOption; } if (host != null) { foreach (MethodInfo methodInfo in host.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) { UIAction uiaction = methodInfo.GetCustomAttributes(typeof(UIAction), true).FirstOrDefault() as UIAction; string methodName = methodInfo.Name; string uiActionName = null; if (uiaction != null) { uiActionName = uiaction.id; if (parserParams.actions.TryGetValue(uiActionName, out BSMLAction existing)) { if (existing.FromUIAction) { throw new InvalidOperationException($"UIAction '{uiActionName}' is already used by member '{existing.MemberName}'."); } existing.methodInfo = methodInfo; existing.FromUIAction = true; } else { parserParams.actions.Add(uiActionName, new BSMLAction(host, methodInfo, true)); } if (methodAccessOptions == MethodAccessOption.AllowBoth && methodName != uiActionName) { if (!parserParams.actions.ContainsKey(methodName)) { parserParams.actions.Add(methodName, new BSMLAction(host, methodInfo, false)); } } } else if (methodAccessOptions != MethodAccessOption.OptIn) { if (!parserParams.actions.ContainsKey(methodName)) { parserParams.actions.Add(methodName, new BSMLAction(host, methodInfo)); } } } foreach (FieldInfo fieldInfo in host.GetType().GetFields(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) { UIValue uivalue = fieldInfo.GetCustomAttributes(typeof(UIValue), true).FirstOrDefault() as UIValue; string fieldName = fieldInfo.Name; string uiValueName = null; if (uivalue != null) { uiValueName = uivalue.id; if (parserParams.values.TryGetValue(uiValueName, out BSMLValue existing)) { if (existing.FromUIValue) { throw new InvalidOperationException($"UIValue '{uiValueName}' is already used by member '{existing.MemberName}'."); } if (existing is BSMLFieldValue existingField) { existingField.fieldInfo = fieldInfo; existingField.FromUIValue = true; } } else { parserParams.values.Add(uiValueName, new BSMLFieldValue(host, fieldInfo)); } if (fieldAccessOptions == FieldAccessOption.AllowBoth && fieldName != uiValueName) { if (!parserParams.values.ContainsKey(fieldName)) { parserParams.values.Add(fieldName, new BSMLFieldValue(host, fieldInfo, false)); } } } else if (fieldAccessOptions != FieldAccessOption.OptIn) { if (!parserParams.values.ContainsKey(fieldName)) { parserParams.values.Add(fieldName, new BSMLFieldValue(host, fieldInfo, false)); } } UIParams uiParams = fieldInfo.GetCustomAttributes(typeof(UIParams), true).FirstOrDefault() as UIParams; if (uiParams != null) { fieldInfo.SetValue(host, parserParams); } } foreach (PropertyInfo propertyInfo in host.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) { UIValue uivalue = Attribute.GetCustomAttributes(propertyInfo, typeof(UIValue), true).FirstOrDefault() as UIValue; string propName = propertyInfo.Name; string uiValueName = null; if (uivalue != null) { uiValueName = uivalue.id; if (parserParams.values.TryGetValue(uiValueName, out BSMLValue existing)) { if (existing.FromUIValue) { throw new InvalidOperationException($"UIValue '{uiValueName}' is already used by member '{existing.MemberName}'."); } if (existing is BSMLPropertyValue existingProp) { existingProp.propertyInfo = propertyInfo; existingProp.FromUIValue = true; } } else { parserParams.values.Add(uiValueName, new BSMLPropertyValue(host, propertyInfo)); } if (propertyAccessOptions == PropertyAccessOption.AllowBoth && propName != uiValueName) { if (!parserParams.values.ContainsKey(propName)) { parserParams.values.Add(propName, new BSMLPropertyValue(host, propertyInfo, false)); } } } else if (propertyAccessOptions != PropertyAccessOption.OptIn) { if (!parserParams.values.ContainsKey(propName)) { parserParams.values.Add(propName, new BSMLPropertyValue(host, propertyInfo, false)); } } } } IEnumerable <ComponentTypeWithData> componentInfo = Enumerable.Empty <ComponentTypeWithData>(); foreach (XmlNode node in parentNode.ChildNodes) { HandleNode(node, parent, parserParams, out IEnumerable <ComponentTypeWithData> components); componentInfo = componentInfo.Concat(components); } foreach (KeyValuePair <string, BSMLAction> action in parserParams.actions.Where(x => x.Key.StartsWith(SUBSCRIVE_EVENT_ACTION_PREFIX))) { parserParams.AddEvent(action.Key.Substring(1), delegate { action.Value.Invoke(); }); } foreach (ComponentTypeWithData component in componentInfo) { component.typeHandler.HandleTypeAfterParse(component, parserParams); } parserParams.EmitEvent("post-parse"); return(parserParams); }
public SliderHelper(UIParams uiparams) { uiParams = uiparams; uiParams.Add(updateUI); }
// Token: 0x0600031C RID: 796 RVA: 0x00018F70 File Offset: 0x00017170 public SliderHelper(UIParams uiparams) { this.uiParams = uiparams; this.uiParams.Add(new Action <UIParams>(this.updateUI)); }