MonkeyZone changes for JME3 3.2

Conversion/update map for MonekyZone under JME3 V3.2

  1. In:
    ClientMain.java
    DefaultHudControl.java
    UserCommandControl.java
    change from/to

//findElementByName(…)
findElementById(…)

  1. In ClientMain.java change from/to

//for (Iterator it = new LinkedList(panel.getElements()).iterator(); it.hasNext():wink: {
for (Iterator it = panel.getChildren().iterator(); it.hasNext():wink: {
//and
//Element panel = screen.findElementById(“layer”).findElementById(“panel”).findElementById(“players_panel”).findElementById(“players_list”).findElementById(“panel”);
Element panel = screen.findElementById(“panel”).findElementById(“players_panel”).findElementById(“players_list”).findElementById(“players_list”);

//If you want to see why the last line was broken, use this.

digger(“Screen”, screen);
digger(“Panel”, panel);

//display nifty elements

 public void digger(String caption, Object obj){
     System.out.println("Display " + caption);
     digger(obj, 0);
     System.out.println();
 }
 public void digger(Object obj, int k){
     if (obj instanceof Screen){
         for (int j = 0;j < k;j++){
             System.out.print("_");
         }
         Screen screen = (Screen)obj;
         System.out.println("Screen=" + screen.getScreenId());
         List list = screen.getLayerElements();
         for(int i = 0;i < list.size();i++){
             Object newObj = list.get(i);
             digger(newObj, k + 1);
         }
     }
     else if (obj instanceof Element){
         for (int j = 0;j < k;j++){
             System.out.print("_");
         }
         Element element = (Element)obj;
         System.out.println("Element=" + element.getId());
         List list = element.getChildren();
         for(int i = 0;i < list.size();i++){
             Object newObj = list.get(i);
             digger(newObj, k + 1);
         }
     }
     else if (obj == null){
         System.out.println("dis obj is null");
     }
     else{
         System.out.println("obj=" + obj.getClass());
     }
 }
_Element=layer
__Element=panel
___Element=players_panel
____Element=null
____Element=panel
_____Element=players_list
1 Like

Why don’t you make a pull request instead?

1 Like

Yes, I really hate to stop people contributing, but GitHub is a much better place and a much easier way to work.

1 Like

Ok. Looking into it. Never did it before…
Going through tutorials.
(I guess I get it. I make a fork, fix it, upload it and someone can/will incorporate it into the master if they like it.)

3 Likes

https://help.github.com/articles/creating-a-pull-request/

Don’t be shy about asking for help, if you need it.

1 Like

OK. I made a pull request, uploaded the changed files, added a Changes.txt file and took out some debug code. So, now someone reviews and commits it?

That’s a reasonable expectation, yes.

1 Like