Skip to content

Commit

Permalink
2.2.0 (#395)
Browse files Browse the repository at this point in the history
* fixed asset colors

* 2.0.1

* fixed exiting from OWML config menu with button press (#371)

* Allow external patchers to execute before the game (#370)

* Added support for external patchers declared in the manifest

* Fixed typo

* Only check for patcher parameter

* Fixed identation

* again...

* Removed useless check

Co-authored-by: Ricardo <[email protected]>

* ModsMenu fixes (#374) (#375)

* Cancel now also saves, properly unsubscribe events when scene changes

* Conform to repo's code style

* Remove useless cleanup logic

Co-authored-by: artum <[email protected]>

* 2.1.0 (#376)

* Remove RequireVR (#378)

* patcher cleanup (#379)

* patcher cleanup

* cleanup

* cleanup

* Select first fix (#380)

* fixed SelectFirstOnActivate in OWML menus and tweaked nav generation

* Fixed issue with selector, text, and number inputs (#389)

* Better tab nav (#382)

* Run game through epic launcher / steam (#381)

* Remove redundant description (#386)

No longer used anywhere

* Fixes Issue#390: Controller Overriding Input Values (#392)

* Fix Text Input

* Fix number input

* Adding separators as mod settings, to make large configurations easier to parse (#393)

* Added deeper menus for text and number inputs (#394)

* Merge + cleanup (#396)

* fix manifest versions

* Prevent warning on minor version difference

* Option to launch through exe (#402)

* remove test unpatching in sample mod

* update sample mods' owml version

* add forceExe option to owml config

* use forceExe config to force running through exe

* PopupInput fixes (#404)

* first batch (still doesn't reopen the correct menu and has a bunch of debug lines)

* exiting InputPopup now seems to return to it's ModConfig tab correctly

* fixfixfix (something something pause menu)

* removed stray tabs

* removed comments

* Scrollable modconfigmenus (#406)

* added names to added gameObjects (#407)

* modmenus names

* also a main/pause menu MODS button

* Always save when exiting (#408)

* Update ModMenu.cs (#405)

Some minor refactoring to make it more obvious what is happening.

* added null mod check (#409)

Co-authored-by: Aleksandr <[email protected]>
Co-authored-by: artum <[email protected]>
Co-authored-by: Ricardo <[email protected]>
Co-authored-by: Joseph <[email protected]>
Co-authored-by: _nebula <[email protected]>
Co-authored-by: Raicuparta <[email protected]>
  • Loading branch information
7 people authored Nov 13, 2021
1 parent 2bfe6e3 commit 676d21a
Show file tree
Hide file tree
Showing 27 changed files with 208 additions and 82 deletions.
10 changes: 9 additions & 1 deletion src/OWML.Abstractions/ProcessHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@ namespace OWML.Abstractions
{
public class ProcessHelper : IProcessHelper
{
public void Start(string path, string[] args) =>
public void Start(string path, string[] args = null)
{
if (args is null)
{
Process.Start(path);
return;
}

Process.Start(path, string.Join(" ", args));
}

public void KillCurrentProcess() =>
Process.GetCurrentProcess().Kill();
Expand Down
4 changes: 2 additions & 2 deletions src/OWML.Common/Interfaces/IOwmlConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ public interface IOwmlConfig

string LogsPath { get; }

bool BlockInput { get; set; }

bool DebugMode { get; set; }

bool ForceExe { get; set; }

int SocketPort { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/OWML.Common/Interfaces/IProcessHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public interface IProcessHelper
{
void Start(string path, string[] args);
void Start(string path, string[] args = null);

void KillCurrentProcess();
}
Expand Down
3 changes: 2 additions & 1 deletion src/OWML.Common/Interfaces/Menus/IModConfigMenuBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ void Initialize(
IModSliderInput sliderTemplate,
IModTextInput textInputTemplate,
IModNumberInput numberInputTemplate,
IModSelectorInput selectorTemplate);
IModSelectorInput selectorTemplate,
IModSeparator seperatorTemplate);
}
}
4 changes: 2 additions & 2 deletions src/OWML.Common/Interfaces/Menus/IModTabbedMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public interface IModTabbedMenu : IModPopupMenu

new IModTabbedMenu Copy();

void Initialize(TabbedMenu menu);
void Initialize(TabbedMenu menu, int menuStackCount);

new TabbedMenu Menu { get; }

void AddTab(IModTabMenu tab);
void AddTab(IModTabMenu tab, bool enable = true);

void SetIsBlocking(bool isBlocking);
}
Expand Down
6 changes: 3 additions & 3 deletions src/OWML.Common/OwmlConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ public class OwmlConfig : IOwmlConfig
[JsonProperty("gamePath")]
public string GamePath { get; set; }

[JsonProperty("combinationsBlockInput")]
public bool BlockInput { get; set; }

[JsonProperty("debugMode")]
public bool DebugMode { get; set; }

[JsonProperty("forceExe")]
public bool ForceExe { get; set; }

[JsonIgnore]
public string DataPath => $"{GamePath}/OuterWilds_Data";

Expand Down
29 changes: 26 additions & 3 deletions src/OWML.Launcher/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,36 @@ private void ExecutePatcher(IModData modData)

private void StartGame()
{
_writer.WriteLine("Starting game...");

_argumentHelper.RemoveArgument("consolePort");

try
{
_processHelper.Start(_owmlConfig.ExePath, _argumentHelper.Arguments);
void StartGameViaExe()
{
_writer.WriteLine("Starting game via exe...");
_processHelper.Start(_owmlConfig.ExePath, _argumentHelper.Arguments);
}

if (_owmlConfig.ForceExe)
{
StartGameViaExe();
return;
}

if (_owmlConfig.GamePath.ToLower().Contains("epic"))
{
_writer.WriteLine("Starting game via Epic Launcher...");
_processHelper.Start("\"com.epicgames.launcher://apps/starfish%3A601d0668cef146bd8eef75d43c6bbb0b%3AStarfish?action=launch&silent=true\"");
}
else if (_owmlConfig.GamePath.ToLower().Contains("steam"))
{
_writer.WriteLine("Starting game via Steam...");
_processHelper.Start("steam://rungameid/753640");
}
else
{
StartGameViaExe();
}
}
catch (Exception ex)
{
Expand Down
1 change: 1 addition & 0 deletions src/OWML.Launcher/OWML.DefaultConfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"gamePath": "C:/Program Files (x86)/Steam/steamapps/common/Outer Wilds",
"debugMode": false,
"forceExe": false,
"socketPort": 0
}
7 changes: 3 additions & 4 deletions src/OWML.Launcher/OWML.Manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"author": "Alek",
"name": "OWML",
"uniqueName": "Alek.OWML",
"version": "2.1.0",
"description": "The mod loader and mod framework for Outer Wilds",
"minGameVersion": "1.1.8",
"maxGameVersion": "1.1.10.47"
"version": "2.2.0",
"minGameVersion": "1.1.10.47",
"maxGameVersion": "1.1.11.72"
}
5 changes: 4 additions & 1 deletion src/OWML.ModHelper.Menus/ModConfigMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ protected override void OnSave()
foreach (var key in keys)
{
var value = GetInputValue(key);
ModData.Config.SetSettingsValue(key, value);
if (value != null)
{
ModData.Config.SetSettingsValue(key, value);
}
}
ModData.Storage.Save(ModData.Config, Constants.ModConfigFileName);
Mod?.Configure(ModData.Config);
Expand Down
39 changes: 38 additions & 1 deletion src/OWML.ModHelper.Menus/ModConfigMenuBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public abstract class ModConfigMenuBase : ModMenuWithSelectables, IModConfigMenu
private IModSelectorInput _selectorTemplate;
private IModTextInput _textInputTemplate;
private IModNumberInput _numberInputTemplate;
private IModSeparator _seperatorTemplate;

protected abstract void AddInputs();

Expand All @@ -31,13 +32,14 @@ protected ModConfigMenuBase(IModManifest manifest, IModStorage storage, IModCons

public void Initialize(Menu menu, IModToggleInput toggleTemplate, IModSliderInput sliderTemplate,
IModTextInput textInputTemplate, IModNumberInput numberInputTemplate,
IModSelectorInput selectorTemplate)
IModSelectorInput selectorTemplate, IModSeparator seperatorTemplate)
{
_toggleTemplate = toggleTemplate;
_sliderTemplate = sliderTemplate;
_textInputTemplate = textInputTemplate;
_numberInputTemplate = numberInputTemplate;
_selectorTemplate = selectorTemplate;
_seperatorTemplate = seperatorTemplate;

base.Initialize(menu);
menu.SetValue("_menuOptions", new MenuOption[] { });
Expand Down Expand Up @@ -78,6 +80,9 @@ protected void AddConfigInput(string key, object value, int index)
var settingType = (string)obj["type"];
switch (settingType)
{
case "separator":
AddSeparator(key, obj, index);
return;
case "slider":
AddSliderInput(key, obj, index);
return;
Expand All @@ -87,6 +92,12 @@ protected void AddConfigInput(string key, object value, int index)
case "selector":
AddSelectorInput(key, obj, index);
return;
case "text":
AddTextInput(key, obj, index);
return;
case "number":
AddNumberInput(key, obj, index);
return;
default:
Console.WriteLine("Unrecognized complex setting type: " + settingType, MessageType.Warning);
return;
Expand Down Expand Up @@ -132,17 +143,43 @@ private void AddSelectorInput(string key, JObject obj, int index)
selector.Show();
}

private void AddTextInput(string key, JObject obj, int index)
{
var textInput = AddTextInput(_textInputTemplate.Copy(key), index);
textInput.Element.name = key;
textInput.Title = (string)obj["title"] ?? key;
textInput.Show();
}

private void AddTextInput(string key, int index)
{
var textInput = AddTextInput(_textInputTemplate.Copy(key), index);
textInput.Element.name = key;
textInput.Title = key;
textInput.Show();
}

private void AddNumberInput(string key, JObject obj, int index)
{
var numberInput = AddNumberInput(_numberInputTemplate.Copy(key), index);
numberInput.Element.name = key;
numberInput.Title = (string)obj["title"] ?? key;
numberInput.Show();
}

private void AddNumberInput(string key, int index)
{
var numberInput = AddNumberInput(_numberInputTemplate.Copy(key), index);
numberInput.Element.name = key;
numberInput.Title = key;
numberInput.Show();
}

private void AddSeparator(string key, JObject obj, int index)
{
var numberInput = AddSeparator(_seperatorTemplate.Copy("Inputs"), index);
numberInput.Element.name = key;
numberInput.Title = (string)obj["title"] ?? key;
numberInput.Show();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/OWML.ModHelper.Menus/ModInputMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ public void Open(InputType inputType, string value)
}
var message = inputType == InputType.Number ? "Write a number" : "Write some text";

_inputMenu.Invoke("InitializeMenu");
_inputMenu.Activate();
_inputMenu.EnableMenu(true);

var okPrompt = new ScreenPrompt(InputLibrary.confirm2, "OK");
var cancelCommand = OWInput.UsingGamepad() ? InputLibrary.cancel : InputLibrary.escape;
Expand All @@ -60,6 +59,7 @@ public IModInputMenu Copy()
var newPopupObject = CopyMenu();
var newPopup = new ModInputMenu(Console);
newPopup.Initialize(newPopupObject.GetComponent<PopupInputMenu>());
newPopup._inputMenu.SetValue("_initialized", false);
return newPopup;
}

Expand Down
2 changes: 1 addition & 1 deletion src/OWML.ModHelper.Menus/ModMainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void Initialize(TitleScreenManager titleScreenManager)
QuitButton = GetTitleButton("Button-Exit");

var tabbedMenu = titleScreenManager.GetValue<TabbedMenu>("_optionsMenu");
OptionsMenu.Initialize(tabbedMenu);
OptionsMenu.Initialize(tabbedMenu, 0);
InvokeOnInit();
}

Expand Down
10 changes: 8 additions & 2 deletions src/OWML.ModHelper.Menus/ModMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ public object GetInputValue(string key)
{
return numberInput.Value;
}
Console.WriteLine($"Error - No input found with name {key}", MessageType.Error);
if (GetSeparator(key) == null)
{
Console.WriteLine($"Error - No input found with name {key}", MessageType.Error);
}
return null;
}

Expand Down Expand Up @@ -278,7 +281,10 @@ public void SetInputValue(string key, object value)
numberInput.Value = Convert.ToSingle(val);
return;
}
Console.WriteLine("Error - No input found with name " + key, MessageType.Error);
if (GetSeparator(key) == null)
{
Console.WriteLine("Error - No input found with name " + key, MessageType.Error);
}
}

protected void InvokeOnInit() =>
Expand Down
7 changes: 1 addition & 6 deletions src/OWML.ModHelper.Menus/ModMenuWithSelectables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,11 @@ protected virtual void OnDeactivateMenu()

protected virtual void OnButton(IInputCommands command)
{
if (command == InputLibrary.confirm || command == InputLibrary.enter2 || command == InputLibrary.cancel)
if (command == InputLibrary.confirm || command == InputLibrary.enter2 || command == InputLibrary.cancel || command == InputLibrary.escape)
{
command.ConsumeInput();
OnSave();
}
if (command == InputLibrary.escape)
{
command.ConsumeInput();
OnExit();
}
if (command == InputLibrary.setDefaults)
{
command.ConsumeInput();
Expand Down
1 change: 1 addition & 0 deletions src/OWML.ModHelper.Menus/ModNumberInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public override float Value
{
_value = value;
Button.Title = value.ToString();
SelectorElement.Initialize(0, new string[] { value.ToString() });
InvokeOnChange(value);
}
}
Expand Down
Loading

0 comments on commit 676d21a

Please sign in to comment.