예제 #1
0
		private static void SaveLayout(IEModOptions.LayoutOptions layout) {
			layout.TooltipOffset = TooltipOffset.Value;
			layout.CustomizeButtonPosition = _customizeButton.LocalPosition;
			layout.FormationPosition = FormationButtonSet.transform.localPosition;
			layout.BuffsSideLeft = GetAllPortraits().First().Child("StatusEffects").Component<UIAnchor>().side
				!= UIAnchor.Side.TopRight;
			layout.PartyBarPosition = PartyPortraitBar.transform.localPosition;
			layout.PartySolidHudPosition = PartySolidHud.transform.localPosition;
			layout.LogButtonsLeft = RadioGroup.Component<UIAnchor>().side != UIAnchor.Side.TopRight;
			layout.HudPosition = ActionBarTrimB.transform.localPosition;
			layout.AbilitiesBarPosition = AbilitiesBar.transform.localPosition;
			layout.LeftHudBarPosition = ButtonsLeft.transform.localPosition;
			layout.RightHudBarPosition = ButtonsRight.transform.localPosition;
			layout.ClockPosition = TimeWidget.transform.localPosition;
			layout.HudHorizontal = ButtonsLeft.Component<UIGrid>().arrangement != UIGrid.Arrangement.Vertical;
			layout.UsingCustomTextures = Attack.Child("Icon").Component<UISprite>().atlas.spriteMaterial.mainTexture != DefaultActionBarAtlas;
			layout.PortraitHighlightsDisabled = !GetAllPortraits().First().Child("StupidPanelBack").activeSelf;
			layout.ButtonsBackground = ButtonsLeft.ChildPath("#0/Background").activeSelf;
			layout.HudTextureHidden = !ActionBarTrimB.activeSelf;
			layout.LogPosition = ConsoleWindow.transform.localPosition;
			layout.PartyBarHorizontal = mod_UIPartyPortrait.IsVertical;
			
			layout.FramePath = SelectedFrame.Value;
		}
예제 #2
0
		internal static void LoadLayout(IEModOptions.LayoutOptions newLayout) {
			Initialize();
			var buffsChanged = newLayout.BuffsSideLeft;
			foreach (var portrait in GetAllPortraits()) {
				var statusEffects = portrait.Child("StatusEffects");
				var uiAnchor = statusEffects.Component<UIAnchor>();
				uiAnchor.side = buffsChanged ? UIAnchor.Side.TopLeft : UIAnchor.Side.TopRight;
				uiAnchor.pixelOffset = new Vector2(buffsChanged ? -27f : 3f, 0f); // default is (3,0)
				statusEffects.Component<UIGrid>().Reposition();
			}
			FormationButtonSet.transform.localPosition = newLayout.FormationPosition;
			PartyPortraitBar.transform.localPosition = newLayout.PartyBarPosition;
			PartySolidHud.transform.localPosition = newLayout.PartySolidHudPosition;
			_customizeButton.LocalPosition = newLayout.CustomizeButtonPosition;
			if (newLayout.BuffsSideLeft != (RadioGroup.Component<UIAnchor>().side == UIAnchor.Side.TopRight)) {
				var blop = new GameObject();
				SetLogButtonsAlignment(blop);
			}
			ActionBar.Child("trimB").transform.localPosition = newLayout.HudPosition;
			AbilitiesBar.transform.localPosition = newLayout.AbilitiesBarPosition;
			ConsoleWindow.transform.localPosition = newLayout.LogPosition;

			SetLogButtonsAlignment(newLayout.LogButtonsLeft);
			ButtonsLeft.transform.localPosition = newLayout.LeftHudBarPosition;
			ButtonsRight.transform.localPosition = newLayout.RightHudBarPosition;
			TimeWidget.transform.localPosition = newLayout.ClockPosition;
			
			var leftUiGrid = ButtonsLeft.Component<UIGrid>();
			leftUiGrid.arrangement = newLayout.HudHorizontal ? UIGrid.Arrangement.Horizontal : UIGrid.Arrangement.Vertical;
			leftUiGrid.Reposition();

			var rightUiGrid = ButtonsRight.Component<UIGrid>();
			rightUiGrid.arrangement = newLayout.HudHorizontal ? UIGrid.Arrangement.Vertical : UIGrid.Arrangement.Horizontal;
			rightUiGrid.Reposition();

			ActionBarTrimB.gameObject.SetActive(!newLayout.HudTextureHidden);

			mod_UIPartyPortrait.IsVertical = newLayout.PartyBarHorizontal;

			if (ButtonsLeft.ChildPath("#0/Background").gameObject.activeSelf != newLayout.ButtonsBackground) {
				SetButtonsBackgroundActive();
			}

			ReplaceAtlas(newLayout.UsingCustomTextures);

			SetPortraitHighlight(!newLayout.PortraitHighlightsDisabled);

			SelectedFrame.Value = newLayout.FramePath;
			//not sure why, but the tooltip offset only updates correctly if we do this last.
			TooltipOffset.Value = newLayout.TooltipOffset;
		}
예제 #3
0
 public bool MatchesNew(GameMode other)
 {
     return(MatchesOrig(other) && IEModOptions.IsIdenticalToPrefs());
 }
예제 #4
0
 public void SaveToPrefsNew()
 {
     SaveToPrefsOrig();
     IEModOptions.SaveToPrefs();
 }
예제 #5
0
 public void LoadFromPrefsNew()
 {
     LoadFromPrefsOrig();
     IEModOptions.LoadFromPrefs();
 }
예제 #6
0
 public void CtorNew()
 {
     object_ctor();
     CtorOrig();
     IEModOptions.LoadFromPrefs();
 }