public override void onGameState() { Vector3 curPos = mLabel.getPosition(); Vector3 targetPos = curPos + new Vector3(100.0f, 0.0f, 0.0f); LT.MOVE(mLabel, CommonDefine.ZERO_ONE_ZERO, curPos, targetPos, 1.0f, true); }
protected override void onInit(SceneProcedure lastProcedure, string intent) { QualitySettings.vSyncCount = 0; Application.targetFrameRate = 30; mLayoutSubPrefabManager.loadAll(false); LT.LOAD_NGUI_SHOW(LAYOUT_TYPE.LT_EDITOR_SELECT, 0); }
//------------------------------------------------------------------------------------------------------------------------------ protected void updateSlider(float value) { mSliderValue = value; saturate(ref mSliderValue); if (mThumb != null) { LT.MOVE(mThumb, sliderValueToThumbPos(mSliderValue)); } if (mForeground != null) { if (mMode == SLIDER_MODE.SM_FILL) { mForeground.setFillPercent(mSliderValue); } else if (mMode == SLIDER_MODE.SM_SIZING) { if (mDirection == DRAG_DIRECTION.DD_HORIZONTAL) { float newWidth = mSliderValue * mOriginForegroundSize.x; Vector3 newForePos = mOriginForegroundPosition; newForePos.x = mOriginForegroundPosition.x - mOriginForegroundSize.x * 0.5f + newWidth * 0.5f; LT.MOVE(mForeground, newForePos); mForeground.setWindowSize(new Vector2(newWidth, mOriginForegroundSize.y)); } else if (mDirection == DRAG_DIRECTION.DD_VERTICAL) { float newHeight = mSliderValue * mOriginForegroundSize.y; Vector3 newForePos = mOriginForegroundPosition; newForePos.y = mOriginForegroundPosition.y - mOriginForegroundSize.y * 0.5f + newHeight * 0.5f; LT.MOVE(mForeground, newForePos); mForeground.setWindowSize(new Vector2(mOriginForegroundSize.x, newHeight)); } } } }
public override void Initialize(UserControl control) { CT.Initialize(control); LT.Initialize(control); DT.Initialize(control); initializeTabnames(control); }
public override void DrawLine(LT lineType, Vector2D pointBeg, Vector2D pointEnd) { try { _gdiGraphics.DrawLine(ToPen(lineType), ToPointF(pointBeg), ToPointF(pointEnd)); } catch (Exception) {} }
//------------------------------------------------------------------------------------------------------- protected void onAnimationPlaying(INGUIAnimation window, bool isBreak) { // 由于原坐标系是以图片左上角为原点,unity是以图片中心为原点,所以需要根据图片大小再做父节点偏移 Vector2 parentPos = new Vector2(mEffectNode.getWindowSize().x / 2.0f, -mEffectNode.getWindowSize().y / 2.0f); LT.MOVE_WINDOW(mParentNode, parentPos); }
public void ActivateTab(string tabName) { if (Tabnames[tabName]) { return; } IsRunning = true; try { switch (tabName) { case "connectionTabItem": { Tabnames[tabName] = CT.ActivateTab(); break; } case "listTabItem": { Tabnames[tabName] = LT.ActivateTab(); break; } case "folderTabItem": { Tabnames[tabName] = FT.ActivateTab(); break; } case "documentTabItem": { Tabnames[tabName] = DT.ActivateTab(Settings.CreateSchema()); break; } } } catch (Exception e) { SIEEMessageBox.Show(e.Message, "Error in " + tabName, MessageBoxImage.Error); DataLoaded = false; SelectedTab = 0; TabNamesReset(); } finally { IsRunning = false; } }
public override void onReset() { LT.SCALE_WINDOW(mCreateRoomButton); LT.SCALE_WINDOW(mJoinRoomButton); LT.SCALE_WINDOW(mFreeMatchButton); LT.SCALE_WINDOW(mRoomListButton); }
protected void onFreeMatchClicked(GameObject obj) { // 显示正在自由匹配的提示界面 LT.SHOW_LAYOUT(LAYOUT_TYPE.LT_FREE_MATCH_TIP); // 发送消息自由匹配 mSocketManager.sendMessage <CSFreeMatch>(); }
/// <summary> /// 更新多囯语言文本 /// </summary> protected void UpdateComponents(params object[] dataObjects) { foreach (Text text in gameObject.GetComponentsInChildren <Text>(true)) { text.text = LT.Get(text.textKey, dataObjects); } }
// 打出一张牌 public virtual void notifyDrop(MAHJONG mah, int index) { if (index >= 0 && index < mHandInMahjong.Count) { LT.ACTIVE_WINDOW(mHandInMahjong[index].mMahjongWindow, false); } }
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); } }
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); }
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 override void onInit(SceneProcedure lastProcedure, string intent) { // 为了让项目自己控制启动时长,所以有一部分Frame部分的资源加载由Game部分来执行 mKeyFrameManager.loadAll(false); // 一般在此处加载界面,加载场景 LT.LOAD_UGUI_SHOW(LAYOUT.L_DEMO_START, 0); }
public override void onReset() { LT.SCALE_WINDOW(mLeaveRoomButton, Vector2.one); LT.SCALE_WINDOW(mReadyButton, Vector2.one); LT.SCALE_WINDOW(mCancelReadyButton, Vector2.one); notifyReady(false); }
protected void checkPause() { bool isPause = mMonsterAnim.getPlayState() == PLAY_STATE.PS_PAUSE; LT.ACTIVE_WINDOW(mPauseOperate, isPause); mFrameCount.setLabel("帧数:" + (mMonsterAnim.getCurFrameIndex() + 1) + "/" + mMonsterAnim.getTextureFrameCount()); }
private void UpdateButtons() { LT.UpdateState(CheckPressureActive(NativeState.Triggers.Left)); RT.UpdateState(CheckPressureActive(NativeState.Triggers.Right)); LT_Value = FilterPressureValue(NativeState.Triggers.Left); RT_Value = FilterPressureValue(NativeState.Triggers.Right); LB.UpdateState(NativeState.Buttons.LeftShoulder == ButtonState.Pressed); RB.UpdateState(NativeState.Buttons.RightShoulder == ButtonState.Pressed); DPad_Left.UpdateState(NativeState.DPad.Left == ButtonState.Pressed); DPad_Right.UpdateState(NativeState.DPad.Right == ButtonState.Pressed); DPad_Down.UpdateState(NativeState.DPad.Down == ButtonState.Pressed); DPad_Up.UpdateState(NativeState.DPad.Up == ButtonState.Pressed); A.UpdateState(NativeState.Buttons.A == ButtonState.Pressed); B.UpdateState(NativeState.Buttons.B == ButtonState.Pressed); X.UpdateState(NativeState.Buttons.X == ButtonState.Pressed); Y.UpdateState(NativeState.Buttons.Y == ButtonState.Pressed); StickL.UpdateState(NativeState.Buttons.LeftStick == ButtonState.Pressed); StickR.UpdateState(NativeState.Buttons.RightStick == ButtonState.Pressed); StickL_Value = new AxisValue(FilterPressureValue(NativeState.ThumbSticks.Left.X), FilterPressureValue(NativeState.ThumbSticks.Left.Y)); StickR_Value = new AxisValue(FilterPressureValue(NativeState.ThumbSticks.Right.X), FilterPressureValue(NativeState.ThumbSticks.Right.Y)); Start.UpdateState(NativeState.Buttons.Start == ButtonState.Pressed); Back.UpdateState(NativeState.Buttons.Back == ButtonState.Pressed); Guide.UpdateState(NativeState.Buttons.Guide == ButtonState.Pressed); }
public static string GetTimeAgo(long time) { TimeSpan ts = TimeSpan.FromMilliseconds(time); string strD = ""; string strH = ""; string strM = ""; if (ts.Days != 0) { strD = ts.Days + LT.GetText("CHAT_TIME_DAY"); } if (ts.Hours != 0) { strH = ts.Hours + LT.GetText("CHAT_TIME_HOUR"); } if (ts.Minutes != 0) { strM = ts.Minutes + LT.GetText("CHAT_TIME_MINUTE"); } if (ts.Days != 0) { strM = ""; } if (ts.Days != 0 || ts.Hours != 0 || ts.Minutes != 0) { return(strD + strH + strM + LT.GetText("CHAT_TIME_NOTICE")); } else { return(""); } }
public ActionResult ViewAllTasks(string email) { if (Session["UserClass"] == null) { return(RedirectToAction("AddUser")); } TimerUser user = (TimerUser)Session["UserClass"]; var destPath = Server.MapPath("~/XmlDataBase/Timerdb.xml"); XElement root = XElement.Load(destPath); var listTasks = from LT in root.Elements("TimerTask") where (string)LT.Element("Email") == user.TimerUserEmail select LT; var listTaskENum = (from e in listTasks.Elements() let xElement = e.Element("NameofTask") where xElement != null let element = e.Element("Description") where element != null let xElement1 = e.Element("ElaspedTime") where xElement1 != null select new TimerTask { NameOfTask = xElement.Value, Description = element.Value, Timer = xElement1.Value }).ToList(); return(View(listTaskENum)); }
//--------------------------------------------------------------------------------------------------------------------- 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); } }
protected void checkPause() { bool isPause = mCurEffectNode.getPlayState() == PLAY_STATE.PS_PAUSE; LT.ACTIVE_WINDOW(mLastFrame, isPause); LT.ACTIVE_WINDOW(mNextFrame, isPause); }
public ControllerXbox360(params int[] joystickId) { AddButton(Controls.A); AddButton(Controls.B); AddButton(Controls.X); AddButton(Controls.Y); AddButton(Controls.RB); AddButton(Controls.LB); AddButton(Controls.LStickClick); AddButton(Controls.RStickClick); AddButton(Controls.Start); AddButton(Controls.Back); AddButton(Controls.RT); AddButton(Controls.LT); AddButton(Controls.Up); AddButton(Controls.Down); AddButton(Controls.Left); AddButton(Controls.Right); AddAxis(Controls.LStick); AddAxis(Controls.RStick); AddAxis(Controls.DPad); AddAxis(Controls.Triggers); foreach (var joy in joystickId) { A.AddJoyButton(0, joy); B.AddJoyButton(1, joy); X.AddJoyButton(2, joy); Y.AddJoyButton(3, joy); LB.AddJoyButton(4, joy); RB.AddJoyButton(5, joy); Back.AddJoyButton(6, joy); Start.AddJoyButton(7, joy); LeftStickClick.AddJoyButton(8, joy); RightStickClick.AddJoyButton(9, joy); RT.AddAxisButton(AxisButton.ZMinus, joy); LT.AddAxisButton(AxisButton.ZPlus, joy); LeftStick.AddJoyAxis(JoyAxis.X, JoyAxis.Y, joy); RightStick.AddJoyAxis(JoyAxis.U, JoyAxis.R, joy); DPad.AddJoyAxis(JoyAxis.PovX, JoyAxis.PovY, joy); Triggers.AddJoyAxis(JoyAxis.Z, JoyAxis.Z, joy); Up .AddAxisButton(AxisButton.YMinus, joy) .AddAxisButton(AxisButton.PovYMinus, joy); Down .AddAxisButton(AxisButton.YPlus, joy) .AddAxisButton(AxisButton.PovYPlus, joy); Right .AddAxisButton(AxisButton.XPlus, joy) .AddAxisButton(AxisButton.PovXPlus, joy); Left .AddAxisButton(AxisButton.XMinus, joy) .AddAxisButton(AxisButton.PovXMinus, joy); } }
protected override void onInit(SceneProcedure lastProcedure, string intent) { LT.SHOW_LAYOUT(LAYOUT_TYPE.LT_MAIN_FRAME_BACK); LT.SHOW_LAYOUT(LAYOUT_TYPE.LT_BACK_TO_MAIN_HALL); LT.SHOW_LAYOUT(LAYOUT_TYPE.LT_ROOM_LIST); // 只重置当前页的下标 mCurPage = 0; }
public override void update(float elapsedTime) { base.update(elapsedTime); if (mTimer.tickTimer(elapsedTime)) { LT.HIDE_LAYOUT(mID); } }
public override void onReset() { LT.SCALE_WINDOW(mLoginButton); LT.SCALE_WINDOW(mRegisterButton); LT.SCALE_WINDOW(mQuitButton); LT.SCALE_WINDOW(mCancelButton); mCurTime = 0.0f; }
public override void update(float elapsedTime) { base.update(elapsedTime); if (mTimer.checkTimeCount(elapsedTime)) { LT.HIDE_LAYOUT(mLayout.getType()); } }
//-------------------------------------------------------------------------------------------------------------- public override void setActive(bool active) { if (active && !LT.checkStaticPanel(mComponentOwner as txUIObject)) { return; } base.setActive(active); }
// 通知开局时的拿牌 public virtual void notifyGetStart(MAHJONG mah) { // 开局拿了一张牌 HandInMahjongInfo info = mHandInMahjong[mCurHandInCount]; LT.ACTIVE_WINDOW(info.mMahjongWindow); ++mCurHandInCount; }
protected override void onInit(SceneProcedure lastProcedure, string intent) { LT.HIDE_LAYOUT(LAYOUT_TYPE.LT_MAIN_FRAME, true); LT.HIDE_LAYOUT(LAYOUT_TYPE.LT_CHARACTER, true); LT.HIDE_LAYOUT(LAYOUT_TYPE.LT_BILLBOARD, true); LT.HIDE_LAYOUT(LAYOUT_TYPE.LT_ROOM_MENU, true); LT.HIDE_LAYOUT(LAYOUT_TYPE.LT_JOIN_ROOM_DIALOG, true); }
public override void DrawLine(LT lineType, Vector2D ptBeg, Vector2D ptEnd) { _cb.SetLineWidth(0.0f); _cb.SetColorStroke(LineTypeToBaseColor(lineType)); _cb.MoveTo(DX(ptBeg.X), DY(ptBeg.Y)); _cb.LineTo(DX(ptEnd.X), DY(ptEnd.Y)); _cb.Stroke(); }
public override void DrawArc(LT lineType, Vector2D ptCenter, double radius, double angleBeg, double angleEnd) { _cb.SetLineWidth(0.0f); _cb.SetColorStroke(LineTypeToBaseColor(lineType)); _cb.Arc( DX(ptCenter.X-radius), DY(ptCenter.Y-radius) // Bottom Left(x,y) , DX(ptCenter.X + radius), DY(ptCenter.Y + radius) // Top Right(x,y) , -(float)angleBeg // Start Angle , -(float)(angleEnd - angleBeg) // Extent ); _cb.Stroke(); }
public override void DrawArc(LT lineType, Vector2D ptCenter, double radius, double angleBeg, double angleEnd) { this.pdfGfx.DrawArc(new XPen(LineTypeToPdfColor(lineType)) , DX(ptCenter.X - radius), DY(ptCenter.Y + radius) , DL(2 * radius), DL(2 * radius) , -angleBeg, -angleEnd + angleBeg); }
public override void DrawLine(LT lineType, Vector2D ptBeg, Vector2D ptEnd) { this.pdfGfx.DrawLine(new XPen(LineTypeToPdfColor(lineType)) , DX(ptBeg.X), DY(ptBeg.Y) , DX(ptEnd.X), DY(ptEnd.Y)); }
public override void DrawPoint(LT lineType, Vector2D pt) { }
public static string LTypeToString(LT lType) { switch (lType) { case LT.LT_CUT: return "Cut"; case LT.LT_CREASING: return "Creasing"; case LT.LT_CONSTRUCTION: return "Construction"; case LT.LT_AXIS: return "Axis"; case LT.LT_COTATION: return "Cotation"; case LT.LT_PERFO: return "Perfo"; default: return "Unknown"; } }
public abstract void DrawPoint(LT lineType, Vector2D pt);
public abstract void DrawLine(LT lineType, Vector2D ptBeg, Vector2D ptEnd);
public abstract void DrawArc(LT lineType, Vector2D ptCenter, double radius, double angleBeg, double angleEnd);