@@ -11,6 +11,7 @@ import (
1111 "ue-git-plugin-manager/internal/engine"
1212 "ue-git-plugin-manager/internal/git"
1313 "ue-git-plugin-manager/internal/plugin"
14+ "ue-git-plugin-manager/internal/projectconfig"
1415 "ue-git-plugin-manager/internal/utils"
1516
1617 "github.com/fatih/color"
@@ -64,6 +65,13 @@ func Run(app Application) error {
6465 utils .Pause ()
6566 }
6667 app .GetUtils ().ClearScreen ()
68+ case "Configure project" :
69+ app .GetUtils ().ClearScreen ()
70+ if err := runProjectConfigurator (app ); err != nil {
71+ fmt .Printf ("Error configuring project: %v\n " , err )
72+ utils .Pause ()
73+ }
74+ app .GetUtils ().ClearScreen ()
6775 case "Settings" :
6876 app .GetUtils ().ClearScreen ()
6977 if err := runSettings (app , config ); err != nil {
@@ -95,6 +103,7 @@ func showMainMenu(app Application, config *config.Config) (string, error) {
95103 items := []string {
96104 "What is this?" ,
97105 "Edit Setup" ,
106+ "Configure project" ,
98107 "Settings" ,
99108 "Quit" ,
100109 }
@@ -250,7 +259,7 @@ func runUpdate(app Application, config *config.Config) error {
250259 }
251260 fmt .Printf ("✅ Done\n " )
252261
253- // Rebuild binaries for this engine
262+ // Ensure stock plugin is disabled before rebuild
254263 // Find engine path for this version
255264 var enginePath string
256265 for _ , e := range config .Engines {
@@ -259,6 +268,14 @@ func runUpdate(app Application, config *config.Config) error {
259268 break
260269 }
261270 }
271+ if app .GetEngine ().CheckPluginCollision (enginePath ) {
272+ if err := app .GetEngine ().DisableStockPlugin (enginePath ); err != nil {
273+ fmt .Printf ("❌ %v\n " , err )
274+ continue
275+ }
276+ }
277+
278+ // Rebuild binaries for this engine
262279 wt := app .GetGit ().GetWorktreePath (update .EngineVersion )
263280 fmt .Printf ("Compiling plugin for UE %s... " , update .EngineVersion )
264281 if err := app .GetPlugin ().BuildForEngine (enginePath , wt ); err != nil {
@@ -773,16 +790,18 @@ func runSetupForEngine(app Application, config *config.Config, enginePath, engin
773790 return fmt .Errorf ("failed to create junction: %v" , err )
774791 }
775792
793+ // Always disable stock plugin before building to avoid name collision
794+ if app .GetEngine ().CheckPluginCollision (enginePath ) {
795+ if err := app .GetEngine ().DisableStockPlugin (enginePath ); err != nil {
796+ return fmt .Errorf ("failed to disable stock plugin: %v" , err )
797+ }
798+ }
799+
776800 // Build plugin
777801 if err := app .GetPlugin ().BuildForEngine (enginePath , worktreePath ); err != nil {
778802 return fmt .Errorf ("failed to build plugin: %v" , err )
779803 }
780804
781- // Disable stock plugin
782- if err := app .GetEngine ().DisableStockPlugin (enginePath ); err != nil {
783- return fmt .Errorf ("failed to disable stock plugin: %v" , err )
784- }
785-
786805 fmt .Printf ("✅ UE %s setup complete!\n " , engineVersion )
787806 utils .Pause ()
788807 return nil
@@ -817,6 +836,13 @@ func runUpdateForEngine(app Application, config *config.Config, enginePath, engi
817836 return fmt .Errorf ("failed to update worktree: %v" , err )
818837 }
819838
839+ // Ensure stock plugin is disabled before rebuilding
840+ if app .GetEngine ().CheckPluginCollision (enginePath ) {
841+ if err := app .GetEngine ().DisableStockPlugin (enginePath ); err != nil {
842+ return fmt .Errorf ("failed to disable stock plugin: %v" , err )
843+ }
844+ }
845+
820846 // Rebuild plugin
821847 fmt .Println ("Rebuilding plugin..." )
822848 worktreePath := app .GetGit ().GetWorktreePath (engineVersion )
@@ -855,20 +881,21 @@ func runRepairForEngine(app Application, config *config.Config, enginePath, engi
855881 }
856882 }
857883
884+ // Ensure stock plugin is disabled before any rebuild
885+ if app .GetEngine ().CheckPluginCollision (enginePath ) {
886+ if err := app .GetEngine ().DisableStockPlugin (enginePath ); err != nil {
887+ return fmt .Errorf ("failed to disable stock plugin: %v" , err )
888+ }
889+ }
890+
858891 // Rebuild plugin if binaries missing
859892 if ! status .BinariesExist {
860893 worktreePath := app .GetGit ().GetWorktreePath (engineVersion )
861894 if err := app .GetPlugin ().BuildForEngine (enginePath , worktreePath ); err != nil {
862895 return fmt .Errorf ("failed to build plugin: %v" , err )
863896 }
864897 }
865-
866- // Disable stock plugin if still enabled
867- if status .StockPluginStatus == "enabled" {
868- if err := app .GetEngine ().DisableStockPlugin (enginePath ); err != nil {
869- return fmt .Errorf ("failed to disable stock plugin: %v" , err )
870- }
871- }
898+ // Stock plugin already ensured disabled above
872899
873900 fmt .Printf ("✅ UE %s repaired successfully!\n " , engineVersion )
874901 utils .Pause ()
@@ -1364,6 +1391,15 @@ func rebuildPluginForEngine(app Application, config *config.Config) {
13641391 fmt .Printf (" Engine path: %s\n " , selectedEngine .EnginePath )
13651392 fmt .Printf (" Worktree path: %s\n " , worktreePath )
13661393
1394+ // Ensure stock plugin is disabled before manual rebuild
1395+ if app .GetEngine ().CheckPluginCollision (selectedEngine .EnginePath ) {
1396+ if err := app .GetEngine ().DisableStockPlugin (selectedEngine .EnginePath ); err != nil {
1397+ fmt .Printf ("❌ Failed to disable stock plugin: %v\n " , err )
1398+ utils .Pause ()
1399+ return
1400+ }
1401+ }
1402+
13671403 if err := app .GetPlugin ().BuildForEngine (selectedEngine .EnginePath , worktreePath ); err != nil {
13681404 fmt .Printf ("❌ Failed to rebuild plugin: %v\n " , err )
13691405 } else {
@@ -1372,3 +1408,8 @@ func rebuildPluginForEngine(app Application, config *config.Config) {
13721408
13731409 utils .Pause ()
13741410}
1411+
1412+ // runProjectConfigurator starts the Configure project wizard
1413+ func runProjectConfigurator (app Application ) error {
1414+ return projectconfig .RunWizard ()
1415+ }
0 commit comments