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.10.0 #567

Merged
merged 103 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
2d0b7c8
create rebinding helper
misternebula May 21, 2023
0dae760
add to containers and modhelper
misternebula May 21, 2023
c04d2a3
update menus
misternebula May 21, 2023
e232f42
Update Readme.md
misternebula May 21, 2023
1825229
add patch
misternebula May 22, 2023
26587ba
stuff?
misternebula May 22, 2023
5e2dac5
aaaaa
misternebula May 22, 2023
7d9c5e1
fix menu tab
misternebula May 23, 2023
3f619e2
fix position of submenu
misternebula May 23, 2023
c3b6b30
actually make it affected by passed parameters (lol)
misternebula May 24, 2023
e55bc8f
add sub tab
misternebula May 24, 2023
b969389
patches
misternebula May 24, 2023
673c9c7
add OpenOptionsAtTab
misternebula May 24, 2023
e1b46b2
fix title button indexing
misternebula May 24, 2023
afc7c31
destroy all option items in new sub tab
misternebula May 24, 2023
daa7694
add checkbox inputs for OWML and mods
misternebula May 24, 2023
ea6382e
add selectors, two button, start of slider, etc
misternebula May 25, 2023
b3c0b6b
add button, redo owml mods menu layout
misternebula May 28, 2023
87a8be1
make toggles with no labels into checkboxes
misternebula May 29, 2023
77786a8
Merge pull request #536 from ow-mods/new-menus
misternebula May 29, 2023
7eaf152
stuff
misternebula May 30, 2023
fe97564
remove rebinding stuff
misternebula May 30, 2023
1bd4514
do a bunch of interfaces to get menus working with ModHelper
misternebula May 30, 2023
46d96f3
add label creation
misternebula Jun 4, 2023
93ba4af
make mod label into one line
misternebula Jun 4, 2023
ea3bd21
add slider input
misternebula Jun 4, 2023
4b85735
make standard menus scrollable
misternebula Jun 4, 2023
b3d0544
fix spacing and audio
misternebula Jun 5, 2023
756b7d1
add old interfaces + scripts back in
misternebula Jun 5, 2023
f32951a
add back in old menus properly
misternebula Jun 5, 2023
6922810
make old menus obsolete
misternebula Jun 5, 2023
25c58de
disable old menus
misternebula Jun 22, 2023
e5ec4e0
just don't add mods tab lol
misternebula Jun 24, 2023
dad0eda
Merge branch 'dev' into just-menus
misternebula Jun 24, 2023
ab237fb
rename StartupPopupManager to PopupMenuManager
misternebula Jun 24, 2023
151fe76
add popup menus
misternebula Jun 24, 2023
fcb0a21
half-add buttons with labels
misternebula Jun 25, 2023
ef19e11
Merge branch 'dev' into just-menus
misternebula Jul 3, 2023
339d6a0
Merge branch 'dev' into just-menus
misternebula Sep 8, 2023
5fffdf6
remove debug logs in CreateButtonWithLabel
misternebula Sep 8, 2023
6202ef2
fix XML comment
misternebula Sep 9, 2023
cf83b7d
adding "default settings" functionality to OWML tab
misternebula Sep 9, 2023
e78e720
add DefaultConfig to IModHelper
misternebula Sep 10, 2023
5edce37
add mod settings default button functionality
misternebula Sep 10, 2023
fe79d26
add three choice popup
misternebula Sep 10, 2023
271b195
add four choice popup menus
misternebula Sep 10, 2023
660e0e3
fix incorrect title screen fade-in order
misternebula Sep 10, 2023
1cb6522
add more test stuff to LoadCustomAssets
misternebula Sep 11, 2023
9d78933
setup menus every time title screen is loaded
misternebula Sep 12, 2023
9fbb7e1
add SetupTitleMenus and SetupPauseMenus
misternebula Sep 12, 2023
4d36583
update documentation
misternebula Sep 12, 2023
01305c0
do things better
misternebula Sep 13, 2023
6f90a98
fix scaling issue
misternebula Sep 13, 2023
b3f93b4
make buttons smaller on title screen
misternebula Sep 13, 2023
de3a98c
Merge branch 'dev' into just-menus
misternebula Nov 9, 2023
9138537
update for patch 14 change
misternebula Nov 9, 2023
70870d7
set ModAssets logs to be MessageType.Debug
misternebula Nov 9, 2023
562fdef
add OWML version to title screen
misternebula Nov 9, 2023
530195e
add label for unknown setting type
misternebula Nov 9, 2023
4797175
fix some popups appearing underneath menus
misternebula Nov 10, 2023
e25cce8
build sample mods to mods folder
misternebula Nov 10, 2023
ef6c095
Revert "build sample mods to mods folder"
misternebula Nov 10, 2023
5940668
fix other popups
misternebula Nov 10, 2023
42d7d63
Update LoadCustomAssets.cs
misternebula Feb 19, 2024
b8ea5c9
Update PopupMenuManager.cs
misternebula Feb 19, 2024
2b2fd15
switch to modhelper.storage
misternebula Feb 19, 2024
99a07ab
center all inputs
misternebula Feb 19, 2024
e8231cf
add docs for CreateInputFieldPopup
misternebula Feb 19, 2024
fea8e28
Expose and fix input popup validation
misternebula Feb 19, 2024
6dfd1aa
implement number setting, use enums for settingtype
misternebula Feb 19, 2024
65d30f6
make NUMBER float, remove NUMBER_FLOAT
misternebula Feb 19, 2024
8afa6fc
Create EventExtensions.cs
misternebula Feb 20, 2024
30cc28e
fix custom title buttons not hiding in option menu
misternebula Feb 20, 2024
54a0c6e
make button input have name
misternebula Feb 20, 2024
36cdf0a
add uistyleapplier to text/number
misternebula Feb 20, 2024
fc5d7e4
patch TabbedMenu.Activate to work with other TabbedMenus
misternebula Feb 20, 2024
e90351a
make input fields a menuoption
misternebula Feb 21, 2024
ccb6935
cleanup
misternebula Feb 21, 2024
d85a871
add doc for CreateTextEntryInput
misternebula Feb 21, 2024
9ab7cd5
bump version
misternebula Feb 21, 2024
9937e80
rename to AddTextEntryInput
misternebula Feb 21, 2024
1e775ac
fix options stuff not working ingame
misternebula Feb 28, 2024
fda5405
add pause menu
misternebula Feb 28, 2024
707198e
remove scene load button
misternebula Feb 28, 2024
c9a01d4
add pause menu index/text methods
misternebula Feb 28, 2024
d3fc638
copy sample mods in a way github will like???
misternebula Mar 11, 2024
76c5157
Update Readme.md
misternebula Mar 11, 2024
168b4d8
add comments and documentation
misternebula Mar 11, 2024
e193c11
add input commands to popups
misternebula Mar 17, 2024
47811ff
fix menus being made before settings are read
misternebula Mar 17, 2024
fab1f2b
fix navigation on text entry
misternebula Mar 19, 2024
bb91ec3
add full stops to config docs
misternebula Mar 19, 2024
328a1dc
docs: make menus deprecated
misternebula Mar 19, 2024
32dfec3
Update MenuManager.cs
misternebula Mar 19, 2024
60856fd
let local rotation
misternebula Mar 19, 2024
82258cf
edit localposition and fix label rotation
misternebula Mar 19, 2024
b904dde
change localrotation of button with label
misternebula Mar 19, 2024
f4ed545
fix local position of button with label
misternebula Mar 19, 2024
1912e30
fix position of selector inputs
misternebula Mar 19, 2024
0f1c8aa
Merge pull request #537 from ow-mods/just-menus
misternebula Mar 19, 2024
083409c
fix #556
misternebula Mar 19, 2024
9d34423
use ModData.Enabled instead of ModData.Config.Enabled
misternebula Mar 19, 2024
7d9cd55
Merge branch 'master' into dev
misternebula Mar 20, 2024
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
11 changes: 3 additions & 8 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,9 @@ To get started, check out [our tutorial on the docs](https://owml.outerwildsmods

## Compatibility

|Version|Compatible|
|-|-|
|1.1.10|Yes|
|1.1.9|Unknown|
|1.1.8|Unknown|
|1.0.0 - 1.0.7|No|
OWML is only supported on the latest game version. It may work on older versions, but that cannot be guaranteed.

OWML is compatible with Echoes of the Eye, and works on both Epic and Steam installations.
OWML is compatible with Echoes of the Eye, and works on Epic, Steam, and Microsoft Store installations.

## Feedback and Support

Expand All @@ -80,7 +75,7 @@ Contributors:
* [JohnCorby](https://github.com/JohnCorby) - Helped with audio loading stuff.

Special thanks to:
* [Outer Wilds](http://www.outerwilds.com)
* [Outer Wilds](https://www.mobiusdigitalgames.com/outer-wilds.html)
* [Outer Wilds on Reddit](https://www.reddit.com/r/outerwilds)
* The unnofficial Outer Wilds Discord
* Inspired by (and some code from) [SMAPI](https://smapi.io)
Expand Down
10 changes: 5 additions & 5 deletions docs/content/pages/mod_helper/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ A `Dictionary<string, object>` containing your mod's settings, it's recommended

## GetSettingValue&lt;T&gt;

Gets the setting's value from the mod's config with the given key. Deserialized into type `T`
Gets the setting's value from the mod's config with the given key. Deserialized into type `T`.

### Get Parameters

- `string key`: The key to get
- `string key`: The key to get.

## SetSettingsValue

Sets the setting's value in the mod's config with the given key to the given value.

### Set Parameters

- `string key`: The key to set
- `object value`: The value to set the key to, auto-serialized to a JSON string
- `string key`: The key to set.
- `object value`: The value to set the key to, auto-serialized to a JSON string.

## Copy

Copies the config of the mod
Copies the config of the mod.
156 changes: 2 additions & 154 deletions docs/content/pages/mod_helper/menus.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,157 +4,5 @@ Title: Menus

# ModHelper.Menus

Provides utilities to extend base-game menus and UI.

## Interfaces

These interfaces are used throughout the module

## IModMenu

Represents a menu

### OnInit

The event that's fired when the menu has been initialized.

## IModButton

Represents a button

### OnClick

The event that fires when clicked

### Title

Text displayed on the button

### Duplicate

Duplicates the button with a new label

### Show

Shows the button

### Hide

Hides the button

## IModMessagePopup

### OnConfirm

The event that's fired when the confirm button is pressed

### OnCancel

The event that's fired when the cancel button is pressed

## IModInputMenu

### OnConfirm(string)

The event that's fired when the input is confirmed, it expects an Action&lt;string&gt;

## MainMenu

The main menu of the game. It is represented by `IModMainMenu`.

### IModButtons

- OptionsButton
- QuitButton
- ResumeExpeditionButton
- NewExpeditionButton
- ViewCreditsButton
- SwitchProfileButton

## PauseMenu

The pause menu. It is represented by `IModPauseMenu`.

### IModButtons

- ResumeButton
- OptionsButton
- QuitButton

## Button Example

```csharp
public class MyCoolMod : ModBehaviour {
public void Start() {
ModHelper.Menus.MainMenu.OnInit += () => {
var myButton = ModHelper.Menus.MainMenu.OptionsButton.Duplicate("My Cool Button");
myButton.OnClick += MyButtonClicked;
};
}

public void MyButtonClicked() {
ModHelper.Console.WriteLine("My Button Was Clicked!");
}
}
```

## PopupManager

Allows you to show information and input messages

### CreateMessagePopup

Creates a new message popup

#### Message Parameters

(*italicized* = optional)

- `string message`: The message to show
- *`bool addCancel`*: Whether to add a cancel button to the popup
- *`string okMessage`*: The message to show in the OK button
- *`string cancelMessage`*: The message to show in the cancel button

#### Message Example

```csharp
public class MyCoolMod : ModBehaviour {
public void Start() {
var popup = ModHelper.Menus.PopupManager.CreateMessagePopup("What do?", true, "Yes", "What");
popup.OnConfirm += OnOk;
popup.OnCancel += OnCancel;
}

public void OnOk() {
ModHelper.Console.WriteLine("You Clicked OK!", MessageType.Success);
}

public void OnCancel() {
ModHelper.Console.WriteLine("You Clicked Cancel!", MessageType.Warning);
}
}
```

### CreateInputPopup

Creates a new input popup for the player.

#### Input Parameters

- `InputType inputType`: Either `InputType.Text` or `InputType.Number`
- `string value`: The default value for the prompt

#### Input Example

```csharp
public class MyCoolMod : ModBehaviour {
public void Start() {
var prompt = ModHelper.Menus.PopupManager.CreateInputPrompt(InputType.Text, "Default");
prompt.OnConfirm += OnConfirm;
}

public void OnConfirm(string value) {
ModHelper.Console.WriteLine($"You entered: {value}!");
}
}
```
!!! alert-warning "Deprecated"
This module has been deprecated in favor of the new menu system, covered in [the tutorial]({{ "Creating Custom Menus"|route }}){class="link-info"}.
9 changes: 8 additions & 1 deletion src/OWML.Common/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
namespace OWML.Common
using System.Runtime.CompilerServices;

// make everything in OWML.Common visible to these namespaces
// this is in this file just because it's the first one that comes up in VS :P
[assembly: InternalsVisibleTo("OWML.ModHelper.Menus")]
[assembly: InternalsVisibleTo("OWML.ModLoader")]

namespace OWML.Common
{
public class Constants
{
Expand Down
9 changes: 9 additions & 0 deletions src/OWML.Common/Enums/MenuSide.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace OWML.Common
{
public enum MenuSide
{
LEFT,
CENTER,
RIGHT
}
}
6 changes: 6 additions & 0 deletions src/OWML.Common/Interfaces/IModBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ public interface IModBehaviour

object GetApi();

void SetupTitleMenu();

void SetupPauseMenu();

void SetupOptionsMenu();

void Init(IModHelper helper);
}
}
2 changes: 1 addition & 1 deletion src/OWML.Common/Interfaces/IModData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public interface IModData

IModConfig Config { get; }

IModConfig DefaultConfig { get; }
IModDefaultConfig DefaultConfig { get; }

IModStorage Storage { get; }

Expand Down
15 changes: 15 additions & 0 deletions src/OWML.Common/Interfaces/IModDefaultConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Collections.Generic;

namespace OWML.Common
{
public interface IModDefaultConfig
{
bool Enabled { get; set; }

Dictionary<string, object> Settings { get; set; }

T GetSettingsValue<T>(string key);

IModConfig Copy();
}
}
6 changes: 6 additions & 0 deletions src/OWML.Common/Interfaces/IModHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using OWML.Common.Menus;
using System;

namespace OWML.Common
{
Expand All @@ -16,14 +17,19 @@ public interface IModHelper

IModStorage Storage { get; }

[Obsolete("Use the new menu system instead.", true)]
IModMenus Menus { get; }

IModManifest Manifest { get; }

IModConfig Config { get; }

IModDefaultConfig DefaultConfig { get; }

IOwmlConfig OwmlConfig { get; }

IModInteraction Interaction { get; }

IMenuManager MenuHelper { get; }
}
}
14 changes: 14 additions & 0 deletions src/OWML.Common/Interfaces/Menus/IMenuManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Collections.Generic;

namespace OWML.Common
{
public interface IMenuManager
{
public ITitleMenuManager TitleMenuManager { get; }
public IPauseMenuManager PauseMenuManager { get; }
public IOptionsMenuManager OptionsMenuManager { get; }
public IPopupMenuManager PopupMenuManager { get; }

internal IList<IModBehaviour> ModList { get; set; }
}
}
13 changes: 13 additions & 0 deletions src/OWML.Common/Interfaces/Menus/IOWMLFourChoicePopupMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace OWML.Common
{
public interface IOWMLFourChoicePopupMenu
{
event PopupConfirmEvent OnPopupConfirm1;
event PopupConfirmEvent OnPopupConfirm2;
event PopupConfirmEvent OnPopupConfirm3;
event PopupValidateEvent OnPopupValidate;
event PopupCancelEvent OnPopupCancel;

void EnableMenu(bool value);
}
}
7 changes: 7 additions & 0 deletions src/OWML.Common/Interfaces/Menus/IOWMLMenuValueOption.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace OWML.Common
{
public interface IOWMLMenuValueOption
{
string ModSettingKey { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace OWML.Common
{
public delegate void OptionValueChangedEvent(int newIndex, string newSelection);

public interface IOWMLOptionsSelectorElement : IOWMLMenuValueOption
{
public event OptionValueChangedEvent OnValueChanged;
}
}
17 changes: 17 additions & 0 deletions src/OWML.Common/Interfaces/Menus/IOWMLPopupInputMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using UnityEngine.UI;

namespace OWML.Common.Interfaces.Menus
{
public interface IOWMLPopupInputMenu
{
public event PopupInputMenu.InputPopupValidateCharEvent OnInputPopupValidateChar;

public void EnableMenu(bool value);

public string GetInputText();

public InputField GetInputField();

public event PopupMenu.PopupConfirmEvent OnPopupConfirm;
}
}
9 changes: 9 additions & 0 deletions src/OWML.Common/Interfaces/Menus/IOWMLSliderElement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace OWML.Common
{
public delegate void FloatOptionValueChangedEvent(float newValue);

public interface IOWMLSliderElement : IOWMLMenuValueOption
{
public event FloatOptionValueChangedEvent OnValueChanged;
}
}
11 changes: 11 additions & 0 deletions src/OWML.Common/Interfaces/Menus/IOWMLTextEntryElement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace OWML.Common
{
public delegate void TextEntryConfirmEvent();

public interface IOWMLTextEntryElement : IOWMLMenuValueOption
{
public event TextEntryConfirmEvent OnConfirmEntry;

public string GetInputText();
}
}
Loading
Loading