Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.13.0 #587

Merged
merged 10 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/OWML.Common/OWML.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="OuterWildsGameLibs" Version="1.1.14.768" />
<PackageReference Include="OuterWildsGameLibs" Version="1.1.15.1018" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions src/OWML.Launcher/OWML.Manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Alek",
"name": "OWML",
"uniqueName": "Alek.OWML",
"version": "2.12.1",
"minGameVersion": "1.1.14.768",
"maxGameVersion": "1.1.14.768"
"version": "2.13.0",
"minGameVersion": "1.1.15.1018",
"maxGameVersion": "1.1.15.1018"
}
6 changes: 3 additions & 3 deletions src/OWML.Launcher/game-versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"steam": "1.1.14.768",
"epic": "1.1.14.768",
"gamepass": "1.1.14.768"
"steam": "1.1.15.1018",
"epic": "1.1.15.1018",
"gamepass": "1.1.15.1018"
}
68 changes: 25 additions & 43 deletions src/OWML.ModHelper.Menus/NewMenuSystem/OptionsMenuManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,7 @@ public IOWMLToggleElement AddCheckboxInput(Menu menu, string label, string toolt
{
var existingCheckbox = Resources.FindObjectsOfTypeAll<TabbedSubMenu>()
.Single(x => x.name == "GameplayMenu").transform
.Find("MenuGameplayBasic")
.Find("UIElement-InvertPlayerLook").gameObject;
.Find("MenuGameplayBasic/Scroll View/Viewport/Content/UIElement-InvertPlayerLook").gameObject;

var newCheckbox = Object.Instantiate(existingCheckbox);
newCheckbox.transform.parent = GetParentForAddedElements(menu);
Expand Down Expand Up @@ -276,8 +275,7 @@ public IOWMLTwoButtonToggleElement AddToggleInput(Menu menu, string label, strin
{
var existingToggle = Resources.FindObjectsOfTypeAll<TabbedSubMenu>()
.Single(x => x.name == "InputMenu").transform
.Find("MenuGeneral")
.Find("UIElement-ConfirmToggle").gameObject;
.Find("MenuGeneral/UIElement-ConfirmToggle").gameObject;

var script = existingToggle.GetComponent<TwoButtonToggleElement>();
var text = script._buttonTrue.GetComponent<UIStyleApplier>()._textItems[0];
Expand Down Expand Up @@ -330,8 +328,7 @@ public IOWMLOptionsSelectorElement AddSelectorInput(Menu menu, string label, str
{
var existingSelector = Resources.FindObjectsOfTypeAll<TabbedSubMenu>()
.Single(x => x.name == "GameplayMenu").transform
.Find("MenuGameplayBasic")
.Find("UIElement-ControllerProfile").gameObject;
.Find("MenuGameplayBasic/Scroll View/Viewport/Content/UIElement-ControllerProfile").gameObject;

var newSelector = Object.Instantiate(existingSelector);
newSelector.transform.parent = GetParentForAddedElements(menu);
Expand Down Expand Up @@ -379,8 +376,7 @@ public IOWMLSliderElement AddSliderInput(Menu menu, string label, float lower, f
{
var existingSlider = Resources.FindObjectsOfTypeAll<TabbedSubMenu>()
.Single(x => x.name == "GameplayMenu").transform
.Find("MenuGameplayBasic")
.Find("UIElement-LookSensitivity").gameObject;
.Find("MenuGameplayBasic/Scroll View/Viewport/Content/UIElement-LookSensitivity").gameObject;

var newSlider = Object.Instantiate(existingSlider);
newSlider.transform.parent = GetParentForAddedElements(menu);
Expand Down Expand Up @@ -432,7 +428,7 @@ public GameObject AddSeparator(Menu menu, bool dots)

var dotsSprite = Resources.FindObjectsOfTypeAll<TabbedSubMenu>()
.Single(x => x.name == "GameplayMenu").transform
.Find("MenuGameplayBasic")
.Find("MenuGameplayBasic/Scroll View/Viewport/Content")
.Find("UIElement-ControllerProfile")
.Find("HorizontalLayoutGroup")
.Find("LabelBlock")
Expand Down Expand Up @@ -466,12 +462,7 @@ public GameObject AddSeparator(Menu menu, bool dots)

public SubmitAction CreateButton(Menu menu, string buttonLabel, string tooltip, MenuSide side)
{
var existingButton = Resources.FindObjectsOfTypeAll<Menu>()
.Single(x => x.name == "GraphicsMenu").transform
.Find("Scroll View")
.Find("Viewport")
.Find("Content")
.Find("GammaButtonPanel").gameObject;
var existingButton = Resources.FindObjectsOfTypeAll<Button>().First(x => x.name == "UIElement-ButtonContinue");

var newButtonObj = Object.Instantiate(existingButton);
newButtonObj.transform.parent = GetParentForAddedElements(menu);
Expand All @@ -480,37 +471,34 @@ public SubmitAction CreateButton(Menu menu, string buttonLabel, string tooltip,
newButtonObj.name = $"UIElement-Button-{buttonLabel}";
newButtonObj.transform.localRotation = Quaternion.identity;

// the thing we're copying is already LEFT, so dont need to handle it
if (side == MenuSide.CENTER)
if (side == MenuSide.LEFT)
{
Object.Destroy(newButtonObj.transform.Find("RightSpacer").gameObject);
Object.Destroy(newButtonObj.transform.Find("ForegroundLayoutGroup/RightSpacer").gameObject);
newButtonObj.transform.Find("ForegroundLayoutGroup/LeftSpacer").SetAsFirstSibling();
}
else if (side == MenuSide.CENTER)
{
Object.Destroy(newButtonObj.transform.Find("ForegroundLayoutGroup/RightSpacer").gameObject);
Object.Destroy(newButtonObj.transform.Find("ForegroundLayoutGroup/LeftSpacer").gameObject);
}
else if (side == MenuSide.RIGHT)
{
newButtonObj.transform.Find("RightSpacer").SetAsFirstSibling();
Object.Destroy(newButtonObj.transform.Find("ForegroundLayoutGroup/LeftSpacer").gameObject);
newButtonObj.transform.Find("ForegroundLayoutGroup/RightSpacer").SetAsFirstSibling();
}

var uielement = newButtonObj.transform.Find("UIElement-GammaButton").gameObject;

Object.Destroy(uielement.GetComponent<SubmitActionMenu>());
var submitAction = uielement.AddComponent<SubmitAction>();
Object.Destroy(newButtonObj.GetComponent<SubmitAction>());
var submitAction = newButtonObj.gameObject.AddComponent<SubmitAction>();

Object.Destroy(uielement.GetComponentInChildren<LocalizedText>());

var menuOption = uielement.GetComponent<MenuOption>();
menuOption._tooltipTextType = UITextType.None;
menuOption._overrideTooltipText = tooltip;
menuOption._label.text = buttonLabel;
Object.Destroy(newButtonObj.gameObject.GetComponentInChildren<LocalizedText>());

menu._menuOptions = menu._menuOptions.Add(menuOption);
newButtonObj.GetComponentInChildren<Text>().text = buttonLabel;

if (menu._selectOnActivate == null)
{
menu._selectOnActivate = newButtonObj.GetComponent<Selectable>();
}

uielement.AddComponent<SelectableAudioPlayer>();

return submitAction;
}

Expand Down Expand Up @@ -562,13 +550,7 @@ public SubmitAction CreateButtonWithLabel(Menu menu, string label, string button
Object.Destroy(controlBlock.Find("OptionSelectorBG").gameObject);
Object.Destroy(controlBlock.Find("HorizontalLayoutGroup").gameObject);

var existingButton = Resources.FindObjectsOfTypeAll<Menu>()
.Single(x => x.name == "GraphicsMenu").transform
.Find("Scroll View")
.Find("Viewport")
.Find("Content")
.Find("GammaButtonPanel")
.Find("UIElement-GammaButton").gameObject;
var existingButton = Resources.FindObjectsOfTypeAll<Button>().First(x => x.name == "UIElement-ButtonContinue").gameObject;

var newButton = Object.Instantiate(existingButton);
newButton.transform.parent = controlBlock;
Expand All @@ -586,8 +568,7 @@ public SubmitAction CreateButtonWithLabel(Menu menu, string label, string button
rt.anchoredPosition3D = ort.anchoredPosition3D;
rt.sizeDelta = ort.sizeDelta;

Object.Destroy(newButton.GetComponent<SubmitActionMenu>());
var submitAction = newButton.AddComponent<SubmitAction>();
var submitAction = newButton.GetComponent<SubmitAction>();

Object.Destroy(newButton.GetComponentInChildren<LocalizedText>());

Expand Down Expand Up @@ -631,16 +612,17 @@ public SubmitAction CreateButtonWithLabel(Menu menu, string label, string button

newButton.GetAddComponent<SelectableAudioPlayer>();

var menuOption = newButton.GetComponent<MenuOption>();
var menuOption = newButton.GetAddComponent<MenuOption>();
menuOption._tooltipTextType = UITextType.None;
menuOption._overrideTooltipText = tooltip;
menuOption._label = newButton.GetComponentInChildren<Text>();
menuOption._label.text = buttonLabel;

menu._menuOptions = menu._menuOptions.Add(menuOption);

if (menu._selectOnActivate == null)
{
menu._selectOnActivate = newButtonObj.GetComponent<Selectable>();
menu._selectOnActivate = newButtonObj.GetComponent<Button>();
}

return submitAction;
Expand Down
Loading