Пример #1
0
    private void renderDreams(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   dream     = simData.getDream();
        int   num1      = x + (width >> 1);
        int   x1        = num1;
        int   y1        = y + 4;
        int   num2      = x + 50;
        int   x2        = num2 + 28;
        int   lineWidth = x + width - x2 - 50;
        int   num3      = y1 + 13;
        float x3        = (float)num1;
        float scaleX1   = (float)lineWidth / animationManager2D.getAnimWidth((int)sbyte.MaxValue);
        float scaleX2   = (float)lineWidth / animationManager2D.getAnimWidth(126);
        int   num4      = num3;
        int   num5      = num1;
        int   num6      = y + height + (num4 + 112) >> 1;
        int   num7      = width - 20;
        int   y2        = num6 - 16;
        int   num8      = y2 + 8;
        int   num9      = num5 + 25;
        int   y3        = num8 + 3;
        int   x4        = num5 - 125;
        int   y4        = num6;

        animationManager2D.submitAnim((int)sbyte.MaxValue, x3, (float)num3, 1f, scaleX1, 1f);
        int num10 = num4;

        for (int index = 0; index < 4; ++index)
        {
            animationManager2D.submitAnim(135, (float)num2, (float)(num10 + 14), 1f, 1.8f, 1.8f);
            if (simData.getPromise(index) != -1)
            {
                animationManager2D.submitAnim(40, (float)num2, (float)(num10 + 14));
            }
            num10 += 28;
            animationManager2D.submitAnim(126, x3, (float)num10, 1f, scaleX2, 1f);
        }
        animationManager2D.submitAnimHBar(189, 190, 191, (float)num5, (float)num6, (float)num7);
        animationManager2D.submitAnim(126, (float)num9, (float)num8, 1f, scaleX2, 1f);
        if (dream != -1)
        {
            this.getScene().getUIButton(16384).submit(ref animationManager2D, x4, y4);
        }
        animationManager2D.flushAnims(g);
        g.Begin();
        textManager.drawString(g, 799, 3, x1, y1, 18);
        int chunk = 0;
        int num11 = num4;

        for (int index = 0; index < 4; ++index)
        {
            int promise  = simData.getPromise(index);
            int stringId = 805;
            if (promise != -1)
            {
                stringId = simData.getDreamDescString(promise);
            }
            textManager.drawWrappedStringChunk(g, chunk, stringId, 3, lineWidth, x2, num11 + 14, 10);
            ++chunk;
            num11 += 28;
        }
        textManager.drawString(g, 800, 3, x2, y2, 10);
        int stringId1 = 806;

        if (dream != -1)
        {
            stringId1 = simData.getDreamDescString(dream);
        }
        textManager.drawWrappedStringChunk(g, chunk, stringId1, 3, lineWidth, x2, y3, 9);
        g.End();
    }