I_GRIN_I

card.js

Jan 4th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var _card;
  2.  
  3. function OnActivate() {
  4.     //$.Msg("OnActivate");
  5.     //_card.faceUp(!_card.faceUp());
  6. }
  7.  
  8. function OnMouseOver() {
  9.     //$.Msg("OnMouseOver", _card.zIndex());
  10.     //$.GetContextPanel().style["z-index"] = 999;
  11.  
  12.     //$.GetContextPanel().style["y"] = _card.y() + 20 + "px";
  13.  
  14.     //_card._OnMouseOver();
  15. }
  16.  
  17. //var OnMouseOverThrottled = GameUI.CustomUIConfig().sharedHoverDebounce(OnMouseOver, 2000);
  18. //var OnMouseOverThrottled = GameUI.CustomUIConfig().sharedHoverThrottle(OnMouseOver, 200);
  19. //var OnMouseOutThrottled = GameUI.CustomUIConfig().sharedHoverThrottle(OnMouseOut, 1000);
  20.  
  21. function OnMouseOut() {
  22.     //$.Msg("OnMouseOut");
  23.     //_card.zIndex(_card.zIndex());
  24.     //$.GetContextPanel().style["y"] = _card.y() + "px";
  25.  
  26.     //_card._OnMouseOut();
  27. }
  28.  
  29. function SetCard(card) {
  30.     _card = card;
  31. }
  32.  
  33. function GetCard() {
  34.     return _card;
  35. }
  36.  
  37. function OnDragEnter(a, draggedPanel) {
  38.     $.Msg("OnDragEnter");
  39.     //_card._OnDragEnter(a, draggedPanel);
  40.     return true;
  41. }
  42.  
  43. function OnDragDrop(panelId, draggedPanel) {
  44.     //$.Msg("OnDragDrop");
  45.     _card._OnDragDrop(panelId, draggedPanel);
  46.  
  47.     return true;
  48. }
  49.  
  50. function OnDragLeave(panelId, draggedPanel) {
  51.     //$.Msg("OnDragLeave");
  52.     _card._OnDragLeave(panelId, draggedPanel);
  53.     return true;
  54. }
  55.  
  56. function OnDragStart(panelId, dragCallbacks) {
  57.     //$.Msg("OnDragStart");
  58.     _card._OnDragStart(panelId, dragCallbacks);
  59.     return true;
  60. }
  61.  
  62. function OnDragEnd(panelId, draggedPanel) {
  63.     //$.Msg("OnDragEnd");
  64.     _card._OnDragEnd(panelId, draggedPanel);
  65.  
  66.     // kill the display panel
  67.     draggedPanel.DeleteAsync(0);
  68.  
  69.     // restore our look
  70.     $.GetContextPanel().RemoveClass("dragging_from");
  71.     return true;
  72. }
  73.  
  74. function OnDblClick() {
  75.     $.Msg("OnDblClick");
  76.     _card._OnDblClick();
  77. }
  78.  
  79. function OnContextMenu() {
  80.     $.Msg("OnContextMenu");
  81.     //_card._OnContextMenu();
  82. }
  83.  
  84. function OnFocus() {
  85.     $.Msg("OnFocus");
  86.     _card._OnFocus();
  87. }
  88.  
  89. function OnBlur() {
  90.     $.Msg("OnBlur");
  91.     _card._OnBlur();
  92. }
  93.  
  94. (function() {
  95.     $.GetContextPanel().SetCard = SetCard;
  96.     $.GetContextPanel().GetCard = GetCard;
  97.     /*
  98.     $.RegisterEventHandler( 'DragEnter', $.GetContextPanel(), OnDragEnter );
  99.     $.RegisterEventHandler( 'DragDrop', $.GetContextPanel(), OnDragDrop );
  100.     $.RegisterEventHandler( 'DragLeave', $.GetContextPanel(), OnDragLeave );
  101.     $.RegisterEventHandler( 'DragStart', $.GetContextPanel(), OnDragStart );
  102.     $.RegisterEventHandler( 'DragEnd', $.GetContextPanel(), OnDragEnd );
  103.   */
  104.     //$.Msg("cards/card.js");
  105. })();
Add Comment
Please, Sign In to add comment