Skip to content

Commit

Permalink
Merge pull request #5 from Auros/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
ErisApps authored Oct 1, 2021
2 parents 8ea26b8 + d0c5a9b commit 12548f8
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 33 deletions.
4 changes: 4 additions & 0 deletions EnhancedStreamChat/Chat/ChatDisplay.Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@ private void PostParse()
_backgroundColorSetting.editButton.onClick.AddListener(HideSettings);
_backgroundColorSetting.modalColorPicker.cancelEvent += ShowSettings;
_backgroundColorSetting.CurrentColor = _chatConfig.BackgroundColor;

// accent
_accentColorSetting.editButton.onClick.AddListener(HideSettings);
_accentColorSetting.modalColorPicker.cancelEvent += ShowSettings;
_accentColorSetting.CurrentColor = _chatConfig.AccentColor;

// highlight
_highlightColorSetting.editButton.onClick.AddListener(HideSettings);
_highlightColorSetting.modalColorPicker.cancelEvent += ShowSettings;
_highlightColorSetting.CurrentColor = _chatConfig.HighlightColor;

// ping
_pingColorSetting.editButton.onClick.AddListener(HideSettings);
_pingColorSetting.modalColorPicker.cancelEvent += ShowSettings;
_pingColorSetting.CurrentColor = _chatConfig.PingColor;

// text
_textColorSetting.editButton.onClick.AddListener(HideSettings);
_textColorSetting.modalColorPicker.cancelEvent += ShowSettings;
Expand Down
46 changes: 25 additions & 21 deletions EnhancedStreamChat/Chat/ChatDisplay.bsml
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
<bg xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='https://raw.githubusercontent.com/monkeymanboy/BSML-Docs/gh-pages/BSMLSchema.xsd'>
<clickable-image id="settings-icon" src='EnhancedStreamChat.Resources.Settings.png' click-event='show-settings' ignore-layout='true' anchor-min-x='0.96' anchor-max-x='0.96' anchor-min-y='0.04' anchor-max-y='0.04' size-delta-x='7' preserve-aspect='true' default-color='#FFFFFF11' highlight-color='#FFFFFFFF'></clickable-image>
<clickable-image id="settings-icon" src='EnhancedStreamChat.Resources.Settings.png' click-event='show-settings' ignore-layout='true' anchor-min-x='0.96' anchor-max-x='0.96' anchor-min-y='0.04'
anchor-max-y='0.04' size-delta-x='7' preserve-aspect='true' default-color='#FFFFFF11' highlight-color='#FFFFFFFF'/>
<modal id="settings-modal" show-event='show-settings' hide-event='hide-settings' move-to-center="true" click-off-closes="true" size-delta-x='~settings-width' size-delta-y='100'>
<vertical child-control-height='false' child-expand-height='false' pad-top='6'>
<!--<horizontal bg='panel-top' pad-left='15' pad-right='15' horizontal-fit='PreferredSize'>
<text text='Enhanced Stream Chat v3' align='Center' font-size='8'/>
</horizontal>-->
<tab-selector tab-tag='settings-tab'></tab-selector>
<tab-selector tab-tag='settings-tab'/>
<vertical pad-top='77'>
<button text='Close' click-event='hide-settings'></button>
<button text='Close' click-event='hide-settings'/>
</vertical>
<tab tags ='settings-tab' tab-name='Layout'>
<vertical pad='10' pad-top='5' child-control-height='false' child-expand-height='false' child-align='UpperCenter' pref-width='~settings-width'>
<bool-setting text='Allow Movement' pref-height='6' value='allow-movement' apply-on-change='true' bind-value='true'></bool-setting>
<bool-setting text='Allow Movement' pref-height='6' value='allow-movement' apply-on-change='true' bind-value='true'/>
<bool-setting text='Same position in-game/menu' hover-hint='This setting makes it possible to set the position (and rotation) of the chat for both in-game as menu at the same time.' pref-height='6' value='sync-orientation' apply-on-change='true' bind-value='true'/>
<bool-setting text='Reverse Chat Order' pref-height='6' value='reverse-chat-order' apply-on-change='true' bind-value='true'></bool-setting>
<slider-setting text='Chat Width' min='5' max='1000' increment='5' pref-height='6' value='chat-width' apply-on-change='true' integer-only='true'></slider-setting>
<slider-setting text='Chat Height' min='5' max='1000' increment='5' pref-height='6' value='chat-height' apply-on-change='true' integer-only='true'></slider-setting>
<slider-setting text='Font Size' min='1' max='20' increment='0.1' pref-height='6' value='font-size' apply-on-change='true'></slider-setting>
<bool-setting text='Reverse Chat Order' pref-height='6' value='reverse-chat-order' apply-on-change='true' bind-value='true'/>
<slider-setting text='Chat Width' min='5' max='1000' increment='5' pref-height='6' value='chat-width' apply-on-change='true' integer-only='true'/>
<slider-setting text='Chat Height' min='5' max='1000' increment='5' pref-height='6' value='chat-height' apply-on-change='true' integer-only='true'/>
<slider-setting text='Font Size' min='1' max='20' increment='0.1' pref-height='6' value='font-size' apply-on-change='true'/>
</vertical>
</tab>
<tab tags ='settings-tab' tab-name='Colors'>
<vertical pad='10' pad-top='5' child-control-height='false' child-expand-height='false' child-align='UpperCenter' pref-width='~settings-width'>
<color-setting id='background-color-setting' value='background-color' text='Background Color' apply-on-change='true'></color-setting>
<color-setting id='accent-color-setting' value='accent-color' text='Accent Color' apply-on-change='true'></color-setting>
<color-setting id='highlight-color-setting' value='highlight-color' text='Highlight Color' apply-on-change='true'></color-setting>
<color-setting id='ping-color-setting' value='ping-color' text='Ping Color' apply-on-change='true'></color-setting>
<color-setting id='text-color-setting' value='text-color' text='Text Color' apply-on-change='true'></color-setting>
<color-setting id='background-color-setting' value='background-color' text='Background Color' apply-on-change='true'/>
<color-setting id='accent-color-setting' value='accent-color' text='Accent Color' apply-on-change='true'/>
<color-setting id='highlight-color-setting' value='highlight-color' text='Highlight Color' apply-on-change='true'/>
<color-setting id='ping-color-setting' value='ping-color' text='Ping Color' apply-on-change='true'/>
<color-setting id='text-color-setting' value='text-color' text='Text Color' apply-on-change='true'/>
</vertical>
</tab>
<tab tags ='settings-tab' tab-name='Login/Channels'>
<vertical pad='10' pad-top='70' vertical-fit='PreferredSize' child-expand-height='false' child-align='MiddleCenter' pref-width='~settings-width'>
<text text='Login and channel configuration are currently done via your default browser in the new ChatCore webapp.' font-size='5' word-wrapping='true' align='Center'></text>
<text text='Login and channel configuration are currently done via your default browser in the new ChatCore webapp.' font-size='5' word-wrapping='true' align='Center'/>
<horizontal child-expand-width='false' child-align='MiddleCenter' pad-top='10'>
<text text='To launch the ChatCore web app,&#xA0;' font-size='5'></text>
<clickable-text text='click here' hover-hint='The ChatCore web app will allow you to manage chat service logins, add/remove channels, and configure several other preferences.' default-color='#00bcff' on-click='launch-web-app' highlight-color='cyan' font-size='5'></clickable-text>
<text text='.' font-size='5'></text>
<text text='To launch the ChatCore web app,&#xA0;' font-size='5'/>
<clickable-text text='click here' hover-hint='The ChatCore web app will allow you to manage chat service logins, add/remove channels, and configure several other preferences.'
default-color='#00bcff' on-click='launch-web-app' highlight-color='cyan' font-size='5'/>
<text text='.' font-size='5'/>
</horizontal>
</vertical>
</tab>
<tab tags ='settings-tab' tab-name='About'>
<vertical ignore-layout='true' vertical-fit='PreferredSize' child-expand-height='false' anchor-min-x='0' anchor-max-x='0' pad-top='155'>
<clickable-text text='GitHub' hover-hint='Follow the project on GitHub!' default-color='#00bcff' on-click='launch-github' highlight-color='cyan' font-size='5' ></clickable-text>
<clickable-text text='GitHub' hover-hint='Follow the project on GitHub!' default-color='#00bcff' on-click='launch-github' highlight-color='cyan' font-size='5'/>
</vertical>
<vertical ignore-layout='true' vertical-fit='PreferredSize' child-expand-height='false' anchor-min-x='1' anchor-max-x='1' pad-top='155'>
<!--<clickable-text text='Donate' hover-hint='Buy me a pizza!' default-color='#00bcff' on-click='launch-kofi' highlight-color='cyan' font-size='5' ></clickable-text>-->
<text text="~mod-version" font-size='4.5' word-wrapping='true' align='Center'></text>
<text text="~mod-version" font-size='4.5' word-wrapping='true' align='Center'/>
</vertical>
<vertical pad='10' spacing='3' pad-top='72' vertical-fit='PreferredSize' child-expand-height='false' child-align='MiddleCenter' pref-width='~settings-width'>
<clickable-image src='EnhancedStreamChat.Resources.PizzaDog.jpg' hover-hint="Click to feed Pizza Dog a damn pizza." on-click='launch-kofi' preferred-height='35' preserve-aspect='true' highlight-color='#aaaaaa'></clickable-image>
<text text="Enhanced Stream Chat is provided free of charge, and always will be. If you want to show some support, click on the Pizza Dog to open the donation page in your default browser." font-size='4.5' word-wrapping='true' align='Center'></text>
<clickable-image src='EnhancedStreamChat.Resources.PizzaDog.jpg' hover-hint="Click to feed Pizza Dog a damn pizza." on-click='launch-kofi' preferred-height='35' preserve-aspect='true'
highlight-color='#aaaaaa'/>
<text text="Enhanced Stream Chat is provided free of charge, and always will be. If you want to show some support, click on the Pizza Dog to open the donation page in your default browser."
font-size='4.5' word-wrapping='true' align='Center'/>
</vertical>
</tab>
</vertical>
Expand Down
4 changes: 2 additions & 2 deletions EnhancedStreamChat/EnhancedStreamChat.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<HintPath>$(BeatSaberDir)\Libs\ChatCore.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="SemVer">
<HintPath>$(BeatSaberDir)\Libs\SemVer.dll</HintPath>
<Reference Include="Hive.Versioning">
<HintPath>$(BeatSaberDir)\Libs\Hive.Versioning.dll</HintPath>
<Private>false</Private>
</Reference>
<Reference Include="System">
Expand Down
11 changes: 5 additions & 6 deletions EnhancedStreamChat/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,26 @@
using IPALogger = IPA.Logging.Logger;
using EnhancedStreamChat.Chat;
using IPA.Loader;
using System.Reflection;

namespace EnhancedStreamChat
{
[Plugin(RuntimeOptions.DynamicInit)]
public class Plugin
{
internal static Plugin instance { get; private set; }
internal static string Name => "EnhancedStreamChat";
internal static string Version => _meta.Version.ToString() ?? Assembly.GetExecutingAssembly().GetName().Version.ToString();
internal static string Version => _meta.HVersion.ToString();

private static PluginMetadata _meta;
private static PluginMetadata _meta = null!;

[Init]
public void Init(IPALogger logger, PluginMetadata meta)
{
instance = this;
_meta = meta;

Logger.log = logger;
Logger.log.Debug("Logger initialized.");
var config = ChatConfig.instance;

var _ = ChatConfig.instance;
}

[OnEnable]
Expand Down
2 changes: 1 addition & 1 deletion EnhancedStreamChat/Utilities/BeatSaberUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace EnhancedStreamChat.Utilities
public static class BeatSaberUtils
{
private static Material? _noGlow;
public static Material? UINoGlowMaterial => _noGlow ??= new Material(Resources.FindObjectsOfTypeAll<Material>().Where(m => m.name == "UINoGlow").FirstOrDefault());
public static Material? UINoGlowMaterial => _noGlow ??= new Material(Resources.FindObjectsOfTypeAll<Material>().FirstOrDefault(m => m.name == "UINoGlow"));

private static Shader? _tmpNoGlowFontShader;
public static Shader? TMPNoGlowFontShader
Expand Down
6 changes: 3 additions & 3 deletions EnhancedStreamChat/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"name": "Enhanced Stream Chat",
"description": "Enhanced Stream Chat is a rich text chat integration mod, with full unicode, emote, and emoji support.",
"author": "brian91292",
"gameVersion": "1.17.1",
"version": "3.0.0",
"gameVersion": "1.18.0",
"version": "3.0.1",
"dependsOn": {
"BSIPA": "^4.2.0",
"BeatSaberMarkupLanguage": "^1.5.5",
"BeatSaberMarkupLanguage": "^1.5.11",
"BS Utils": "^1.11.0",
"ChatCore": "^2.1.2"
},
Expand Down

0 comments on commit 12548f8

Please sign in to comment.