commit 15adc10258f50b621d02cdb8fd6a53db2b7a5043
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Mon Jul 11 15:20:41 2022 +0200

    Move 'bandaged' from the main menu to the object popup.

diff --git a/src/main/java/org/distorted/objects/MainEntry.java b/src/main/java/org/distorted/objects/MainEntry.java
new file mode 100644
index 00000000..e7224fcf
--- /dev/null
+++ b/src/main/java/org/distorted/objects/MainEntry.java
@@ -0,0 +1,104 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2022 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Magic Cube.                                                              //
+//                                                                                               //
+// Magic Cube is free software: you can redistribute it and/or modify                            //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Magic Cube is distributed in the hope that it will be useful,                                 //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.objects;
+
+import android.app.Activity;
+import android.graphics.drawable.Drawable;
+import android.widget.ImageButton;
+
+import org.distorted.main.RubikActivity;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class MainEntry
+{
+  public final static int TYPE_OBJECT  = 0;
+  public final static int TYPE_CREATOR = 1;
+
+  private final RubikObject mObject;
+  private final int mType;
+  private final int mIconID;
+  private final int mOridnal;
+  private Drawable mIconDrawable;
+  private boolean mPrepared;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MainEntry(RubikObject object, int ordinal)
+    {
+    mType         = TYPE_OBJECT;
+    mIconID       = 0;
+    mOridnal      = ordinal;
+    mIconDrawable = null;
+    mObject       = object;
+    mPrepared     = false;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  MainEntry(int type, int iconID)
+    {
+    mType         = type;
+    mIconID       = iconID;
+    mOridnal      = -1;
+    mIconDrawable = null;
+    mObject       = null;
+    mPrepared     = false;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void prepare(Activity act)
+    {
+    mIconDrawable = act.getDrawable(mIconID);
+    mPrepared = true;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// PUBLIC API
+
+  public void setIconTo(RubikActivity act, ImageButton button)
+    {
+    if( mType==TYPE_OBJECT )
+      {
+      if( mObject!=null ) mObject.setIconTo(act,button);
+      else android.util.Log.e("D", "MainListEntry: object null!!");
+      }
+    else if( mType==TYPE_CREATOR )
+      {
+      if( !mPrepared ) prepare(act);
+      button.setBackground(mIconDrawable);
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getType()
+    {
+    return mType;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getOrdinal()
+    {
+    return mOridnal;
+    }
+}
diff --git a/src/main/java/org/distorted/objects/MainEntryList.java b/src/main/java/org/distorted/objects/MainEntryList.java
new file mode 100644
index 00000000..b5573987
--- /dev/null
+++ b/src/main/java/org/distorted/objects/MainEntryList.java
@@ -0,0 +1,89 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2022 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Magic Cube.                                                              //
+//                                                                                               //
+// Magic Cube is free software: you can redistribute it and/or modify                            //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Magic Cube is distributed in the hope that it will be useful,                                 //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.objects;
+
+import org.distorted.main.R;
+
+import java.util.ArrayList;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class MainEntryList
+{
+  private final ArrayList<MainEntry> mList;
+  private static MainEntryList mThis;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private MainEntryList()
+    {
+    mList = new ArrayList<>();
+
+    int numObjects = RubikObjectList.getNumObjects();
+
+    for(int i=0; i<numObjects; i++)
+      {
+      RubikObject object = RubikObjectList.getObject(i);
+
+      if( object!=null )
+        {
+        MainEntry entry = new MainEntry(object,i);
+        mList.add(entry);
+
+        String name = object.getLowerName();
+
+        if( name!=null && name.equals("ban4_3") )
+          {
+          MainEntry creator = new MainEntry(MainEntry.TYPE_CREATOR, R.drawable.plus);
+          mList.add(creator);
+          }
+        }
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public static MainEntryList getInstance()
+    {
+    if( mThis==null ) mThis = new MainEntryList();
+    return mThis;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void addEntry(MainEntry entry)
+    {
+    mList.add(entry);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public int getNumOfEntries()
+    {
+    return mList.size();
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public MainEntry getEntry(int index)
+    {
+    return mList.get(index);
+    }
+}
diff --git a/src/main/java/org/distorted/screens/RubikScreenPlay.java b/src/main/java/org/distorted/screens/RubikScreenPlay.java
index 48739031..a08ea988 100644
--- a/src/main/java/org/distorted/screens/RubikScreenPlay.java
+++ b/src/main/java/org/distorted/screens/RubikScreenPlay.java
@@ -54,6 +54,8 @@ import org.distorted.dialogs.RubikDialogTutorial;
 import org.distorted.helpers.TransparentButton;
 import org.distorted.helpers.TransparentImageButton;
 import org.distorted.external.RubikScores;
+import org.distorted.objects.MainEntry;
+import org.distorted.objects.MainEntryList;
 import org.distorted.objects.RubikObject;
 import org.distorted.objects.RubikObjectList;
 
@@ -70,7 +72,6 @@ public class RubikScreenPlay extends RubikScreenBase implements RubikNetwork.Upd
                                                R.string.patterns,
                                                R.string.solver,
                                                R.string.tutorials,
-                                               R.string.bandaged,
                                                R.string.about };
   private static final int NUM_BUTTONS = BUTTON_LABELS.length;
 
@@ -271,15 +272,15 @@ public class RubikScreenPlay extends RubikScreenBase implements RubikNetwork.Upd
       colSpecs[col] = GridLayout.spec(col);
       }
 
-    int numObjects = RubikObjectList.getNumObjects();
+    MainEntryList list = MainEntryList.getInstance();
+    int numEntries = list.getNumOfEntries();
 
-    for(int object=0; object<numObjects; object++)
+    for(int entry=0; entry<numEntries; entry++)
       {
-      final int ordinal = object;
-      final RubikObject rObject = RubikObjectList.getObject(object);
-      int row = object/NUM_COLUMNS;
+      final MainEntry mainEntry = list.getEntry(entry);
+      int row = entry/NUM_COLUMNS;
       ImageButton button = new ImageButton(act);
-      if( rObject!=null ) rObject.setIconTo(act,button);
+      if( mainEntry!=null ) mainEntry.setIconTo(act,button);
 
       button.setOnClickListener( new View.OnClickListener()
         {
@@ -288,10 +289,20 @@ public class RubikScreenPlay extends RubikScreenBase implements RubikNetwork.Upd
           {
           if( act.getControl().isUINotBlocked() && ScreenList.getCurrentScreen()== ScreenList.PLAY )
             {
-            RubikObjectList.setCurrObject(act,ordinal);
-            act.changeObject(ordinal,true);
-            if( mPlayLayout!=null ) adjustLevels(act);
-            mMovesController.clearMoves(act);
+            int type = mainEntry!=null ? mainEntry.getType() : -1;
+
+            if( type==MainEntry.TYPE_OBJECT )
+              {
+              int ordinal = mainEntry.getOrdinal();
+              RubikObjectList.setCurrObject(act,ordinal);
+              act.changeObject(ordinal,true);
+              if( mPlayLayout!=null ) adjustLevels(act);
+              mMovesController.clearMoves(act);
+              }
+            else if( type==MainEntry.TYPE_CREATOR )
+              {
+              act.switchToBandagedCreator();
+              }
             }
 
           if( mObjectPopup!=null ) mObjectPopup.dismiss();
@@ -459,9 +470,7 @@ public class RubikScreenPlay extends RubikScreenBase implements RubikNetwork.Upd
       case 3: RubikDialogTutorial tDiag = new RubikDialogTutorial();
               tDiag.show( act.getSupportFragmentManager(), RubikDialogTutorial.getDialogTag() );
               break;
-      case 4: act.switchToBandagedCreator();
-              break;
-      case 5: RubikDialogAbout aDiag = new RubikDialogAbout();
+      case 4: RubikDialogAbout aDiag = new RubikDialogAbout();
               aDiag.show(act.getSupportFragmentManager(), null);
               break;
       }
