Esempio n. 1
0
    public void initList(int startSelection)
    {
        if (!this.getFlag(1))
        {
            this.m_startSelection = startSelection;
            this.unsetFlag(2);
        }
        else
        {
            AppEngine   canvas      = AppEngine.getCanvas();
            TextManager textManager = canvas.getTextManager();
            SimWorld    simWorld    = canvas.getSimWorld();
            SimData     simData     = canvas.getSimData();
            SceneGame   sceneGame   = canvas.getSceneGame();
            this.setFlag(2);
            this.m_itemNumX     = 1;
            this.m_itemW        = this.m_width - 20;
            this.m_itemSelected = startSelection;
            switch (this.m_listId)
            {
            case 0:
                this.m_selectPreSend = false;
                this.m_itemSelected  = canvas.getRMSGameSlotIndex();
                this.m_itemNum       = 7;
                this.m_itemNumX      = this.m_itemNum;
                this.m_itemNumY      = 1;
                this.m_itemW         = 118;
                this.m_itemH         = this.m_height;
                break;

            case 1:
                this.m_selectPreSend = true;
                this.m_itemNum       = simData.getPersonaCount();
                this.m_itemSelected  = simData.getPersona();
                this.m_itemNumX      = this.m_itemNum;
                this.m_itemH         = 40;
                this.m_itemNumY      = 1;
                this.m_itemW         = 160;
                this.m_itemH         = this.m_height;
                break;

            case 2:
                this.m_itemNum = simData.getTraitCount();
                this.m_itemH   = 40;
                break;

            case 3:
                this.m_itemNum = simData.getTaskCount();
                this.m_itemH   = 28;
                break;

            case 4:
                this.m_itemNum = simData.getSkillCount();
                this.m_itemH   = 45;
                int num1 = 0;
                for (int skill = simData.getSkillCount() - 1; skill >= 0; --skill)
                {
                    int skillDesc   = simData.getSkillDesc(skill);
                    int stringWidth = textManager.getStringWidth(skillDesc, 3);
                    if (stringWidth > num1)
                    {
                        num1 = stringWidth;
                    }
                }
                this.m_offsetCol = num1;
                break;

            case 5:
                this.m_itemNum = simData.getInventoryNthCount();
                this.m_itemH   = 40;
                break;

            case 6:
                this.m_itemNum = simData.getRelationshipNthCount();
                this.m_itemH   = 40;
                break;

            case 7:
                this.m_itemSelected = 0;
                this.m_itemNum      = sceneGame.getShoppingItemCount();
                this.m_itemH        = 40;
                break;

            case 8:
                this.m_itemSelected = 0;
                this.m_itemNum      = simWorld.getFurnitureCountOfCategory(sceneGame.getCurFurnitureCategory());
                this.m_itemH        = 40;
                this.m_itemNumY     = 1;
                this.m_itemW        = 180;
                for (int index = 0; index < 5; ++index)
                {
                    int nthItemOfCategory = simWorld.getFurnitureNthItemOfCategory(index, sceneGame.getCurFurnitureCategory());
                    this.m_objectPreviews[index] = new UIObjectPreview();
                    this.m_objectPreviews[index].loadObject(nthItemOfCategory);
                    this.m_objectPreviews[index].getModel().disableFurnitureShadows();
                    this.m_previewToIndexMap[index] = index;
                }
                break;

            case 9:
                this.m_itemSelected = 0;
                this.m_itemH        = textManager.getLineHeight(3);
                this.m_itemNum      = sceneGame.shoppingListSize();
                break;

            case 10:
                this.m_itemNum  = simWorld.getUnlockedFloorNthCount();
                this.m_itemNumX = this.m_itemNum;
                this.m_itemNumY = 1;
                this.m_itemW    = 160;
                this.m_itemH    = this.m_height;
                break;

            case 11:
                this.m_itemNum  = simWorld.getUnlockedWallNthCount();
                this.m_itemNumX = this.m_itemNum;
                this.m_itemNumY = 1;
                this.m_itemW    = 160;
                this.m_itemH    = this.m_height;
                break;

            case 12:
                int buildModeOldSetting   = canvas.getSceneGame().getBuildModeOldSetting();
                int objectFootprintHeight = simWorld.getObjectFootprintHeight(buildModeOldSetting);
                this.m_itemNum  = simWorld.getWindowNthTypeCount(objectFootprintHeight);
                this.m_itemNumX = this.m_itemNum;
                this.m_itemNumY = 1;
                this.m_itemW    = 160;
                this.m_itemH    = this.m_height;
                break;

            case 13:
                this.m_itemNum  = simWorld.getDoorNthTypeCount();
                this.m_itemNumX = this.m_itemNum;
                this.m_itemNumY = 1;
                this.m_itemW    = 160;
                this.m_itemH    = this.m_height;
                break;
            }
            if (this.m_swipeList)
            {
                this.m_width    = this.m_itemW;
                this.m_posX     = this.m_clipPosX + (this.m_clipWidth - this.m_width >> 1);
                this.m_itemNumX = this.m_itemNum / this.m_itemNumY + (this.m_itemNum % this.m_itemNumY > 0 ? 1 : 0);
                int   num2 = this.m_itemSelected >= 0 ? this.m_itemSelected : 0;
                int   num3 = (this.m_itemNumX - 1) * this.m_itemW;
                float min  = (float)JMath.min(0, -num3);
                float max  = 0.0f;
                if (this.m_listId == 0)
                {
                    min += (float)this.m_itemW;
                    max -= (float)this.m_itemW;
                    if (num2 == 0)
                    {
                        num2 = 1;
                    }
                    else if (num2 == this.m_itemNumX - 1)
                    {
                        num2 = this.m_itemNumX - 2;
                    }
                }
                this.setSwipeRange(min, max, (float)this.m_itemW);
                this.resetSwiping(num3 >= this.m_width);
                this.setSwipeOffset((float)(-num2 * this.m_itemW));
            }
            else
            {
                this.m_itemNumY = this.m_itemNum / this.m_itemNumX + (this.m_itemNum % this.m_itemNumX > 0 ? 1 : 0);
                int num2 = this.m_itemNumY * this.m_itemH;
                this.setScrollRange((float)JMath.min(0, -num2 + this.m_height), 0.0f);
                this.resetScrolling(num2 > this.m_height);
                this.setScrollOffset(0.0f);
            }
        }
    }
Esempio n. 2
0
    public void trackCAS(bool edited)
    {
        EASpywareManager instance = EASpywareManager.getInstance();
        SimData          simData  = AppEngine.getCanvas().getSimData();
        string           simName  = AppEngine.getCanvas().getSimName();
        string           slotStr  = string.Concat((object)AppEngine.getCanvas().getRMSGameSlotIndex());
        int simAttributeUnique1   = simData.getSimAttributeUnique(0, 0);
        int simAttributeUnique2   = simData.getSimAttributeUnique(0, 1);
        int simAttributeUnique3   = simData.getSimAttributeUnique(0, 2);
        int simAttributeUnique4   = simData.getSimAttributeUnique(0, 3);
        int simAttributeUnique5   = simData.getSimAttributeUnique(0, 4);
        int simAttributeUnique6   = simData.getSimAttributeUnique(0, 11);
        int simAttributeUnique7   = simData.getSimAttributeUnique(0, 12);
        int simAttributeUnique8   = simData.getSimAttributeUnique(0, 5);
        int simAttributeUnique9   = simData.getSimAttributeUnique(0, 6);
        int simAttributeUnique10  = simData.getSimAttributeUnique(0, 7);
        int simAttributeUnique11  = simData.getSimAttributeUnique(0, 8);
        int simAttributeUnique12  = simData.getSimAttributeUnique(0, 9);
        int simAttributeUnique13  = simData.getSimAttributeUnique(0, 10);

        if (!edited)
        {
            instance.logEvent(241, simName, slotStr);
            instance.logEvent(226, simName, slotStr);
            instance.logEvent(235, simAttributeUnique1 == 0 ? "male" : "female");
            instance.logEvent(236, simAttributeUnique2);
            instance.logEvent(232, simAttributeUnique3, simAttributeUnique4);
            instance.logEvent(441, simAttributeUnique6, simAttributeUnique7);
            instance.logEvent(234, simAttributeUnique5);
            instance.logEvent(233, simAttributeUnique8, simAttributeUnique9);
            instance.logEvent(237, simAttributeUnique10, simAttributeUnique11);
            instance.logEvent(238, simAttributeUnique12, simAttributeUnique13);
            int    persona = simData.getPersona();
            string str1    = GlobalConstants.LOOKUP_PERSONA[persona];
            instance.logEvent(239, str1);
            int    simTrait1 = simData.getSimTrait(0, 0);
            string str2      = GlobalConstants.LOOKUP_TRAIT[simTrait1];
            instance.logEvent(240, str2);
            int    simTrait2 = simData.getSimTrait(0, 1);
            string str3      = GlobalConstants.LOOKUP_TRAIT[simTrait2];
            instance.logEvent(240, str3);
            int    simTrait3 = simData.getSimTrait(0, 2);
            string str4      = GlobalConstants.LOOKUP_TRAIT[simTrait3];
            instance.logEvent(240, str4);
            int    simTrait4 = simData.getSimTrait(0, 3);
            string str5      = GlobalConstants.LOOKUP_TRAIT[simTrait4];
            instance.logEvent(240, str5);
            int    simTrait5 = simData.getSimTrait(0, 4);
            string str6      = GlobalConstants.LOOKUP_TRAIT[simTrait5];
            instance.logEvent(240, str6);
        }
        else
        {
            instance.logEvent(242, simName, slotStr);
            if (this.m_casHairType != simAttributeUnique3 || this.m_casHairColor != simAttributeUnique4)
            {
                instance.logEvent(232, simAttributeUnique3, simAttributeUnique4);
            }
            if (this.m_casHeadType != simAttributeUnique6 || this.m_casHeadColor != simAttributeUnique7)
            {
                instance.logEvent(441, simAttributeUnique6, simAttributeUnique7);
            }
            if (this.m_casTorsoType != simAttributeUnique8 || this.m_casTorsoColor != simAttributeUnique9)
            {
                instance.logEvent(233, simAttributeUnique8, simAttributeUnique9);
            }
            if (this.m_casLegsType != simAttributeUnique10 || this.m_casLegsColor != simAttributeUnique11)
            {
                instance.logEvent(237, simAttributeUnique10, simAttributeUnique11);
            }
            if (this.m_casFeetType == simAttributeUnique12 && this.m_casFeetColor == simAttributeUnique13)
            {
                return;
            }
            instance.logEvent(238, simAttributeUnique12, simAttributeUnique13);
        }
    }
Esempio n. 3
0
    private void renderPersona(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   sim                 = 0;
        int   persona             = simData.getPersona();
        int   personaDescString   = (int)simData.getPersonaDescString(persona);
        int   personaNthGoalCount = simData.getPersonaNthGoalCount();
        int   num1                = x + (width >> 1);
        int   num2                = num1;
        int   num3                = y;
        int   num4                = width >> 1;
        int   num5                = num1 - (width >> 2);
        int   num6                = y + 25;
        int   x1         = num5;
        int   y1         = num6 + 35;
        int   x2         = x1;
        int   y2         = y1 + 16;
        int   x3         = x1;
        int   y3         = y2 + 15;
        int   x4         = num2 + 10;
        int   x5         = num2 + (num4 >> 1);
        int   num7       = num3 + 8;
        int   lineHeight = textManager.getLineHeight(3);
        int   x6         = num1;
        int   y4         = num3 + 100 + 11;
        int   x7         = x + 60;
        int   num8       = x7 - 16;
        int   num9       = y4 + 20;
        int   num10      = 16;
        int   num11      = x6;
        float scaleX     = (float)width * 0.9f / animationManager2D.getAnimWidth(126);
        int   num12      = -(num10 >> 1);

        animationManager2D.submitAnim(181, (float)num5, (float)num6);
        animationManager2D.submitAnimGrid(233, 234, 235, 236, 237, 238, 239, 240, 241, (float)num2, (float)num3, (float)num4, 100f, 1f);
        int num13 = num9;

        for (int index = 0; index < personaNthGoalCount; ++index)
        {
            bool flag = simData.isPersonaGoalsCompleted(index);
            animationManager2D.submitAnim(135, (float)num8, (float)num13);
            if (flag)
            {
                animationManager2D.submitAnim(134, (float)num8, (float)num13);
            }
            animationManager2D.submitAnim(126, (float)num11, (float)(num13 + num12), 1f, scaleX, 1f);
            num13 += num10;
        }
        animationManager2D.flushAnims(g);
        g.Begin();
        string simName = canvas.getSimName();

        textManager.drawString(g, simName, 6, x1, y1, 18);
        textManager.drawString(g, 969, 3, x2, y2, 18);
        textManager.drawString(g, personaDescString, 3, x3, y3, 18);
        int numPlayerTraits = simData.getNumPlayerTraits();
        int y5 = num7;

        textManager.drawString(g, 967, 3, x5, y5, 17);
        int y6 = y5 + lineHeight;

        for (int index = 0; index < numPlayerTraits; ++index)
        {
            int simTrait        = simData.getSimTrait(sim, index);
            int traitDescString = (int)simData.getTraitDescString(simTrait);
            textManager.drawString(g, traitDescString, 3, x4, y6, 9);
            y6 += lineHeight;
        }
        textManager.drawString(g, 970, 3, x6, y4, 18);
        int y7 = num9;

        for (int index = 0; index < personaNthGoalCount; ++index)
        {
            int personaNthGoalItem = simData.getPersonaNthGoalItem(index);
            int dreamDescString    = simData.getDreamDescString(personaNthGoalItem);
            textManager.drawString(g, dreamDescString, 3, x7, y7, 10);
            y7 += num10;
        }
        g.End();
    }