Advertisement
ErickStorm

chat resize

Sep 19th, 2016
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.39 KB | None | 0 0
  1. m_Mapping[KS_CHAT_RESIZEUP] = KeyboardMapping(INPUTMAP_KEYBOARD, kbsEquals, "$HUD_Chat_ResizeUp", false);
  2. m_Mapping[KS_CHAT_RESIZEDOWN] = KeyboardMapping(INPUTMAP_KEYBOARD, kbsMinus, "$HUD_Chat_ResizeDown", false);
  3.  
  4. KS_CHAT_RESIZEUP,
  5. KS_CHAT_RESIZEDOWN,
  6.  
  7.  
  8. if((Keyboard->WasPressed(kbsEsc)) && hudStore->isActive())
  9. hudStore->Deactivate();
  10.  
  11. bool showAttachment = InputMappingMngr->wasPressed(r3dInputMappingMngr::KS_SHOW_ATTACHMENTS);
  12.  
  13. bool chatResizeUp = InputMappingMngr->wasPressed(r3dInputMappingMngr::KS_CHAT_RESIZEUP);
  14. if(chatResizeUp)
  15. {
  16. hudMain->chatResizeUp();
  17. }
  18.  
  19. bool chatResizeDown = InputMappingMngr->wasPressed(r3dInputMappingMngr::KS_CHAT_RESIZEDOWN);
  20. if(chatResizeDown)
  21. {
  22. hudMain->chatResizeDown();
  23. }
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. if(r_render_in_game_HUD->GetBool())
  32. {
  33. R3DPROFILE_FUNCTION("gfxHUD.UpdateAndDraw");
  34. #ifndef FINAL_BUILD
  35. gfxHUD.UpdateAndDraw(d_disable_render_hud->GetBool());
  36. #else
  37. gfxHUD.UpdateAndDraw();
  38. #endif
  39. }
  40.  
  41. return 1;
  42. }
  43.  
  44. void HUDDisplay::chatResizeUp()
  45. {
  46. if(!Inited) return;
  47. gfxHUD.Invoke("_root.api.chatResizeUp", "");
  48. }
  49.  
  50. void HUDDisplay::chatResizeDown()
  51. {
  52. if(!Inited) return;
  53. gfxHUD.Invoke("_root.api.chatResizeDown", "");
  54. }
  55.  
  56.  
  57.  
  58.  
  59. int isWeaponInfoVisible() const{return weaponInfoVisible;}
  60. void setChatVisibility(bool vis);
  61. void chatResizeUp();
  62. void chatResizeDown();
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. public function handleScrollerUpDown(delta:Number)
  75. {
  76. if(delta < 0)
  77. {
  78. var startY = Scroller.Field.y;
  79. if(Scroller.Trigger.y > startY) {
  80. Scroller.Trigger.y += delta;
  81. if(Scroller.Trigger.y < startY)
  82. Scroller.Trigger.y = startY;
  83. }
  84. }
  85. else
  86. {
  87. var endY = Scroller.Field.height - Scroller.Trigger.height+25;
  88. if(Scroller.Trigger.y < endY) {
  89. Scroller.Trigger.y += delta;
  90. if(Scroller.Trigger.y > endY)
  91. Scroller.Trigger.y = endY;
  92. }
  93. }
  94. }
  95.  
  96. public function chatResizeUp() : *
  97. {
  98. this.Main.Chat.y = this.Main.Chat.y - 40;
  99. this.Main.Chat.width = this.Main.Chat.width + 50;
  100. this.Main.Chat.height = this.Main.Chat.height + 40;
  101. }
  102.  
  103. public function chatResizeDown() : *
  104. {
  105. this.Main.Chat.y = this.Main.Chat.y + 40;
  106. this.Main.Chat.width = this.Main.Chat.width - 50;
  107. this.Main.Chat.height = this.Main.Chat.height - 40;
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement