本文整理汇总了C#中UpdateState类的典型用法代码示例。如果您正苦于以下问题:C# UpdateState类的具体用法?C# UpdateState怎么用?C# UpdateState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UpdateState类属于命名空间,在下文中一共展示了UpdateState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetState
static string GetState(UpdateState mu) {
if (string.IsNullOrWhiteSpace(mu.CurrentRevision))
return "New";
if (mu.IsEqual())
return "Diagnose";
return mu.IsNewer() ? "Upgrade" : "Downgrade";
}
示例2: MouseUp
public void MouseUp(UpdateState state)
{
HITVM.Get().PlaySoundEvent(UISounds.BuildDragToolUp);
vm.Context.Architecture.RunCommands(Commands);
Commands.Clear();
Drawing = false;
}
示例3: OnMouseEvent
private void OnMouseEvent(UIMouseEventType type, UpdateState state)
{
switch (type)
{
case UIMouseEventType.MouseOver:
//m_isOver = true;
break;
case UIMouseEventType.MouseOut:
//m_isOver = false;
break;
case UIMouseEventType.MouseDown:
m_isDown = true;
break;
case UIMouseEventType.MouseUp:
if (m_isDown)
{
if (OnButtonClick != null)
{
OnButtonClick(this);
//GameFacade.SoundManager.PlayUISound(1);
}
}
m_isDown = false;
break;
}
}
示例4: ShowDialog
public DialogResult ShowDialog(UpdateState state, string version="")
{
btn_yes.Text = "Yes";
btn_no.Text = "No";
string title="";
string desc="";
switch(state)
{
case UpdateState.OffsetsMissing:
pic_image.Image = Properties.Resources.file_missing;
btn_no.Text = "Exit program";
title="Offsets missing!";
desc= String.Format("{0} could not be found. Do you want to download the latest offsets?", settings.OffSetXML);
break;
case UpdateState.UpgradeTool:
title="Program update available!";
desc = String.Format("Dungeon Teller v{0} is available. Do you want to start the updater?", version);
break;
case UpdateState.UpdateOffsets:
title="Offset update available!";
desc = String.Format("Your offsets version: {0}\nLatest offsets version: {1}\nDo you want to update them now?", settings.WowVersion, version);
break;
}
lbl_title.Text = title;
lbl_desc.Text = desc;
return this.ShowDialog();
}
示例5:
UpdateFrequency IUpdate.Update(UpdateState state)
{
if (disposed)
return UpdateFrequency.Terminate;
Update(state, state.PlayerInput[PlayerIndex].InputState);
return UpdateFrequency.FullUpdate60hz;
}
示例6: requestStateChange
public void requestStateChange(string name)
{
if(this.InvokeRequired) {
UpdateState d = new UpdateState(requestStateChange);
this.Invoke(d, new object[]{name});
} else {
sHandler.activateState(name);
}
}
示例7: Update
public void Update(UpdateState state)
{
DateTime now = DateTime.Now;
if (_lastCacheClean + _cleanInterval >= now)
return;
_landCache.Clean();
_lastCacheClean = now;
}
示例8: MouseDown
public void MouseDown(UpdateState state)
{
if (!Drawing)
{
HITVM.Get().PlaySoundEvent(UISounds.BuildDragToolDown);
Drawing = true;
var tilePos = World.State.WorldSpace.GetTileAtPosWithScroll(new Vector2(state.MouseState.X, state.MouseState.Y));
StartPosition = new Point((int)Math.Round(tilePos.X), (int)Math.Round(tilePos.Y));
}
}
示例9: Update
public virtual void Update(UpdateState state)
{
MaterialManager.RefreshLights();
PhysicsSpace.Update();
foreach (var gameObject in beingRemoved)
{
drawToScreen.Remove(gameObject);
}
}
示例10: OnMouse
private void OnMouse(UIMouseEventType type, UpdateState state)
{
if (type == UIMouseEventType.MouseOver)
{
if (isDown) { return; }
color = Color.Red;
}
else if (type == UIMouseEventType.MouseOut)
{
if (isDown) { return; }
color = Color.White;
}
else if (type == UIMouseEventType.MouseDown)
{
color = Color.Blue;
isDown = true;
}
else if (type == UIMouseEventType.MouseUp)
{
isDown = false;
color = Color.Green;
}
}
示例11: Update
/// <summary></summary>
/// <param name="state"></param>
/// <param name="input"></param>
protected override sealed void Update(UpdateState state, InputState input)
{
Vector2 r = input.ThumbSticks.RightStick * (rotAcceleration * rotAcceleration * 0.05f + new Vector2(1, 1));
viewRotation += r * RotationSensitivity * 0.04f;
float cap = v_cap;
if (viewRotation.Y > cap)
viewRotation.Y = cap;
if (viewRotation.Y < -cap)
viewRotation.Y = -cap;
rotAcceleration += input.ThumbSticks.RightStick * (new Vector2(0.5f, 0.25f) * (1.5f - move.Length() * 0.5f)) * 1.25f;
rotAcceleration *= 0.9f;
#if !XBOX360
if (state.PlayerInput[PlayerIndex].ControlInput == ControlInput.KeyboardMouse)
rotAcceleration *= 0;//no rotation acceleration for mouse
#endif
move *= 0.75f;
move += input.ThumbSticks.LeftStick / 4;
if (rotAcceleration.LengthSquared() > 0 && r.LengthSquared() > 0)
{
Vector2 v1 = rotAcceleration, v2 = r;
v1.Normalize();
v2.Normalize();
float a = Vector2.Dot(v1, v2);
if (a > 0)
rotAcceleration *= a;
else
rotAcceleration *= 0.25f;
}
Matrix m1, rotation;
if (zUp)
{
//z is up, so rotate left/right is around z.
Matrix.CreateRotationZ(-viewRotation.X, out rotation);
//x is always left to right, so rotate up/down is around x
Matrix.CreateRotationX(viewRotation.Y + MathHelper.PiOver2, out m1);
}
else
{
//y is up, so rotate left/right is around y.
Matrix.CreateRotationY(-viewRotation.X, out rotation);
Matrix.CreateRotationX(viewRotation.Y, out m1);
}
Matrix.Multiply(ref m1, ref rotation, out rotation);
Vector3 pos = Position;
pos -= (rotation.Forward * move.Y * MovementSensitivity.Y * -8 + rotation.Left * move.X * MovementSensitivity.X * 8);// new Vector3(move.X * -8, 0, move.Y * 8);
Matrix.CreateTranslation(ref pos, out m1);
Matrix.Multiply(ref rotation, ref m1, out rotation);
CameraMatrix = rotation;
}
示例12: Update
public UpdateFrequency Update(UpdateState state)
{
Vector3 color = new Vector3(0.08f, 0.08f, 0.08f);
if (Highlight)
color = new Vector3(0.15f, 0.5f, 0.05f);
this.Colour = this.Colour * 0.75f + color * 0.25f;
Vector3 half = Vector3.One * 0.5f;
background[0].Colour = new Color(this.Colour * Fade);
background[2].Colour = new Color(new Vector3(0.25f, 0.25f, 0.25f) * Fade + half * (1 - Fade));
background[1].Colour = new Color(new Vector3(1, 1, 1) * Fade + half * (1-Fade));
text.ColourFloat = new Vector4(this.Colour + Vector3.One * 0.5f, Fade);
return UpdateFrequency.OncePerFrame;
}
示例13: ButtonAnim
public void ButtonAnim(UpdateState state)
{
icon.button.Selected = false;
if (Alert && Ticks < 30) icon.button.Selected = true;
if (++Ticks > 59)
{
Ticks = 0;
}
}
示例14: Update
private void Update(UpdateState state)
{
Vector2 pt = Target.GetMousePosition(state.MouseState);
var pt2 = new Microsoft.Xna.Framework.Point((int)pt.X, (int)pt.Y);
if (m_active)
{
if (m_fade < 1) m_fade += 0.1f;
if (m_fade > 1) m_fade = 1;
GameFacade.Screens.TooltipProperties.UpdateDead = false;
GameFacade.Screens.TooltipProperties.Position = m_position;
GameFacade.Screens.TooltipProperties.Opacity = m_fade;
/** fade in **/
if (!Target.GetBounds().Contains(pt2) || !GameFacade.Focus || !Target.WillDraw())
{
m_active = false;
GameFacade.Screens.TooltipProperties.Show = false;
GameFacade.Screens.TooltipProperties.Opacity = 0;
m_fade = 0;
}
}
else
{
if (Target.GetBounds().Contains(pt2) && Target.Tooltip != null && Target.WillDraw() && GameFacade.Focus)
{
m_active = true;
GameFacade.Screens.TooltipProperties.Show = true;
GameFacade.Screens.TooltipProperties.Opacity = 0;
GameFacade.Screens.TooltipProperties.UpdateDead = false;
GameFacade.Screens.Tooltip = Target.Tooltip;
m_fade = 0;
m_position = new Vector2(state.MouseState.X, Target.LocalPoint(new Vector2(0, 0)).Y); //at top of element
}
}
}
示例15: SetUpdateProgress
private void SetUpdateProgress(int updatedItemCount = 0, int totalUpdateItemCount = 0, UpdateState updateState = UpdateState.Default)
{
int progress = 0;
string message = "";
if (totalUpdateItemCount > 0)
progress = (int)(100.0f * (float)updatedItemCount / (float)totalUpdateItemCount);
if (updateState == UpdateState.Default)
{
switch (_state)
{
case NovelState.Active:
updateState = UpdateState.Waiting;
break;
case NovelState.Completed:
updateState = UpdateState.Completed;
break;
case NovelState.Inactive:
updateState = UpdateState.Inactive;
break;
case NovelState.Dropped:
updateState = UpdateState.Dropped;
break;
}
}
switch (updateState)
{
case UpdateState.Waiting:
progress = 0;
message = "Waiting For Updates";
break;
case UpdateState.Checking:
progress = 0;
message = "Checking For Updates";
break;
case UpdateState.Fetching:
message = "Fetching Updates: " + updatedItemCount + " / " + totalUpdateItemCount;
break;
case UpdateState.UpToDate:
if (_state == NovelState.Active)
message = "Novel Up To Date";
else if(_state == NovelState.Completed)
message = "Complted Novel Up To Date";
else if (_state == NovelState.Inactive)
message = "Inactive Novel Up To Date";
else if (_state == NovelState.Dropped)
message = "Dropped Novel Up To Date";
progress = 100;
break;
case UpdateState.Completed:
progress = 100;
message = "Novel Completed";
break;
case UpdateState.Inactive:
progress = 0;
message = "Novel Inactive";
break;
case UpdateState.Dropped:
progress = 0;
message = "Novel Dropped";
break;
}
if (BackgroundService.Instance.novelReaderForm != null && BackgroundService.Instance.novelReaderForm.InvokeRequired)
{
BackgroundService.Instance.novelReaderForm.BeginInvoke(new System.Windows.Forms.MethodInvoker(delegate
{
UpdateProgress = new Tuple<int, string>(progress, message);
}));
}
else
{
UpdateProgress = new Tuple<int, string>(progress, message);
}
}