Nope, not even close. Proper usage would be something like
PHP Code:class Test {
public:
char m_szTest[512];
};
void doSomething(Test *pTest) {
strcpy(pTest->m_szTest, "Pointer");
}
void main() {
Test *pTest = new Test();
doSomething(pTest);
printf("%s\n", pTest->m_szTest);
delete pTest;
}
No. You're the one trying to point out he's better than Sensor (here).
And you're doing it once more. Funny thing to blame me for trying to bash people while you're the one actually bashing.
Yeah, hence it being incorrect.
Not really, no. Doing "Dont * Testme" in C++ (assuming both are variables), your compiler will multiply "Dont" with "Testme". You know, as in 1 * 1 = 1.
Last edited by Solaire; 20-06-13 at 04:30 PM.
Peter dude.. I was just trying to explain in short.
Only i wanted to say '*' this matters. i provided good def though.
Chuck topic!
I have some my own code work that I want to release here.
However, because of people like you, I pending post.
If I posted releases, people like you would say unnecessary things always. For example,
"Your code XXXXX is absolutely wrong!"
"Your code is messed up!"
"My code XXXXX is better than your YYYYY code!"
"Learn how to code first!"
I don't need answers like this. I need advices or ideas, not complaint or knowledge fight.
I'm very afraid.
So again, in short, don't ruin this section.
Ok, so I decided to work on the dead tags. Spent 2 hours (as a C++ newb) but I can't get it fixed on 1 line. However, I can get it on 2 lines. This is the code I have now:
Output:Code:char szTemp[sizeof(szMsg)+64]; char szDead[64]; MCOLOR DeadColor = MCOLOR(0xFFFF0000); if(bSpUser && !ZGetGame()->m_pMyCharacter->IsDie()) { sprintf(szTemp, "%s : %s", pChar->GetProperty()->GetName(),szMsg); ZChatOutput(UserNameColor, szTemp); } else if(bSpUser && ZGetGame()->m_pMyCharacter->IsDie()) { sprintf(szDead, "(Dead)"), sprintf(szTemp, "%s : %s", pChar->GetProperty()->GetName(),szMsg); ZChatOutput(DeadColor, szDead),ZChatOutput(UserNameColor, szTemp); } else if(!bSpUser && !ZGetGame()->m_pMyCharacter->IsDie()) { sprintf(szTemp, "%s : %s", pChar->GetProperty()->GetName(),szMsg); ZChatOutput(ChatColor, szTemp); } else if(!bSpUser && ZGetGame()->m_pMyCharacter->IsDie()) { sprintf(szDead, "(Dead)"), sprintf(szTemp, "%s : %s", pChar->GetProperty()->GetName(),szMsg); ZChatOutput(DeadColor, szDead),ZChatOutput(ChatColor, szTemp); }
Any ideas?Code:(Dead) Developer:
Here's my way :
Code:// 1024 : too much? char szOutput[1024] = ""; MCOLOR chatcolor = MCOLOR(0xFFD0D0D0); if(bSpUser) chatcolor = UserNameColor; if(ZGetGame()->m_pMyCharacter->IsDie()) { strcat(szOutput, "(Dead) "); chatcolor = MCOLOR(0xFFFF0000); } char szBody[256]; sprintf(szBody, "%s : %s", pChar->GetProperty()->GetName(), szMsg); strcat(szOutput, szBody); ZChatOutput(chatcolor, szOutput);
Last edited by aV3PQmCJjM9L; 22-06-13 at 01:59 AM. Reason: Never mind.
I have no idea to do that. A only way is use chat color like ^1example.
If you interested to add new color mark, you can try :
./Mint2/Source/MDrawContext.cpp
Undo color does revert back to your first color.Code:// オムツーチルコホナヘ nIndentationククナュ オ鯀ゥセイア篋ヲ ヌムエル, skiplineククナュ タュカホタサ サゥー・テ箙ツヌムエル. int MDrawContext::TextMultiLine(MRECT& r, const char* szText,int nLineGap,bool bAutoNextLine,int nIndentation,int nSkipLine, MPOINT* pPositions) { bool bColorSupport=true; MBeginProfile(99,"MDrawContext::TextMultiLine"); MCOLOR first_color = GetColor(); // Undo color. int nLine = 0; MFont* pFont = GetFont(); int nLength = strlen(szText); int y = r.y; const char* szCurrent=szText; MPOINT* pCurrentPos = pPositions; do { int nX = nLine==0 ? 0 : nIndentation; int nOriginalCharCount = MMGetNextLinePos(pFont,szCurrent,r.w-nX,bAutoNextLine,true); if(nSkipLine<=nLine) { int nCharCount = min(nOriginalCharCount,MAX_CHAR_A_LINE); char buffer[256]; if(bColorSupport) { // Textー。 アラキチチツ ニヌ チ、コククヲ テ、ソ・ウヨエツエル. #define FLUSHPOS(_Pos) if(pCurrentPos!=NULL){ \ for(int i=0; buffer[i]!=NULL; i++){ \ pCurrentPos[i+szCurrent-szText].x = _Pos+pFont->GetWidth(buffer, i); \ pCurrentPos[i+szCurrent-szText].y = y; \ } \ } #define FLUSH if(buffer[0]) { Text(r.x+nLastX, y, buffer); FLUSHPOS(r.x+nLastX); nLastX=nX; buffer[0]=0;pcurbuf=buffer; } int nLastX=nX; buffer[0]=0; char *pcurbuf=buffer; for(int i=0; i<nCharCount; i++){ unsigned char c = szCurrent[i], cc = szCurrent[i+1]; // Undo color. if(c=='^') { if(('0'<=cc) && (cc<='9')) { FLUSH; // テ、ニテキ・スコニョクオ サ釤・ SetColor(MCOLOR(MMColorSet[cc - '0'])); i++; continue; } else if(cc=='-') { FLUSH; // テ、ニテキ・スコニョクオ サ釤・ SetColor(first_color); i++; continue; } } // End of undo color. int w; *(pcurbuf++)=c; if(c>127 && i<nCharCount){ *(pcurbuf++)=cc; w = pFont->GetWidth(szCurrent+i,2); i++; } else w = pFont->GetWidth(szCurrent+i,1); *pcurbuf=0; nX += w; } FLUSH; }else { strncpy(buffer,szCurrent,nCharCount); buffer[nCharCount]=0; Text(r.x+nX, y,buffer); FLUSHPOS(r.x+nX); } y+=pFont->GetHeight()+nLineGap; } szCurrent+=nOriginalCharCount; nLine++; if(y>=r.y+r.h) break; } while(szCurrent<szText+nLength); MEndProfile(99); return nLine-nSkipLine; }
For example,
So you can :Code:^1Hello! ^-How are you? Administrator : Hello! How are you?
and, to add color mark like this correctly, it seems need to edit more place. but I couldn't read all of effect, and this seems ok as now, I didn't.Code:char szOutput[1024] = ""; MCOLOR chatcolor = MCOLOR(0xFFD0D0D0); if(bSpUser) chatcolor = UserNameColor; if(ZGetGame()->m_pMyCharacter->IsDie()) { strcat(szOutput, "^1(Dead) ^-"); chatcolor = MCOLOR(0xFFFF0000); } char szBody[256]; sprintf(szBody, "%s : %s", pChar->GetProperty()->GetName(), szMsg); strcat(szOutput, szBody); ZChatOutput(chatcolor, szOutput);
Ok I'll try tomorrow when I continue to work on it. I'll let you know. Thanks so far!
Works like a charm aV3PQmCJjM9L. Thank you once again for helping me out! :)