Guest User

Untitled

a guest
Jan 21st, 2018
3
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.93 KB | None | 0 0
  1. import sign.signlink;
  2.  
  3. public class TextDrawingArea extends DrawingArea {
  4.  
  5. public int baseCharacterHeight = 0;
  6. public int anInt4142;
  7. public int anInt4144;
  8. public int[] characterDrawYOffsets;
  9. public int[] characterHeights;
  10. public int[] characterDrawXOffsets;
  11. public int[] characterWidths;
  12. public int[] iconWidths;
  13. public byte[] aByteArray4151;
  14. public byte[][] fontPixels;
  15. public int[] characterScreenWidths;
  16. public Sprite[] chatImages;
  17. public static String aRSString_4135;
  18. public static String startTransparency;
  19. public static String startDefaultShadow;
  20. public static String endShadow = "/shad";
  21. public static String endEffect;
  22. public static String aRSString_4143;
  23. public static String endStrikethrough = "/str";
  24. public static String aRSString_4147;
  25. public static String startColor;
  26. public static String lineBreak;
  27. public static String startStrikethrough;
  28. public static String endColor;
  29. public static String startImage;
  30. public static String endUnderline;
  31. public static String defaultStrikethrough;
  32. public static String startShadow;
  33. public static String startEffect;
  34. public static String aRSString_4162;
  35. public static String aRSString_4163;
  36. public static String endTransparency;
  37. public static String aRSString_4165;
  38. public static String startUnderline;
  39. public static String startDefaultUnderline;
  40. public static String aRSString_4169;
  41. public static String[] splitTextStrings;
  42. public static int defaultColor;
  43. public static int textShadowColor;
  44. public static int strikethroughColor;
  45. public static int defaultTransparency;
  46. public static int anInt4175;
  47. public static int underlineColor;
  48. public static int defaultShadow;
  49. public static int anInt4178;
  50. public static int transparency;
  51. public static int textColor;
  52.  
  53. public TextDrawingArea(boolean TypeFont, String s, NamedArchive archive) {
  54. int fontLength = 256;
  55.  
  56. fontPixels = new byte[fontLength][];
  57. characterWidths = new int[fontLength];
  58. characterHeights = new int[fontLength];
  59. characterDrawXOffsets = new int[fontLength];
  60. characterDrawYOffsets = new int[fontLength];
  61. characterScreenWidths = new int[fontLength];
  62.  
  63.  
  64.  
  65. Stream stream = new Stream(archive.getDataForName(s + ".dat"));
  66.  
  67. Stream stream_1 = new Stream(archive.getDataForName("index.dat"));
  68. stream_1.currentOffset = stream.readUnsignedWord() + 4;
  69. int k = stream_1.readUnsignedByte();
  70. if (k > 0) {
  71. stream_1.currentOffset += 3 * (k - 1);
  72. }
  73. for (int l = 0; l < fontLength; l++) {
  74. characterDrawXOffsets[l] = stream_1.readUnsignedByte();
  75. characterDrawYOffsets[l] = stream_1.readUnsignedByte();
  76. int i1 = characterWidths[l] = stream_1.readUnsignedWord();
  77. int j1 = characterHeights[l] = stream_1.readUnsignedWord();
  78. int k1 = stream_1.readUnsignedByte();
  79. int l1 = i1 * j1;
  80. fontPixels[l] = new byte[l1];
  81. if (k1 == 0) {
  82. for (int i2 = 0; i2 < l1; i2++) {
  83. fontPixels[l][i2] = stream.readSignedByte();
  84. }
  85.  
  86. } else if (k1 == 1) {
  87. for (int j2 = 0; j2 < i1; j2++) {
  88. for (int l2 = 0; l2 < j1; l2++) {
  89. fontPixels[l][j2 + l2 * i1] = stream.readSignedByte();
  90. }
  91.  
  92. }
  93.  
  94. }
  95. if (j1 > baseCharacterHeight && l < 128) {
  96. baseCharacterHeight = j1;
  97. }
  98. characterDrawXOffsets[l] = 1;
  99. characterScreenWidths[l] = i1 + 2;
  100. int k2 = 0;
  101. for (int i3 = j1 / 7; i3 < j1; i3++) {
  102. k2 += fontPixels[l][i3 * i1];
  103. }
  104.  
  105. if (k2 <= j1 / 7) {
  106. characterScreenWidths[l]--;
  107. characterDrawXOffsets[l] = 0;
  108. }
  109. k2 = 0;
  110. for (int j3 = j1 / 7; j3 < j1; j3++) {
  111. k2 += fontPixels[l][(i1 - 1) + j3 * i1];
  112. }
  113.  
  114. if (k2 <= j1 / 7) {
  115. characterScreenWidths[l]--;
  116. }
  117. }
  118.  
  119. if (TypeFont) {
  120. characterScreenWidths[32] = characterScreenWidths[73];
  121. } else {
  122. characterScreenWidths[32] = characterScreenWidths[105];
  123. }
  124. }
  125.  
  126. public TextDrawingArea(boolean TypeFont, String s, NamedArchive archive, int j23){
  127. int fontLength = 58;
  128.  
  129. fontPixels = new byte[58][];
  130. characterWidths = new int[fontLength];
  131. characterHeights = new int[fontLength];
  132. characterDrawXOffsets = new int[fontLength];
  133. characterDrawYOffsets = new int[fontLength];
  134. characterScreenWidths = new int[200];
  135. String name = (s.equals("b11_full")) ? "index2.dat" : "frames2.dat";
  136. Stream stream = new Stream(FileOperations.ReadFile(signlink.findcachedir() + name));
  137. Stream stream_1 = new Stream(FileOperations.ReadFile(signlink.findcachedir() + "index.dat"));
  138. stream_1.currentOffset = stream.readUnsignedWord() + 4;
  139. int k = stream_1.readUnsignedByte();
  140. if (k > 0) {
  141. stream_1.currentOffset += 3 * (k - 1);
  142. }
  143. for (int l = 0; l < fontLength; l++) {
  144. characterDrawXOffsets[l] = stream_1.readUnsignedByte();
  145. characterDrawYOffsets[l] = stream_1.readUnsignedByte();
  146. int i1 = characterWidths[l] = stream_1.readUnsignedWord();
  147. int j1 = characterHeights[l] = stream_1.readUnsignedWord();
  148. int k1 = stream_1.readUnsignedByte();
  149. int l1 = i1 * j1;
  150. fontPixels[l] = new byte[l1];
  151. if (k1 == 0) {
  152. for (int i2 = 0; i2 < l1; i2++) {
  153. fontPixels[l][i2] = stream.readSignedByte();
  154. }
  155.  
  156. } else if (k1 == 1) {
  157. for (int j2 = 0; j2 < i1; j2++) {
  158. for (int l2 = 0; l2 < j1; l2++) {
  159. fontPixels[l][j2 + l2 * i1] = stream.readSignedByte();
  160. }
  161.  
  162. }
  163.  
  164. }
  165. if (j1 > baseCharacterHeight && l < 128) {
  166. baseCharacterHeight = j1;
  167. }
  168. characterDrawXOffsets[l] = 1;
  169. characterScreenWidths[l] = i1 + 2;
  170. int k2 = 0;
  171. for (int i3 = j1 / 7; i3 < j1; i3++) {
  172. k2 += fontPixels[l][i3 * i1];
  173. }
  174.  
  175. if (k2 <= j1 / 7) {
  176. characterScreenWidths[l]--;
  177. characterDrawXOffsets[l] = 0;
  178. }
  179. k2 = 0;
  180. for (int j3 = j1 / 7; j3 < j1; j3++) {
  181. k2 += fontPixels[l][(i1 - 1) + j3 * i1];
  182. }
  183.  
  184. if (k2 <= j1 / 7) {
  185. characterScreenWidths[l]--;
  186. }
  187. }
  188.  
  189. if (TypeFont) {
  190. characterScreenWidths[32] = characterScreenWidths[73];
  191. } else {
  192. characterScreenWidths[32] = characterScreenWidths[105];
  193. }
  194. }
  195. public void drawCenteredString(String s, int i, int j)
  196. {
  197. if(s != null)
  198. drawBasicString(s, i - getTextWidth(s) / 2, j);
  199. }
  200. public void setTrans(int i, int j, int k)
  201. {
  202. textShadowColor = defaultShadow = i;
  203. textColor = defaultColor = j;
  204. transparency = defaultTransparency = k;
  205. }
  206. //method
  207. public void drawStringMoveY(String string, int drawX, int drawY, int color,
  208. int shadow, int randomMod, int randomMod2) {
  209. if (string != null) {
  210. setColorAndShadow(color, shadow);
  211. double d = 7.0 - (double) randomMod2 / 8.0;
  212. if (d < 0.0) {
  213. d = 0.0;
  214. }
  215. int[] yOffset = new int[string.length()];
  216. for (int index = 0; index < string.length(); index++) {
  217. yOffset[index] = (int) (Math.sin((double) index / 1.5 + (double) randomMod) * d);
  218. }
  219. drawBaseStringMoveXY(string, drawX - getTextWidth(string) / 2, drawY, null, yOffset);
  220. }
  221. }
  222. //method
  223. public int getCharacterWidth(int i) {
  224. return characterScreenWidths[i & 0xff];
  225. }
  226. //method
  227. public void setDefaultTextEffectValues(int color, int shadow, int trans) {
  228. strikethroughColor = -1;
  229. underlineColor = -1;
  230. textShadowColor = defaultShadow = shadow;
  231. textColor = defaultColor = color;
  232. transparency = defaultTransparency = trans;
  233. anInt4178 = 0;
  234. anInt4175 = 0;
  235. }
  236. //method
  237. public static int method1014(byte[][] is, byte[][] is_27_, int[] is_28_,
  238. int[] is_29_, int[] is_30_, int i,
  239. int i_31_) {
  240. int i_32_ = is_28_[i];
  241. int i_33_ = i_32_ + is_30_[i];
  242. int i_34_ = is_28_[i_31_];
  243. int i_35_ = i_34_ + is_30_[i_31_];
  244. int i_36_ = i_32_;
  245. if (i_34_ > i_32_) {
  246. i_36_ = i_34_;
  247. }
  248. int i_37_ = i_33_;
  249. if (i_35_ < i_33_) {
  250. i_37_ = i_35_;
  251. }
  252. int i_38_ = is_29_[i];
  253. if (is_29_[i_31_] < i_38_) {
  254. i_38_ = is_29_[i_31_];
  255. }
  256. byte[] is_39_ = is_27_[i];
  257. byte[] is_40_ = is[i_31_];
  258. int i_41_ = i_36_ - i_32_;
  259. int i_42_ = i_36_ - i_34_;
  260. for (int i_43_ = i_36_; i_43_ < i_37_; i_43_++) {
  261. int i_44_ = is_39_[i_41_++] + is_40_[i_42_++];
  262. if (i_44_ < i_38_) {
  263. i_38_ = i_44_;
  264. }
  265. }
  266. return -i_38_;
  267. }
  268. //method
  269. public void drawCenteredStringMoveXY(String string, int drawX, int drawY, int color,
  270. int shadow, int randomMod) {
  271. if (string != null) {
  272. setColorAndShadow(color, shadow);
  273. int[] xMods = new int[string.length()];
  274. int[] yMods = new int[string.length()];
  275. for (int index = 0; index < string.length(); index++) {
  276. xMods[index] = (int) (Math.sin((double) index / 5.0 + (double) randomMod / 5.0) * 5.0);
  277. yMods[index] = (int) (Math.sin((double) index / 3.0 + (double) randomMod / 5.0) * 5.0);
  278. }
  279. drawBaseStringMoveXY(string, drawX - getTextWidth(string) / 2, drawY, xMods,
  280. yMods);
  281. }
  282. }
  283. //method
  284. public void drawCenteredStringMoveY(String string, int drawX, int drawY, int color,
  285. int shadow, int i_54_) {
  286. if (string != null) {
  287. setColorAndShadow(color, shadow);
  288. int[] yOffset = new int[string.length()];
  289. for (int index = 0; index < string.length(); index++) {
  290. yOffset[index] = (int) (Math.sin((double) index / 2.0 + (double) i_54_ / 5.0) * 5.0);
  291. }
  292. drawBaseStringMoveXY(string, drawX - getTextWidth(string) / 2, drawY, null,
  293. yOffset);
  294. }
  295. }
  296. //method
  297. public void unpackChatImages(Sprite[] icons) {
  298. chatImages = icons;
  299. }
  300. //method389
  301. public void drawBasicString(String string, int drawX, int drawY) {
  302. drawY -= baseCharacterHeight;
  303. int startIndex = -1;
  304. int i_70_ = -1;
  305. for (int currentCharacter = 0; currentCharacter < string.length(); currentCharacter++) {
  306. int character = string.charAt(currentCharacter);
  307. if (character > 255) {
  308. character = 32;
  309. }
  310. if (character == 60) {
  311. startIndex = currentCharacter;
  312. } else {
  313. if (character == 62 && startIndex != -1) {
  314. String effectString = string.substring(startIndex + 1, currentCharacter);
  315. startIndex = -1;
  316. if (effectString.equals(startEffect)) {
  317. character = 60;
  318. } else if (effectString.equals(endEffect)) {
  319. character = 62;
  320. } else if (effectString.equals(aRSString_4135)) {
  321. character = 160;
  322. } else if (effectString.equals(aRSString_4162)) {
  323. character = 173;
  324. } else if (effectString.equals(aRSString_4165)) {
  325. character = 215;
  326. } else if (effectString.equals(aRSString_4147)) {
  327. character = 128;
  328. } else if (effectString.equals(aRSString_4163)) {
  329. character = 169;
  330. } else if (effectString.equals(aRSString_4169)) {
  331. character = 174;
  332. } else {
  333. if (effectString.startsWith(startImage)) {
  334. try {
  335. int imageId = Integer.valueOf(effectString.substring(4));
  336. Sprite icon = chatImages[imageId];
  337. int iconModY = icon.maxHeight;//maxHeight
  338. if (transparency == 256) {
  339. icon.drawSprite(drawX,
  340. (drawY + baseCharacterHeight - iconModY));
  341. } else {
  342. icon.drawSprite2(drawX,
  343. (drawY + baseCharacterHeight - iconModY),
  344. transparency);
  345. }
  346. drawX += icon.maxWidth;//maxWidth
  347. i_70_ = -1;
  348. } catch (Exception exception) {
  349. /* empty */
  350. }
  351. } else {
  352. setTextEffects(effectString);
  353. }
  354. continue;
  355. }
  356. }
  357. if (startIndex == -1) {
  358. int width = characterWidths[character];
  359. int height = characterHeights[character];
  360. if (character != 32) {
  361. if (transparency == 256) {
  362. if (textShadowColor != -1) {
  363. drawCharacter(character,
  364. drawX + characterDrawXOffsets[character] + 1,
  365. drawY + characterDrawYOffsets[character] + 1,
  366. width, height, textShadowColor, true);
  367. }
  368. drawCharacter(character,
  369. drawX + characterDrawXOffsets[character],
  370. drawY + characterDrawYOffsets[character], width,
  371. height, textColor, false);
  372. } else {
  373. if (textShadowColor != -1) {
  374. drawTransparentCharacter(character,
  375. drawX + characterDrawXOffsets[character] + 1,
  376. drawY + characterDrawYOffsets[character] + 1,
  377. width, height, textShadowColor, transparency,
  378. true);
  379. }
  380. drawTransparentCharacter(character,
  381. drawX + characterDrawXOffsets[character],
  382. drawY + characterDrawYOffsets[character], width,
  383. height, textColor, transparency, false);
  384. }
  385. } else if (anInt4178 > 0) {
  386. anInt4175 += anInt4178;
  387. drawX += anInt4175 >> 8;
  388. anInt4175 &= 0xff;
  389. }
  390. int lineWidth = characterScreenWidths[character];
  391. if (strikethroughColor != -1) {
  392. rsDrawingArea.drawHorizontalLine(drawX,
  393. drawY + (int) ((double) baseCharacterHeight * 0.69999999999999996D),
  394. lineWidth,strikethroughColor);
  395. }
  396. if (underlineColor != -1) {
  397. rsDrawingArea.drawHorizontalLine(drawX,
  398. drawY + baseCharacterHeight,
  399. lineWidth,
  400. underlineColor);
  401. }
  402. drawX += lineWidth;
  403. i_70_ = character;
  404. }
  405. }
  406. }
  407. }
  408. //method
  409. public void drawRAString(String string, int drawX, int drawY, int color,
  410. int shadow) {
  411. if (string != null) {
  412. setColorAndShadow(color, shadow);
  413. drawBasicString(string, drawX - getTextWidth(string), drawY);
  414. }
  415. }
  416. //method
  417. public void drawBaseStringMoveXY(String string, int drawX, int drawY, int[] xModifier,
  418. int[] yModifier) {
  419. drawY -= baseCharacterHeight;
  420. int startIndex = -1;
  421. int i_96_ = -1;
  422. int modifierOffset = 0;
  423. for (int currentCharacter = 0; currentCharacter < string.length(); currentCharacter++) {
  424. int character = string.charAt(currentCharacter);
  425. if (character == 60) {
  426. startIndex = currentCharacter;
  427. } else {
  428. if (character == 62 && startIndex != -1) {
  429. String effectString = string.substring(startIndex + 1, currentCharacter);
  430. startIndex = -1;
  431. if (effectString.equals(startEffect)) {
  432. character = 60;
  433. } else if (effectString.equals(endEffect)) {
  434. character = 62;
  435. } else if (effectString.equals(aRSString_4135)) {
  436. character = 160;
  437. } else if (effectString.equals(aRSString_4162)) {
  438. character = 173;
  439. } else if (effectString.equals(aRSString_4165)) {
  440. character = 215;
  441. } else if (effectString.equals(aRSString_4147)) {
  442. character = 128;
  443. } else if (effectString.equals(aRSString_4163)) {
  444. character = 169;
  445. } else if (effectString.equals(aRSString_4169)) {
  446. character = 174;
  447. } else {
  448. if (effectString.startsWith(startImage)) {
  449. try {
  450. int xModI;
  451. if (xModifier != null) {
  452. xModI = xModifier[modifierOffset];
  453. } else {
  454. xModI = 0;
  455. }
  456. int yMod;
  457. if (yModifier != null) {
  458. yMod = yModifier[modifierOffset];
  459. } else {
  460. yMod = 0;
  461. }
  462. modifierOffset++;
  463. int iconId = Integer.valueOf(effectString.substring(4));
  464. Sprite sprite_1 = chatImages[iconId];
  465. int iconOffsetY = sprite_1.maxHeight;
  466. if (transparency == 256) {
  467. sprite_1.drawSprite(drawX + xModI,
  468. (drawY + baseCharacterHeight - iconOffsetY + yMod));
  469. } else {
  470. sprite_1.drawSprite2(drawX + xModI,
  471. (drawY + baseCharacterHeight - iconOffsetY + yMod),
  472. transparency);
  473. }
  474. drawX += sprite_1.maxWidth;
  475. i_96_ = -1;
  476. } catch (Exception exception) {
  477. /* empty */
  478. }
  479. } else {
  480. setTextEffects(effectString);
  481. }
  482. continue;
  483. }
  484. }
  485. if (startIndex == -1) {
  486. int width = characterWidths[character];
  487. int height = characterHeights[character];
  488. int xOff;
  489. if (xModifier != null) {
  490. xOff = xModifier[modifierOffset];
  491. } else {
  492. xOff = 0;
  493. }
  494. int yOff;
  495. if (yModifier != null) {
  496. yOff = yModifier[modifierOffset];
  497. } else {
  498. yOff = 0;
  499. }
  500. modifierOffset++;
  501. if (character != 32) {
  502. if (transparency == 256) {
  503. if (textShadowColor != -1) {
  504. drawCharacter(character,
  505. (drawX + characterDrawXOffsets[character] + 1 + xOff),
  506. (drawY + characterDrawYOffsets[character] + 1 + yOff),
  507. width, height, textShadowColor, true);
  508. }
  509. drawCharacter(character,
  510. drawX + characterDrawXOffsets[character] + xOff,
  511. drawY + characterDrawYOffsets[character] + yOff,
  512. width, height, textColor, false);
  513. } else {
  514. if (textShadowColor != -1) {
  515. drawTransparentCharacter(character,
  516. (drawX + characterDrawXOffsets[character] + 1 + xOff),
  517. (drawY + characterDrawYOffsets[character] + 1 + yOff),
  518. width, height, textShadowColor,
  519. transparency, true);
  520. }
  521. drawTransparentCharacter(character,
  522. drawX + characterDrawXOffsets[character] + xOff,
  523. drawY + characterDrawYOffsets[character] + yOff,
  524. width, height, textColor, transparency,
  525. false);
  526. }
  527. } else if (anInt4178 > 0) {
  528. anInt4175 += anInt4178;
  529. drawX += anInt4175 >> 8;
  530. anInt4175 &= 0xff;
  531. }
  532. int lineWidth = characterScreenWidths[character];
  533. if (strikethroughColor != -1) {
  534. rsDrawingArea.drawHorizontalLine(drawX,
  535. drawY + (int) ((double) baseCharacterHeight * 0.7),
  536. lineWidth, strikethroughColor);
  537. }
  538. if (underlineColor != -1) {
  539. rsDrawingArea.drawHorizontalLine(drawX,
  540. drawY + baseCharacterHeight,
  541. lineWidth,
  542. underlineColor);
  543. }
  544. drawX += lineWidth;
  545. i_96_ = character;
  546. }
  547. }
  548. }
  549. }
  550. //method
  551. public void setTextEffects(String string) {
  552. do {
  553. try {
  554. if (string.startsWith(startColor)) {
  555. textColor = Integer.valueOf(string.substring(4));
  556. } else if (string.equals(endColor)) {
  557. textColor = defaultColor;
  558. } else if (string.startsWith(startTransparency)) {
  559. transparency = Integer.valueOf(string.substring(6));
  560. } else if (string.equals(endTransparency)) {
  561. transparency = defaultTransparency;
  562. } else if (string.startsWith(startStrikethrough)) {
  563. strikethroughColor = Integer.valueOf(string.substring(4));
  564. } else if (string.equals(defaultStrikethrough)) {
  565. strikethroughColor = 8388608;
  566. } else if (string.equals(endStrikethrough)) {
  567. strikethroughColor = -1;
  568. } else if (string.startsWith(startUnderline)) {
  569. underlineColor = Integer.valueOf(string.substring(2));
  570. } else if (string.equals(startDefaultUnderline)) {
  571. underlineColor = 0;
  572. } else if (string.equals(endUnderline)) {
  573. underlineColor = -1;
  574. } else if (string.startsWith(startShadow)) {
  575. textShadowColor = Integer.valueOf(string.substring(5));
  576. } else if (string.equals(startDefaultShadow)) {
  577. textShadowColor = 0;
  578. } else if (string.equals(endShadow)) {
  579. textShadowColor = defaultShadow;
  580. } else {
  581. if (!string.equals(lineBreak)) {
  582. break;
  583. }
  584. setDefaultTextEffectValues(defaultColor, defaultShadow, defaultTransparency);
  585. }
  586. } catch (Exception exception) {
  587. break;
  588. }
  589. break;
  590. } while (false);
  591. }
  592. //method
  593. public void setColorAndShadow(int color, int shadow) {
  594. strikethroughColor = -1;
  595. underlineColor = -1;
  596. textShadowColor = defaultShadow = shadow;
  597. textColor = defaultColor = color;
  598. transparency = defaultTransparency = 256;
  599. anInt4178 = 0;
  600. anInt4175 = 0;
  601. }
  602. //method
  603. public int getTextWidth(String string) {
  604. if (string == null) {
  605. return 0;
  606. }
  607. int startIndex = -1;
  608. int i_126_ = -1;
  609. int finalWidth = 0;
  610. for (int currentCharacter = 0; currentCharacter < string.length(); currentCharacter++) {
  611. int character = string.charAt(currentCharacter);
  612. if (character > 255) {
  613. character = 32;
  614. }
  615. if (character == 60) {
  616. startIndex = currentCharacter;
  617. } else {
  618. if (character == 62 && startIndex != -1) {
  619. String effectString = string.substring(startIndex + 1, currentCharacter);
  620. startIndex = -1;
  621. if (effectString.equals(startEffect)) {
  622. character = 60;
  623. } else if (effectString.equals(endEffect)) {
  624. character = 62;
  625. } else if (effectString.equals(aRSString_4135)) {
  626. character = 160;
  627. } else if (effectString.equals(aRSString_4162)) {
  628. character = 173;
  629. } else if (effectString.equals(aRSString_4165)) {
  630. character = 215;
  631. } else if (effectString.equals(aRSString_4147)) {
  632. character = 128;
  633. } else if (effectString.equals(aRSString_4163)) {
  634. character = 169;
  635. } else if (effectString.equals(aRSString_4169)) {
  636. character = 174;
  637. } else {
  638. if (effectString.startsWith(startImage)) {
  639. try {//<img=
  640. int iconId = Integer.valueOf(effectString.substring(4));
  641. finalWidth += chatImages[iconId].maxWidth;
  642. i_126_ = -1;
  643. } catch (Exception exception) {
  644. /* empty */
  645. }
  646. }
  647. continue;
  648. }
  649. }
  650. if (startIndex == -1) {
  651. finalWidth += characterScreenWidths[character];
  652. i_126_ = character;
  653. }
  654. }
  655. }
  656. return finalWidth;
  657. }
  658. //method
  659. public void drawBasicString(String string, int drawX, int drawY, int color,
  660. int shadow) {
  661. if (string != null) {
  662. setColorAndShadow(color, shadow);
  663. drawBasicString(string, drawX, drawY);
  664. }
  665. }
  666. //method
  667. public void drawCenteredString(String string, int drawX, int drawY, int color,
  668. int shadow) {
  669. if (string != null) {
  670. setColorAndShadow(color, shadow);
  671. drawBasicString(string, drawX - getTextWidth(string) / 2, drawY);
  672. }
  673. }
  674.  
  675. public static void nullLoader() {
  676. startEffect = null;
  677. endEffect = null;
  678. aRSString_4135 = null;
  679. aRSString_4162 = null;
  680. aRSString_4165 = null;
  681. aRSString_4147 = null;
  682. aRSString_4163 = null;
  683. aRSString_4169 = null;
  684. startImage = null;
  685. lineBreak = null;
  686. startColor = null;
  687. endColor = null;
  688. startTransparency = null;
  689. endTransparency = null;
  690. startUnderline = null;
  691. startDefaultUnderline = null;
  692. endUnderline = null;
  693. startShadow = null;
  694. startDefaultShadow = null;
  695. endShadow = null;
  696. startStrikethrough = null;
  697. defaultStrikethrough = null;
  698. endStrikethrough = null;
  699. aRSString_4143 = null;
  700. splitTextStrings = null;
  701. }
  702. //method395
  703. public static void createTransparentCharacterPixels(int[] is, byte[] is_0_, int i, int i_1_,
  704. int i_2_, int i_3_, int i_4_, int i_5_,
  705. int i_6_, int i_7_) {
  706. i = ((i & 0xff00ff) * i_7_ & ~0xff00ff) + ((i & 0xff00) * i_7_ & 0xff0000) >> 8;
  707. i_7_ = 256 - i_7_;
  708. for (int i_8_ = -i_4_; i_8_ < 0; i_8_++) {
  709. for (int i_9_ = -i_3_; i_9_ < 0; i_9_++) {
  710. if (is_0_[i_1_++] != 0) {
  711. int i_10_ = is[i_2_];
  712. is[i_2_++] = ((((i_10_ & 0xff00ff) * i_7_ & ~0xff00ff) + ((i_10_ & 0xff00) * i_7_ & 0xff0000)) >> 8) + i;
  713. } else {
  714. i_2_++;
  715. }
  716. }
  717. i_2_ += i_5_;
  718. i_1_ += i_6_;
  719. }
  720. }
  721. //method394
  722. public void drawTransparentCharacter(int i, int i_11_, int i_12_, int i_13_, int i_14_,
  723. int i_15_, int i_16_, boolean bool) {
  724. int i_17_ = i_11_ + i_12_ * DrawingArea.width;
  725. int i_18_ = DrawingArea.width - i_13_;
  726. int i_19_ = 0;
  727. int i_20_ = 0;
  728. if (i_12_ < DrawingArea.topY) {
  729. int i_21_ = DrawingArea.topY - i_12_;
  730. i_14_ -= i_21_;
  731. i_12_ = DrawingArea.topY;
  732. i_20_ += i_21_ * i_13_;
  733. i_17_ += i_21_ * DrawingArea.width;
  734. }
  735. if (i_12_ + i_14_ > DrawingArea.bottomY) {
  736. i_14_ -= i_12_ + i_14_ - DrawingArea.bottomY;
  737. }
  738. if (i_11_ < DrawingArea.topX) {
  739. int i_22_ = DrawingArea.topX - i_11_;
  740. i_13_ -= i_22_;
  741. i_11_ = DrawingArea.topX;
  742. i_20_ += i_22_;
  743. i_17_ += i_22_;
  744. i_19_ += i_22_;
  745. i_18_ += i_22_;
  746. }
  747. if (i_11_ + i_13_ > DrawingArea.bottomX) {
  748. int i_23_ = i_11_ + i_13_ - DrawingArea.bottomX;
  749. i_13_ -= i_23_;
  750. i_19_ += i_23_;
  751. i_18_ += i_23_;
  752. }
  753. if (i_13_ > 0 && i_14_ > 0) {
  754. createTransparentCharacterPixels(DrawingArea.pixels, fontPixels[i], i_15_,
  755. i_20_, i_17_, i_13_, i_14_, i_18_, i_19_, i_16_);
  756. }
  757. }
  758. //method393
  759. public static void createCharacterPixels(int[] is, byte[] is_24_, int i, int i_25_,
  760. int i_26_, int i_27_, int i_28_, int i_29_, int i_30_) {
  761. int i_31_ = -(i_27_ >> 2);
  762. i_27_ = -(i_27_ & 0x3);
  763. for (int i_32_ = -i_28_; i_32_ < 0; i_32_++) {
  764. for (int i_33_ = i_31_; i_33_ < 0; i_33_++) {
  765. if (is_24_[i_25_++] != 0) {
  766. is[i_26_++] = i;
  767. } else {
  768. i_26_++;
  769. }
  770. if (is_24_[i_25_++] != 0) {
  771. is[i_26_++] = i;
  772. } else {
  773. i_26_++;
  774. }
  775. if (is_24_[i_25_++] != 0) {
  776. is[i_26_++] = i;
  777. } else {
  778. i_26_++;
  779. }
  780. if (is_24_[i_25_++] != 0) {
  781. is[i_26_++] = i;
  782. } else {
  783. i_26_++;
  784. }
  785. }
  786. for (int i_34_ = i_27_; i_34_ < 0; i_34_++) {
  787. if (is_24_[i_25_++] != 0) {
  788. is[i_26_++] = i;
  789. } else {
  790. i_26_++;
  791. }
  792. }
  793. i_26_ += i_29_;
  794. i_25_ += i_30_;
  795. }
  796. }
  797. //method 392
  798. public void drawCharacter(int character, int i_35_, int i_36_, int i_37_, int i_38_,
  799. int i_39_, boolean bool) {
  800. int i_40_ = i_35_ + i_36_ * DrawingArea.width;
  801. int i_41_ = DrawingArea.width - i_37_;
  802. int i_42_ = 0;
  803. int i_43_ = 0;
  804. if (i_36_ < DrawingArea.topY) {
  805. int i_44_ = DrawingArea.topY - i_36_;
  806. i_38_ -= i_44_;
  807. i_36_ = DrawingArea.topY;
  808. i_43_ += i_44_ * i_37_;
  809. i_40_ += i_44_ * DrawingArea.width;
  810. }
  811. if (i_36_ + i_38_ > DrawingArea.bottomY) {
  812. i_38_ -= i_36_ + i_38_ - DrawingArea.bottomY;
  813. }
  814. if (i_35_ < DrawingArea.topX) {
  815. int i_45_ = DrawingArea.topX - i_35_;
  816. i_37_ -= i_45_;
  817. i_35_ = DrawingArea.topX;
  818. i_43_ += i_45_;
  819. i_40_ += i_45_;
  820. i_42_ += i_45_;
  821. i_41_ += i_45_;
  822. }
  823. if (i_35_ + i_37_ > DrawingArea.bottomX) {
  824. int i_46_ = i_35_ + i_37_ - DrawingArea.bottomX;
  825. i_37_ -= i_46_;
  826. i_42_ += i_46_;
  827. i_41_ += i_46_;
  828. }
  829. if (i_37_ > 0 && i_38_ > 0) {
  830. createCharacterPixels(DrawingArea.pixels, fontPixels[character],
  831. i_39_, i_43_, i_40_, i_37_, i_38_, i_41_, i_42_);
  832.  
  833. }
  834. }
  835.  
  836. static {
  837. startTransparency = "trans=";
  838. startStrikethrough = "str=";
  839. startDefaultShadow = "shad";
  840. startColor = "col=";
  841. lineBreak = "br";
  842. defaultStrikethrough = "str";
  843. endUnderline = "/u";
  844. startImage = "img=";
  845. startShadow = "shad=";
  846. startUnderline = "u=";
  847. endColor = "/col";
  848. startDefaultUnderline = "u";
  849. endTransparency = "/trans";
  850.  
  851. aRSString_4143 = Integer.toString(100);
  852. aRSString_4135 = "nbsp";
  853. aRSString_4169 = "reg";
  854. aRSString_4165 = "times";
  855. aRSString_4162 = "shy";
  856. aRSString_4163 = "copy";
  857. endEffect = "gt";
  858. aRSString_4147 = "euro";
  859. startEffect = "lt";
  860. defaultTransparency = 256;
  861. defaultShadow = -1;
  862. anInt4175 = 0;
  863. textShadowColor = -1;
  864. textColor = 0;
  865. defaultColor = 0;
  866. strikethroughColor = -1;
  867. splitTextStrings = new String[100];
  868. underlineColor = -1;
  869. anInt4178 = 0;
  870. transparency = 256;
  871. }
  872. }
Add Comment
Please, Sign In to add comment