Пример #1
0
    private void renderStatus(Graphics g, int x, int y, int width, int height)
    {
        AppEngine          canvas             = AppEngine.getCanvas();
        TextManager        textManager        = canvas.getTextManager();
        AnimationManager2D animationManager2D = canvas.getAnimationManager2D();
        SimData            simData            = canvas.getSimData();
        int motiveCount = simData.getMotiveCount();

        if (this.m_longestStringMotive == 0)
        {
            int num = 0;
            for (int motive = 0; motive < motiveCount; ++motive)
            {
                int motiveDescString = (int)simData.getMotiveDescString(motive);
                int stringWidth      = textManager.getStringWidth(motiveDescString, 3);
                if (stringWidth > num)
                {
                    num = stringWidth;
                }
            }
            this.m_longestStringMotive = num;
        }
        int   num1  = y + height - 32;
        int   num2  = x + 10;
        int   num3  = width - 20;
        int   x1    = num2 + (num3 >> 1);
        int   y1    = num1 + 16;
        int   num4  = (height - 32 - 5 - 5) / motiveCount;
        float num5  = (float)(y + 5);
        float num6  = (float)num4;
        int   x2    = x + 10 + this.m_longestStringMotive;
        int   num7  = num4 >> 1;
        int   num8  = x2 + 12;
        int   num9  = x + width - 40 - num8;
        int   num10 = num8 + (num9 >> 1);
        int   num11 = num7;
        int   num12 = num8 + num9 + 20;
        int   num13 = num7;
        float num14 = num5;

        for (int motive = 0; motive < motiveCount; ++motive)
        {
            int   motiveLevel = simData.getMotiveLevel(motive);
            float num15       = (float)MathExt.Fdiv(motiveLevel, 6553600) * 1.525879E-05f;
            float y2          = num14 + (float)num11;
            animationManager2D.submitAnimHBar(46, 47, 48, (float)num10, y2, (float)num9);
            int num16   = 49;
            int animMid = 50;
            int num17   = 51;
            int animId  = (int)simData.getMotiveHighAnim(motive);
            if (motiveLevel < 2293760)
            {
                num16   = 52;
                animMid = 53;
                num17   = 54;
                animId  = (int)simData.getMotiveLowAnim(motive);
            }
            else if (motiveLevel < 4259840)
            {
                animId = (int)simData.getMotiveMidAnim(motive);
            }
            int   num18 = (int)((double)animationManager2D.getAnimWidth(num16) + (double)animationManager2D.getAnimWidth(num17) - 8.0);
            float w     = (float)num18 + num15 * (float)(num9 - num18);
            float x3    = (float)num8 + w * 0.5f;
            animationManager2D.submitAnimHBar(num16, animMid, num17, x3, y2, w);
            float y3 = num14 + (float)num13;
            animationManager2D.submitAnim(animId, (float)num12, y3);
            num14 += num6;
        }
        animationManager2D.submitAnimGrid(233, 234, 235, 236, 237, 238, 239, 240, 241, (float)num2, (float)num1, (float)num3, 32f);
        animationManager2D.flushAnims(g);
        g.Begin();
        int num19 = (int)num5;

        for (int motive = 0; motive < motiveCount; ++motive)
        {
            int motiveDescString = (int)simData.getMotiveDescString(motive);
            int y2 = num19 + num7;
            textManager.drawString(g, motiveDescString, 3, x2, y2, 34);
            num19 += (int)num6;
        }
        StringBuffer strBuffer = textManager.clearStringBuffer();

        textManager.appendStringIdToBuffer(767);
        textManager.appendStringIdToBuffer(simData.getMoodDescStringId());
        textManager.drawString(g, strBuffer, 3, x1, y1, 18);
        g.End();
    }