Skip to content

Commit

Permalink
Merge branch 'mod' into mea-mod
Browse files Browse the repository at this point in the history
# Conflicts:
#	Assets.Scripts.UI.SaveLoad/SaveLoadButton.cs
  • Loading branch information
drojf committed Dec 26, 2023
2 parents 352bb27 + d42d5cd commit 6e5d976
Show file tree
Hide file tree
Showing 25 changed files with 1,685 additions and 409 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build_dll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# NOTE: Releases are not created in this repository!
# DLL builds are compiled/published as part of the releases for each game - please see each game's individual repository.
name: Build DLL

# Run this workflow on every push or pull request
on:
push:
pull_request:

jobs:
build_dll:
name: Build DLL
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v3

# Note: This uses the mono bundled with Ubuntu to build the project
- name: Compile project
run: msbuild /p:Configuration=Release
46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions Assembly-CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
<Compile Include="MOD.Scripts.Core.State\StateMovie.cs" />
<Compile Include="MOD.Scripts.Core.TextWindow\MODTextController.cs" />
<Compile Include="MOD.Scripts.Core\MODLocalization.cs" />
<Compile Include="MOD.Scripts.Core\MODLocalizationData.cs" />
<Compile Include="MOD.Scripts.Core\MODLogger.cs" />
<Compile Include="MOD.Scripts.Core\MODSystem.cs" />
<Compile Include="MOD.Scripts.Core\MODUtility.cs" />
Expand Down
13 changes: 12 additions & 1 deletion Assets.Scripts.Core.Scene/Layer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,18 @@ public void ReloadTexture()
{
if (PrimaryName == string.Empty)
{
HideLayer();
// PrimaryName is set to string.Empty when Layer's texture is released -
// therefore there is no texture to reload, so do nothing here.
//
// Note: Previously there was a HideLayer() call here, which caused problems
// with backgrounds if ReloadTexture() was called just after the game had started
// running, and DrawSceneWithMask() had not yet been called. It would cause
// backgrounds to display for one frame(?), then turn black.
//
// I think may be a special layer is activated on startup, but has no texture set,
// triggering this if statement.
//
// See https://github.com/07th-mod/higurashi-assembly/issues/104 for details
}
else
{
Expand Down
40 changes: 28 additions & 12 deletions Assets.Scripts.Core/GameSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using Assets.Scripts.UI.Choice;
using Assets.Scripts.UI.Config;
using Assets.Scripts.UI.Prompt;
using MOD.Scripts.Core;
using MOD.Scripts.Core.Localization;
using MOD.Scripts.UI;
using System;
using System.Collections;
Expand Down Expand Up @@ -243,7 +243,7 @@ private void Initialize()
{
Logger.Log($"GameSystem: Starting GameSystem - DLL Version: {MODUtility.InformationalVersion()}");
MainUIController.InitializeToaster();
MODLocalization.LoadFromJSON();
Loc.LoadFromJSON();
IsInitialized = true;
AssetManager = new AssetManager();
AudioController = new AudioController();
Expand Down Expand Up @@ -533,8 +533,17 @@ public void CloseChoiceIfExists()
{
if (ChoiceController != null)
{
ChoiceController.Destroy();
ChoiceController = null;
if (GameSystem.Instance.GameState == GameState.ChoiceScreen)
{
// If you're currently on the choice screen, then cleanly leave the choices state and delete the choice controller
LeaveChoices();
}
else
{
// If you're on another screen layered ontop of the choice screen (eg the load screen), just delete the choice controller and hope for the best.
ChoiceController.Destroy();
ChoiceController = null;
}
}
}

Expand Down Expand Up @@ -1110,7 +1119,7 @@ public T ChooseJapaneseEnglish<T>(T japanese, T english)
}
}

public Resolution GetFullscreenResolution()
public Resolution GetFullscreenResolution(bool useOverride = true, bool doLogging = true)
{
Resolution resolution = new Resolution();
string source = "";
Expand Down Expand Up @@ -1170,17 +1179,24 @@ public Resolution GetFullscreenResolution()
PlayerPrefs.SetInt("fullscreen_height_override", 0);
}

if (PlayerPrefs.GetInt("fullscreen_width_override") > 0)
if(useOverride)
{
resolution.width = PlayerPrefs.GetInt("fullscreen_width_override");
source += " + Width Override";
if (PlayerPrefs.GetInt("fullscreen_width_override") > 0)
{
resolution.width = PlayerPrefs.GetInt("fullscreen_width_override");
source += " + Width Override";
}
if (PlayerPrefs.GetInt("fullscreen_height_override") > 0)
{
resolution.height = PlayerPrefs.GetInt("fullscreen_height_override");
source += " + Height Override";
}
}
if (PlayerPrefs.GetInt("fullscreen_height_override") > 0)

if(doLogging)
{
resolution.height = PlayerPrefs.GetInt("fullscreen_height_override");
source += " + Height Override";
Debug.Log("Using resolution " + resolution.width + "x" + resolution.height + " as the fullscreen resolution based on " + source + ".");
}
Debug.Log("Using resolution " + resolution.width + "x" + resolution.height + " as the fullscreen resolution based on " + source + ".");
return resolution;
}

Expand Down
2 changes: 2 additions & 0 deletions Assets.Scripts.UI.Menu/MenuUIButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ private void OnClick()
gameSystem.PopStateStack();
GameSystem.Instance.PushStateObject(new StateDialogPrompt(PromptType.DialogTitle, delegate
{
gameSystem.CloseChoiceIfExists();
gameSystem.ClearActions();
gameSystem.ClearAllWaits();
gameSystem.TextController.ClearText();
Expand All @@ -74,6 +75,7 @@ private void OnClick()
gameSystem.PopStateStack();
GameSystem.Instance.PushStateObject(new StateDialogPrompt(PromptType.DialogExit, delegate
{
gameSystem.CloseChoiceIfExists();
gameSystem.CanExit = true;
Application.Quit();
}, delegate
Expand Down
7 changes: 4 additions & 3 deletions Assets.Scripts.UI.SaveLoad/SaveLoadButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Assets.Scripts.Core.State;
using Assets.Scripts.UI.Prompt;
using System.Collections.Generic;
using MOD.Scripts.Core.Localization;
using System.IO;
using UnityEngine;

Expand Down Expand Up @@ -83,7 +84,7 @@ private void OnClick()
{
string fileNameWithoutExtension3 = Path.GetFileNameWithoutExtension(d5.Path);
Texture2D image3 = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension3 + ".png");
promptController3.SetScreenshotDetails(image3, d5.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d5.Text, d5.TextJp);
promptController3.SetScreenshotDetails(image3, d5.Time.ToString(Loc.dateTimeFormat, Loc.cultureInfo), d5.Text, d5.TextJp);
}
});
gameSystem.ExecuteActions();
Expand All @@ -107,7 +108,7 @@ private void OnClick()
{
string fileNameWithoutExtension2 = Path.GetFileNameWithoutExtension(d4.Path);
Texture2D image2 = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension2 + ".png");
promptController2.SetScreenshotDetails(image2, d4.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d4.Text, d4.TextJp);
promptController2.SetScreenshotDetails(image2, d4.Time.ToString(Loc.dateTimeFormat, Loc.cultureInfo), d4.Text, d4.TextJp);
}
});
goto IL_02e0;
Expand All @@ -133,7 +134,7 @@ private void OnClick()
{
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(d3.Path);
Texture2D image = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension + ".png");
promptController.SetScreenshotDetails(image, d3.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d3.Text, d3.TextJp);
promptController.SetScreenshotDetails(image, d3.Time.ToString(Loc.dateTimeFormat, Loc.cultureInfo), d3.Text, d3.TextJp);
}
});
gameSystem.ExecuteActions();
Expand Down
3 changes: 2 additions & 1 deletion Assets.Scripts.UI.SaveLoad/SaveLoadManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Assets.Scripts.Core.Buriko;
using Assets.Scripts.Core.State;
using Assets.Scripts.UI.Prompt;
using MOD.Scripts.Core.Localization;
using System;
using System.Collections;
using UnityEngine;
Expand Down Expand Up @@ -95,7 +96,7 @@ public void Save(int slot)
DateTime now = DateTime.Now;
string fullText = GameSystem.Instance.TextController.GetFullText(1);
string fullText2 = GameSystem.Instance.TextController.GetFullText(0);
p.SetScreenshotDetails(tex, now.ToString("ddd MMM dd, yyyy h:mm tt"), fullText, fullText2);
p.SetScreenshotDetails(tex, now.ToString(Loc.dateTimeFormat, Loc.cultureInfo), fullText, fullText2);
});
}
});
Expand Down
5 changes: 4 additions & 1 deletion Assets.Scripts.UI.SaveLoad/SaveLoadQSave.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Assets.Scripts.Core.Buriko;
using MOD.Scripts.Core.Localization;
using UnityEngine;

namespace Assets.Scripts.UI.SaveLoad
Expand All @@ -15,11 +16,13 @@ public class SaveLoadQSave : MonoBehaviour

private bool isEnabled = true;



public void EnableEntry(SaveEntry entry)
{
SaveButton.isEnabled = false;
LoadButton.isEnabled = true;
BottomLabel.text = entry.Time.ToString("MMM dd, yyyy h:mm tt");
BottomLabel.text = entry.Time.ToString(Loc.dateTimeFormat, Loc.cultureInfo);
// Save button is never useful so hide it
SaveButton.gameObject.SetActive(false);
}
Expand Down
8 changes: 6 additions & 2 deletions Assets.Scripts.UI/MainUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -558,15 +558,19 @@ public void OnGUI()
return;
}

toaster.OnGUIFragment();

if (this.modMenu == null)
{
// If mod menu not available, just draw any toast notifications and exit
toaster.OnGUIFragment();
return;
}

modMenu.OnGUIFragment();

// If the mod menu is available, draw the toast notifications last,
// so they appear ontop of the mod menu
toaster.OnGUIFragment();

// Helper Functions for processing flags
string boolDesc(string flag, string name)
{
Expand Down
3 changes: 2 additions & 1 deletion Assets.Scripts.UI/SlideBoxButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Assets.Scripts.Core.Buriko;
using Assets.Scripts.Core.State;
using Assets.Scripts.UI.Prompt;
using MOD.Scripts.Core.Localization;
using System.IO;
using UnityEngine;

Expand Down Expand Up @@ -68,7 +69,7 @@ private void OnClick()
Texture2D image = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension + ".png");
Debug.Log(promptController);
Debug.Log(d);
promptController.SetScreenshotDetails(image, d.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d.Text, d.TextJp);
promptController.SetScreenshotDetails(image, d.Time.ToString(Loc.dateTimeFormat, Loc.cultureInfo), d.Text, d.TextJp);
}
});
GameSystem.Instance.ExecuteActions();
Expand Down
Loading

0 comments on commit 6e5d976

Please sign in to comment.