Exemple #1
0
 public ScreenParty(Module m, GameView g)
 {
     mod = m;
     gv = g;
     setControlsStart();
     description = new IbbHtmlTextBox(gv, 320, 100, 500, 300);
     description.showBoxBorder = false;
 }
 public ScreenLauncher(Module m, GameView g)
 {
     mod = m;
     gv = g;
     setControlsStart();
     int pH = (int)((float)gv.screenHeight / 100.0f);
     description = new IbbHtmlTextBox(gv);
     description.tbXloc = 0 * gv.squareSize + gv.oXshift;
     description.tbYloc = 6 * gv.squareSize + gv.oYshift;
     description.tbWidth = 16 * gv.squareSize;
     description.tbHeight = 6 * gv.squareSize;
     description.showBoxBorder = false;
 }
        public ScreenLauncher(Module m, GameView g)
        {
            //mod = m;
            gv = g;
            setControlsStart();
            int pH = (int)((float)gv.screenHeight / 100.0f);

            description               = new IbbHtmlTextBox(gv);
            description.tbXloc        = 0 * gv.squareSize + gv.oXshift;
            description.tbYloc        = 6 * gv.squareSize + gv.oYshift;
            description.tbWidth       = 16 * gv.squareSize;
            description.tbHeight      = 6 * gv.squareSize;
            description.showBoxBorder = false;
        }
        public void setControlsStart()
        {
            int pW = (int)((float)gv.screenWidth / 100.0f);
            int pH = (int)((float)gv.screenHeight / 100.0f);
            int padW = gv.squareSize/6;

            description = new IbbHtmlTextBox(gv, 320, 100, 500, 300);
            description.showBoxBorder = false;

            if (btnInventoryLeft == null)
            {
                btnInventoryLeft = new IbbButton(gv, 1.0f);
                btnInventoryLeft.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnInventoryLeft.Img2 = gv.cc.LoadBitmap("ctrl_left_arrow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_left_arrow);
                btnInventoryLeft.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnInventoryLeft.X = 8 * gv.squareSize;
                btnInventoryLeft.Y = (1 * gv.squareSize) - (pH * 2);
                btnInventoryLeft.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnInventoryLeft.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (btnPageIndex == null)
            {
                btnPageIndex = new IbbButton(gv, 1.0f);
                btnPageIndex.Img = gv.cc.LoadBitmap("btn_small_off"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_off);
                btnPageIndex.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnPageIndex.Text = "1/10";
                btnPageIndex.X = 9 * gv.squareSize;
                btnPageIndex.Y = (1 * gv.squareSize) - (pH * 2);
                btnPageIndex.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnPageIndex.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (btnInventoryRight == null)
            {
                btnInventoryRight = new IbbButton(gv, 1.0f);
                btnInventoryRight.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnInventoryRight.Img2 = gv.cc.LoadBitmap("ctrl_right_arrow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_right_arrow);
                btnInventoryRight.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnInventoryRight.X = 10 * gv.squareSize;
                btnInventoryRight.Y = (1 * gv.squareSize) - (pH * 2);
                btnInventoryRight.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnInventoryRight.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }

            if (btnAction == null)
            {
                btnAction = new IbbButton(gv, 1.0f);
                if (itemSelectorType.Equals("container"))
                {
                    btnAction.Text = "TAKE ALL";
                }
                else if (itemSelectorType.Equals("equip"))
                {
                    btnAction.Text = "EQUIP SELECTED";
                }
                btnAction.Img = gv.cc.LoadBitmap("btn_large"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large);
                btnAction.Glow = gv.cc.LoadBitmap("btn_large_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large_glow);
                btnAction.X = (gv.screenWidth / 2) - (int)(gv.ibbwidthL * gv.screenDensity / 2.0f) - (gv.squareSize * 4);
                btnAction.Y = 9 * gv.squareSize + pH * 2;
                btnAction.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnAction.Width = (int)(gv.ibbwidthL * gv.screenDensity);
            }
            if (btnAction2 == null)
            {
                btnAction2 = new IbbButton(gv, 1.0f);
                if (itemSelectorType.Equals("container"))
                {
                    btnAction2.Text = "TAKE SELECTED";
                }
                else if (itemSelectorType.Equals("equip"))
                {
                    btnAction2.Text = "UNEQUIP";
                }
                btnAction2.Img = gv.cc.LoadBitmap("btn_large"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large);
                btnAction2.Glow = gv.cc.LoadBitmap("btn_large_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large_glow);
                btnAction2.X = (gv.screenWidth / 2) - (int)(gv.ibbwidthL * gv.screenDensity / 2.0f) + (gv.squareSize * 4);
                btnAction2.Y = 9 * gv.squareSize + pH * 2;
                btnAction2.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnAction2.Width = (int)(gv.ibbwidthL * gv.screenDensity);
            }
            if (btnExit == null)
            {
                btnExit = new IbbButton(gv, 1.0f);
                btnExit.Text = "EXIT";
                btnExit.Img = gv.cc.LoadBitmap("btn_large"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large);
                btnExit.Glow = gv.cc.LoadBitmap("btn_large_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large_glow);
                btnExit.X = (gv.screenWidth / 2) - (int)(gv.ibbwidthL * gv.screenDensity / 2.0f);
                btnExit.Y = 9 * gv.squareSize + pH * 2;
                btnExit.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnExit.Width = (int)(gv.ibbwidthL * gv.screenDensity);
            }
            if (btnInfo == null)
            {
                btnInfo = new IbbButton(gv, 0.8f);
                btnInfo.Text = "INFO";
                btnInfo.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnInfo.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnInfo.X = (16 * gv.squareSize) - padW * 1 + gv.oXshift;
                btnInfo.Y = 9 * gv.squareSize + pH * 2;
                btnInfo.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnInfo.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            for (int y = 0; y < slotsPerPage; y++)
            {
                IbbButton btnNew = new IbbButton(gv, 1.0f);
                btnNew.Img = gv.cc.LoadBitmap("item_slot"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.item_slot);
                btnNew.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);

                if (y < 5)
                {
                    btnNew.X = ((y + 2 + 4) * gv.squareSize) + (padW * (y+1)) + gv.oXshift;
                    btnNew.Y = 2 * gv.squareSize;
                }
                else if ((y >=5 ) && (y < 10))
                {
                    btnNew.X = ((y-5 + 2 + 4) * gv.squareSize) + (padW * ((y-5)+1)) + gv.oXshift;
                    btnNew.Y = 3 * gv.squareSize + padW;
                }
                else if ((y >=10 ) && (y < 15))
                {
                    btnNew.X = ((y-10 + 2 + 4) * gv.squareSize) + (padW * ((y-10)+1)) + gv.oXshift;
                    btnNew.Y = 4 * gv.squareSize + (padW * 2);
                }
                else
                {
                    btnNew.X = ((y-15 + 2 + 4) * gv.squareSize) + (padW * ((y-15)+1)) + gv.oXshift;
                    btnNew.Y = 5 * gv.squareSize + (padW * 3);
                }

                btnNew.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnNew.Width = (int)(gv.ibbwidthR * gv.screenDensity);

                btnInventorySlot.Add(btnNew);
            }
        }
        public void setControlsStart()
        {
            int pW = (int)((float)gv.screenWidth / 100.0f);
            int pH = (int)((float)gv.screenHeight / 100.0f);
            int padW = gv.squareSize/6;
            int xShift = gv.squareSize/2;
            int yShift = gv.squareSize/2;

            description = new IbbHtmlTextBox(gv, 320, 100, 500, 300);
            description.showBoxBorder = false;

            if (ctrlUpArrow == null)
            {
                ctrlUpArrow = new IbbButton(gv, 1.0f);
                ctrlUpArrow.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                ctrlUpArrow.Img2 = gv.cc.LoadBitmap("ctrl_up_arrow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_up_arrow);
                ctrlUpArrow.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.arrow_glow);
                ctrlUpArrow.X = 12 * gv.squareSize;
                ctrlUpArrow.Y = 1 * gv.squareSize + pH * 2;
                ctrlUpArrow.Height = (int)(gv.ibbheight * gv.screenDensity);
                ctrlUpArrow.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (ctrlDownArrow == null)
            {
                ctrlDownArrow = new IbbButton(gv, 1.0f);
                ctrlDownArrow.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                ctrlDownArrow.Img2 = gv.cc.LoadBitmap("ctrl_down_arrow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_down_arrow);
                ctrlDownArrow.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.arrow_glow);
                ctrlDownArrow.X = 12 * gv.squareSize;
                ctrlDownArrow.Y = 2 * gv.squareSize + pH * 3;
                ctrlDownArrow.Height = (int)(gv.ibbheight * gv.screenDensity);
                ctrlDownArrow.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (ctrlLeftArrow == null)
            {
                ctrlLeftArrow = new IbbButton(gv, 1.0f);
                ctrlLeftArrow.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                ctrlLeftArrow.Img2 = gv.cc.LoadBitmap("ctrl_left_arrow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_left_arrow);
                ctrlLeftArrow.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.arrow_glow);
                ctrlLeftArrow.X = 10 * gv.squareSize + xShift;
                ctrlLeftArrow.Y = pH * 34;
                ctrlLeftArrow.Height = (int)(gv.ibbheight * gv.screenDensity);
                ctrlLeftArrow.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (ctrlRightArrow == null)
            {
                ctrlRightArrow = new IbbButton(gv, 1.0f);
                ctrlRightArrow.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                ctrlRightArrow.Img2 = gv.cc.LoadBitmap("ctrl_right_arrow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_right_arrow);
                ctrlRightArrow.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.arrow_glow);
                ctrlRightArrow.X = 11 * gv.squareSize + pW * 2 + xShift;
                ctrlRightArrow.Y = pH * 34;
                ctrlRightArrow.Height = (int)(gv.ibbheight * gv.screenDensity);
                ctrlRightArrow.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (btnReturnJournal == null)
            {
                btnReturnJournal = new IbbButton(gv, 1.2f);
                btnReturnJournal.Text = "RETURN";
                btnReturnJournal.Img = gv.cc.LoadBitmap("btn_large"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large);
                btnReturnJournal.Glow = gv.cc.LoadBitmap("btn_large_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large_glow);
                btnReturnJournal.X = (gv.screenWidth / 2) - (int)(gv.ibbwidthL * gv.screenDensity / 2.0f);
                btnReturnJournal.Y = 9 * gv.squareSize + pH * 2;
                btnReturnJournal.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnReturnJournal.Width = (int)(gv.ibbwidthL * gv.screenDensity);
            }
        }
        public void setControlsStart()
        {
            int pW = (int)((float)gv.screenWidth / 100.0f);
            int pH = (int)((float)gv.screenHeight / 100.0f);
            int padW = gv.squareSize/6;

            description = new IbbHtmlTextBox(gv, 320, 100, 500, 300);
            description.showBoxBorder = false;

            if (btnSelect == null)
            {
                btnSelect = new IbbButton(gv, 0.8f);
                btnSelect.Text = "LEARN SELECTED TRAIT";
                btnSelect.Img = gv.cc.LoadBitmap("btn_large"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large);
                btnSelect.Glow = gv.cc.LoadBitmap("btn_large_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large_glow);
                btnSelect.X = (gv.screenWidth / 2) - (int)(gv.ibbwidthL * gv.screenDensity / 2.0f);
                btnSelect.Y = 9 * gv.squareSize + pH * 2;
                btnSelect.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnSelect.Width = (int)(gv.ibbwidthL * gv.screenDensity);
            }
            if (btnHelp == null)
            {
                btnHelp = new IbbButton(gv, 0.8f);
                btnHelp.Text = "HELP";
                btnHelp.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnHelp.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnHelp.X = 5 * gv.squareSize + padW * 1 + gv.oXshift;
                btnHelp.Y = 9 * gv.squareSize + pH * 2;
                btnHelp.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnHelp.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (btnExit == null)
            {
                btnExit = new IbbButton(gv, 0.8f);
                btnExit.Text = "EXIT";
                btnExit.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnExit.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnExit.X = (15 * gv.squareSize) - padW * 1 + gv.oXshift;
                btnExit.Y = 9 * gv.squareSize + pH * 2;
                btnExit.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnExit.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            for (int y = 0; y < slotsPerPage; y++)
            {
                IbbButton btnNew = new IbbButton(gv, 1.0f);
                btnNew.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnNew.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);

                int x = y % 5;
                int yy = y / 5;
                btnNew.X = ((x + 4) * gv.squareSize) + (padW * (x+1)) + gv.oXshift;
                btnNew.Y = (1 + yy) * gv.squareSize + (padW * yy);

                btnNew.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnNew.Width = (int)(gv.ibbwidthR * gv.screenDensity);

                btnTraitSlots.Add(btnNew);
            }
        }
Exemple #7
0
        public void setControlsStart()
        {
            int pW = (int)((float)gv.screenWidth / 100.0f);
            int pH = (int)((float)gv.screenHeight / 100.0f);
            int padW = gv.squareSize/6;

            description = new IbbHtmlTextBox(gv, 320, 100, 500, 300);
            description.showBoxBorder = false;

            if (btnInventoryLeft == null)
            {
                btnInventoryLeft = new IbbButton(gv, 1.0f);
                btnInventoryLeft.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnInventoryLeft.Img2 = gv.cc.LoadBitmap("ctrl_left_arrow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_left_arrow);
                btnInventoryLeft.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnInventoryLeft.X = 7 * gv.squareSize;
                btnInventoryLeft.Y = (5 * gv.squareSize) - (pH * 2);
                btnInventoryLeft.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnInventoryLeft.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (btnPageIndex == null)
            {
                btnPageIndex = new IbbButton(gv, 1.0f);
                btnPageIndex.Img = gv.cc.LoadBitmap("btn_small_off"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_off);
                btnPageIndex.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnPageIndex.Text = "1/10";
                btnPageIndex.X = 8 * gv.squareSize;
                btnPageIndex.Y = (5 * gv.squareSize) - (pH * 2);
                btnPageIndex.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnPageIndex.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (btnInventoryRight == null)
            {
                btnInventoryRight = new IbbButton(gv, 1.0f);
                btnInventoryRight.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnInventoryRight.Img2 = gv.cc.LoadBitmap("ctrl_right_arrow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_right_arrow);
                btnInventoryRight.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnInventoryRight.X = 9 * gv.squareSize;
                btnInventoryRight.Y = (5 * gv.squareSize) - (pH * 2);
                btnInventoryRight.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnInventoryRight.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (btnShopLeft == null)
            {
                btnShopLeft = new IbbButton(gv, 1.0f);
                btnShopLeft.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnShopLeft.Img2 = gv.cc.LoadBitmap("ctrl_left_arrow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_left_arrow);
                btnShopLeft.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnShopLeft.X = 7 * gv.squareSize;
                btnShopLeft.Y = (1 * gv.squareSize) - (pH * 2);
                btnShopLeft.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnShopLeft.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (btnShopPageIndex == null)
            {
                btnShopPageIndex = new IbbButton(gv, 1.0f);
                btnShopPageIndex.Img = gv.cc.LoadBitmap("btn_small_off"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_off);
                btnShopPageIndex.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnShopPageIndex.Text = "1/10";
                btnShopPageIndex.X = 8 * gv.squareSize;
                btnShopPageIndex.Y = (1 * gv.squareSize) - (pH * 2);
                btnShopPageIndex.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnShopPageIndex.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (btnShopRight == null)
            {
                btnShopRight = new IbbButton(gv, 1.0f);
                btnShopRight.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnShopRight.Img2 = gv.cc.LoadBitmap("ctrl_right_arrow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_right_arrow);
                btnShopRight.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnShopRight.X = 9 * gv.squareSize;
                btnShopRight.Y = (1 * gv.squareSize) - (pH * 2);
                btnShopRight.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnShopRight.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (btnReturn == null)
            {
                btnReturn = new IbbButton(gv, 1.2f);
                btnReturn.Text = "EXIT SHOP";
                btnReturn.Img = gv.cc.LoadBitmap("btn_large"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large);
                btnReturn.Glow = gv.cc.LoadBitmap("btn_large_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large_glow);
                btnReturn.X = (gv.screenWidth / 2) - (int)(gv.ibbwidthL * gv.screenDensity / 2.0f);
                btnReturn.Y = 9 * gv.squareSize + pH * 2;
                btnReturn.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnReturn.Width = (int)(gv.ibbwidthL * gv.screenDensity);
            }
            if (btnHelp == null)
            {
                btnHelp = new IbbButton(gv, 0.8f);
                btnHelp.Text = "HELP";
                btnHelp.Img = gv.cc.LoadBitmap("btn_small"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnHelp.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnHelp.X = 0 * gv.squareSize + padW * 1 + gv.oXshift;
                btnHelp.Y = 9 * gv.squareSize + pH * 2;
                btnHelp.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnHelp.Width = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            for (int j = 0; j < 10; j++)
            {
                IbbButton btnNew = new IbbButton(gv, 1.0f);
                btnNew.Img = gv.cc.LoadBitmap("item_slot"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.item_slot);
                btnNew.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                if (j < 5)
                {
                    btnNew.X = ((j+2+4) * gv.squareSize) + (padW * (j+1)) + gv.oXshift;
                    btnNew.Y = 6 * gv.squareSize;
                }
                else
                {
                    btnNew.X = ((j-5+2+4) * gv.squareSize) + (padW * ((j-5)+1)) + gv.oXshift;
                    btnNew.Y = 7 * gv.squareSize + padW;
                }
                btnNew.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnNew.Width = (int)(gv.ibbwidthR * gv.screenDensity);

                btnInventorySlot.Add(btnNew);
            }
            for (int j = 0; j < 10; j++)
            {
                IbbButton btnNew = new IbbButton(gv, 1.0f);
                btnNew.Img = gv.cc.LoadBitmap("item_slot"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.item_slot);
                btnNew.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                if (j < 5)
                {
                    btnNew.X = ((j+2+4) * gv.squareSize) + (padW * (j+1)) + gv.oXshift;
                    btnNew.Y = 2 * gv.squareSize;
                }
                else
                {
                    btnNew.X = ((j-5+2+4) * gv.squareSize) + (padW * ((j-5)+1)) + gv.oXshift;
                    btnNew.Y = 3 * gv.squareSize + padW;
                }
                btnNew.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnNew.Width = (int)(gv.ibbwidthR * gv.screenDensity);

                btnShopSlot.Add(btnNew);
            }
        }
        public void setControlsStart()
        {
            List <string>       spellsForLearningTags = new List <string>();
            List <SpellAllowed> spellsForLearning     = new List <SpellAllowed>();

            int pW   = (int)((float)gv.screenWidth / 100.0f);
            int pH   = (int)((float)gv.screenHeight / 100.0f);
            int padW = gv.squareSize / 6;

            description = new IbbHtmlTextBox(gv, 320, 100, 500, 300);
            description.showBoxBorder = false;

            //added
            if (btnTokensLeft == null)
            {
                btnTokensLeft        = new IbbButton(gv, 1.0f);
                btnTokensLeft.Img    = gv.cc.LoadBitmap("btn_small");       // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnTokensLeft.Img2   = gv.cc.LoadBitmap("ctrl_left_arrow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_left_arrow);
                btnTokensLeft.Glow   = gv.cc.LoadBitmap("btn_small_glow");  // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnTokensLeft.X      = (int)(5 * gv.squareSize) + (3 * pW);
                btnTokensLeft.Y      = (2 * gv.squareSize);
                btnTokensLeft.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnTokensLeft.Width  = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            //added
            if (btnPageIndex == null)
            {
                btnPageIndex        = new IbbButton(gv, 1.0f);
                btnPageIndex.Img    = gv.cc.LoadBitmap("btn_small_off");  // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_off);
                btnPageIndex.Glow   = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnPageIndex.Text   = "1/20";
                btnPageIndex.X      = (int)(6 * gv.squareSize) + (3 * pW);
                btnPageIndex.Y      = (2 * gv.squareSize);
                btnPageIndex.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnPageIndex.Width  = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            //added
            if (btnTokensRight == null)
            {
                btnTokensRight        = new IbbButton(gv, 1.0f);
                btnTokensRight.Img    = gv.cc.LoadBitmap("btn_small");        // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnTokensRight.Img2   = gv.cc.LoadBitmap("ctrl_right_arrow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_right_arrow);
                btnTokensRight.Glow   = gv.cc.LoadBitmap("btn_small_glow");   // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnTokensRight.X      = (int)(7f * gv.squareSize) + (3 * pW);
                btnTokensRight.Y      = (2 * gv.squareSize);
                btnTokensRight.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnTokensRight.Width  = (int)(gv.ibbwidthR * gv.screenDensity);
            }

            if (btnSelect == null)
            {
                btnSelect        = new IbbButton(gv, 0.8f);
                btnSelect.Text   = gv.mod.playerList[gv.screenCastSelector.castingPlayerIndex].playerClass.labelForUseTraitAction.ToUpper() + " SELECTED " + gv.mod.playerList[gv.screenCastSelector.castingPlayerIndex].playerClass.spellLabelSingular.ToUpper();
                btnSelect.Img    = gv.cc.LoadBitmap("btn_large");      // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large);
                btnSelect.Glow   = gv.cc.LoadBitmap("btn_large_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large_glow);
                btnSelect.X      = (gv.screenWidth / 2) - (int)(gv.ibbwidthL * gv.screenDensity / 2.0f);
                btnSelect.Y      = 9 * gv.squareSize + pH * 2;
                btnSelect.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnSelect.Width  = (int)(gv.ibbwidthL * gv.screenDensity);
            }
            if (btnHelp == null)
            {
                btnHelp        = new IbbButton(gv, 0.8f);
                btnHelp.Text   = "HELP";
                btnHelp.Img    = gv.cc.LoadBitmap("btn_small");      // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnHelp.Glow   = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnHelp.X      = 5 * gv.squareSize + padW * 1 + gv.oXshift;
                btnHelp.Y      = 9 * gv.squareSize + pH * 2;
                btnHelp.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnHelp.Width  = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (btnExit == null)
            {
                btnExit        = new IbbButton(gv, 0.8f);
                btnExit.Text   = "RETURN";
                btnExit.Img    = gv.cc.LoadBitmap("btn_small");      // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnExit.Glow   = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnExit.X      = (15 * gv.squareSize) - padW * 1 + gv.oXshift;
                btnExit.Y      = 9 * gv.squareSize + pH * 2;
                btnExit.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnExit.Width  = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            for (int y = 0; y < slotsPerPage; y++)
            {
                IbbButton btnNew = new IbbButton(gv, 1.0f);
                btnNew.Img    = gv.cc.LoadBitmap("btn_small");      // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                btnNew.ImgOff = gv.cc.LoadBitmap("btn_small_off");
                btnNew.Glow   = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);

                int x  = y % 5;
                int yy = y / 5;
                btnNew.X = ((x + 4) * gv.squareSize) + (padW * (x + 1)) + gv.oXshift;
                btnNew.Y = (3 + yy) * gv.squareSize + (padW * yy + padW);

                btnNew.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnNew.Width  = (int)(gv.ibbwidthR * gv.screenDensity);

                btnSpellSlots.Add(btnNew);
            }
            //DRAW ALL SPELL SLOTS
            if (isInCombat)
            {
                int cntSlot = 0;
                foreach (IbbButton btn in btnSpellSlots)
                {
                    Player pc = getCastingPlayer();

                    if (cntSlot == spellSlotIndex)
                    {
                        btn.glowOn = true;
                    }
                    else
                    {
                        btn.glowOn = false;
                    }

                    sortTraitsForLevelUp(pc);

                    //show only spells for the PC class
                    //if (cntSlot < pc.playerClass.spellsAllowed.Count)
                    if ((cntSlot + (tknPageIndex * slotsPerPage)) < backupKnownSpellTagsInCombat.Count)
                    {
                        //SpellAllowed sa = pc.playerClass.spellsAllowed[cntSlot];
                        Spell sp = gv.mod.getSpellByTag(backupKnownSpellTagsInCombat[cntSlot + (tknPageIndex * slotsPerPage)]);

                        btn.Img2     = gv.cc.LoadBitmap(sp.spellImage);
                        btn.Img2Off  = gv.cc.LoadBitmap(sp.spellImage + "_off");
                        btn.btnState = buttonState.Normal;

                        /*
                         * if (pc.knownSpellsTags.Contains(sp.tag))
                         * {
                         *  if (isInCombat) //all spells can be used in combat
                         *  {
                         *      //btn.Img = gv.cc.LoadBitmap("btn_small");
                         *      btn.btnState = buttonState.Normal;
                         *  }
                         *  //not in combat so check if spell can be used on adventure maps
                         *  else if ((sp.useableInSituation.Equals("Always")) || (sp.useableInSituation.Equals("OutOfCombat")))
                         *  {
                         *      //btn.Img = gv.cc.LoadBitmap("btn_small");
                         *      btn.btnState = buttonState.Normal;
                         *      //btn.Img2 = gv.cc.LoadBitmap(sp.spellImage);
                         *  }
                         *  else //can't be used on adventure map
                         *  {
                         *      btn.btnState = buttonState.Off;
                         *      //btn.Img2 = gv.cc.LoadBitmap(sp.spellImage);
                         *      //btn.Img2Off = gv.cc.LoadBitmap(sp.spellImage + "_off");
                         *  }
                         * }
                         * else //spell not known
                         * {
                         *  btn.btnState = buttonState.Off;
                         *  //btn.Img2 = gv.cc.LoadBitmap(sp.spellImage);
                         *  //btn.Img2Off = gv.cc.LoadBitmap(sp.spellImage + "_off");
                         * }
                         */
                    }
                    else //slot is not in spells allowed index range
                    {
                        btn.btnState = buttonState.Off;
                        btn.Img2     = null;
                        btn.Img2Off  = null;
                    }
                    cntSlot++;
                }
            }
            //ouside combat
            else
            {
                int cntSlot = 0;
                foreach (IbbButton btn in btnSpellSlots)
                {
                    Player pc = getCastingPlayer();

                    if (cntSlot == spellSlotIndex)
                    {
                        btn.glowOn = true;
                    }
                    else
                    {
                        btn.glowOn = false;
                    }

                    sortTraitsForLevelUp(pc);

                    //show only spells for the PC class
                    //if (cntSlot < pc.playerClass.spellsAllowed.Count)
                    if ((cntSlot + (tknPageIndex * slotsPerPage)) < backupKnownSpellTagsOutsideCombat.Count)
                    {
                        //SpellAllowed sa = pc.playerClass.spellsAllowed[cntSlot];
                        Spell sp = gv.mod.getSpellByTag(backupKnownSpellTagsOutsideCombat[cntSlot + (tknPageIndex * slotsPerPage)]);

                        btn.Img2     = gv.cc.LoadBitmap(sp.spellImage);
                        btn.Img2Off  = gv.cc.LoadBitmap(sp.spellImage + "_off");
                        btn.btnState = buttonState.Normal;
                    }
                    else //slot is not in spells allowed index range
                    {
                        btn.btnState = buttonState.Off;
                        btn.Img2     = null;
                        btn.Img2Off  = null;
                    }
                }
                cntSlot++;
            }
        }
Exemple #9
0
        public void setControlsStart()
        {
            int pW = (int)((float)gv.screenWidth / 100.0f);
            int pH = (int)((float)gv.screenHeight / 100.0f);
            int padW = gv.squareSize/6;

            htmltext = new IbbHtmlTextBox(gv, 320, 100, 500, 300);
            htmltext.showBoxBorder = false;

            for (int x = 0; x < 6; x++)
            {
                IbbButton btnNew = new IbbButton(gv, 1.0f);
                btnNew.Img = gv.cc.LoadBitmap("item_slot"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.item_slot);
                btnNew.Glow = gv.cc.LoadBitmap("btn_small_glow"); // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small_glow);
                btnNew.X = ((x+5) * gv.squareSize) + (padW * (x+1)) + gv.oXshift;
                btnNew.Y = 9 * gv.squareSize + (pH * 2);
                btnNew.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnNew.Width = (int)(gv.ibbwidthR * gv.screenDensity);

                btnPartyIndex.Add(btnNew);
            }
        }
Exemple #10
0
        public void setControlsStart()
        {
            int pW     = (int)((float)gv.screenWidth / 100.0f);
            int pH     = (int)((float)gv.screenHeight / 100.0f);
            int padW   = gv.squareSize / 6;
            int xShift = gv.squareSize / 2;
            int yShift = gv.squareSize / 2;

            description = new IbbHtmlTextBox(gv, 320, 100, 500, 300);
            description.showBoxBorder = false;

            if (ctrlUpArrow == null)
            {
                ctrlUpArrow        = new IbbButton(gv, 1.0f);
                ctrlUpArrow.Img    = gv.cc.LoadBitmap("btn_small");          // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                ctrlUpArrow.Img2   = gv.cc.LoadBitmap("ctrl_up_arrow");      // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_up_arrow);
                ctrlUpArrow.Glow   = gv.cc.LoadBitmap("btn_small_glow");     // BitmapFactory.decodeResource(gv.getResources(), R.drawable.arrow_glow);
                ctrlUpArrow.X      = 12 * gv.squareSize;
                ctrlUpArrow.Y      = 1 * gv.squareSize + pH * 2;
                ctrlUpArrow.Height = (int)(gv.ibbheight * gv.screenDensity);
                ctrlUpArrow.Width  = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (ctrlDownArrow == null)
            {
                ctrlDownArrow        = new IbbButton(gv, 1.0f);
                ctrlDownArrow.Img    = gv.cc.LoadBitmap("btn_small");          // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                ctrlDownArrow.Img2   = gv.cc.LoadBitmap("ctrl_down_arrow");    // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_down_arrow);
                ctrlDownArrow.Glow   = gv.cc.LoadBitmap("btn_small_glow");     // BitmapFactory.decodeResource(gv.getResources(), R.drawable.arrow_glow);
                ctrlDownArrow.X      = 12 * gv.squareSize;
                ctrlDownArrow.Y      = 2 * gv.squareSize + pH * 3;
                ctrlDownArrow.Height = (int)(gv.ibbheight * gv.screenDensity);
                ctrlDownArrow.Width  = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (ctrlLeftArrow == null)
            {
                ctrlLeftArrow        = new IbbButton(gv, 1.0f);
                ctrlLeftArrow.Img    = gv.cc.LoadBitmap("btn_small");          // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                ctrlLeftArrow.Img2   = gv.cc.LoadBitmap("ctrl_left_arrow");    // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_left_arrow);
                ctrlLeftArrow.Glow   = gv.cc.LoadBitmap("btn_small_glow");     // BitmapFactory.decodeResource(gv.getResources(), R.drawable.arrow_glow);
                ctrlLeftArrow.X      = 10 * gv.squareSize + xShift;
                ctrlLeftArrow.Y      = pH * 34;
                ctrlLeftArrow.Height = (int)(gv.ibbheight * gv.screenDensity);
                ctrlLeftArrow.Width  = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (ctrlRightArrow == null)
            {
                ctrlRightArrow        = new IbbButton(gv, 1.0f);
                ctrlRightArrow.Img    = gv.cc.LoadBitmap("btn_small");          // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_small);
                ctrlRightArrow.Img2   = gv.cc.LoadBitmap("ctrl_right_arrow");   // BitmapFactory.decodeResource(gv.getResources(), R.drawable.ctrl_right_arrow);
                ctrlRightArrow.Glow   = gv.cc.LoadBitmap("btn_small_glow");     // BitmapFactory.decodeResource(gv.getResources(), R.drawable.arrow_glow);
                ctrlRightArrow.X      = 11 * gv.squareSize + pW * 2 + xShift;
                ctrlRightArrow.Y      = pH * 34;
                ctrlRightArrow.Height = (int)(gv.ibbheight * gv.screenDensity);
                ctrlRightArrow.Width  = (int)(gv.ibbwidthR * gv.screenDensity);
            }
            if (btnReturnJournal == null)
            {
                btnReturnJournal        = new IbbButton(gv, 1.2f);
                btnReturnJournal.Text   = "RETURN";
                btnReturnJournal.Img    = gv.cc.LoadBitmap("btn_large");          // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large);
                btnReturnJournal.Glow   = gv.cc.LoadBitmap("btn_large_glow");     // BitmapFactory.decodeResource(gv.getResources(), R.drawable.btn_large_glow);
                btnReturnJournal.X      = (gv.screenWidth / 2) - (int)(gv.ibbwidthL * gv.screenDensity / 2.0f);
                btnReturnJournal.Y      = 9 * gv.squareSize + pH * 2;
                btnReturnJournal.Height = (int)(gv.ibbheight * gv.screenDensity);
                btnReturnJournal.Width  = (int)(gv.ibbwidthL * gv.screenDensity);
            }
        }