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

Improved combination input UI, OWML config menu, refactoring of menu code #174

Merged
merged 46 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0be5743
Revert "Launch game with OpenVR flag if VR is required (#124)"
Raicuparta Jul 2, 2020
5e2aeef
Re-revert HasVrMod
Raicuparta Jul 3, 2020
cf8d307
Merge pull request #142 from amazingalek/revert-124-raicuparta/vr-flag
Raicuparta Jul 3, 2020
379efe0
Bump version to 0.4.1
Raicuparta Jul 3, 2020
7ffce6d
Merge pull request #145 from amazingalek/raicuparta/0.4.1
amazingalek Jul 3, 2020
8a282e6
moved CommandLineArguments.cs to ModHelper (#149)
amazingalek Jul 5, 2020
3ed7362
Button base (#151)
amazingalek Jul 9, 2020
0af28b3
added ModCommandListener and ModCommandUpdater
TAImatem Jul 10, 2020
94c6dcb
Merge pull request #159 from amazingalek/tai/InputCommandHandlers
TAImatem Jul 10, 2020
82a8ebd
Command listener event commands (#160)
amazingalek Jul 10, 2020
172f4b6
Config menu for OWML (#147)
amazingalek Jul 10, 2020
0f5f78b
Introduced common Interface for ModMainMenu and ModPauseMenu
TAImatem Jul 10, 2020
0636350
fixed removal in invokes
TAImatem Jul 10, 2020
e128b5a
Merge pull request #166 from amazingalek/tai/ListenerFix
TAImatem Jul 10, 2020
c9f719b
Merge pull request #165 from amazingalek/tai/InitializeMerge
TAImatem Jul 10, 2020
2a13839
made Console protected in menus
TAImatem Jul 10, 2020
aae751c
turned empty .ctors into one-liners
TAImatem Jul 10, 2020
e7077b2
Merge pull request #170 from amazingalek/tai/protectedConsole
TAImatem Jul 10, 2020
3ec73ad
menus for ModInputHandler (#122)
TAImatem Jul 11, 2020
f98f03c
renamed BaseConfigMenu to ModConfigMenuBase (#173)
amazingalek Jul 11, 2020
69903c3
isSelected and common parents (#171)
TAImatem Jul 11, 2020
89e4fb4
implemented modPromptButton (#172)
TAImatem Jul 11, 2020
f1830ab
gathered all file reading/writing to one place (#157)
amazingalek Jul 11, 2020
7db68fe
made PromptButton inherit TitleButton (#175)
TAImatem Jul 12, 2020
b3440e8
fixed error from pipeline (there was GUID of TAIcheat still in there)
TAImatem Jul 12, 2020
d605f20
Merge pull request #179 from amazingalek/tai/pipeline-fix
TAImatem Jul 12, 2020
f6485df
Now Menus react to buttons a bit nicer :3 (#176)
TAImatem Jul 12, 2020
e594e15
Now ModPopupInputs properly react to buttons (#177)
TAImatem Jul 12, 2020
bd3cf65
Static gameobject to object (#181)
amazingalek Jul 12, 2020
cd5d02f
version 0.5.0 (#182)
amazingalek Jul 12, 2020
98ad633
Dev master conflicts (#183)
amazingalek Jul 12, 2020
6371c0d
merge
amazingalek Jul 12, 2020
e77078e
Merge pull request #184 from amazingalek/dev-master-conflicts-again
amazingalek Jul 12, 2020
991a2ee
* some formatting (#185)
amazingalek Jul 12, 2020
bf536ca
sacrifice for a better code :P (#186)
TAImatem Jul 12, 2020
76f87de
added `A` binding (#188)
TAImatem Jul 12, 2020
6a47c19
fix conflicting bindings in Combination editor menu (#190)
TAImatem Jul 13, 2020
bcd2b16
Backward Combatibility fix (#194)
TAImatem Jul 13, 2020
4b7f678
Tai/input handler improvements (#191)
TAImatem Jul 13, 2020
4dfbe42
made sure PopupInput will be reselected after Popup gets closed even …
TAImatem Jul 14, 2020
830ba4a
Merge pull request #204 from amazingalek/tai/PopupInputGetsReselected…
TAImatem Jul 14, 2020
ed64aae
Fix duplicate mods and fix dependancy errors (#200)
misternebula Jul 14, 2020
5d6088f
removed rebinding menu workaround (#201)
amazingalek Jul 14, 2020
bae6b74
menu boundary fix (#206)
amazingalek Jul 14, 2020
b38a8cc
added .Show
TAImatem Jul 14, 2020
0107764
Merge pull request #207 from amazingalek/tai/AddedShow
TAImatem Jul 14, 2020
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
3 changes: 3 additions & 0 deletions OWML.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ public class Constants
{
public const string QuitKeyPhrase = "{RageAgainstTheDyingOfTheLight}";
public const string ConsolePortArgument = "consolePort";
public const string OwmlConfigFileName = "OWML.Config.json";
public const string OwmlDefaultConfigFileName = "OWML.DefaultConfig.json";
public const string OwmlManifestFileName = "OWML.Manifest.json";
}
}
3 changes: 3 additions & 0 deletions OWML.Common/IHarmonyHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ public interface IHarmonyHelper
{
void AddPrefix<T>(string methodName, Type patchType, string patchMethodName);
void AddPrefix(MethodBase methodInfo, Type patchType, string patchMethodName);

void AddPostfix<T>(string methodName, Type patchType, string patchMethodName);
void AddPostfix(MethodBase methodInfo, Type patchType, string patchMethodName);

void EmptyMethod<T>(string methodName);
void EmptyMethod(MethodBase methodInfo);

void Transpile<T>(string methodName, Type patchType, string patchMethodName);
void Transpile(MethodBase methodInfo, Type patchType, string patchMethodName);
}
Expand Down
1 change: 1 addition & 0 deletions OWML.Common/IModConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public interface IModConfig
bool Enabled { get; set; }
bool RequireVR { get; set; }
Dictionary<string, object> Settings { get; set; }

T GetSettingsValue<T>(string key);
void SetSettingsValue(string key, object value);

Expand Down
2 changes: 0 additions & 2 deletions OWML.Common/IModData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ public interface IModData
IModManifest Manifest { get; }
IModConfig Config { get; }
IModConfig DefaultConfig { get; }

void ResetConfig();
}
}
3 changes: 1 addition & 2 deletions OWML.Common/IModInputCombination.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using UnityEngine;

namespace OWML.Common
Expand Down
5 changes: 4 additions & 1 deletion OWML.Common/IModInputHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace OWML.Common
using System.Collections.Generic;

namespace OWML.Common
{
public interface IModInputHandler
{
Expand All @@ -14,5 +16,6 @@ public interface IModInputHandler
bool IsNewlyPressed(IModInputCombination combo);
bool WasTapped(IModInputCombination combo);
bool WasNewlyReleased(IModInputCombination combo);
List<string> GetWarningMessages(string combinations);
}
}
6 changes: 3 additions & 3 deletions OWML.Common/IOwmlConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ public interface IOwmlConfig
string ManagedPath { get; }
string PluginsPath { get; }
string DataPath { get; }
string OWMLPath { get; }
string OWMLPath { get; set; }
string ModsPath { get; }
string OutputFilePath { get; }
string LogFilePath { get; }
bool Verbose { get; }
bool BlockInput { get; }
bool Verbose { get; set; }
bool BlockInput { get; set; }
}
}
14 changes: 3 additions & 11 deletions OWML.Common/Menus/IModButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,24 @@

namespace OWML.Common.Menus
{
public interface IModButton
public interface IModButton : IModButtonBase
{
event Action OnClick;
string Title { get; set; }
int Index { get; set; }
Button Button { get; }
void Initialize(IModMenu menu);
string Title { get; set; }

IModButton Copy();
new IModButton Copy();
IModButton Copy(string title);
IModButton Copy(int index);
IModButton Copy(string title, int index);

IModButton Duplicate();
IModButton Duplicate(string title);
IModButton Duplicate(int index);
IModButton Duplicate(string title, int index);

IModButton Replace();
IModButton Replace(string title);
IModButton Replace(int index);
IModButton Replace(string title, int index);

void Show();
void Hide();

void SetControllerCommand(SingleAxisCommand inputCommand);
}
}
26 changes: 26 additions & 0 deletions OWML.Common/Menus/IModButtonBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using UnityEngine.UI;

namespace OWML.Common.Menus
{
public interface IModButtonBase
{
event Action OnClick;
int Index { get; set; }
Button Button { get; }
bool IsSelected { get; }
void Initialize(IModMenu menu);

IModButtonBase Copy();
IModButtonBase Copy(int index);

IModButtonBase Duplicate();
IModButtonBase Duplicate(int index);

IModButtonBase Replace();
IModButtonBase Replace(int index);

void Show();
void Hide();
}
}
1 change: 1 addition & 0 deletions OWML.Common/Menus/IModComboInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
public interface IModComboInput : IModInput<string>
{
IModLayoutButton Button { get; }
IModComboInput Copy();
IModComboInput Copy(string key);
}
Expand Down
4 changes: 1 addition & 3 deletions OWML.Common/Menus/IModConfigMenu.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
namespace OWML.Common.Menus
{
public interface IModConfigMenu : IModPopupMenu
public interface IModConfigMenu : IModConfigMenuBase
{
IModData ModData { get; }
IModBehaviour Mod { get; }

void Initialize(Menu modMenuCopy, IModToggleInput toggleTemplate, IModSliderInput sliderTemplate, IModTextInput textInputTemplate, IModNumberInput numberInputTemplate, IModComboInput comboInputTemplate);
}
}
10 changes: 10 additions & 0 deletions OWML.Common/Menus/IModConfigMenuBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace OWML.Common.Menus
{
public interface IModConfigMenuBase : IModPopupMenu
{
IModManifest Manifest { get; }

void Initialize(Menu modMenuCopy, IModToggleInput toggleTemplate, IModSliderInput sliderTemplate,
IModTextInput textInputTemplate, IModNumberInput numberInputTemplate, IModComboInput comboInputTemplate);
}
}
7 changes: 7 additions & 0 deletions OWML.Common/Menus/IModFieldInput.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace OWML.Common.Menus
{
public interface IModFieldInput<T> : IModInput<T>
{
IModButton Button { get; }
}
}
9 changes: 1 addition & 8 deletions OWML.Common/Menus/IModInput.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
using System;
using UnityEngine;

namespace OWML.Common.Menus
{
public interface IModInput<T>
public interface IModInput<T> : IModInputBase
{
event Action<T> OnChange;
T Value { get; set; }
MonoBehaviour Element { get; }
string Title { get; set; }
int Index { get; set; }
void Show();
void Hide();
void Initialize(IModMenu menu);
}
}
15 changes: 15 additions & 0 deletions OWML.Common/Menus/IModInputBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using UnityEngine;

namespace OWML.Common.Menus
{
public interface IModInputBase
{
MonoBehaviour Element { get; }
string Title { get; set; }
int Index { get; set; }
bool IsSelected { get; }
void Show();
void Hide();
void Initialize(IModMenu menu);
}
}
10 changes: 10 additions & 0 deletions OWML.Common/Menus/IModInputCombinationElement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace OWML.Common.Menus
{
public interface IModInputCombinationElement : IModToggleInput
{
IModLayoutManager Layout { get; }
void Destroy();
void DestroySelf();
new IModInputCombinationElement Copy(string combination);
}
}
14 changes: 14 additions & 0 deletions OWML.Common/Menus/IModInputCombinationElementMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;

namespace OWML.Common.Menus
{
public interface IModInputCombinationElementMenu : IModMenu
{
event Action<string> OnConfirm;
event Action OnCancel;

void Initialize(PopupInputMenu menu);
void Open(string value, string comboName, IModInputCombinationMenu combinationMenu = null,
IModInputCombinationElement element = null);
}
}
17 changes: 17 additions & 0 deletions OWML.Common/Menus/IModInputCombinationMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;

namespace OWML.Common.Menus
{
public interface IModInputCombinationMenu : IModPopupMenu
{
event Action<string> OnConfirm;
event Action OnCancel;

List<IModInputCombinationElement> CombinationElements { get; }
string GenerateCombination();
void FillMenu(string combination);
void Initialize(Menu menu, IModInputCombinationElement combinationElementTemplate);
void RemoveCombinationElement(IModInputCombinationElement element);
}
}
30 changes: 2 additions & 28 deletions OWML.Common/Menus/IModLayoutButton.cs
Original file line number Diff line number Diff line change
@@ -1,33 +1,7 @@
using System;
using UnityEngine;
using UnityEngine.UI;

namespace OWML.Common.Menus
{
public interface IModLayoutButton
public interface IModLayoutButton : IModButtonBase
{
event Action OnClick;
HorizontalLayoutGroup LayoutGroup { get; }
int Index { get; set; }
Button Button { get; }
void UpdateState();
void Initialize(IModMenu menu);

IModLayoutButton Copy();
IModLayoutButton Copy(int index);

IModLayoutButton Duplicate();
IModLayoutButton Duplicate(int index);

IModLayoutButton Replace();
IModLayoutButton Replace(int index);

void Show();
void Hide();

void SetControllerCommand(SingleAxisCommand inputCommand);

void AddText(string text);
void AddPicture(Texture2D texture, float scale = 1.0f);
IModLayoutManager Layout { get; }
}
}
18 changes: 18 additions & 0 deletions OWML.Common/Menus/IModLayoutManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using UnityEngine;
using UnityEngine.UI;

namespace OWML.Common.Menus
{
public interface IModLayoutManager
{
LayoutGroup LayoutGroup { get; }
int ChildCount { get; }

void UpdateState();
void Clear();
void AddText(string text);
void AddTextAt(string text, int index);
void AddPicture(Texture2D texture, float scale = 1.0f);
void AddPictureAt(Texture2D texture, int index, float scale = 1.0f);
}
}
9 changes: 4 additions & 5 deletions OWML.Common/Menus/IModMainMenu.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
namespace OWML.Common.Menus
{
public interface IModMainMenu : IModMenu
public interface IModMainMenu : IModOWMenu
{
IModTabbedMenu OptionsMenu { get; }

new IModTabbedMenu OptionsMenu { get; }
new IModButton OptionsButton { get; }
new IModButton QuitButton { get; }
IModButton ResumeExpeditionButton { get; }
IModButton NewExpeditionButton { get; }
IModButton OptionsButton { get; }
IModButton ViewCreditsButton { get; }
IModButton SwitchProfileButton { get; }
IModButton QuitButton { get; }

void Initialize(TitleScreenManager titleScreenManager);
}
Expand Down
12 changes: 10 additions & 2 deletions OWML.Common/Menus/IModMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ public interface IModMenu

Menu Menu { get; }

List<IModButtonBase> BaseButtons { get; }
List<IModButton> Buttons { get; }
List<IModLayoutButton> LayoutButtons { get; }
List<IModPromptButton> PromptButtons { get; }

[Obsolete("Use GetTitleButton instead")]
IModButton GetButton(string title);
IModButton GetTitleButton(string title);
IModPromptButton GetPromptButton(string title);

IModButton AddButton(IModButton button);
IModButton AddButton(IModButton button, int index);
IModLayoutButton AddLayoutButton(IModLayoutButton button);
IModLayoutButton AddLayoutButton(IModLayoutButton button, int index);
IModButtonBase AddButton(IModButtonBase button);
IModButtonBase AddButton(IModButtonBase button, int index);

List<IModToggleInput> ToggleInputs { get; }
IModToggleInput GetToggleInput(string title);
Expand Down
9 changes: 9 additions & 0 deletions OWML.Common/Menus/IModMenuWithSelectables.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace OWML.Common.Menus
{
public interface IModMenuWithSelectables : IModPopupMenu
{
event Action OnCancel;
}
}
3 changes: 3 additions & 0 deletions OWML.Common/Menus/IModMenus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ public interface IModMenus
IModMainMenu MainMenu { get; }
IModPauseMenu PauseMenu { get; }
IModsMenu ModsMenu { get; }
IModConfigMenuBase OwmlMenu { get; }
IModInputMenu InputMenu { get; }
IModInputCombinationElementMenu InputCombinationElementMenu { get; }
IModInputCombinationMenu InputCombinationMenu { get; }
}
}
2 changes: 1 addition & 1 deletion OWML.Common/Menus/IModNumberInput.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace OWML.Common.Menus
{
public interface IModNumberInput : IModInput<float>
public interface IModNumberInput : IModFieldInput<float>
{
IModNumberInput Copy();
IModNumberInput Copy(string key);
Expand Down
9 changes: 9 additions & 0 deletions OWML.Common/Menus/IModOWMenu.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace OWML.Common.Menus
{
public interface IModOWMenu : IModMenu
{
IModTabbedMenu OptionsMenu { get; }
IModButton OptionsButton { get; }
IModButton QuitButton { get; }
}
}
Loading