# MCSButton 2022/08/31 If (<-deleteSet GT0) TraceAllSp ("DeleteSet is active") <-deleteSet 1 - ->deleteSet If(<-deleteSet eq0) @DeleteList endIf endIf :Awake RegisterForMSG("ClickExit" "ButtonExit") RegisterForMSG("ClickBackup" "ButtonBackup") RegisterForMSG("ClickContinue" "ButtonContinue") RegisterForMSG("ClickList" "ButtonList") RegisterForMSG("ClickNext" "ButtonNext") RegisterForMSG("ClickPrev" "ButtonPrev") RegisterForMSG("ClickDelete" "ButtonDelete") RegisterForMSG("ClickMode" "ButtonMode") V4(0 1 0 1) ->green V4(1 0 0 1) ->red V4(1 1 0 1) ->yellow V4(0 1 1 1) ->blue V4(0 0 0 1) ->black V4(0 0 0 0) ->invisible V4(1 1 1 1) ->white SetMSGButton(0 true LF " Exit" LF " " concat concat concat <-red "ClickExit" "X") SetMSGButton(1 true LF " mcs.dat is not backed up" LF " " concat concat concat <-yellow "ClickBackup" "N") SetMSGButton(2 FALSE " " " " " " " ") SetMSGButton(3 False " " " " " " " ") SetMSGButton(4 true LF " mcs.dat is backed up" LF " " concat concat concat <-green "ClickContinue" "Y") :ButtonBackup SetMSGButton(0 true LF " Exit" LF " " concat concat concat <-red "ClickExit" "X") SetMSGButton(1 TRUE "Only use when you have backed up mcs.dat " <-white " " " ") SetMSGButton(2 FALSE " " " " " " " ") SetMSGButton(3 FALSE " " " " " " " ") SetMSGButton(4 FALSE " " " " " " " ") :ButtonExit SetMSGButton(0 FALSE " " " " " " " ") SetMSGButton(1 FALSE " " " " " " " ") SetMSGButton(2 FALSE " " " " " " " ") SetMSGButton(3 FALSE " " " " " " " ") SetMSGButton(4 FALSE " " " " " " " ") StopConsole :ButtonContinue @ParseMCS SetMSGButton(0 true LF " Exit" LF " " concat concat concat <-red "ClickExit" "X") SetMSGButton(1 FALSE " " " " " " " ") SetMSGButton(2 FALSE " " " " " " " ") SetMSGButton(3 true LF " List " <-completedCount " Completed maps" LF " " concat concat concat concat concat <-green "ClickList" "C") SetMSGButton(4 true LF " List " <-incompleteCount " Incomplete maps" LF " " concat concat concat concat concat <-yellow "ClickList" "I") :ButtonList # CreateList ->processList If (<-_DATA "C" EQ) # Do (3 0) testing code # AppendToList ( <-processList <-coloniesComplete[I]) # Loop <-coloniesComplete ->processList <-completedCount ->listCount else # Do (3 0) testing code # AppendToList ( <-processList <-coloniesIncomplete[I]) # Loop <-ColoniesIncomplete ->processList <-incompleteCount ->listCount endIf 0 ->listPos SetMSGButton(0 true LF " Exit" LF " " concat concat concat <-red "ClickExit" "X") SetMSGButton(1 FALSE " " " " " " " ") SetMSGButton(2 FALSE " " " " " " " ") SetMSGButton(3 true LF " Select maps to remove " LF " " concat concat concat <-green "ClickMode" "S") SetMSGButton(4 true LF " Remove all maps " LF " " concat concat concat <-yellow "ClickMode" "A") :ButtonMode If (<-_DATA "S" EQ) @ProcessButtons else @ScheduleDelete endIf :ButtonNext If (<-listPos GetListCount(<-processList) 1 - LT) <-listPos 1 + ->listPos endIf @ProcessButtons :ButtonPrev If (<-listPos GTE0) <-listPos 1 - ->listPos endIf @ProcessButtons :ButtonDelete DeleteMCSEntry(<-Processlist[<-listPos][0]) RemoveListElement(<-Processlist <-listPos ) if (<-listPos gt0, <-listPos GetListCount(<-processList) gte, &&) <-listPos 1 - ->listPos endif @ProcessButtons :ScheduleDelete SetMSGButton(0 FALSE " " " " " " " ") SetMSGButton(1 TRUE " This may take some time. Please wait." <-white " " " ") SetMSGButton(2 FALSE " " " " " " " ") SetMSGButton(3 FALSE " " " " " " " ") SetMSGButton(4 FALSE " " " " " " " ") 2 ->deleteSet :DeleteList 0 ->deleteCount do( getListCount(<-ProcessList) 0) DeleteMCSEntry(<-ProcessList[I][0]) <-deleteCount 1 + ->deleteCount Loop SetMSGButton(0 true LF " Exit" LF " " concat concat concat <-red "ClickExit" "X") SetMSGButton(1 TRUE <-deleteCount " Map entries deleted." Concat <-white " " " ") SetMSGButton(2 FALSE " " " " " " " ") SetMSGButton(3 FALSE " " " " " " " ") SetMSGButton(4 FALSE " " " " " " " ") TraceAllSp(<-deleteCount "Map entries deleted.") :ProcessButtons TraceAllSp ("List position:" <-listPos) SetMSGButton(0 true LF " Exit" LF " " Concat Concat Concat <-red "ClickExit" "X") SetMSGButton(4 TRUE "#" <-Processlist[<-listPos][0] ": " <-Processlist[<-listPos][1] Concat Concat Concat " " " " " ") If (<-listPos LTE0) setMSGButton(1 TRUE LF "Prev map" LF " " Concat Concat Concat <-black "ClickPrev" -1) else SetMSGButton(1 TRUE LF "Prev map" LF " " Concat Concat Concat <-blue "ClickPrev" -1) endIf If (<-listPos GetListCount(<-processList) 1 - GTE) setMSGButton(2 TRUE LF "Next map" LF " " Concat Concat Concat <-black "ClickNext" -1) else SetMSGButton(2 TRUE LF "Next map" LF " " Concat Concat Concat <-blue "ClickNext" 1) endIf SetMSGButton(3 TRUE LF "Delete Map #" <-Processlist[<-listPos][0] LF " " Concat Concat Concat Concat <-red "ClickDelete" <-listPos) TraceAllSP ("I have " GetListCount (<-ProcessList) "entries to process") :ParseMCS GetPrintPrefixEnabled ->enabled SetPrintPrefixEnabled(FALSE) ClearPrintLog GetMCSEntries ->MCSList TraceAllSp ("MCS contains:" GetListCount(<-MCSList) "entries") CreateList ->coloniesComplete CreateList ->ColoniesIncomplete 0 ->completedCount 0 ->incompleteCount # Split completed Colonies maps from incomplete do (GetListCount(<-MCSList) 0) If (<-MCSList[I][0] NEQ (-1)) If (<-MCSList[I][2]) AppendToList( <-coloniesComplete <-MCSList[I]) <-completedCount 1 + ->completedCount Else AppendToList( <-coloniesIncomplete <-MCSList[I]) <-incompleteCount 1 + ->incompleteCount endIf endIf Loop TraceAllSp ("Colonies completed: " GetListCount(<-coloniesComplete) ) TraceAllSp ("Colonies incompleted:" GetListCount(<-ColoniesIncomplete) ) # Output all lists: PrintAllSp ("Colonies Incomplete") do( getListCount(<-coloniesIncomplete) 0) PrintAllSP(<-coloniesIncomplete[I]) Loop PrintAllSP(" ") PrintAllSp ("Colonies Completed") do( getListCount(<-coloniesComplete) 0) PrintAllSP(<-coloniesComplete[I]) Loop # @DeleteIncomplete ### USE AT OWN RISK! Make a Copy of MCS.Dat First! ### SetPrintPrefixEnabled(<-enabled)