Skip to content

Commit

Permalink
Add new logo, update colors and #22
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesGameDev committed Apr 11, 2024
1 parent 2af52a3 commit bca39f5
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 32 deletions.
4 changes: 1 addition & 3 deletions Fushigi/course/CourseActor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public CourseActor Clone()

public static readonly Dictionary<CourseActorType, uint> CourseActorColors = new()
{
{ CourseActorType.None, ImGui.ColorConvertFloat4ToU32(new(0.8f, 0.8f, 0.8f, 1)) },
{ CourseActorType.None, ImGui.ColorConvertFloat4ToU32(new(0.125f, 0.988f, 0.561f, 1)) },
{ CourseActorType.Tag, ImGui.ColorConvertFloat4ToU32(new(1, 0.55f, 0, 1)) },
{ CourseActorType.Area, ImGui.ColorConvertFloat4ToU32(new(1, 0, 0, 1)) },
{ CourseActorType.Block, ImGui.ColorConvertFloat4ToU32(new(0.125f, 0.976f, 0.988f, 1)) },
Expand All @@ -348,9 +348,7 @@ public CourseActorHolder()
public CourseActorHolder(BymlArrayNode actorArray)
{
foreach (BymlHashTable actor in actorArray.Array)
{
mActors.Add(new CourseActor(actor));
}
}

public bool TryGetActor(ulong hash, [NotNullWhen(true)] out CourseActor? actor)
Expand Down
Binary file modified Fushigi/res/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 26 additions & 27 deletions Fushigi/ui/widgets/CourseScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2616,51 +2616,50 @@ private async Task DeleteObjectsWithWarningPrompt(IReadOnlyList<object> objectsT
{
var actors = objectsToDelete.OfType<CourseActor>();
if (actors.Count() == 1)
actionName = "Delete "+actors.ElementAt(0).mPackName;
List<string> dstMsgStrs = [];
List<string> srcMsgStrs = [];
actionName = "Delete " + actors.ElementAt(0).mPackName;

foreach (var actor in actors)
if (!UserSettings.HideDeletingLinkedActorsPopup())
{
if (selectedArea.mLinkHolder.HasLinksWithDest(actor.mHash))
{
var links = selectedArea.mLinkHolder.GetSrcHashesFromDest(actor.mHash);
List<string> dstMsgStrs = [];
List<string> srcMsgStrs = [];

foreach (KeyValuePair<string, List<ulong>> kvp in links)
foreach (var actor in actors)
{
if (selectedArea.mLinkHolder.HasLinksWithDest(actor.mHash))
{
var hashes = kvp.Value;
var links = selectedArea.mLinkHolder.GetSrcHashesFromDest(actor.mHash);

foreach (var hash in hashes)
foreach (KeyValuePair<string, List<ulong>> kvp in links)
{
/* only delete actors that the hash exists for...this may be caused by a user already deleting the source actor */
if (selectedArea.mActorHolder.TryGetActor(hash, out _))
var hashes = kvp.Value;

foreach (var hash in hashes)
{
dstMsgStrs.Add($"{selectedArea.mActorHolder[hash].mPackName} [{selectedArea.mActorHolder[hash].mName}]\n");
/* only delete actors that the hash exists for...this may be caused by a user already deleting the source actor */
if (selectedArea.mActorHolder.TryGetActor(hash, out _))
{
dstMsgStrs.Add($"{selectedArea.mActorHolder[hash].mPackName} [{selectedArea.mActorHolder[hash].mName}]\n");
}
}
}
}

var destHashes = selectedArea.mLinkHolder.GetDestHashesFromSrc(actor.mHash);
var destHashes = selectedArea.mLinkHolder.GetDestHashesFromSrc(actor.mHash);

foreach (KeyValuePair<string, List<ulong>> kvp in destHashes)
{
var hashes = kvp.Value;

foreach (var hash in hashes)
foreach (KeyValuePair<string, List<ulong>> kvp in destHashes)
{
if (selectedArea.mActorHolder.TryGetActor(hash, out _))
var hashes = kvp.Value;

foreach (var hash in hashes)
{
srcMsgStrs.Add($"{selectedArea.mActorHolder[hash].mPackName} [{selectedArea.mActorHolder[hash].mName}]\n");
if (selectedArea.mActorHolder.TryGetActor(hash, out _))
{
srcMsgStrs.Add($"{selectedArea.mActorHolder[hash].mPackName} [{selectedArea.mActorHolder[hash].mName}]\n");
}
}
}
}
}
}

bool noWarnings = (dstMsgStrs.Count == 0 && srcMsgStrs.Count == 0);

if (!noWarnings)
{
var result = await OperationWarningDialog.ShowDialog(mPopupModalHost,
"Deletion warning",
"The object(s) you are about to delete " +
Expand Down
3 changes: 1 addition & 2 deletions Fushigi/ui/widgets/LevelViewport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1368,8 +1368,7 @@ Vector2[] GetPoints()
s_actorRectPolygon[3] = WorldToScreen(Vector3.Transform(new Vector3(min.X, min.Y, 0) + off, transform));

uint color = CourseActor.CourseActorColors[CourseActorType.None];
if (CourseActor.CourseActorColors.TryGetValue(actor.mType, out uint value))
color = value;
CourseActor.CourseActorColors.TryGetValue(actor.mType, out color);

bool isHovered = mHoveredObject == actor;

Expand Down
8 changes: 8 additions & 0 deletions Fushigi/ui/widgets/Preferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static void Draw(ref bool continueDisplay, GLTaskScheduler glTaskSchedule
var mod = UserSettings.GetModRomFSPath();
var useGameShaders = UserSettings.UseGameShaders();
var useAstcTextureCache = UserSettings.UseAstcTextureCache();
var hideDeletingLinkedActorsPopup = UserSettings.HideDeletingLinkedActorsPopup();

ImGui.Indent();

Expand Down Expand Up @@ -99,6 +100,13 @@ await ProgressBarDialog.ShowDialogForAsyncAction(modalHost,

Tooltip.Show("Saves ASTC textures to disk which takes up disk space, but improves loading times and ram usage significantly.");

if (ImGui.Checkbox("Hide Deleting Linked Actors Popup", ref hideDeletingLinkedActorsPopup))
{
UserSettings.SetHideDeletingLinkedObjectsPopup(hideDeletingLinkedActorsPopup);
}

Tooltip.Show("Hides the warning popup when you delete actors with links.");

ImGui.Unindent();

if (ImGui.Button("Close"))
Expand Down
9 changes: 9 additions & 0 deletions Fushigi/util/UserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct Settings
public List<string> RecentCourses;
public bool UseGameShaders;
public bool UseAstcTextureCache;
public bool HideDeletingLinkedActorsPopup;

public Settings()
{
Expand All @@ -36,6 +37,7 @@ public Settings()
RecentCourses = new List<string>(MaxRecents);
UseGameShaders = false;
UseAstcTextureCache = false;
HideDeletingLinkedActorsPopup = false;
}
}

Expand All @@ -58,6 +60,7 @@ public static void Save()

public static bool UseGameShaders() => AppSettings.UseGameShaders;
public static bool UseAstcTextureCache() => AppSettings.UseAstcTextureCache;
public static bool HideDeletingLinkedActorsPopup() => AppSettings.HideDeletingLinkedActorsPopup;

public static void SetGameShaders(bool value)
{
Expand All @@ -71,6 +74,12 @@ public static void SetAstcTextureCache(bool value)
Save(); //save setting
}

public static void SetHideDeletingLinkedObjectsPopup(bool value)
{
AppSettings.HideDeletingLinkedActorsPopup = value;
Save(); //save setting
}

public static void SetRomFSPath(string path)
{
AppSettings.RomFSPath = path;
Expand Down

0 comments on commit bca39f5

Please sign in to comment.