Exemplo n.º 1
0
    public void setSubType(int subType, int focusItem)
    {
        AppEngine canvas   = AppEngine.getCanvas();
        SimData   simData  = canvas.getSimData();
        SimWorld  simWorld = canvas.getSimWorld();
        int       subType1 = this.m_subType;

        this.m_subType   = subType;
        this.m_focusItem = focusItem;
        switch (subType)
        {
        case -1:
            if (subType1 != -1)
            {
                this.resetSwiping(true);
            }
            this.m_focusItem = -1;
            break;

        case 10:
            this.m_titleId = simData.getSimName(focusItem);
            this.resetSwiping(false);
            break;

        case 11:
            this.m_titleId = simWorld.getItemDescString(focusItem);
            this.resetSwiping(false);
            break;
        }
    }
Exemplo n.º 2
0
    public static int getLongestStringNPCName()
    {
        AppEngine    canvas     = AppEngine.getCanvas();
        UIInfoScreen infoScreen = canvas.getSceneGame().getInfoScreen();
        SimData      simData    = canvas.getSimData();

        if (infoScreen.m_longestStringNPCName == 0)
        {
            int num      = 0;
            int simCount = simData.getSimCount();
            for (int sim = 1; sim < simCount; ++sim)
            {
                int simName     = simData.getSimName(sim);
                int stringWidth = canvas.getTextManager().getStringWidth(simName, 3);
                if (stringWidth > num)
                {
                    num = stringWidth;
                }
            }
            infoScreen.m_longestStringNPCName = num;
        }
        return(infoScreen.m_longestStringNPCName);
    }
Exemplo n.º 3
0
    private void renderItem(
        Graphics g,
        AnimationManager2D am2d,
        int index,
        int x,
        int y,
        int width,
        int height)
    {
        AppEngine   canvas      = AppEngine.getCanvas();
        TextManager textManager = canvas.getTextManager();
        SimData     simData     = canvas.getSimData();
        SimWorld    simWorld    = canvas.getSimWorld();
        DLCManager  instance    = DLCManager.getInstance();
        SceneGame   sceneGame   = canvas.getSceneGame();

        switch (this.m_listId)
        {
        case 0:
            bool rmsActiveGame = canvas.getRMSActiveGame(index);
            bool flag1         = canvas.getSceneMenu().isDeletingSaveGame();
            int  lineHeight    = textManager.getLineHeight(4);
            int  y1            = y + height - 10 - lineHeight;
            int  x1            = x + (width >> 1);
            int  num1          = x + (width >> 1);
            int  num2          = y + (y1 - y >> 1);
            if (g != null)
            {
                if (rmsActiveGame)
                {
                    SceneMenu sceneMenu  = canvas.getSceneMenu();
                    int       clipX      = g.getClipX();
                    int       clipY      = g.getClipY();
                    int       clipWidth  = g.getClipWidth();
                    int       clipHeight = g.getClipHeight();
                    sceneMenu.getHudPlumbBob().render(g, num1 - 75, num2 - 75, 150, 150);
                    g.setClip(clipX, clipY, clipWidth, clipHeight);
                }
                if (!rmsActiveGame && flag1)
                {
                    break;
                }
                string simName = canvas.getSimName(index);
                if (simName != null && simName != "" && simName != " ")
                {
                    g.Begin();
                    textManager.drawString(g, simName, 4, x1, y1, 17);
                    g.End();
                    break;
                }
                g.Begin();
                textManager.drawString(g, 40, 4, x1, y1, 17);
                g.End();
                break;
            }
            int   num3   = width;
            int   num4   = height;
            int   num5   = x + (width - num3 >> 1);
            int   num6   = y + (height - num4 >> 1) + 1;
            float alpha1 = rmsActiveGame || !flag1 ? 1f : 0.2f;
            am2d.submitAnimGrid(340, 341, 342, 343, 344, 345, 346, 347, 348, (float)num5, (float)num6, (float)num3, (float)num4, alpha1);
            am2d.submitAnim(rmsActiveGame ? 403 : 402, (float)num1, (float)num2, alpha1);
            if (this.m_state != 1 || index != this.m_itemSelected || flag1 && !rmsActiveGame)
            {
                break;
            }
            float alpha2 = this.m_animTimer.getValue();
            am2d.submitAnimGrid(250, 253, 256, 251, 254, 257, 252, (int)byte.MaxValue, 258, (float)num5, (float)num6, (float)num3, (float)num4, alpha2);
            break;

        case 1:
            if (g != null)
            {
                g.Begin();
                int x2 = x + (width >> 1);
                int y2 = y + 96;
                int personaDescString = (int)simData.getPersonaDescString(index);
                textManager.drawString(g, personaDescString, 4, x2, y2, 18);
                int personaLongDescString = (int)simData.getPersonaLongDescString(index);
                int x3 = x2;
                int y3 = y + 143;
                textManager.drawWrappedStringChunk(g, 0, personaLongDescString, 4, width - 12, x3, y3, 18);
                g.End();
                break;
            }
            int num7  = width;
            int num8  = (int)(0.65 * (double)height);
            int num9  = x + (width - num7 >> 1);
            int num10 = y;
            int num11 = num9 + (width >> 1);
            am2d.submitAnimGrid(340, 341, 342, 343, 344, 345, 346, 347, 348, (float)num9, (float)num10, (float)num7, (float)num8);
            am2d.submitAnim(181, (float)num11, (float)(num10 + 50));
            int   num12  = num9 + (num7 >> 1);
            int   num13  = num10 + 115;
            float scaleX = (float)width / am2d.getAnimWidth((int)sbyte.MaxValue);
            am2d.submitAnim((int)sbyte.MaxValue, (float)num12, (float)num13, 1f, scaleX, 1f);
            break;

        case 2:
            if (g != null)
            {
                int x2              = x + 35;
                int num14           = height >> 1;
                int y2              = y + num14;
                int traitDescString = (int)simData.getTraitDescString(index);
                g.Begin();
                textManager.drawWrappedStringChunk(g, 0, traitDescString, 4, width - 35, x2, y2, 2);
                g.End();
                break;
            }
            int  num15 = height >> 1;
            int  num16 = (height >> 1) - 5;
            bool flag2 = simData.hasSimGotTrait(0, index) != -1;
            if (this.m_state == 1 && this.m_itemSelected == index)
            {
                float num14 = this.m_animTimer.getValue();
                if (this.m_selectionResult == 0)
                {
                    am2d.submitAnim(171, (float)(x + num16), (float)(y + num15), 1f, num14, num14);
                }
                else if (this.m_selectionResult != 1)
                {
                    int selectionResult = this.m_selectionResult;
                }
            }
            if (!flag2)
            {
                break;
            }
            am2d.submitAnim(114, (float)(x + num16), (float)(y + num15));
            break;

        case 3:
            int x4         = x + 55;
            int lineWidth1 = this.m_width - 110;
            int num17      = (height >> 1) + 1;
            int y4         = y + num17;
            int dream      = this.remapGlobalGoalIndex(index);
            int num18      = -1;
            int stringId1;
            if (canvas.isDreamDiscovered(dream))
            {
                stringId1 = simData.getDreamDescString(dream);
                if (canvas.isGoalCompleted(dream))
                {
                    num18 = 134;
                }
            }
            else
            {
                stringId1 = 807;
            }
            if (g != null)
            {
                g.Begin();
                textManager.drawWrappedStringChunk(g, this.m_stringChunk, stringId1, 3, lineWidth1, x4, y4, 10);
                g.End();
            }
            else
            {
                float x2 = (float)x + 30f;
                float y2 = (float)y + (float)height * 0.5f;
                am2d.submitAnim(135, x2, y2);
                if (num18 != -1)
                {
                    am2d.submitAnim(134, x2, y2);
                }
            }
            ++this.m_stringChunk;
            break;

        case 4:
            int x5    = x + 32;
            int num19 = (height >> 1) + 1;
            int y5    = y + num19;
            int x6    = x + width - 12;
            int y6    = y5;
            int num20 = x5 + this.m_offsetCol + 12;
            int num21 = x6 - 12 - num20;
            int x7    = num20 + (num21 >> 1);
            int num22 = y5 - 9;
            int y7    = y5 + 9;
            if (g != null)
            {
                int skillDesc = simData.getSkillDesc(index);
                g.Begin();
                textManager.drawString(g, skillDesc, 3, x5, y5, 10);
                StringBuffer strBuffer = textManager.clearStringBuffer();
                textManager.appendIntToBuffer(simData.getSkillLevel(index) >> 16);
                textManager.drawString(g, strBuffer, 3, x6, y6, 10);
                textManager.drawString(g, simData.getSkillLevelDesc(index), 3, x7, y7, 18);
                g.End();
                break;
            }
            int   num23 = (int)((double)am2d.getAnimWidth(199) + (double)am2d.getAnimWidth(201));
            float num24 = (float)MathExt.Fdiv(simData.getSkillLevel(index), 327680) * 1.525879E-05f;
            am2d.submitAnimHBar(202, 203, 204, (float)x7, (float)num22, (float)num21);
            float w1 = (float)num23 + num24 * (float)(num21 - num23);
            float x8 = (float)num20 + w1 * 0.5f;
            am2d.submitAnimHBar(199, 200, 201, x8, (float)num22, w1);
            am2d.submitAnimHBar(205, 206, 207, (float)x7, (float)y7, (float)num21);
            break;

        case 5:
        case 7:
            bool flag3 = this.m_listId == 7;
            int  num25 = this.m_listId == 5 ? simData.getInventoryNthItem(index) : sceneGame.getShoppingItemId(index);
            int  num26 = height >> 1;
            if (g != null)
            {
                int num14          = x + 42;
                int y2             = y + num26;
                int num27          = width - 15;
                int x2             = x + num27;
                int y3             = y2;
                int itemDescString = simWorld.getItemDescString(num25);
                int lineWidth2     = flag3 ? width >> 1 : 120;
                g.Begin();
                textManager.drawWrappedStringChunk(g, 0, itemDescString, 3, lineWidth2, num14 + 4, y2, 10);
                if (this.m_listId == 5)
                {
                    if ((simWorld.getItemFlags(num25) & 4) == 0)
                    {
                        int          inventoryCount   = simData.getInventoryCount(num25);
                        int          itemMaxInventory = simWorld.getItemMaxInventory(num25);
                        StringBuffer strBuffer        = textManager.clearStringBuffer();
                        textManager.appendIntToBuffer(inventoryCount);
                        textManager.appendStringIdToBuffer(11);
                        textManager.appendIntToBuffer(itemMaxInventory);
                        textManager.drawString(g, strBuffer, 3, x2, y3, 34);
                    }
                }
                else
                {
                    int          shoppingQty      = sceneGame.getShoppingQty(index);
                    int          itemMaxInventory = simWorld.getItemMaxInventory(num25);
                    StringBuffer strBuffer        = textManager.clearStringBuffer();
                    textManager.appendIntToBuffer(shoppingQty);
                    textManager.appendStringIdToBuffer(11);
                    textManager.appendIntToBuffer(itemMaxInventory);
                    textManager.drawString(g, strBuffer, 3, x2, y3, 34);
                }
                int itemPackId = simWorld.getItemPackId(num25);
                if (itemPackId != -1)
                {
                    Image packTag = instance.getPackTag(itemPackId);
                    if (packTag != null)
                    {
                        int num28 = x + width - 50;
                        int num29 = y + 20;
                        g.drawImage(packTag, (float)num28, (float)num29, 18);
                    }
                }
                g.End();
                break;
            }
            if (this.m_listId == 7 && this.m_itemSelected == index)
            {
                int num14 = width;
                int num27 = height - 4;
                int num28 = (int)((double)x + (double)(width - num14) * 0.5 + 4.0);
                int num29 = (int)((double)y + (double)(height - num27) * 0.5);
                am2d.submitAnimGrid(224, 225, 226, 227, 228, 229, 230, 231, 232, (float)num28, (float)num29, (float)num14, (float)num27);
            }
            if ((simWorld.getItemFlags(num25) & 4) != 0 && !flag3)
            {
                if (this.m_state != 1 || this.m_itemSelected != index || (double)this.m_animTimer.getValue() > 0.5)
                {
                    int num14 = width;
                    int num27 = height - 4;
                    int num28 = x + (width - num14 >> 1) + 4;
                    int num29 = y + (height - num27 >> 1) + 1;
                    am2d.submitAnimGrid(224, 225, 226, 227, 228, 229, 230, 231, 232, (float)num28, (float)num29, (float)num14, (float)num27);
                    int recipeForItem         = simWorld.getRecipeForItem(num25);
                    int recipeIngredientCount = simWorld.getRecipeIngredientCount(recipeForItem);
                    int num30 = (int)((double)am2d.getAnimHeight(simWorld.getItemIcon(simWorld.getRecipeIngredient(recipeForItem, 0))) * 0.5 - 2.0);
                    int num31 = (int)((double)am2d.getAnimWidth(simWorld.getItemIcon(simWorld.getRecipeIngredient(recipeForItem, 0))) * 0.5);
                    int num32 = -(num30 >> 1);
                    int num33 = x + (width >> 1) + 20;
                    int num34 = y + (height >> 1) + (recipeIngredientCount > 4 ? num32 : 0);
                    int num35 = num33;
                    int num36 = num34;
                    for (int index1 = 0; index1 < recipeIngredientCount; ++index1)
                    {
                        int   recipeIngredient = simWorld.getRecipeIngredient(recipeForItem, index1);
                        int   itemIcon         = simWorld.getItemIcon(recipeIngredient);
                        float alpha3           = simData.getInventoryCount(recipeIngredient) > 0 ? 1f : 0.4f;
                        am2d.submitAnim(itemIcon, (float)num35, (float)num36, alpha3, 0.5f, 0.5f);
                        if (index1 == 3)
                        {
                            num36 += num30;
                            num35  = num33;
                        }
                        else
                        {
                            num35 += num31;
                        }
                    }
                }
                int num37 = width - 35;
                int num38 = x + num37;
                int num39 = (int)((double)y + (double)height * 0.5);
                am2d.submitAnim(180, (float)num38, (float)num39);
            }
            int num40     = x + 21;
            int num41     = y + num26;
            int itemIcon1 = simWorld.getItemIcon(num25);
            am2d.submitAnim(itemIcon1, (float)num40, (float)num41);
            break;

        case 6:
            int x9    = x + 20;
            int num42 = height >> 1;
            int num43 = y + num42;
            int relationshipNthItem = simData.getRelationshipNthItem(index);
            int simName1            = simData.getSimName(relationshipNthItem);
            int relState            = simData.getRelState(relationshipNthItem);
            int x10 = x + (width >> 1) + 20;
            int y8  = num43;
            if (g != null)
            {
                g.Begin();
                textManager.drawString(g, simName1, 4, x9, num43 - 3, 10);
                g.End();
            }
            else
            {
                if (this.m_state != 1 || this.m_itemSelected != index || (double)this.m_animTimer.getValue() > 0.5)
                {
                    int num14 = height - 2;
                    int num27 = (int)((double)y + (double)(height - num14) * 0.5);
                    int num28 = x10 - x - 75;
                    int num29 = x;
                    int num30 = x + width - (x10 + 75);
                    int num31 = x10 + 75;
                    int num32 = num31 - (num29 + num28);
                    int num33 = height - 16;
                    int num34 = num29 + num28;
                    int num35 = y + (height - num33 >> 1);
                    am2d.submitAnimGrid(224, 225, 226, 227, 228, 229, 230, 231, 232, (float)num29, (float)num27, (float)num28, (float)num14);
                    am2d.submitAnimGrid(224, 225, 226, 227, 228, 229, 230, 231, 232, (float)num31, (float)num27, (float)num30, (float)num14);
                    am2d.submitAnimStretched(228, (float)num34, (float)num35, (float)num32, (float)num33);
                }
                int num36 = width - 35;
                int num37 = x + num36;
                int num38 = (int)((double)y + (double)height * 0.5);
                am2d.submitAnim(180, (float)num37, (float)num38);
            }
            UIInfoScreen.drawRelBar(g, am2d, x10, y8, 150, relState, 65536, false);
            break;

        case 8:
            int nthItemOfCategory = simWorld.getFurnitureNthItemOfCategory(index, sceneGame.getCurFurnitureCategory());
            int objectStringId    = simWorld.getObjectStringId(nthItemOfCategory);
            int num44             = 173;
            int x11 = x + 5;
            int y9  = y + 5;
            int w2  = num44 - 10;
            if (g == null)
            {
                am2d.submitAnimGrid(340, 341, 342, 343, 344, 345, 346, 347, 348, (float)x, (float)y, (float)num44, 195f);
                if (!simWorld.isFurnitureAvailable(nthItemOfCategory))
                {
                    am2d.submitAnim(320, (float)(x11 + (w2 >> 1)), (float)(y9 + 65));
                }
            }
            else
            {
                int clipX      = g.getClipX();
                int clipY      = g.getClipY();
                int clipWidth  = g.getClipWidth();
                int clipHeight = g.getClipHeight();
                if (simWorld.isFurnitureAvailable(nthItemOfCategory))
                {
                    int index1 = -1;
                    for (int index2 = 0; index2 < 5; ++index2)
                    {
                        if (this.m_previewToIndexMap[index2] == index)
                        {
                            index1 = index2;
                            break;
                        }
                    }
                    if (index1 == -1)
                    {
                        int num14 = -this.getSwipeNotch(this.getSwipeOffset());
                        int num27 = num14 == this.m_lastMid ? this.m_lastDir : JMath.min(1, JMath.max(-1, num14 - this.m_lastMid));
                        this.m_lastMid = num14;
                        this.m_lastDir = num27;
                        int num28 = 0;
                        for (int index2 = 0; index2 < 5; ++index2)
                        {
                            int a     = this.m_previewToIndexMap[index2] - num14;
                            int num29 = JMath.abs(a);
                            if (a * num27 < 0 && num29 >= 2 || (num29 >= 4 || this.m_previewToIndexMap[index2] == -1))
                            {
                                this.m_previewToIndexMap[index2] = -1;
                                ++num28;
                            }
                        }
                        int index3     = index;
                        int objectType = nthItemOfCategory;
                        for (int index2 = 0; index2 < 5; ++index2)
                        {
                            if (this.m_previewToIndexMap[index2] == -1)
                            {
                                this.m_objectPreviews[index2].loadObject(objectType);
                                this.m_objectPreviews[index2].getModel().disableFurnitureShadows();
                                this.m_previewToIndexMap[index2] = index3;
                                --num28;
                                if (index3 == index)
                                {
                                    index1 = index2;
                                }
                                index3    += num27;
                                objectType = simWorld.getFurnitureNthItemOfCategory(index3, sceneGame.getCurFurnitureCategory());
                                if (index3 < 0 || index3 >= this.m_itemNum || num28 == 0)
                                {
                                    break;
                                }
                            }
                        }
                    }
                    this.m_objectPreviews[index1].render(g, x11, y9, w2, 130);
                    g.setClip(clipX, clipY, clipWidth, clipHeight);
                }
                int x2 = x + (num44 >> 1);
                int y2 = y9 + 130;
                g.Begin();
                textManager.drawWrappedStringChunk(g, this.m_stringChunk, objectStringId, 4, num44 - 10, x2, y2, 17);
                int          y3             = y + 195 - 10;
                int          x3             = x + (num44 >> 1);
                int          objectBuyPrice = simWorld.getObjectBuyPrice(nthItemOfCategory);
                StringBuffer strBuffer      = textManager.clearStringBuffer();
                textManager.appendMoneyToBuffer(objectBuyPrice);
                textManager.drawString(g, strBuffer, 4, x3, y3, 20);
                int objectPackId = simWorld.getObjectPackId(nthItemOfCategory);
                if (objectPackId != -1)
                {
                    Image packTag = instance.getPackTag(objectPackId);
                    if (packTag != null)
                    {
                        int num14 = x + width - 27;
                        int num27 = y + 21;
                        g.drawImage(packTag, (float)num14, (float)num27, 18);
                    }
                }
                g.End();
            }
            ++this.m_stringChunk;
            break;

        case 9:
            if (g == null)
            {
                break;
            }
            int font1           = 3;
            int x12             = x;
            int x13             = x + width - 30;
            int num45           = sceneGame.shoppingListItem(index);
            int num46           = sceneGame.shoppingListQty(index);
            int itemDescString1 = simWorld.getItemDescString(num45);
            g.Begin();
            textManager.drawString(g, itemDescString1, font1, x12, y, 9);
            StringBuffer strBuffer1 = textManager.clearStringBuffer();
            textManager.appendStringIdToBuffer(1085);
            textManager.appendIntToBuffer(num46);
            textManager.drawString(g, strBuffer1, font1, x13, y, 9);
            g.End();
            break;

        case 10:
        case 11:
        case 12:
        case 13:
            if (g != null)
            {
                int  font2               = 4;
                int  font3               = 3;
                int  x2                  = x + (width >> 1);
                int  y2                  = y + (height - textManager.getLineHeight(font2) >> 1);
                int  y3                  = y + height - textManager.getLineHeight(font3);
                int  lineWidth2          = width - 25;
                int  buildModeOldSetting = canvas.getSceneGame().getBuildModeOldSetting();
                int  stringId2           = -1;
                int  packId              = -1;
                int  num14               = 0;
                bool flag4               = false;
                switch (this.m_listId)
                {
                case 10:
                    int unlockedFloorNthId = simWorld.getUnlockedFloorNthId(index);
                    stringId2 = simWorld.getFloorStringId(unlockedFloorNthId);
                    packId    = simWorld.getFloorPackId(unlockedFloorNthId);
                    flag4     = unlockedFloorNthId == buildModeOldSetting;
                    num14     = 50;
                    break;

                case 11:
                    int unlockedWallNthId = simWorld.getUnlockedWallNthId(index);
                    stringId2 = simWorld.getWallStringId(unlockedWallNthId);
                    packId    = simWorld.getWallPackId(unlockedWallNthId);
                    flag4     = unlockedWallNthId == buildModeOldSetting;
                    num14     = 50;
                    break;

                case 12:
                    int objectFootprintHeight = simWorld.getObjectFootprintHeight(buildModeOldSetting);
                    int windowNthType         = simWorld.getWindowNthType(index, objectFootprintHeight);
                    stringId2 = simWorld.getObjectStringId(windowNthType);
                    flag4     = windowNthType == buildModeOldSetting;
                    break;

                case 13:
                    int doorNthType = simWorld.getDoorNthType(index);
                    stringId2 = simWorld.getObjectStringId(doorNthType);
                    flag4     = doorNthType == buildModeOldSetting;
                    break;
                }
                g.Begin();
                textManager.drawWrappedStringChunk(g, this.m_stringChunk, stringId2, font2, lineWidth2, x2, y2, 18);
                ++this.m_stringChunk;
                if (flag4)
                {
                    textManager.drawString(g, 1078, font3, x2, y3, 18);
                }
                else
                {
                    StringBuffer strBuffer2 = textManager.clearStringBuffer();
                    textManager.appendMoneyToBuffer(num14);
                    textManager.drawString(g, strBuffer2, font3, x2, y3, 18);
                }
                if (packId != -1)
                {
                    Image packTag = instance.getPackTag(packId);
                    if (packTag != null)
                    {
                        int num27 = x + width - 12;
                        int num28 = y + 42;
                        g.drawImage(packTag, (float)num27, (float)num28, 18);
                    }
                }
                g.End();
                break;
            }
            if (index == this.m_itemSelected)
            {
                am2d.submitAnimGrid(349, 350, 351, 352, 353, 354, 355, 356, 357, (float)x, (float)y, (float)width, (float)height);
                break;
            }
            am2d.submitAnimGrid(331, 332, 333, 334, 335, 336, 337, 338, 339, (float)x, (float)y, (float)width, (float)height);
            break;
        }
    }
Exemplo n.º 4
0
    private void renderRelationshipsNPC(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 simCareer1       = simData.getSimCareer(0);
        int num1             = simCareer1 != -1 ? simData.getCareerBoss(simCareer1) : -1;
        int focusItem        = this.m_focusItem;
        int simPortraitAnim  = simData.getSimPortraitAnim(focusItem);
        int simPartner       = simData.getSimPartner(focusItem);
        int strId            = simPartner >= 0 ? simData.getSimName(simPartner) : -1;
        int simCareer2       = simData.getSimCareer(focusItem);
        int careerDescString = simData.getCareerDescString(simCareer2);
        int relState1        = simData.getRelState(focusItem);

        int[] tempInt10 = this.m_tempInt10;
        simData.getRelationshipLevels(focusItem, tempInt10);
        bool flag1     = simCareer1 != -1 && simCareer2 == simCareer1;
        bool flag2     = num1 == focusItem;
        int  num2      = x + (width >> 1);
        int  num3      = y + (height >> 1);
        int  num4      = x + num2 >> 1;
        int  num5      = y + 18;
        int  num6      = 30;
        int  x1        = num4;
        int  width1    = width >> 1;
        int  width2    = width * 3 >> 2;
        int  x2        = x1 + (width2 - width1 >> 1);
        int  num7      = num2 + 42;
        int  num8      = y - 42;
        int  num9      = width >> 1;
        int  num10     = height >> 1;
        int  num11     = num7 + (num9 >> 1);
        int  num12     = num8 + (num10 >> 1);
        int  num13     = num2 + 5;
        int  num14     = y + 5 + 50;
        int  num15     = (width >> 1) - 10;
        int  num16     = (int)(0.75 * (double)height);
        int  x3        = num13 + (num15 >> 1);
        int  num17     = num14 + 8;
        int  num18     = 2 * textManager.getLineHeight(3);
        int  num19     = width >> 1;
        int  x4        = x + 4;
        int  x5        = num2 - 4;
        int  num20     = num3 + 5;
        int  num21     = 2 * textManager.getLineHeight(3) + 4;
        int  num22     = x4 + x5 >> 1;
        int  num23     = num20 + 47;
        int  num24     = (int)((double)num19 / (double)animationManager2D.getAnimWidth(126));
        int  x6        = num22 + 22;
        int  num25     = num22 - 44;
        int  y1        = num23 + (y + height - num23 >> 1);
        int  lineWidth = num19 >> 1;

        animationManager2D.submitAnim(simPortraitAnim, (float)num11, (float)num12);
        animationManager2D.submitAnimGrid(233, 234, 235, 236, 237, 238, 239, 240, 241, (float)num13, (float)num14, (float)num15, (float)num16, 1f);
        animationManager2D.submitAnim(126, (float)num22, (float)num23, 1f, (float)num24, 1f);
        if (flag1)
        {
            animationManager2D.submitAnim(182, (float)num25, (float)y1);
        }
        int y2 = num5;

        UIInfoScreen.drawRelBar(g, animationManager2D, x2, y2, width2, relState1, 65536, true);
        int y3 = y2 + num6;

        for (int index = 0; index < 4; index += 2)
        {
            int relState2 = tempInt10[index];
            if (relState2 != -1)
            {
                int levelF = tempInt10[index + 1];
                UIInfoScreen.drawRelBar(g, animationManager2D, x1, y3, width1, relState2, levelF, false);
                y3 += 24;
            }
            else
            {
                break;
            }
        }
        animationManager2D.flushAnims(g);
        int y4 = num5;

        UIInfoScreen.drawRelBar(g, (AnimationManager2D)null, x2, y4, width1, relState1, 65536, true);
        int y5 = y4 + num6;

        for (int index = 0; index < 4; index += 2)
        {
            int relState2 = tempInt10[index];
            if (relState2 != -1)
            {
                int levelF = tempInt10[index + 1];
                UIInfoScreen.drawRelBar(g, (AnimationManager2D)null, x1, y5, width1, relState2, levelF, false);
                y5 += 24;
            }
            else
            {
                break;
            }
        }
        g.Begin();
        int simTraitCount = simData.getSimTraitCount(focusItem);
        int y6            = num17;

        textManager.drawString(g, 967, 3, x3, y6, 17);
        int y7 = y6 + num18;

        for (int index = 0; index < simTraitCount; ++index)
        {
            int simTrait = simData.getSimTrait(focusItem, index);
            int stringId = (int)simData.getTraitDescString(simTrait);
            if (!simData.isTraitDiscovered(focusItem, simTrait))
            {
                stringId = 968;
            }
            textManager.drawWrappedStringChunk(g, 0, stringId, 3, num15 - 10, x3, y7, 18);
            y7 += num18;
        }
        int y8 = num20;

        textManager.drawString(g, 975, 3, x4, y8, 10);
        textManager.drawWrappedStringChunk(g, 1, careerDescString, 3, num19 >> 1, x5, y8, 34);
        int y9 = y8 + num21;

        if (simPartner != -1)
        {
            textManager.drawString(g, 971, 3, x4, y9, 9);
            textManager.drawString(g, strId, 3, x5, y9, 33);
        }
        int num26 = y9 + num21;

        if (flag1)
        {
            int stringId = 973;
            if (flag2)
            {
                stringId = 972;
            }
            textManager.drawWrappedStringChunk(g, 2, stringId, 3, lineWidth, x6, y1, 18);
        }
        g.End();
    }
Exemplo n.º 5
0
    private void renderCareer(Graphics g, int x, int y, int width, int height)
    {
        AppEngine          canvas             = AppEngine.getCanvas();
        TextManager        textManager        = canvas.getTextManager();
        SimData            simData            = canvas.getSimData();
        SimWorld           simWorld           = canvas.getSimWorld();
        AnimationManager2D animationManager2D = canvas.getAnimationManager2D();
        int simCareer = simData.getSimCareer(0);

        if (simCareer == -1)
        {
            int   x1     = x + (width >> 1);
            int   num    = y + 68;
            float scaleX = 200f / animationManager2D.getAnimWidth(126);
            int   y1     = y + 34;
            int   y2     = y + 68 + (height - 68 >> 1);
            animationManager2D.submitAnim(126, (float)x1, (float)num, 1f, scaleX, 1f);
            animationManager2D.flushAnims(g);
            g.Begin();
            textManager.drawString(g, 997, 3, x1, y1, 18);
            textManager.drawWrappedStringChunk(g, 0, 998, 3, 200, x1, y2, 18);
            g.End();
        }
        else
        {
            int   simCareerLevel        = simData.getSimCareerLevel(0);
            int   careerLevelFlags      = simData.getCareerLevelFlags(simCareer, simCareerLevel);
            int   careerLevelIncome     = simData.getCareerLevelIncome(simCareer, simCareerLevel);
            int   careerIcon            = simData.getCareerIcon(simCareer);
            int   careerDescString      = simData.getCareerDescString(simCareer);
            int   careerLevelDescString = simData.getCareerLevelDescString(simCareer, simCareerLevel);
            int   careerRabbitHole      = simData.getCareerRabbitHole(simCareer);
            int   objectStringId        = simWorld.getObjectStringId(careerRabbitHole);
            int   careerBoss            = simData.getCareerBoss(simCareer);
            int   simName   = simData.getSimName(careerBoss);
            int   num1      = x + (width >> 1);
            int   num2      = x + 251;
            int   num3      = y + 27;
            int   x1        = x + num2 >> 1;
            int   y1        = y + 27;
            int   num4      = x + (width >> 1);
            int   num5      = y + 55;
            float animWidth = animationManager2D.getAnimWidth(188);
            int   num6      = num4;
            int   num7      = (int)((double)(y + height - 25) + (double)animationManager2D.getAnimHeight((int)sbyte.MaxValue));
            float scaleX    = animWidth / animationManager2D.getAnimWidth((int)sbyte.MaxValue);
            int   num8      = (width >> 1) - 10;
            int   num9      = height - 55 - 25;
            int   num10     = y + 55;
            int   num11     = x;
            int   num12     = num1 + 5;
            int   x2        = num11 + (num8 >> 1);
            int   x3        = num12;
            int   x4        = num12 + num8;
            animationManager2D.submitAnimGrid(233, 234, 235, 236, 237, 238, 239, 240, 241, (float)num11, (float)num10, (float)num8, (float)num9);
            animationManager2D.submitAnim(188, (float)num4, (float)num5);
            animationManager2D.submitAnim(careerIcon, (float)num2, (float)num3);
            animationManager2D.submitAnim((int)sbyte.MaxValue, (float)num6, (float)num7, 1f, scaleX, -1f);
            animationManager2D.flushAnims(g);
            g.Begin();
            textManager.drawString(g, careerLevelDescString, 3, x1, y1, 18);
            int font       = 3;
            int lineHeight = textManager.getLineHeight(font);
            int num13      = 4 * lineHeight + 4;
            int y2         = num10 + (num9 - num13 >> 1);
            textManager.drawString(g, 981, font, x2, y2, 18);
            int          y3         = y2 + lineHeight;
            StringBuffer strBuffer1 = textManager.clearStringBuffer();
            int          num14      = 0;
            for (int index = 0; index < SimData.DAY_FLAGS.Length; ++index)
            {
                if ((careerLevelFlags & SimData.DAY_FLAGS[index]) != 0)
                {
                    if (num14 > 0)
                    {
                        textManager.appendStringIdToBuffer(11);
                    }
                    textManager.appendStringIdToBuffer(SimData.DAY_STRINGS[index]);
                    ++num14;
                }
            }
            textManager.drawString(g, strBuffer1, font, x2, y3, 18);
            int y4 = y3 + (lineHeight + 4);
            textManager.drawString(g, 990, font, x2, y4, 18);
            int          y5                    = y4 + lineHeight;
            StringBuffer strBuffer2            = textManager.clearStringBuffer();
            int          careerLevelHoursStart = simData.getCareerLevelHoursStart(simCareer, simCareerLevel);
            textManager.appendTimeToBuffer24Hour(careerLevelHoursStart);
            textManager.appendStringIdToBuffer(991);
            int careerLevelHoursEnd = simData.getCareerLevelHoursEnd(simCareer, simCareerLevel);
            textManager.appendTimeToBuffer24Hour(careerLevelHoursEnd);
            textManager.drawString(g, strBuffer2, font, x2, y5, 18);
            int num15 = 4 * lineHeight + 12;
            int y6    = num10 + (num9 - num15 >> 1);
            textManager.drawString(g, 975, font, x3, y6, 10);
            textManager.drawString(g, careerDescString, font, x4, y6, 34);
            int y7 = y6 + (lineHeight + 4);
            textManager.drawString(g, 977, font, x3, y7, 10);
            StringBuffer strBuffer3 = textManager.clearStringBuffer();
            textManager.appendMoneyToBuffer(careerLevelIncome);
            textManager.drawString(g, strBuffer3, font, x4, y7, 34);
            int y8 = y7 + (lineHeight + 4);
            textManager.drawString(g, 979, font, x3, y8, 10);
            textManager.drawString(g, objectStringId, font, x4, y8, 34);
            int y9 = y8 + (lineHeight + 4);
            textManager.drawString(g, 980, font, x3, y9, 10);
            textManager.drawString(g, simName, font, x4, y9, 34);
            int num16 = y9 + lineHeight;
            g.End();
        }
    }