Skip to content

Commit

Permalink
Merge branch 'mod' into tata-mod
Browse files Browse the repository at this point in the history
  • Loading branch information
drojf committed Dec 26, 2023
2 parents c8e0196 + d42d5cd commit 7fa496e
Show file tree
Hide file tree
Showing 38 changed files with 1,701 additions and 425 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 @@ -239,6 +239,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 @@ -734,7 +734,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 @@ -237,7 +237,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 @@ -497,8 +497,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 @@ -1064,7 +1073,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 @@ -1124,17 +1133,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: 1 addition & 1 deletion Assets.Scripts.UI.CGGallery/GalleryButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ private void OnClick()
{
gameSystem = GameSystem.Instance;
}
if (gameSystem.GameState == GameState.CGGallery && !(time > 0f) && UICamera.currentTouchID == -1)
if (gameSystem.GameState == GameState.CGGallery && !(time > 0f) && UICamera.currentTouchID >= -1)
{
gameSystem.PopStateStack();
BurikoMemory.Instance.SetFlag("LOCALWORK_NO_RESULT", cgslot);
Expand Down
2 changes: 1 addition & 1 deletion Assets.Scripts.UI.ChapterJump/ChapterJumpButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void Disable()

private void OnClick()
{
if (isActive && UICamera.currentTouchID == -1 && GameSystem.Instance.GameState == GameState.ChapterJumpScreen)
if (isActive && UICamera.currentTouchID >= -1 && GameSystem.Instance.GameState == GameState.ChapterJumpScreen)
{
StateChapterJump stateChapterJump = GameSystem.Instance.GetStateObject() as StateChapterJump;
if (stateChapterJump != null)
Expand Down
2 changes: 1 addition & 1 deletion Assets.Scripts.UI.ChapterPreview/ChapterPreviewButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void Disable()

public void OnClick()
{
if (UICamera.currentTouchID == -1 && GameSystem.Instance.GameState == GameState.ChapterPreview)
if (UICamera.currentTouchID >= -1 && GameSystem.Instance.GameState == GameState.ChapterPreview)
{
StateChapterPreview stateChapterPreview = GameSystem.Instance.GetStateObject() as StateChapterPreview;
if (stateChapterPreview != null)
Expand Down
2 changes: 1 addition & 1 deletion Assets.Scripts.UI.ChapterScreen/ChapterButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void Disable()

private void OnClick()
{
if (isActive && UICamera.currentTouchID == -1 && GameSystem.Instance.GameState == GameState.ChapterScreen)
if (isActive && UICamera.currentTouchID >= -1 && GameSystem.Instance.GameState == GameState.ChapterScreen)
{
StateChapterScreen stateChapterScreen = GameSystem.Instance.GetStateObject() as StateChapterScreen;
if (stateChapterScreen != null)
Expand Down
2 changes: 1 addition & 1 deletion Assets.Scripts.UI.Choice/ChoiceButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private void FadeToAlpha(float alpha)

private void OnClick()
{
if (GameSystem.Instance.GameState == GameState.ChoiceScreen && !(fadeInTime > 0f) && isEnabled && UICamera.currentTouchID == -1)
if (GameSystem.Instance.GameState == GameState.ChoiceScreen && !(fadeInTime > 0f) && isEnabled && UICamera.currentTouchID >= -1)
{
if (clickCallback != null)
{
Expand Down
2 changes: 1 addition & 1 deletion Assets.Scripts.UI.Config/ArrowButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class ArrowButton : MonoBehaviour

private void OnClick()
{
if (UICamera.currentTouchID == -1)
if (UICamera.currentTouchID >= -1)
{
Slider.Changestep(StepChange);
}
Expand Down
2 changes: 1 addition & 1 deletion Assets.Scripts.UI.Config/SwitchButtonObj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class SwitchButtonObj : MonoBehaviour

private void OnClick()
{
if (!(cooldown > 0f) && UICamera.currentTouchID == -1)
if (!(cooldown > 0f) && UICamera.currentTouchID >= -1)
{
AudioController.Instance.PlaySystemSound("wa_038.ogg", 1);
controller.Click();
Expand Down
2 changes: 1 addition & 1 deletion Assets.Scripts.UI.Extra/ExtraButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void Disable()

private void OnClick()
{
if (isActive && UICamera.currentTouchID == -1 && GameSystem.Instance.GameState == GameState.ExtraScreen)
if (isActive && UICamera.currentTouchID >= -1 && GameSystem.Instance.GameState == GameState.ExtraScreen)
{
StateExtraScreen stateExtraScreen = GameSystem.Instance.GetStateObject() as StateExtraScreen;
if (stateExtraScreen != null)
Expand Down
4 changes: 3 additions & 1 deletion Assets.Scripts.UI.Menu/MenuUIButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private void OnClick()
{
return;
}
if (gameSystem.GameState == GameState.RightClickMenu && !(time > 0f) && UICamera.currentTouchID == -1 && isEnabled)
if (gameSystem.GameState == GameState.RightClickMenu && !(time > 0f) && UICamera.currentTouchID >= -1 && isEnabled)
{
switch (base.name)
{
Expand All @@ -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
2 changes: 1 addition & 1 deletion Assets.Scripts.UI.Prompt/PromptButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void ChangeButtonImages(string normal, string hover, string down)

private void OnClick()
{
if (isEnabled && GameSystem.Instance.GameState == GameState.DialogPrompt && !(time > 0f) && UICamera.currentTouchID == -1)
if (isEnabled && GameSystem.Instance.GameState == GameState.DialogPrompt && !(time > 0f) && UICamera.currentTouchID >= -1)
{
switch (base.name)
{
Expand Down
9 changes: 5 additions & 4 deletions Assets.Scripts.UI.SaveLoad/SaveLoadButton.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 All @@ -27,7 +28,7 @@ private void OnClick()
{
gameSystem = GameSystem.Instance;
}
if (gameSystem.GameState == GameState.SaveLoadScreen && !(time > 0f) && UICamera.currentTouchID == -1 && isEnabled)
if (gameSystem.GameState == GameState.SaveLoadScreen && !(time > 0f) && UICamera.currentTouchID >= -1 && isEnabled)
{
StateSaveLoad state = gameSystem.GetStateObject() as StateSaveLoad;
if (state != null)
Expand Down Expand Up @@ -67,7 +68,7 @@ private void OnClick()
{
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(d.Path);
Texture2D image = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension + ".png");
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.ExecuteActions();
Expand All @@ -92,7 +93,7 @@ private void OnClick()
{
string fileNameWithoutExtension2 = Path.GetFileNameWithoutExtension(d2.Path);
Texture2D image2 = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension2 + ".png");
promptController2.SetScreenshotDetails(image2, d2.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d2.Text, d2.TextJp);
promptController2.SetScreenshotDetails(image2, d2.Time.ToString(Loc.dateTimeFormat, Loc.cultureInfo), d2.Text, d2.TextJp);
}
});
gameSystem.ExecuteActions();
Expand All @@ -118,7 +119,7 @@ private void OnClick()
{
string fileNameWithoutExtension3 = Path.GetFileNameWithoutExtension(d3.Path);
Texture2D image3 = AssetManager.Instance.LoadScreenshot(fileNameWithoutExtension3 + ".png");
promptController3.SetScreenshotDetails(image3, d3.Time.ToString("ddd MMM dd, yyyy h:mm tt"), d3.Text, d3.TextJp);
promptController3.SetScreenshotDetails(image3, d3.Time.ToString(Loc.dateTimeFormat, Loc.cultureInfo), d3.Text, d3.TextJp);
}
});
break;
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 @@ -90,7 +91,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
2 changes: 1 addition & 1 deletion Assets.Scripts.UI.Tips/TipsButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private void OnClick()
return;
}
GameSystem instance = GameSystem.Instance;
if (instance.GameState == GameState.TipsScreen && isEnabled && manager.isActive && UICamera.currentTouchID == -1)
if (instance.GameState == GameState.TipsScreen && isEnabled && manager.isActive && UICamera.currentTouchID >= -1)
{
StateViewTips stateViewTips = instance.GetStateObject() as StateViewTips;
if (stateViewTips != null)
Expand Down
2 changes: 1 addition & 1 deletion Assets.Scripts.UI.Tips/TipsEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void Init(TipsDataEntry t, TipsManager mg)

private void OnClick()
{
if (UICamera.currentTouchID == -1 && tip != null && manager.isActive && GameSystem.Instance.GameState == GameState.TipsScreen)
if (UICamera.currentTouchID >= -1 && tip != null && manager.isActive && GameSystem.Instance.GameState == GameState.TipsScreen)
{
(GameSystem.Instance.GetStateObject() as StateViewTips)?.OpenTips(tip.Script);
}
Expand Down
2 changes: 1 addition & 1 deletion Assets.Scripts.UI.TitleScreen/TitleScreenButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private void OnClick()

if(gameSystem.MODIgnoreInputs()) { return; }

if (gameSystem.GameState == GameState.TitleScreen && !(time > 0f) && UICamera.currentTouchID == -1)
if (gameSystem.GameState == GameState.TitleScreen && !(time > 0f) && UICamera.currentTouchID >= -1)
{
StateTitle stateTitle = gameSystem.GetStateObject() as StateTitle;
if (stateTitle != null)
Expand Down
Loading

0 comments on commit 7fa496e

Please sign in to comment.