Пример #1
0
		void Menu::gameModeChanged()
		{
			if( (cursorNum() != 1) || (cursor() != 4) ) {
				clearCursor();
				addCursor( command_.size() );
			}
		}
/*!
 * This method oborts the current visual drag.
 */
void   FV_VisualDragText::abortDrag(void)
{
        if(m_pAutoScrollTimer != NULL)
	{
		m_pAutoScrollTimer->stop();
		DELETEP(m_pAutoScrollTimer);
	}
	m_bSelectedRow = false;
	bool bDidCopy = m_bDoingCopy;
	m_bDoingCopy = false;
	m_bNotDraggingImage = false;
	clearCursor();
	UT_DEBUGMSG(("Abort Drag! \n"));
	if(m_iVisualDragMode != FV_VisualDrag_DRAGGING)
	{
//
// we didn't actually drag anything. Just release the selection.
//
	        setMode(FV_VisualDrag_NOT_ACTIVE);
		return;
	}
	getGraphics()->setClipRect(&m_recCurFrame);
	m_pView->updateScreen(false);
	getGraphics()->setClipRect(NULL);
	setMode(FV_VisualDrag_NOT_ACTIVE);
	if(!bDidCopy)
	{
	  m_pView->cmdUndo(1);
	}
	return;
}
Пример #3
0
void AGOSEngine_PN::addChar(uint8 chr) {
	if (chr == 13) {
		_keyboardBuffer[_intputCounter++] = chr;
		windowPutChar(_inputWindow, 13);
	} else if (chr == 8 && _intputCounter) {
		clearCursor(_inputWindow);
		windowPutChar(_inputWindow, 8);
		windowPutChar(_inputWindow, 128);
		windowPutChar(_inputWindow, 8);

		_keyboardBuffer[--_intputCounter] = 0;
	} else if (chr >= 32 && _intputCounter < _inputMax) {
		_keyboardBuffer[_intputCounter++] = chr;

		clearCursor(_inputWindow);
		windowPutChar(_inputWindow, chr);
		windowPutChar(_inputWindow, 128);
		windowPutChar(_inputWindow, 8);
	}
}
Пример #4
0
/**
 * キャラクター移動範囲検索.
 * @param mapIndex 移動するキャラクターの座標
 * @param dist 移動可能な距離
 */
std::list<MapIndex> MapManager::createActorFindDist(const MapIndex& mapIndex, int dist)
{
    assert(vaildateInit());
    
    // カーソル情報を初期化
    clearCursor();
    
    // 検索開始(再帰呼び出し)
    findDist(mapIndex.x, mapIndex.y, dist, true);
    
    // cursorListを作成
    return map_data_.map_move_cursor_list;
}
Пример #5
0
		void Skill::pass(int val)
		{
			model::SaveData& lsd = getOwner().getProject().getLSD();

			clearCursor();
			addCursor( lsd.memberNum() );
			cursor(0) = val;

			curCharID_ = lsd.member(val);
			idList_ = lsd[108].getArray2D()[curCharID_][52].getBinary();
			idList_.push_back(INVALID_ID);
			addCursor( idList_.size() + 1 );
		}
Пример #6
0
void MapManager::initMapping(int top, int bottom, int left, int right)
{
    map_data_.map_data_setting.top = top;
    map_data_.map_data_setting.bottom = bottom;
    map_data_.map_data_setting.left = left;
    map_data_.map_data_setting.right = right;
    
    assert(vaildateInit());
    
    clearCursor();
    clearMapItemArray(&map_data_.map_object_data_array);
    clearMapItemArray(&map_data_.map_drop_item_data_array);

    clearArray(&map_data_.mapping_array, false);
    
    map_data_.map_move_point_list.clear();
}
Пример #7
0
void main() {
  uchar c, c1;
  uchar selAnimationT = 0;
  uint selAnimationTT = 0, keybTimeout=0; 

  intro();
    
  // Инициализируем экран
  initGameScreen();

  // Запускаем игру
  startGame();

  while(1) {
    rand();

    if(selX!=-1) {
      selAnimationTT++;
      if(selAnimationTT==500) {
        selAnimationTT=0;
        drawSpriteSel(selX, selY, game[selX][selY], selX==cursorX && selY==cursorY, selAnimationT);
        selAnimationT++;
        if(selAnimationT>=4) selAnimationT=0; else
        if(playSound && selAnimationT==2) soundJumpSel();
      }
    }

    c1 = bioskey_();

    if(keybTimeout) {
      keybTimeout--;
      continue;
    }
    
    if(c == c1) continue;
    c = c1;

    switch(c) {
      case KEY_PATH:       showPath  = !showPath;  drawOnOff(0, showPath);  break;
      case KEY_SOUND:      playSound = !playSound; drawOnOff(1, playSound); break;
      case KEY_HELP:       showHelp  = !showHelp;  drawOnOff(2, showHelp);  redrawNewBalls2(); break;
      case KEY_RECORD:
        prepareRecordScreen();
        drawRecordScreen(-1);
        getch_();
        drawCells();
        break;
      case KEY_NEW:        startGame(); break;
/*      case KEY_UP:
        if(score>=10)
          score-=10;
        drawScore1();
        break;
      case KEY_DOWN:
        score+=10;
        drawScore1();
        break; */
      case KEY_UP:    clearCursor(); if(cursorY==0) cursorY=8; else cursorY--; drawCursor(); break;
      case KEY_DOWN:  clearCursor(); if(cursorY==8) cursorY=0; else cursorY++; drawCursor(); break;
      case KEY_LEFT:  clearCursor(); if(cursorX==0) cursorX=8; else cursorX--; drawCursor(); break;
      case KEY_RIGHT: clearCursor(); if(cursorX==8) cursorX=0; else cursorX++; drawCursor(); break;
      case KEY_SPACE: 
        if(game[cursorX][cursorY]) { if(selX!=-1) drawCell(selX, selY); selX=cursorX, selY=cursorY; break; }
        if(selX==-1) break;
        move();
        if(gameOver) {
          recordAnimation();
          startGame();
        }
        break;        
      default:
        continue;
    }

    keybTimeout=300;
  }
}
void FV_VisualDragText::_mouseDrag(UT_sint32 x, UT_sint32 y)
{
 	  //
	  // Don't try to drag the entire document.
	  //
  if(!m_bDoingCopy && (m_pView->isSelectAll() && !m_pView->isHdrFtrEdit())&&(m_iVisualDragMode != FV_VisualDrag_DRAGGING))
	 {
	     setMode(FV_VisualDrag_NOT_ACTIVE);
	     return;
	 }

        if(m_iVisualDragMode == FV_VisualDrag_NOT_ACTIVE)
        {
	  m_iInitialOffX = x;
	  m_iInitialOffY = y;
	  m_iVisualDragMode = FV_VisualDrag_WAIT_FOR_MOUSE_DRAG;
	  UT_DEBUGMSG(("Initial call for drag -1\n"));
	  return;
	}
	if((m_iInitialOffX == 0) && (m_iInitialOffY == 0))
	{
	  m_iInitialOffX = x;
	  m_iInitialOffY = y;
	  m_iVisualDragMode = FV_VisualDrag_WAIT_FOR_MOUSE_DRAG;
	  UT_DEBUGMSG(("Initial call for drag -2 \n"));
	}
	if(m_iVisualDragMode == FV_VisualDrag_WAIT_FOR_MOUSE_DRAG)
	{
          double diff = sqrt((static_cast<double>(x) - static_cast<double>(m_iInitialOffX))*(static_cast<double>(x) - static_cast<double>(m_iInitialOffX)) +
                              (static_cast<double>(y) - static_cast<double>(m_iInitialOffY))*(static_cast<double>(y) - static_cast<double>(m_iInitialOffY)));
          if(diff < static_cast<double>(getGraphics()->tlu(MIN_DRAG_PIXELS)))
          {
	    UT_DEBUGMSG(("Not yet dragged enough.%f \n", diff));
            //
            // Have to drag 4 pixels before initiating the drag
            //
            return;
          }
	  else
	  {
	    m_iVisualDragMode = FV_VisualDrag_START_DRAGGING;
	    XAP_Frame * pFrame = static_cast<XAP_Frame*>(m_pView->getParentData());
	    if (pFrame)
	      pFrame->dragText();
	  }
        }
	if((m_iVisualDragMode != FV_VisualDrag_DRAGGING) && (m_iVisualDragMode != FV_VisualDrag_WAIT_FOR_MOUSE_DRAG) && !m_bDoingCopy)
	{
//
// Haven't started the drag yet so create our image and cut the text.
//
		m_pView->getDocument()->beginUserAtomicGlob();
		mouseCut(m_iInitialOffX,m_iInitialOffY);
		m_bTextCut = true;

	}
	clearCursor();
	if(m_iVisualDragMode == FV_VisualDrag_START_DRAGGING)
	{
	  reposOffsets(x,y);
	}
	m_iVisualDragMode = FV_VisualDrag_DRAGGING;
	xxx_UT_DEBUGMSG(("x = %d y = %d width \n",x,y));
	bool bScrollDown = false;
	bool bScrollUp = false;
	bool bScrollLeft = false;
	bool bScrollRight = false;
	m_xLastMouse = x;
	m_yLastMouse = y;
	if(y<=0)
	{
		bScrollUp = true;
	}
	else if( y >= m_pView->getWindowHeight())
	{
		bScrollDown = true;
	}
	if(x <= 0)
	{
		bScrollLeft = true;
	}
	else if(x >= m_pView->getWindowWidth())
	{
		bScrollRight = true;
	}
	if(bScrollDown || bScrollUp || bScrollLeft || bScrollRight)
	{
		if(m_pAutoScrollTimer != NULL)
		{
			return;
		}
		m_pAutoScrollTimer = UT_Timer::static_constructor(_autoScroll, this);
		m_pAutoScrollTimer->set(AUTO_SCROLL_MSECS);
		m_pAutoScrollTimer->start();
		return;
	}
	UT_sint32 dx = 0;
	UT_sint32 dy = 0;
	UT_Rect expX(0,m_recCurFrame.top,0,m_recCurFrame.height);
	UT_Rect expY(m_recCurFrame.left,0,m_recCurFrame.width,0);
	UT_sint32 iext = getGraphics()->tlu(3);
	dx = x - m_iLastX;
	dy = y - m_iLastY;
	m_recCurFrame.left += dx;
	m_recCurFrame.top += dy;
	m_recOrigLeft.left += dx;
	m_recOrigLeft.top += dy;
	m_recOrigRight.left += dx;
	m_recOrigRight.top += dy;
	if(dx < 0)
	{
		expX.left = m_recCurFrame.left+m_recCurFrame.width -iext;
		expX.width = -dx + 2*iext;
		if(dy > 0)
		{
			expX.top -=  iext;
			expX.height += dy + 2*iext;
		}
		else
		{
			expX.top -=  iext;
			expX.height += (-dy + 2*iext);
		}
	}
	else
	{
		expX.left = m_recCurFrame.left - dx - iext;
		expX.width = dx + 2*iext;
		if(dy > 0)
		{
			expX.top -=  iext;
			expX.height += dy + 2*iext;
		}
		else
		{
			expX.top -= iext;
			expX.height += (-dy + 2*iext);
		}
	}
	expY.left -= iext;
	expY.width += 2*iext;
	if(dy < 0)
	{
		expY.top = m_recCurFrame.top + m_recCurFrame.height -iext;
		expY.height = -dy + 2*iext;
	}
	else
	{
		expY.top = m_recCurFrame.top - dy - iext;
		expY.height = dy + 2*iext;
	}

	if(!m_bNotDraggingImage && (expX.width > 0))
	{
		getGraphics()->setClipRect(&expX);
		if(m_bSelectedRow)

		{
		      m_pView->setSelectionMode(FV_SelectionMode_NONE);
		}
		m_pView->updateScreen(false);
		if(m_bSelectedRow)
		{
		      m_pView->setSelectionMode(FV_SelectionMode_TableRow);
		}

	}
	if(!m_bNotDraggingImage && (expY.height > 0))
	{
	  xxx_UT_DEBUGMSG(("expY left %d top %d width %d height %d \n",expY.left,expY.top,expY.width,expY.height));
		getGraphics()->setClipRect(&expY);
		if(m_bSelectedRow)
		{
		      m_pView->setSelectionMode(FV_SelectionMode_NONE);
		}
		m_pView->updateScreen(false);
		if(m_bSelectedRow)
		{
		      m_pView->setSelectionMode(FV_SelectionMode_TableRow);
		}

	}
	if(!m_bNotDraggingImage && (expX.height > 0))
	{
	  xxx_UT_DEBUGMSG(("expY left %d top %d width %d height %d \n",expX.left,expX.top,expX.width,expX.height));
		getGraphics()->setClipRect(&expX);
		if(m_bSelectedRow)
		{
		      m_pView->setSelectionMode(FV_SelectionMode_NONE);
		}
		m_pView->updateScreen(false);
		if(m_bSelectedRow)
		{
		      m_pView->setSelectionMode(FV_SelectionMode_TableRow);
		}

	}
	if(!m_bNotDraggingImage)
	{
	        getGraphics()->setClipRect(NULL);
		drawImage();
		if(m_recOrigLeft.width > 0)
		{
		     getGraphics()->setClipRect(&m_recOrigLeft);
		     m_pView->updateScreen(false);
		}
		if(m_recOrigRight.width > 0)
		{
		     getGraphics()->setClipRect(&m_recOrigRight);
		     m_pView->updateScreen(false);
		}
	}
	m_iLastX = x;
	m_iLastY = y;
	getGraphics()->setClipRect(NULL);
	PT_DocPosition posAtXY = getPosFromXY(x,y);
	m_pView->_setPoint(posAtXY);
	xxx_UT_DEBUGMSG(("Point at visual drag set to %d \n",m_pView->getPoint()));
//	m_pView->_fixInsertionPointCoords();
	drawCursor(posAtXY);
}
/*!
 * x and y is the location in the document windows of the mouse in logical
 * units.
 */
void FV_VisualDragText::mouseRelease(UT_sint32 x, UT_sint32 y)
{
        if(m_pAutoScrollTimer != NULL)
	{
		m_pAutoScrollTimer->stop();
		DELETEP(m_pAutoScrollTimer);
	}
	m_bDoingCopy = false;
	m_bNotDraggingImage = false;
	m_bSelectedRow = false;
	clearCursor();
	if(m_iVisualDragMode != FV_VisualDrag_DRAGGING)
	{
//
// we didn't actually drag anything. Just release the selection.
//
		m_pView->warpInsPtToXY(x, y,true);
		return;
	}
	
	FV_ViewDoubleBuffering dblBuffObj(m_pView, true, true);
	dblBuffObj.beginDoubleBuffering();

	PT_DocPosition posAtXY = getPosFromXY(x,y);
	m_pView->setPoint(posAtXY);
	fl_BlockLayout * pCurB = m_pView->getCurrentBlock();
	if(pCurB)
	{
	    fl_ContainerLayout * pCL = pCurB->myContainingLayout();
	    if(pCL && pCL->getContainerType() == FL_CONTAINER_SHADOW)
	    {
	         m_pView->setHdrFtrEdit(static_cast<fl_HdrFtrShadow *>(pCL));
	    }
	}
	getGraphics()->setClipRect(&m_recCurFrame);
	m_pView->updateScreen(false);
	getGraphics()->setClipRect(NULL);
	m_iVisualDragMode = FV_VisualDrag_NOT_ACTIVE;
	m_pView->getMouseContext(x,y);
	m_iInitialOffX = 0;
	m_iInitialOffY = 0;
	PT_DocPosition oldPoint = m_pView->getPoint();
	if(oldPoint < 2)
	{
	  oldPoint = 2;
	}
	bool bInFrame = m_pView->isInFrame(oldPoint);

	bool bPasteTableCol = (m_pView->getPrevSelectionMode() == FV_SelectionMode_TableColumn);
	if(!bPasteTableCol)
	  {
	    m_pView->pasteFromLocalTo(m_pView->getPoint());
	  }
	else
	  {
	    m_pView->cmdPaste();
	  }

	dblBuffObj.endDoubleBuffering();
	
	m_bSelectedRow = false;
	PT_DocPosition newPoint = m_pView->getPoint();
	DELETEP(m_pDragImage);
	if(m_bTextCut)
	  {
	    m_pView->getDocument()->endUserAtomicGlob(); // End the big undo block
	  }
	if(m_pView->getDocument()->isEndFootnoteAtPos(newPoint))
	  {
	    newPoint++;
	  }
	bool bFinalFrame = m_pView->isInFrame(newPoint) && !m_pView->getDocument()->isFrameAtPos(newPoint);
	bool bDoSelect = true;
	if(bInFrame && !bFinalFrame)
	  {
	    bDoSelect = false;
	  }

	if(bDoSelect)
	  {
	    if(!bPasteTableCol)
	      {
		m_pView->cmdSelect(oldPoint,newPoint);
	      }
	    else
	      {
		m_pView->cmdSelectColumn(newPoint);
	      }
	  }
	m_bTextCut = false;
}
Пример #10
0
		void Skill::reset()
		{
			clearCursor();
		}
Пример #11
0
		void Item::gameModeChanged()
		{
			clearCursor();
			addCursor( getOwner().getProject().getLSD().item().size() + 1 );
		}
Пример #12
0
		void Item::reset()
		{
			clearCursor();
		}