Vatansever Tarzı İtem Sayısı Gösterimi (K, M)

  • Konuyu açan Konuyu açan Baldwin
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 8
  • Gösterim Gösterim 553

Baldwin

Yasaklanmış Üye
Cezalı
Mesaj
178
Çözümler
3
Beğeni
139
Puan
744
Ticaret Puanı
0
elciklerimle vatanseverden sökülmüştür çalışıyor sıkıntı yaşarsanız konu altına yazınız
Kod:
Genişlet Daralt Kopyala
pythonslotwindow.cpp aç
arat
void CSlotWindow::SetSlotCount(DWORD dwIndex, DWORD dwCount)
void CSlotWindow::SetSlotCount(DWORD dwIndex, DWORD dwCount)
{
    TSlot * pSlot;
    if (!GetSlotPointer(dwIndex, &pSlot))
        return;

    if (dwCount <= 0)
    {
        if (pSlot->pNumberLine)
        {
            delete pSlot->pNumberLine;
            pSlot->pNumberLine = NULL;
        }
    }
    else
    {
        std::string szCount;
            DWORD index = 0;

        DWORD modIndex = 1;
        while (dwCount > 0)
        {
            if ((index + 1) % 4 == 0)
            {

                if (modIndex == 1)
                    szCount = "k" + szCount;
                else if (modIndex == 2)
                    szCount = "m" + szCount;
                else
                    szCount = "t" + szCount;
                modIndex++;
            }
            else
            {
                szCount = std::to_string(dwCount % 10) + szCount;
                dwCount /= 10;
            }

            index++;
        }

        std::string::reverse_iterator checkPoint = szCount.rbegin();
        for (auto it = szCount.rbegin(); it != szCount.rend(); it++)
        {
            if (it == '0')
            {
                continue;
            }
            if (it >= '1' && it <= '9')
            {
                break;
            }
            else // k m t
            {
                checkPoint = it;
            }
        }

        if (checkPoint != szCount.rbegin())
        {
            szCount.erase(checkPoint.base(), szCount.end());
        }

        if (!pSlot->pNumberLine)
        {
            CNumberLine pNumberLine = new UI::CNumberLine(this);
            pNumberLine->SetHorizontalAlign(CNumberLine::HORIZONTAL_ALIGN_RIGHT);
            pNumberLine->Show();
            pSlot->pNumberLine = pNumberLine;
        }

        pSlot->pNumberLine->SetNumber(szCount.c_str());
    }
}
Değiştir
pythonwindow.cpp aç
arat
void CNumberLine::SetNumber
ekle
else if ('m' == cChar)
            {
                strImageFileName = m_strPath + "m.sub";
            }
            else if ('k' == cChar)
            {
                strImageFileName = m_strPath + "k.tga";
            }
            else if ('t' == cChar)
            {
                strImageFileName = m_strPath + "t.tga";
            }
Linkleri görebilmek için giriş yap veya kayıt ol.
 
Üst