private static bool DrawMudclient(mudclient _rscMudclient) { _rscMudclient.paint(mudclient.graphics); try { if (_rscMudclient.loggedIn == 0) { _rscMudclient.gameGraphics.loggedIn = false; _rscMudclient.drawLoginScreens(); } if (_rscMudclient.loggedIn == 1) { _rscMudclient.gameGraphics.loggedIn = true; _rscMudclient.drawGame(); return(true); } } catch (Exception _ex) { _rscMudclient.cleanUp(); _rscMudclient.memoryError = true; return(false); } return(true); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); _diagnosticFont = Content.Load <SpriteFont>("fonts/gameFont12"); _diagnosticFont2 = Content.Load <SpriteFont>("fonts/gameFont16"); _loadingBackgroundImage = Content.Load <Texture2D>("sprites/pattern_40"); _gameLogo = Content.Load <Texture2D>("sprites/yuno4"); _rscMudclient = mudclient.CreateMudclient(Window.Title, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight); _rscMudclient.DoNotDrawLogo = true; _rscMudclient.OnContentLoadedCompleted += new EventHandler(rscMudclient_OnContentLoadedCompleted); _rscMudclient.OnContentLoaded += new EventHandler <ContentLoadedEventArgs>(rscMudclient_OnContentLoaded); _rscMudclient.OnLoadingSection += new EventHandler(_rscMudclient_OnLoadingSection); _rscMudclient.OnLoadingSectionCompleted += new EventHandler(_rscMudclient_OnLoadingSectionCompleted); //_rscMudclient.LoadContent(); _rscMudclient.gameMinThreadSleepTime = 10; _rscMudclient.start(); _gameThread = new System.Threading.Thread(_rscMudclient.run); _gameThread.Start(); //_rscMudclient. // TODO: use this.Content to load your game content here }
public static void AcceptDuel(this mudclient mc, TradeAndDuelState state) { if (state == TradeAndDuelState.Confirm) { mc.duelConfirmOurAccepted = true; mc.streamClass.createPacket(87); mc.streamClass.formatPacket(); } }
public static void AcceptTrade(this mudclient mc, TradeAndDuelState state) { if (state == TradeAndDuelState.Initial) { } else { } }
private void DrawGame(mudclient _rscMudclient) { if (_rscMudclient != null) { try { try { spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); } catch { try { spriteBatch.End(); spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); } catch { } } //rscMudclient.Draw(gameTime); if (_rscMudclient.gameGraphics != null) { // rscMudclient.gameGraphics.UpdateGameImage(); if (!_isSectionLoading) { if (!DrawMudclient(_rscMudclient)) { return; } // _rscMudclient.drawWindow(); // var colors = new List<Color>(); uint[] colors = new uint[_rscMudclient.gameGraphics.pixels.Length]; for (int j = 0; j < _rscMudclient.gameGraphics.pixels.Length; j++) { var bytes = BitConverter.GetBytes(_rscMudclient.gameGraphics.pixels[j]); var r = bytes[2]; var g = bytes[1]; var b = bytes[0]; colors[j] = RSCXNALib.Game.GameImage.rgbaToUInt(r, g, b, 255);//new Color(r, g, b, 255).PackedValue; //colors.Add(); } if (_rscMudclient.gameGraphics.pixels.Any(p => p != 0) && _rscMudclient.DrawIsNecessary) { var imageTexture = new Texture2D(GraphicsDevice, _rscMudclient.gameGraphics.gameWidth, _rscMudclient.gameGraphics.gameHeight, false, SurfaceFormat.Color); imageTexture.SetData(colors.ToArray()); spriteBatch.Draw(imageTexture, Vector2.Zero, Color.White); _lastGameImageTexture = imageTexture; _rscMudclient.DrawIsNecessary = false; } else if (_lastGameImageTexture != null) { spriteBatch.Draw(_lastGameImageTexture, Vector2.Zero, Color.White); } } else if (_lastGameImageTexture != null) { spriteBatch.Draw(_lastGameImageTexture, Vector2.Zero, Color.White); DrawSectionLoading(); } } spriteBatch.End(); } catch { } } }
public static void DeclineDuel(this mudclient mc) { mc.showDuelConfirmBox = false; mc.streamClass.createPacket(35); mc.streamClass.formatPacket(); }
public static bool IsDuelWindowVisible(this mudclient mc, TradeAndDuelState state) { return(state == TradeAndDuelState.Initial ? mc.showDuelBox : mc.showDuelConfirmBox); }
public static void DeclineTrade(this mudclient mc) { }
public static void DisplayMessage(this mudclient mc, string message, int type) { mc.displayMessage(message, type); }