-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from ISOR3X/main2
Main2 into main
- Loading branch information
Showing
65 changed files
with
2,633 additions
and
1,191 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using UnityEngine; | ||
using Verse; | ||
|
||
namespace PawnEditor; | ||
|
||
[HotSwappable] | ||
public class Dialog_Confirm : Dialog_MessageBox | ||
{ | ||
private readonly string confirmationKey; | ||
private bool dontShowAgain; | ||
|
||
public Dialog_Confirm(TaggedString text, string key, Action confirmedAct, bool destructive = false, string title = null, | ||
WindowLayer layer = WindowLayer.Dialog) : | ||
base(text, "Confirm".Translate(), confirmedAct, "GoBack".Translate(), null, title, destructive, confirmedAct, delegate { }, layer) => | ||
confirmationKey = key; | ||
|
||
public override void PreOpen() | ||
{ | ||
if (PawnEditorMod.Settings.DontShowAgain.Contains(confirmationKey)) | ||
{ | ||
acceptAction(); | ||
Close(false); | ||
} | ||
|
||
base.PreOpen(); | ||
buttonAAction += CheckAddHide; | ||
acceptAction += CheckAddHide; | ||
} | ||
|
||
private void CheckAddHide() | ||
{ | ||
if (dontShowAgain) PawnEditorMod.Settings.DontShowAgain.Add(confirmationKey); | ||
} | ||
|
||
public override void DoWindowContents(Rect inRect) | ||
{ | ||
var text = "PawnEditor.DontShowAgain".Translate(); | ||
var width = Text.CalcSize(text).x + 24 + 10; | ||
Widgets.CheckboxLabeled(new(inRect.width - width, inRect.height - 80, width, 30), text, ref dontShowAgain, placeCheckboxNearText: true); | ||
base.DoWindowContents(inRect); | ||
} | ||
} |
Oops, something went wrong.