public IBHtmlMessageBox(GameView g, string htmlstring) { InitializeComponent(); gv = g; button1.Text = "RETURN"; button1.Font = gv.drawFontReg; this.IceBlinkButtonClose.Enabled = false; this.IceBlinkButtonResize.Enabled = false; this.IceBlinkButtonClose.Visible = false; this.IceBlinkButtonResize.Visible = false; this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.form_MouseWheel); hlb = new IbbHtmlLogBox(this, gv, 10, 30, 580, 400); hlb.AddHtmlTextToLog(htmlstring); hlb.numberOfLinesToShow = 16; hlb.AddHtmlTextToLog(""); hlb.currentTopLineIndex = 0; //hlb.scrollToEnd(); }
//public bool logUpdated = false; //public int drawCount = 0; //public int mouseCount = 0; public GameView() { InitializeComponent(); this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.GameView_MouseWheel); mainDirectory = Directory.GetCurrentDirectory(); this.IceBlinkButtonClose.setupAll(this); this.IceBlinkButtonResize.setupAll(this); try { playerButtonClick.SoundLocation = mainDirectory + "\\default\\NewModule\\sounds\\btn_click.wav"; playerButtonClick.Load(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } try { playerButtonEnter.SoundLocation = mainDirectory + "\\default\\NewModule\\sounds\\btn_hover.wav"; playerButtonEnter.Load(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } this.WindowState = FormWindowState.Maximized; this.Width = 1366; this.Height = 768; screenWidth = this.Width; //getResources().getDisplayMetrics().widthPixels; screenHeight = this.Height; //getResources().getDisplayMetrics().heightPixels; float sqrW = (float)screenWidth / (float)squaresInWidth; float sqrH = (float)screenHeight / (float)squaresInHeight; if (sqrW > sqrH) { squareSize = (int)(sqrH); } else { squareSize = (int)(sqrW); } if ((squareSize > 100) && (squareSize < 120)) { squareSize = 100; } screenDensity = (float)squareSize / (float)squareSizeInPixels; oXshift = (screenWidth - (squareSize * squaresInWidth)) / 2; //CREATES A FONTFAMILY //(LOOK THE out word in the parameter sent to the method, that will modify myFonts object) family = LoadFontFamily(mainDirectory + "\\default\\NewModule\\fonts\\Metamorphous-Regular.ttf", out myFonts); float multiplr = (float)squareSize / 100.0f; drawFontLarge = new Font(family, 24.0f * multiplr); drawFontReg = new Font(family, 20.0f * multiplr); drawFontSmall = new Font(family, 16.0f * multiplr); animationTimer.Tick += new System.EventHandler(this.AnimationTimer_Tick); floatyTextTimer.Tick += new System.EventHandler(this.FloatyTextTimer_Tick); floatyTextMainMapTimer.Tick += new System.EventHandler(this.FloatyTextMainMapTimer_Tick); cc = new CommonCode(this); mod = new Module(); log = new IbbHtmlLogBox(this, 0 * squareSize + oXshift - 3, 0 * squareSize + oYshift, 6 * squareSize, 7 * squareSize); log.numberOfLinesToShow = 20; cc.addLogText("red", "screenDensity: " + screenDensity); cc.addLogText("fuchsia", "screenWidth: " + screenWidth); cc.addLogText("lime", "screenHeight: " + screenHeight); cc.addLogText("yellow", "squareSize: " + squareSize); cc.addLogText("yellow", "sqrW: " + sqrW); cc.addLogText("yellow", "sqrH: " + sqrH); cc.addLogText("yellow", ""); cc.addLogText("red", "Welcome to IceBlink 2"); cc.addLogText("fuchsia", "You can scroll this message log box, use mouse wheel or scroll bar"); //TODOinitializeMusic(); //TODOinitializeCombatMusic(); if (fixedModule.Equals("")) //this is the IceBlink Engine app { screenLauncher = new ScreenLauncher(mod, this); screenLauncher.loadModuleFiles(); screenType = "launcher"; } else //this is a fixed module { mod = cc.LoadModule(fixedModule + "/" + fixedModule + ".mod", false); resetGame(); cc.LoadSaveListItems(); screenType = "title"; } }