@@ -82,13 +82,28 @@ public MainWindow() {
8282 GetPenumbraPath ( ) ;
8383 Text += " " + Program . Version ;
8484 textureProcessor = new TextureProcessor ( ) ;
85+ textureProcessor . OnProgressReport += TextureProcessor_OnProgressReport ;
8586 textureProcessor . OnProgressChange += TextureProcessor_OnProgressChange ;
8687 textureProcessor . OnLaunchedXnormal += TextureProcessor_OnLaunchedXnormal ;
8788 textureProcessor . OnStartedProcessing += TextureProcessor_OnStartedProcessing ;
8889 textureProcessor . OnError += TextureProcessor_OnError ;
8990 Racial . RacePaths . otopopNoticeTriggered += RacePaths_otopopNoticeTriggered ;
9091 }
9192
93+ private void TextureProcessor_OnProgressReport ( object ? sender , string e ) {
94+ if ( generateButton . InvokeRequired ) {
95+ Action safeWrite = delegate { ProgressReport ( e ) ; } ;
96+ generateButton . Invoke ( safeWrite ) ;
97+ } else {
98+ exportLabel . AutoSize = true ;
99+ exportLabel . Text = e ;
100+ Console . WriteLine ( e ) ;
101+ }
102+ }
103+ public void ProgressReport ( string text ) {
104+ exportLabel . AutoSize = true ;
105+ exportLabel . Text = text ;
106+ }
92107 private void TextureProcessor_OnError ( object ? sender , string e ) {
93108 MessageBox . Show ( e ) ;
94109 }
@@ -1013,13 +1028,22 @@ private void addCustomPathButton_Click(object sender, EventArgs e) {
10131028 }
10141029 }
10151030
1016- private void materialListContextMenu_Opening ( object sender , System . ComponentModel . CancelEventArgs e ) {
1031+ private void textureSetListContextMenu_Opening ( object sender , System . ComponentModel . CancelEventArgs e ) {
10171032 if ( textureList . Items . Count < 1 || textureList . SelectedIndex < 0 ) {
10181033 e . Cancel = true ;
1019- materialListContextMenu . Close ( ) ;
1034+ textureSetListContextMenu . Close ( ) ;
10201035 } else {
1021- omniExportModeToolStripMenuItem . Text = ( textureList . SelectedItem as TextureSet ) . OmniExportMode
1036+ var textureSet = ( textureList . SelectedItem as TextureSet ) ;
1037+ omniExportModeToolStripMenuItem . Text = textureSet . OmniExportMode
10221038 ? "Disable Universal Compatibility" : "Enable Universal Compatibility" ;
1039+
1040+ if ( textureSet . InternalBasePath . ToLower ( ) . Contains ( "bibo" ) ||
1041+ textureSet . InternalBasePath . ToLower ( ) . Contains ( "gen3" ) ||
1042+ textureSet . InternalBasePath . ToLower ( ) . Contains ( "body" ) ) {
1043+ swapRaceToolStripMenuItem . Visible = true ;
1044+ } else {
1045+ swapRaceToolStripMenuItem . Visible = false ;
1046+ }
10231047 }
10241048 }
10251049
@@ -2273,6 +2297,25 @@ private void duplicateToolStripMenuItem_Click(object sender, EventArgs e) {
22732297 newTextureSet . IgnoreNormalGeneration = textureSet . IgnoreNormalGeneration ;
22742298 newTextureSet . IgnoreMaskGeneration = textureSet . IgnoreMaskGeneration ;
22752299 newTextureSet . OmniExportMode = textureSet . OmniExportMode ;
2300+
2301+ List < string > layers = new List < string > ( ) ;
2302+ foreach ( var item in textureSet . BaseOverlays ) {
2303+ layers . Add ( item ) ;
2304+ }
2305+ newTextureSet . BaseOverlays = layers ;
2306+
2307+ layers = new List < string > ( ) ;
2308+ foreach ( var item in textureSet . NormalOverlays ) {
2309+ layers . Add ( item ) ;
2310+ }
2311+ newTextureSet . NormalOverlays = layers ;
2312+
2313+ layers = new List < string > ( ) ;
2314+ foreach ( var item in textureSet . MaskOverlays ) {
2315+ layers . Add ( item ) ;
2316+ }
2317+ newTextureSet . MaskOverlays = layers ;
2318+
22762319 textureList . Items . Add ( newTextureSet ) ;
22772320 textureList . SelectedIndex = textureList . Items . Count - 1 ;
22782321 }
@@ -3022,8 +3065,61 @@ private void tail4MaleToolStripMenuItem_Click(object sender, EventArgs e) {
30223065 }
30233066 }
30243067
3025- private void eyeToolsToolStripMenuItem_Click ( object sender , EventArgs e ) {
3068+ private void legacyAuRaMapsToDawntrailToolStripMenuItem_Click ( object sender , EventArgs e ) {
3069+ OpenFileDialog openFileDialog = new OpenFileDialog ( ) ;
3070+ openFileDialog . Filter = "Texture File|*.png;*.tga;*.dds;*.bmp;*.tex;" ;
3071+ MessageBox . Show ( "Please select Au Ra diffuse (skin) texture" ) ;
3072+ if ( openFileDialog . ShowDialog ( ) == DialogResult . OK ) {
3073+ var diffuse = openFileDialog . FileName ;
3074+ MessageBox . Show ( "Please select Au Ra normal (blue/red) texture" ) ;
3075+ if ( openFileDialog . ShowDialog ( ) == DialogResult . OK ) {
3076+ var normal = openFileDialog . FileName ;
3077+ MessageBox . Show ( "Please select Au Ra multi (orange/green) texture" ) ;
3078+ if ( openFileDialog . ShowDialog ( ) == DialogResult . OK ) {
3079+ var multi = openFileDialog . FileName ;
3080+ var normalImage = TexIO . ResolveBitmap ( normal ) ;
3081+ var normalR = ImageManipulation . ExtractRed ( normalImage ) ;
3082+ var normalG = ImageManipulation . ExtractGreen ( normalImage ) ;
3083+ var normalB = ImageManipulation . ExtractRed ( TexIO . ResolveBitmap ( multi ) ) ;
3084+ var normalA = ImageManipulation . ExtractAlpha ( normalImage ) ;
3085+ TexIO . SaveBitmap ( ImageManipulation . MergeGrayscalesToRGBA ( normalR , normalG , normalB , normalA ) , ImageManipulation . AddSuffix ( normal , "_dawntrail_normal" ) ) ;
3086+ TexIO . SaveBitmap ( ImageManipulation . ConvertBaseToDawntrailSkinMulti ( TexIO . ResolveBitmap ( diffuse ) ) , ImageManipulation . AddSuffix ( multi , "_dawntrail_mask" ) ) ;
3087+ MessageBox . Show ( "Au Ra textures successfully converted! Your diffuse texture did not require conversion and is the same." , VersionText ) ;
3088+ try {
3089+ Process . Start ( new System . Diagnostics . ProcessStartInfo ( ) {
3090+ FileName = Path . GetDirectoryName ( openFileDialog . FileName ) ,
3091+ UseShellExecute = true ,
3092+ Verb = "OPEN"
3093+ } ) ;
3094+ } catch {
3095+
3096+ }
3097+ }
3098+ }
3099+ }
3100+ }
3101+
3102+ private void swapRaceToolStripMenuItem_Click ( object sender , EventArgs e ) {
3103+ var textureSet = ( textureList . SelectedItem as TextureSet ) ;
3104+ hasDoneReload = false ;
3105+ string previousTextureSetName = textureSet . TextureSetName ;
3106+ textureSet . TextureSetName = baseBodyList . Text + ( baseBodyList . Text . ToLower ( ) . Contains ( "tail" ) ? " " +
3107+ ( tailList . SelectedIndex + 1 ) : "" ) + ", " + ( raceList . SelectedIndex == 3 ? "Unisex" : genderList . Text )
3108+ + ", " + raceList . Text ;
3109+
3110+ if ( previousTextureSetName == textureSet . GroupName ) {
3111+ textureSet . GroupName = textureSet . TextureSetName ;
3112+ }
3113+
3114+ AddBodyPaths ( textureSet ) ;
3115+ RefreshList ( ) ;
3116+ HasSaved = false ;
3117+ }
3118+
3119+ private void swapRaceToolStripMenuItem_VisibleChanged ( object sender , EventArgs e ) {
3120+ if ( swapRaceToolStripMenuItem . Visible ) {
30263121
3122+ }
30273123 }
30283124 }
30293125}
0 commit comments