Sound on 60 seconds and color (Dead) Tags

Page 2 of 2 FirstFirst 12
Results 26 to 38 of 38
  1. #26
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by aV3PQmCJjM9L View Post
    Nope, the (Dont) class's (also struct or typedef) pointer variable (Testme) is pointed to invalid location.
    I'm just explaining a basic concept & declaration

  2. #27
    Valued Member aV3PQmCJjM9L is offline
    MemberRank
    Jun 2013 Join Date
    100Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Ronny786 View Post
    I'm just explaining a basic concept & declaration
    However your "basic concept & declaration" was quite inaccurate.

  3. #28
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Ronny786 View Post
    ahh, its like adressing one variable to other.. if I'm not wrong.
    Like Testme is value of Dont.

    Dont * Testme

    where variable (testme) is pointed to (dont) .
    Now stop !
    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;


  4. #29
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Ronny786 View Post
    You just find people to underetimate.
    No. You're the one trying to point out he's better than Sensor (here).

    Quote Originally Posted by Ronny786 View Post
    m not kind of guy like george to get furious by such chats.
    And you're doing it once more. Funny thing to blame me for trying to bash people while you're the one actually bashing.

    Quote Originally Posted by Ronny786 View Post
    + i never googled what i wrote by myself.
    Yeah, hence it being incorrect.

    Quote Originally Posted by Ronny786 View Post
    + it is correct enough
    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.

  5. #30
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Peter dude.. I was just trying to explain in short.
    Only i wanted to say '*' this matters. i provided good def though.
    Chuck topic!

  6. #31
    Valued Member aV3PQmCJjM9L is offline
    MemberRank
    Jun 2013 Join Date
    100Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Ronny786 View Post
    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.

  7. #32
    Account Upgraded | Title Enabled! Patrick2607 is offline
    MemberRank
    May 2013 Join Date
    The NetherlandsLocation
    345Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    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:

    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);
    }
    Output:
    Code:
    (Dead)
    Developer:
    Any ideas?

  8. #33
    Valued Member aV3PQmCJjM9L is offline
    MemberRank
    Jun 2013 Join Date
    100Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    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.

  9. #34
    Account Upgraded | Title Enabled! Patrick2607 is offline
    MemberRank
    May 2013 Join Date
    The NetherlandsLocation
    345Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by aV3PQmCJjM9L View Post
    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);
    That code makes it:
    Code:
    (Dead) Developer: Text

  10. #35
    Valued Member aV3PQmCJjM9L is offline
    MemberRank
    Jun 2013 Join Date
    100Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Patrick2607 View Post
    That code makes it:
    Code:
    (Dead) Developer: Text
    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
    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;
    }
    Undo color does revert back to your first color.
    For example,
    Code:
    ^1Hello! ^-How are you?
    Administrator : Hello! How are you?
    So you can :
    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);
    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.

  11. #36
    Account Upgraded | Title Enabled! Patrick2607 is offline
    MemberRank
    May 2013 Join Date
    The NetherlandsLocation
    345Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Ok I'll try tomorrow when I continue to work on it. I'll let you know. Thanks so far!

  12. #37
    Alpha Member Chrisss is offline
    MemberRank
    Feb 2012 Join Date
    Ask the Fox!Location
    1,660Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by aV3PQmCJjM9L View Post
    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
    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;
    }
    Undo color does revert back to your first color.
    For example,
    Code:
    ^1Hello! ^-How are you?
    Administrator : Hello! How are you?
    So you can :
    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);
    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.
    That is a very very good idea.

  13. #38
    Account Upgraded | Title Enabled! Patrick2607 is offline
    MemberRank
    May 2013 Join Date
    The NetherlandsLocation
    345Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Works like a charm aV3PQmCJjM9L. Thank you once again for helping me out! :)



Page 2 of 2 FirstFirst 12

Advertisement