/* */ package NET.worlds.console; /* */ /* */ import NET.worlds.network.URL; /* */ import NET.worlds.scape.HoloDrone; /* */ import NET.worlds.scape.InventoryAvatar; /* */ import NET.worlds.scape.InventoryItem; /* */ import NET.worlds.scape.InventoryManager; /* */ import NET.worlds.scape.PosableShape; /* */ import NET.worlds.scape.SelectAvatarAction; /* */ import NET.worlds.scape.WearAction; /* */ import java.awt.Event; /* */ import java.awt.Font; /* */ import java.awt.Menu; /* */ import java.awt.MenuItem; /* */ import java.io.PrintStream; /* */ import java.net.MalformedURLException; /* */ import java.util.Arrays; /* */ import java.util.Enumeration; /* */ import java.util.StringTokenizer; /* */ import java.util.Vector; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class AvMenu /* */ extends Menu /* */ implements AvatarDialogCallback /* */ { /* */ private static final long serialVersionUID = 333613242466644876L; /* */ DefaultConsole defcon; /* */ Menu articMenuAF; /* */ Menu articMenuGO; /* */ Menu articMenuPZ; /* */ Menu specialGuestMenu; /* */ public MenuItem customize; /* */ static AvatarDialog avDialog; /* */ private static Font font; /* */ Vector articulatedAvatarItemsAF; /* */ Vector articulatedAvatarItemsGO; /* */ Vector articulatedAvatarItemsPZ; /* */ Vector holographicAvatarItemsAL; /* */ Vector holographicAvatarItemsMZ; /* */ Vector specialGuestAvatarItems; /* */ private static Vector parts; /* */ private static Vector sizes; /* */ private static Vector colors; /* */ private static Vector faceTypes; /* */ private static Vector headTypes; /* */ /* */ AvMenu(DefaultConsole d, URL lastPilotRequested) /* */ { /* 104 */ super(Console.message("choose-av")); /* */ /* 106 */ this.defcon = d; /* */ /* */ /* 109 */ URL url = URL.getAvatar(); /* */ /* */ /* 112 */ String curAvatar = ""; /* 113 */ if (lastPilotRequested != null) { /* 114 */ curAvatar = lastPilotRequested.getAbsolute(); /* 115 */ String avaStr = url.getAbsolute(); /* 116 */ if (curAvatar.startsWith(avaStr)) { /* 117 */ curAvatar = curAvatar.substring(avaStr.length()); /* */ } /* */ } /* */ /* 121 */ this.articMenuAF = new Menu(Console.message("Articulated-A-F")); /* 122 */ this.articMenuGO = new Menu(Console.message("Articulated-G-O")); /* 123 */ this.articMenuPZ = new Menu(Console.message("Articulated-P-Z")); /* */ /* 125 */ this.articMenuAF.setFont(font); /* 126 */ this.articMenuGO.setFont(font); /* 127 */ this.articMenuPZ.setFont(font); /* */ /* 129 */ add(this.articMenuAF); /* 130 */ add(this.articMenuGO); /* 131 */ add(this.articMenuPZ); /* */ /* 133 */ addAvatars(url, "abcdef", "bod", this.articMenuAF, curAvatar, /* 134 */ this.articulatedAvatarItemsAF = new Vector()); /* 135 */ addAvatars(url, "ghijklmno", "bod", this.articMenuGO, curAvatar, /* 136 */ this.articulatedAvatarItemsGO = new Vector()); /* 137 */ addAvatars(url, "0123456789pqrstuvwxyz", "bod", this.articMenuPZ, curAvatar, /* 138 */ this.articulatedAvatarItemsPZ = new Vector()); /* */ /* */ /* 141 */ Menu holoMenuAL = new Menu(Console.message("Holographic-A-L")); /* 142 */ Menu holoMenuMZ = new Menu(Console.message("Holographic-M-Z")); /* */ /* 144 */ holoMenuAL.setFont(font); /* 145 */ holoMenuMZ.setFont(font); /* */ /* 147 */ add(holoMenuAL); /* 148 */ add(holoMenuMZ); /* 149 */ addAvatars("abcdefghijkl", holoMenuAL, curAvatar, /* 150 */ this.holographicAvatarItemsAL = new Vector()); /* 151 */ addAvatars("0123456789mnopqrstuvwxyz", holoMenuMZ, curAvatar, /* 152 */ this.holographicAvatarItemsMZ = new Vector()); /* */ /* */ /* */ /* 156 */ this.specialGuestMenu = null; /* 157 */ this.specialGuestAvatarItems = new Vector(); /* */ /* 159 */ buildSpecialGuestMenu(); /* */ /* 161 */ this.customize = new MenuItem(Console.message("customize-av")); /* */ } /* */ /* */ /* */ /* */ /* */ public void rebuildVIPMenu() /* */ { /* 169 */ this.articMenuAF.removeAll(); /* 170 */ this.articulatedAvatarItemsAF.removeAllElements(); /* 171 */ this.articMenuGO.removeAll(); /* 172 */ this.articulatedAvatarItemsGO.removeAllElements(); /* 173 */ this.articMenuPZ.removeAll(); /* 174 */ this.articulatedAvatarItemsPZ.removeAllElements(); /* */ /* 176 */ URL url = URL.getAvatar(); /* */ /* 178 */ addAvatars(url, "abcdef", "bod", this.articMenuAF, null, /* 179 */ this.articulatedAvatarItemsAF); /* 180 */ addAvatars(url, "ghijklmno", "bod", this.articMenuGO, null, /* 181 */ this.articulatedAvatarItemsGO); /* 182 */ addAvatars(url, "0123456789pqrstuvwxyz", "bod", this.articMenuPZ, null, /* 183 */ this.articulatedAvatarItemsPZ); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void buildSpecialGuestMenu() /* */ { /* 194 */ Vector specialGuests = /* 195 */ InventoryManager.getInventoryManager().getInventoryAvatars(); /* */ /* 197 */ if ((specialGuests != null) && (specialGuests.size() > 0)) { /* 198 */ if (this.specialGuestMenu != null) { /* 199 */ this.specialGuestMenu.removeAll(); /* 200 */ this.specialGuestAvatarItems.removeAllElements(); /* */ } else { /* 202 */ this.specialGuestMenu = new Menu(Console.message("special-av")); /* 203 */ add(this.specialGuestMenu); /* */ } /* */ /* 206 */ Enumeration e = specialGuests.elements(); /* 207 */ while (e.hasMoreElements()) { /* 208 */ InventoryAvatar invItem = (InventoryAvatar)e.nextElement(); /* 209 */ String fullName = invItem.getItemName(); /* */ /* */ /* */ /* */ /* 214 */ StringTokenizer tok = new StringTokenizer(fullName); /* 215 */ if (tok.countTokens() < 1) /* */ { /* 217 */ System.out.println("ERROR: Special avatar inventory item " + /* 218 */ fullName + /* 219 */ " does not conform to the form \" avatar\""); /* */ } /* */ else /* */ { /* 223 */ String finalName = ""; /* */ /* 225 */ String raw = tok.nextToken(); /* 226 */ if (raw.length() > 1) { /* 227 */ finalName = /* 228 */ raw.substring(0, 1).toUpperCase() + raw.substring(1); /* 229 */ AvMenuItem item = new AvMenuItem(finalName, false); /* 230 */ item.intAvatar = ("_vv" + raw + ".rwg"); /* 231 */ this.specialGuestAvatarItems.addElement(item); /* 232 */ this.specialGuestMenu.add(item); /* */ } /* */ } /* */ } /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private void addAvatars(URL url, String initChar, String ext, Menu menu, String curAvatar, Vector menuItems) /* */ { /* 256 */ if (curAvatar != null) { /* 257 */ curAvatar = SelectAvatarAction.getPrettyAvatarName(curAvatar); /* */ } /* 259 */ Vector names = PosableShape.getPermittedNames(); /* */ /* 261 */ Vector menuItemList = new Vector(); /* */ /* 263 */ int count = names.size(); /* 264 */ for (int i = 0; i < count; i++) { /* 265 */ String name = (String)names.elementAt(i); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 275 */ if (!name.substring(0, 1).equals("_")) /* */ { /* */ /* */ /* 279 */ String properName = SelectAvatarAction.getPrettyAvatarName(name); /* */ /* */ /* 282 */ if (initChar.indexOf(properName.toLowerCase().substring(0, 1)) >= 0) /* */ { /* */ /* */ /* */ /* */ /* 288 */ AvMenuItem item = new AvMenuItem(properName, false); /* 289 */ item.intAvatar = AvMenuItem.avify(name, ".rwg"); /* 290 */ item.setFont(font); /* */ /* 292 */ menuItemList.addElement(item); /* */ } /* */ } /* */ } /* 296 */ try { SortMenu(menuItemList, menu, menuItems); /* */ } /* */ catch (NoClassDefFoundError e) { /* 299 */ count = menuItemList.size(); /* 300 */ for (int i = 0; i < count; i++) { /* 301 */ AvMenuItem item = (AvMenuItem)menuItemList.elementAt(i); /* 302 */ menuItems.addElement(item); /* 303 */ menu.add(item); /* */ } /* */ } /* */ } /* */ /* */ private void SortMenu(Vector menuItemList, Menu menu, Vector menuItems) /* */ throws NoClassDefFoundError /* */ { /* 311 */ Vector sortableArray = new Vector(); /* */ /* 313 */ int count = menuItemList.size(); /* 314 */ for (int i = 0; i < count; i++) { /* 315 */ AvMenuItem item = (AvMenuItem)menuItemList.elementAt(i); /* 316 */ sortableArray.add(new AvMenuItemSortable(item)); /* */ } /* */ /* 319 */ Object[] itemList = sortableArray.toArray(); /* 320 */ Arrays.sort(itemList); /* 321 */ count = itemList.length; /* */ /* 323 */ for (int i = 0; i < count; i++) { /* 324 */ AvMenuItem item = ((AvMenuItemSortable)itemList[i]).menuItem; /* 325 */ menuItems.addElement(item); /* 326 */ menu.add(item); /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private void addAvatars(String initChar, Menu menu, String curAvatar, Vector menuItems) /* */ { /* 339 */ curAvatar = SelectAvatarAction.getPrettyAvatarName(curAvatar); /* */ /* 341 */ String[] list = HoloDrone.getPermittedList(); /* 342 */ Vector menuItemList = new Vector(); /* */ /* 344 */ int count = list.length; /* 345 */ for (int i = 0; i < count; i++) { /* 346 */ String name = list[i]; /* */ /* 348 */ if (!name.substring(0, 1).equals("_")) /* */ { /* */ /* */ /* 352 */ String properName = SelectAvatarAction.getPrettyAvatarName(name); /* */ /* */ /* 355 */ if (initChar.indexOf(properName.toLowerCase().substring(0, 1) /* 356 */ .toLowerCase()) >= 0) /* */ { /* */ /* */ /* */ /* 361 */ AvMenuItem item = new AvMenuItem(properName, false); /* 362 */ item.intAvatar = AvMenuItem.avify(name, ".mov"); /* 363 */ item.setFont(font); /* 364 */ menuItemList.addElement(item); /* */ } /* */ } /* */ } /* 368 */ try { SortMenu(menuItemList, menu, menuItems); /* */ } /* */ catch (NoClassDefFoundError e) { /* 371 */ count = menuItemList.size(); /* 372 */ for (int i = 0; i < count; i++) { /* 373 */ AvMenuItem item = (AvMenuItem)menuItemList.elementAt(i); /* 374 */ menuItems.addElement(item); /* 375 */ menu.add(item); /* */ } /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ public boolean action(Event event, Object what) /* */ { /* 386 */ if ((this.articulatedAvatarItemsAF != null) && ( /* 387 */ (this.articulatedAvatarItemsAF.contains(event.target)) || /* 388 */ (this.articulatedAvatarItemsGO.contains(event.target)) || /* 389 */ (this.articulatedAvatarItemsPZ.contains(event.target)))) { /* 390 */ changeAvatar((AvMenuItem)event.target, "rwg", null); /* 391 */ } else if ((this.holographicAvatarItemsAL != null) && ( /* 392 */ (this.holographicAvatarItemsAL.contains(event.target)) || /* 393 */ (this.holographicAvatarItemsMZ.contains(event.target)))) { /* 394 */ changeAvatar((AvMenuItem)event.target, "mov", null); /* 395 */ } else if ((event.target == this.customize) && (this.customize != null)) { /* 396 */ if (avDialog != null) /* 397 */ avDialog.closeWin(); /* 398 */ avDialog = new AvatarDialog(Console.getFrame(), null, /* 399 */ Console.message("customize-av"), this); /* 400 */ } else if ((this.specialGuestAvatarItems != null) && /* 401 */ (this.specialGuestAvatarItems.contains(event.target))) /* */ { /* */ /* 404 */ AvMenuItem item = (AvMenuItem)event.target; /* 405 */ changeAvatar(item, "rwg", URL.make(URL.getAvatar(), "_vv" + /* 406 */ item.getLabel().toLowerCase() + ".rwg")); /* */ } else { /* 408 */ return false; /* */ } /* 410 */ return true; /* */ } /* */ /* */ public void notifyOfChange() { /* 414 */ if (avDialog != null) { /* 415 */ avDialog.setChangeCheck(); /* */ } /* */ } /* */ /* */ public Vector getChoices(int index) { /* 420 */ switch (index) { /* */ case 0: /* 422 */ return headTypes; /* */ /* */ case 2: /* 425 */ return faceTypes; /* */ /* */ case 1: /* 428 */ return sizes; /* */ } /* */ /* 431 */ return colors; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ private static void addProperCasedEntries(Vector dest, Vector source) /* */ { /* 499 */ for (int i = 0; i < source.size(); i++) { /* 500 */ String s = (String)source.elementAt(i); /* 501 */ if (s.charAt(0) != '_') /* */ { /* 503 */ dest.addElement(s.substring(0, 1).toUpperCase() + s.substring(1)); /* */ } /* */ } /* */ } /* */ /* */ static /* */ { /* 100 */ font = new Font(Console.message("MenuFont"), /* 101 */ 0, 12); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 435 */ parts = new Vector(); /* */ /* 437 */ parts.addElement(Console.message("Head")); /* 438 */ parts.addElement(Console.message("Head-size")); /* 439 */ parts.addElement(Console.message("Face")); /* 440 */ parts.addElement(Console.message("Hair")); /* 441 */ parts.addElement(Console.message("Skin")); /* 442 */ parts.addElement(Console.message("Shirt")); /* 443 */ parts.addElement(Console.message("Coat")); /* 444 */ parts.addElement(Console.message("Dress")); /* 445 */ parts.addElement(Console.message("Pants")); /* 446 */ parts.addElement(Console.message("Left-glove")); /* 447 */ parts.addElement(Console.message("Right-glove")); /* 448 */ parts.addElement(Console.message("Left-shoe")); /* 449 */ parts.addElement(Console.message("Right-shoe")); /* */ /* */ /* 452 */ sizes = new Vector(); /* */ /* 454 */ sizes.addElement(Console.message("m30")); /* 455 */ sizes.addElement(Console.message("m20")); /* 456 */ sizes.addElement(Console.message("m10")); /* 457 */ sizes.addElement(Console.message("standard")); /* 458 */ sizes.addElement(Console.message("p10")); /* 459 */ sizes.addElement(Console.message("p20")); /* 460 */ sizes.addElement(Console.message("p30")); /* */ /* */ /* 463 */ colors = new Vector(); /* */ /* 465 */ colors.addElement(Console.message("Original")); /* 466 */ colors.addElement(Console.message("Black")); /* 467 */ colors.addElement(Console.message("Blue")); /* 468 */ colors.addElement(Console.message("Tan")); /* 469 */ colors.addElement(Console.message("Red-orange")); /* 470 */ colors.addElement(Console.message("Pale-pink")); /* 471 */ colors.addElement(Console.message("Bright-green")); /* 472 */ colors.addElement(Console.message("Green")); /* 473 */ colors.addElement(Console.message("Dark-blue")); /* 474 */ colors.addElement(Console.message("Blue-purple")); /* 475 */ colors.addElement(Console.message("Light-blue")); /* 476 */ colors.addElement(Console.message("Dark-pink")); /* 477 */ colors.addElement(Console.message("Light-green")); /* 478 */ colors.addElement(Console.message("Pale-orange")); /* 479 */ colors.addElement(Console.message("Dark-grey")); /* 480 */ colors.addElement(Console.message("Orange")); /* 481 */ colors.addElement(Console.message("Pink")); /* 482 */ colors.addElement(Console.message("Purple")); /* 483 */ colors.addElement(Console.message("Red")); /* 484 */ colors.addElement(Console.message("Burgundy")); /* 485 */ colors.addElement(Console.message("Brown")); /* 486 */ colors.addElement(Console.message("Light-grey")); /* 487 */ colors.addElement(Console.message("Violet")); /* 488 */ colors.addElement(Console.message("White")); /* 489 */ colors.addElement(Console.message("Golden-yellow")); /* 490 */ colors.addElement(Console.message("Medium-yellow")); /* 491 */ colors.addElement(Console.message("Light-yellow")); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 507 */ faceTypes = new Vector(); /* 508 */ headTypes = new Vector(); /* */ /* 510 */ headTypes.addElement(Console.message("Original")); /* 511 */ addProperCasedEntries(headTypes, PosableShape.getPermittedNames()); /* */ /* 513 */ faceTypes.addElement(Console.message("Original")); /* 514 */ addProperCasedEntries(faceTypes, PosableShape.getFaceNames()); /* */ } /* */ /* */ public static void rebuildHeadList() { /* 518 */ headTypes.removeAllElements(); /* 519 */ headTypes.addElement(Console.message("Original")); /* 520 */ addProperCasedEntries(headTypes, PosableShape.getPermittedNames()); /* */ } /* */ /* */ public Vector getComponents() /* */ { /* 525 */ return parts; /* */ } /* */ /* */ /* */ /* */ /* */ public static int findIndex(Vector v, String match) /* */ { /* 533 */ int end = v.size(); /* 534 */ for (int i = 0; i < end; i++) { /* 535 */ String s = (String)v.elementAt(i); /* 536 */ if (s.equalsIgnoreCase(match)) { /* 537 */ return i; /* */ } /* */ } /* 540 */ return -1; /* */ } /* */ /* */ /* */ /* */ public int getCurrentSelection(int index) /* */ { /* 547 */ String str = PosableShape.getCurrentAvCustomizable(); /* 548 */ if (str == null) { /* 549 */ return 0; /* */ } /* 551 */ int pos = str.indexOf(".", 7); /* 552 */ String bodyType = str.substring(7, pos).toLowerCase(); /* 553 */ int result = -1; /* */ /* */ /* */ /* */ /* 558 */ switch (index) { /* */ case 0: /* 560 */ int p = str.lastIndexOf("NS"); /* 561 */ if ((p >= 0) && (str.charAt(p + 5) == 'G')) { /* 562 */ result = findIndex(headTypes, PosableShape.readName(str, p + 6)); /* 563 */ if (result >= 0) /* 564 */ return result; /* */ } /* 566 */ result = findIndex(headTypes, bodyType); /* 567 */ return result < 0 ? 0 : result; /* */ /* */ case 1: /* 570 */ int p = str.lastIndexOf("NS"); /* 571 */ if (p >= 0) /* 572 */ result = "qhd0DHQ".indexOf(str.charAt(p + 2)); /* 573 */ return result < 0 ? 3 : result; /* */ /* */ case 2: /* 576 */ int head = str.lastIndexOf("NS"); /* 577 */ int p = str.lastIndexOf("DgT"); /* 578 */ if (p > head) { /* 579 */ p += 3; /* */ /* */ /* 582 */ while ((str.charAt(p) >= '0') && (str.charAt(p) <= '9')) { /* 583 */ p++; /* */ } /* */ /* 586 */ String texName = PosableShape.readName(str, p); /* */ /* 588 */ Vector v = faceTypes; /* */ /* 590 */ int i = v.size(); /* 591 */ do { String s = (String)v.elementAt(i); /* 592 */ if (s.regionMatches(true, 0, texName, 0, s.length())) { /* 593 */ result = i; /* 594 */ break; /* */ } /* 590 */ i--; } while (i >= 1); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 598 */ if (result < 0) { /* 599 */ result = findIndex(faceTypes, bodyType); /* */ } /* */ /* 602 */ if (result > 0) /* */ { /* */ /* 605 */ if (((String)faceTypes.elementAt(result)).equals((String)headTypes.elementAt(getCurrentSelection(0)))) /* 606 */ result = 0; /* */ } /* */ } else { /* 609 */ result = 0; /* */ } /* */ /* 612 */ return result < 0 ? 0 : result; /* */ } /* */ /* 615 */ int p = /* 616 */ PosableShape.getMatPosition(str, "fabcdeOVKY".charAt(index - 3)); /* */ /* */ /* */ /* */ /* */ /* 622 */ if (p >= 0) /* */ { /* 624 */ if ((str.charAt(p) == 'C') && (str.charAt(p + 1) == '_')) { /* 625 */ char letter = str.charAt(p + 2); /* 626 */ if ((letter >= 'A') && (letter <= 'Z')) { /* 627 */ result = 1 + (letter - 'A'); /* */ } /* */ } /* */ } /* 631 */ return result < 0 ? 0 : result; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public void setCurrentSelection(int index, int choice) /* */ { /* 642 */ String str = PosableShape.getCurrentAvCustomizable(); /* 643 */ if (str == null) { /* */ return; /* */ } /* */ /* */ /* */ String val; /* */ /* */ char limb; /* */ /* */ String val; /* */ /* 654 */ if (index >= 3) { /* 655 */ char limb = "fabcdeOVKY".charAt(index - 3); /* */ /* 657 */ assert (choice >= 0); /* 658 */ assert (choice <= PosableShape.colorTable.length); /* */ /* 660 */ val = "C_" + (char)(65 + choice - 1); } else { String val; /* 661 */ if (index == 1) /* */ { /* 663 */ char scale = "qhd0DHQ".charAt(choice); /* 664 */ char[] scaleStr = new char[3]; /* 665 */ scaleStr[0] = scale; /* 666 */ scaleStr[1] = scale; /* 667 */ scaleStr[2] = scale; /* */ /* 669 */ char limb = 'Q'; /* 670 */ val = new String(scaleStr); /* */ } else { /* 672 */ limb = index == 0 ? 'H' : 'E'; /* 673 */ Vector choices = index == 0 ? headTypes : faceTypes; /* 674 */ val = choice == 0 ? null : ((String)choices.elementAt(choice)) /* 675 */ .toLowerCase(); /* */ } /* */ } /* 678 */ WearAction.setAvLimb(limb, val); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ private void changeAvatar(AvMenuItem item, String ext, URL url) /* */ { /* 688 */ if (url == null) { /* */ try { /* 690 */ url = new URL(URL.getAvatar(), item.intAvatar); /* */ } catch (MalformedURLException e) { /* 692 */ Console.println(Console.message("invalid-URL") + " " + e); /* 693 */ return; /* */ } /* */ } /* */ /* 697 */ this.defcon.setNextAvatar(url, item); /* */ } /* */ /* */ /* */ /* */ /* */ private AvMenuItem findAvatar(Vector items, String name) /* */ { /* 705 */ if (items != null) { /* 706 */ int count = items.size(); /* 707 */ for (int i = 0; i < count; i++) { /* 708 */ AvMenuItem item = (AvMenuItem)items.elementAt(i); /* 709 */ if (item.getLabel().equals(name)) /* 710 */ return item; /* */ } /* */ } /* 713 */ return null; /* */ } /* */ /* */ public AvMenuItem findMenuItem(URL url) { /* 717 */ String prefix = URL.getAvatar().getAbsolute(); /* 718 */ String name = url.getAbsolute().substring(prefix.length()); /* */ /* 720 */ String pname = SelectAvatarAction.getPrettyAvatarName(name); /* */ /* */ /* */ /* */ /* */ /* 726 */ String suffix = name.substring(name.lastIndexOf('.') + 1); /* */ AvMenuItem item; /* */ AvMenuItem item; /* 729 */ if (((suffix.equalsIgnoreCase("rwg")) && /* 730 */ (this.articulatedAvatarItemsAF != null) && /* 731 */ ((item = findAvatar(this.articulatedAvatarItemsAF, pname)) != null)) || /* 732 */ ((item = findAvatar(this.articulatedAvatarItemsGO, pname)) != null) || /* 733 */ ((item = findAvatar(this.articulatedAvatarItemsPZ, pname)) != null) || /* 734 */ ((item = findAvatar(this.specialGuestAvatarItems, pname)) != null) || ( /* 735 */ (suffix.equalsIgnoreCase("mov")) && /* 736 */ (this.holographicAvatarItemsAL != null) && ( /* 737 */ ((item = findAvatar(this.holographicAvatarItemsAL, pname)) != null) || ((item = findAvatar( /* 738 */ this.holographicAvatarItemsMZ, pname)) != null)))) /* 739 */ return item; /* 740 */ return null; /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\AvMenu.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */