-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(mod): Add buttons to open and change images directory
- Loading branch information
Showing
9 changed files
with
126 additions
and
25 deletions.
There are no files selected for viewing
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
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
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,45 @@ | ||
using UnityEngine; | ||
using Verse; | ||
|
||
namespace Diary | ||
{ | ||
public class Dialog_EditImagesPath : Window | ||
{ | ||
private string currentPath; | ||
|
||
public Dialog_EditImagesPath(string currentPath) | ||
{ | ||
this.currentPath = currentPath; | ||
doCloseButton = false; | ||
doCloseX = true; | ||
} | ||
|
||
public override void OnAcceptKeyPressed() | ||
{ | ||
var service = Current.Game.GetComponent<DiaryService>(); | ||
|
||
service.ChangeImagesFolder(currentPath); | ||
|
||
base.OnAcceptKeyPressed(); | ||
} | ||
|
||
public override void DoWindowContents(Rect inRect) | ||
{ | ||
var listingStandard = new Listing_Standard(); | ||
listingStandard.Begin(inRect); | ||
|
||
listingStandard.Label("Diary_Edit_Screenshot_Folder_Explanation".Translate()); | ||
|
||
currentPath = listingStandard.TextEntry(currentPath); | ||
|
||
listingStandard.End(); | ||
|
||
if (!Widgets.ButtonText( | ||
new Rect(15f, (float)(inRect.height - 35.0 - 15.0), (float)(inRect.width - 15.0 - 15.0), 35f), | ||
"OK")) | ||
return; | ||
|
||
OnAcceptKeyPressed(); | ||
} | ||
} | ||
} |
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