protected void checkPause() { bool isPause = mCurEffectNode.getPlayState() == PLAY_STATE.PS_PAUSE; LT.ACTIVE_WINDOW(mLastFrame, isPause); LT.ACTIVE_WINDOW(mNextFrame, isPause); }
public void showRoomList(List <RoomInfo> roomList, int pageIndex, int allRoomCount) { // 显示当前页房间信息 int maxCount = mRoomItemList.Length; int showCount = getMin(roomList != null ? roomList.Count : 0, maxCount); for (int i = 0; i < maxCount; ++i) { LT.ACTIVE_WINDOW(mRoomItemList[i].mItemParent, i < showCount); if (i < showCount) { mRoomItemList[i].setOwnerName(roomList[i].mOwnerName); mRoomItemList[i].setPlayerCount(roomList[i].mCurCount, roomList[i].mMaxCount); mRoomItemList[i].setRoomID(roomList[i].mID); } } // 计算总页数 int pageCount = allRoomCount / GameDefine.ROOM_LIST_PAGE_ITEM_COUNT; if (allRoomCount % GameDefine.ROOM_LIST_PAGE_ITEM_COUNT > 0) { ++pageCount; } setPageLabel(pageIndex, pageCount); }
public override void markAbleToPengOrGang(MAHJONG mah) { for (int i = 0; i < mHandInMahjong.Count; ++i) { LT.ACTIVE_WINDOW(mHandInMahjong[i].mSelectMask, mah != MAHJONG.M_MAX && mah == mHandInMahjong[i].mMahjong); } }
protected void checkPause() { bool isPause = mMonsterAnim.getPlayState() == PLAY_STATE.PS_PAUSE; LT.ACTIVE_WINDOW(mPauseOperate, isPause); mFrameCount.setLabel("帧数:" + (mMonsterAnim.getCurFrameIndex() + 1) + "/" + mMonsterAnim.getTextureFrameCount()); }
protected void showPengGang(int index, ACTION_TYPE type, MAHJONG mah) { int count = 0; if (type == ACTION_TYPE.AT_PENG) { count = 3; } else if (type == ACTION_TYPE.AT_GANG) { count = 4; } else { return; } LT.ACTIVE_WINDOW(mPengGangSingleRoot[index]); int maxCount = mMahjongWindows[index].Count; string mahjongSpriteName = mMahjongPreName + GameDefine.MAHJONG_NAME[(int)mah]; for (int i = 0; i < maxCount; ++i) { LT.ACTIVE_WINDOW(mMahjongWindows[index][i], i < count); if (i < count) { mMahjongWindows[index][i].setSpriteName(mahjongSpriteName); } } }
//--------------------------------------------------------------------------------------------------------------------- protected void onLoginClick(GameObject obj) { if (!mTestAccount) { CSLogin login = mSocketManager.createPacket <CSLogin>(); login.setAccount(mAccountEdit.getText()); login.setPassword(mPasswordEdit.getText()); mSocketManager.sendMessage(login); // 发送登录消息后显示正在登录的提示框 LT.ACTIVE_WINDOW(mTipMask); mCurTime = 0.0f; } else { // 创建玩家 CommandCharacterManagerCreateCharacter cmdCreate = newCmd(out cmdCreate); cmdCreate.mCharacterType = CHARACTER_TYPE.CT_MYSELF; cmdCreate.mName = "测试"; cmdCreate.mID = 0; pushCommand(cmdCreate, mCharacterManager); // 设置角色数据 CharacterMyself myself = mCharacterManager.getMyself(); CharacterData data = myself.getCharacterData(); data.mMoney = 100; data.mHead = 1; // 进入到主场景 CommandGameSceneManagerEnter cmdEnterMain = newCmd(out cmdEnterMain, true, true); cmdEnterMain.mSceneType = GAME_SCENE_TYPE.GST_MAIN; pushDelayCommand(cmdEnterMain, mGameSceneManager); } }
// 打出一张牌 public virtual void notifyDrop(MAHJONG mah, int index) { if (index >= 0 && index < mHandInMahjong.Count) { LT.ACTIVE_WINDOW(mHandInMahjong[index].mMahjongWindow, false); } }
// 通知开局时的拿牌 public virtual void notifyGetStart(MAHJONG mah) { // 开局拿了一张牌 HandInMahjongInfo info = mHandInMahjong[mCurHandInCount]; LT.ACTIVE_WINDOW(info.mMahjongWindow); ++mCurHandInCount; }
public void setNameCheckRet(bool available) { mRegisterButton.setHandleInput(available); mCheckNameButton.setHandleInput(!available); LT.ACTIVE_WINDOW(mCheckNameButton, !available); LT.ACTIVE_WINDOW(mValidNameTip, available); LT.ACTIVE_WINDOW(mInvalidNameTip, !available); }
//------------------------------------------------------------------------------------------------------ // 刷新麻将的数量 protected void refreshMahjongCount(int count) { mCurHandInCount = count; int maxCount = mHandInMahjong.Count; for (int i = 0; i < maxCount; ++i) { LT.ACTIVE_WINDOW(mHandInMahjong[i].mMahjongWindow, i < mCurHandInCount); } }
public override void onReset() { LT.SCALE_WINDOW(mRegisterButton); LT.SCALE_WINDOW(mCancelButton); LT.SCALE_WINDOW(mCheckNameButton); LT.ACTIVE_WINDOW(mCheckNameButton); LT.ACTIVE_WINDOW(mValidNameTip, false); LT.ACTIVE_WINDOW(mInvalidNameTip, false); mRegisterButton.setHandleInput(false); }
//---------------------------------------------------------------------------------------------------------- protected void resetPengGang(int index) { LT.ACTIVE_WINDOW(mPengGangSingleRoot[index], false); int maxCount = mMahjongWindows[index].Count; for (int i = 0; i < maxCount; ++i) { LT.ACTIVE_WINDOW(mMahjongWindows[index][i], false); } }
public override void onReset() { for (int i = 0; i < GameDefine.MAX_PLAYER_COUNT; ++i) { int count = mDropList[i].Count; for (int j = 0; j < count; ++j) { LT.ACTIVE_WINDOW(mDropList[i][j], false); } } }
public void notifyJoin(Character player) { LT.ACTIVE_WINDOW(mRoot); CharacterData data = player.getCharacterData(); setHead(data.mHead); setName(data.mName); setMoney(data.mMoney); notifyReady(data.mReady); setBanker(data.mBanker); }
//-------------------------------------------------------------------------------------------------------------------------------------- protected void refreshDropMahjong(PLAYER_POSITION pos, List <MAHJONG> droppedMahjong) { int droppedCount = droppedMahjong.Count; int showCount = getMin(mMaxDropCount, droppedCount); int showStartIndex = droppedCount - showCount; for (int i = 0; i < mMaxDropCount; ++i) { LT.ACTIVE_WINDOW(mDropList[(int)pos][i], i < showCount); if (i < showCount) { mDropList[(int)pos][i].setSpriteName(GameDefine.mDropMahjongPreName[(int)pos] + GameDefine.MAHJONG_NAME[(int)droppedMahjong[showStartIndex + i]]); } } }
// pos是玩家的位置 public void notifyDropMahjong(PLAYER_POSITION pos, List <MAHJONG> droppedMahjong, MAHJONG mahjong) { int preCount = droppedMahjong.Count - 1; if (preCount < mDropList[(int)pos].Count) { string mahjongSpriteName = GameDefine.mDropMahjongPreName[(int)pos] + GameDefine.MAHJONG_NAME[(int)mahjong]; mDropList[(int)pos][preCount].setSpriteName(mahjongSpriteName); LT.ACTIVE_WINDOW(mDropList[(int)pos][preCount]); } else { refreshDropMahjong(pos, droppedMahjong); } }
public void getHua(List <MAHJONG> huaList) { LT.ACTIVE_WINDOW(mHuaRoot); int curCount = huaList.Count; int maxCount = mHuaMahjong.Count; for (int i = 0; i < maxCount; ++i) { bool show = i < curCount; LT.ACTIVE_WINDOW(mHuaMahjong[i], show); if (show) { mHuaMahjong[i].setSpriteName(mMahjongPreName + GameDefine.MAHJONG_NAME[(int)huaList[i]]); } } }
public void showCurMahjong(List <MAHJONG> mahList) { LT.ACTIVE_WINDOW(mShowRoot); int curCount = mahList.Count; int maxCount = mShowMahjong.Count; for (int i = 0; i < maxCount; ++i) { bool show = i < curCount; LT.ACTIVE_WINDOW(mShowMahjong[i], show); if (show) { mShowMahjong[i].setSpriteName(mMahjongPreName + GameDefine.MAHJONG_NAME[(int)mahList[i]]); } } }
public void notifyActionAsk(List <MahjongAction> actionList) { // 先隐藏所有行为 int count = mAction.Length; for (int i = 0; i < count; ++i) { LT.ACTIVE_WINDOW(mAction[i], false); } // 显示可以操作的行为 if (actionList != null) { int actionCount = actionList.Count; for (int i = 0; i < actionCount; ++i) { LT.ACTIVE_WINDOW(mAction[(int)actionList[i].mType]); } } }
// 刷新麻将的数量和显示 protected void refreshMahjong(List <MAHJONG> handIn) { mCurHandInCount = handIn.Count; int maxCount = mHandInMahjong.Count; for (int i = 0; i < maxCount; ++i) { LT.ACTIVE_WINDOW(mHandInMahjong[i].mMahjongWindow, i < mCurHandInCount); if (i < mCurHandInCount) { mHandInMahjong[i].mMahjong = handIn[i]; mHandInMahjong[i].mMahjongWindow.setSpriteName(GameDefine.MAHJONG_NAME[(int)handIn[i]]); setState(HANDIN_STATE.HS_SAVED, i); } else { mHandInMahjong[i].mMahjong = MAHJONG.M_MAX; setState(HANDIN_STATE.HS_MAX, i); } } }
public void setDetail(List <ResultInfo> resultList) { LT.ACTIVE_WINDOW(mHu, resultList.Count > 0); LT.ACTIVE_WINDOW(mPingJu, resultList.Count == 0); // 显示番数 if (resultList.Count == 0) { return; } // 暂时只显示第一个胡牌的玩家的番数 ResultInfo info = resultList[0]; int multipleCount = mMultipleList.Count; for (int i = 0; i < multipleCount; ++i) { bool visible = i < info.mHuList.Count; mMultipleList[i].setVisible(visible); if (visible) { mMultipleList[i].setDescribe(GameDefine.HU_NAME[(int)info.mHuList[i]]); mMultipleList[i].setMultiple(GameDefine.HU_MULTIPLE[(int)info.mHuList[i]]); } } }
public void notifyReady(bool ready) { LT.ACTIVE_WINDOW(mReadyButton, !ready); LT.ACTIVE_WINDOW(mCancelReadyButton, ready); }
// 摸牌 public virtual void notifyGet(MAHJONG mah) { LT.ACTIVE_WINDOW(mHandInMahjong[mCurHandInCount].mMahjongWindow); ++mCurHandInCount; }
//----------------------------------------------------------------------------------- protected void onDiceAnimDone(INGUIAnimation window, bool isBreak) { LT.ACTIVE_WINDOW(mDice0); LT.ACTIVE_WINDOW(mDice1); }
public void notifyStartGame() { LT.ACTIVE_WINDOW(mReadyButton, false); LT.ACTIVE_WINDOW(mCancelReadyButton, false); }
public void setBanker(bool banker) { LT.ACTIVE_WINDOW(mBanker, banker); }
public void notifyStartGame() { LT.ACTIVE_WINDOW(mReady, false); }
public void notifyReady(bool ready) { LT.ACTIVE_WINDOW(mReady, ready); }
public void notifyLeave() { LT.ACTIVE_WINDOW(mRoot, false); }
public void onReset() { notifyLeave(); LT.ACTIVE_WINDOW(mReady, false); }