[Solved] [Dev] interface change

Results 1 to 10 of 10
  1. #1
    Guss decarvk is offline
    MemberRank
    Jul 2008 Join Date
    /home/bed/Location
    381Posts

    [Solved] [Dev] interface change

    hi,

    i'm actualy integrating teamspeak into the game (client and server side), actually all thing are weel ao.atm init and connect to the virtual teamspeak server added in field server, I wish now create an interface to manage that new feature and add this on in the community window.

    I have open the INFComunity.cpp to try to add a new button and add some line like this:

    Code:
    	for( int i=0; i < COMMUNITY_MAX; i++ )
    	{
    		m_pCommMenuBtn[i] = new CINFImageBtn;
    	}	
    
    	m_pCommMenuBtn[COMMUNITY_PARTY]->InitDeviceObjects("comFbtn0");
    	m_pCommMenuBtn[COMMUNITY_FRIEND]->InitDeviceObjects("comFrbtn0");
    	m_pCommMenuBtn[COMMUNITY_GUILD]->InitDeviceObjects("comBbtn0");
    	m_pCommMenuBtn[COMMUNITY_CHATROOM]->InitDeviceObjects("comCbtn0");
    	m_pCommMenuBtn[COMMUNITY_MAIL]->InitDeviceObjects("comLbtn0");
    	m_pCommMenuBtn[COMMUNITY_REJECT]->InitDeviceObjects("comRbtn0");
    	m_pCommMenuBtn[COMMUNITY_VOCAL]->InitDeviceObjects("comRbtn0");
    and

    Code:
    		POINT pBkSize;
    		pBkSize.x =  m_pCommunityBKImage->GetMaxPos().x - m_pCommunityBKImage->GetMinPos().x;
    		pBkSize.y =  m_pCommunityBKImage->GetMaxPos().y - m_pCommunityBKImage->GetMinPos().y;
    		float fPosX = m_ptCommunityBk.x + COMMUNITY_BTN_POSX;
    		float fPosY = m_ptCommunityBk.y + COMMUNITY_BTN_POSY;
    		
    		POINT pPos = m_pCommunityControl->GetFindControlTargetofMinPos("comFbtn00");
    		m_pCommMenuBtn[COMMUNITY_PARTY]->SetBtnPosition(fPosX + pPos.x, fPosY + pPos.y);
    		
    		pPos = m_pCommunityControl->GetFindControlTargetofMinPos("comFrbtn00");
    		m_pCommMenuBtn[COMMUNITY_FRIEND]->SetBtnPosition(fPosX + pPos.x, fPosY + pPos.y);
    		
    		pPos = m_pCommunityControl->GetFindControlTargetofMinPos("comBbtn00");
    		m_pCommMenuBtn[COMMUNITY_GUILD]->SetBtnPosition(fPosX + pPos.x, fPosY + pPos.y);
    		
    		pPos = m_pCommunityControl->GetFindControlTargetofMinPos("comCbtn00");
    		m_pCommMenuBtn[COMMUNITY_CHATROOM]->SetBtnPosition(fPosX + pPos.x, fPosY + pPos.y);
    		
    		pPos = m_pCommunityControl->GetFindControlTargetofMinPos("comLbtn00");
    		m_pCommMenuBtn[COMMUNITY_MAIL]->SetBtnPosition(fPosX + pPos.x, fPosY + pPos.y);
    		
    		pPos = m_pCommunityControl->GetFindControlTargetofMinPos("comRbtn");
    		m_pCommMenuBtn[COMMUNITY_REJECT]->SetBtnPosition(fPosX + pPos.x, fPosY + pPos.y);
    
    		pPos = m_pCommunityControl->GetFindControlTargetofMinPos("comRbtn");
    		m_pCommMenuBtn[COMMUNITY_VOCAL]->SetBtnPosition(fPosX + pPos.x, fPosY + pPos.y);
    and in INFComunity.h:
    Code:
    #define COMMUNITY_PARTY			0
    #define COMMUNITY_FRIEND		1
    #define COMMUNITY_GUILD			2
    #define COMMUNITY_CHATROOM		3
    #define COMMUNITY_MAIL			4
    #define COMMUNITY_REJECT		5
    #define COMMUNITY_VOCAL			6
    #define COMMUNITY_MAX			7
    my problem is that little thing are not enough to add my own button (not displaying), and I don't know how to made this working fi someone have already work on the game ui and know something about the procedure to add a button I will be happy to get this information.
    Last edited by decarvk; 18-02-17 at 03:02 PM.


  2. #2
    [Solved] [Dev] interface change Future is offline
    LegendRank
    Dec 2011 Join Date
    2,265Posts

    Re: [Not Solved] [Dev] interface change

    Oh look who's back... Well you copied the existing reject button so your new button gets the same position as that one. In other words your new button is overlapping the reject button and as it has the same image => it looks the same.

    You can hardcode the position a little to actually see the overlapping by doing smth like:

    Code:
    pPos = m_pCommunityControl->GetFindControlTargetofMinPos("comRbtn");
    m_pCommMenuBtn[COMMUNITY_VOCAL]->SetBtnPosition(fPosX + pPos.x + 20, fPosY + pPos.y);
    Should give you an idea of how this works.
    Or you edit a certain file, but you probably can't without the editor or knowledge of it.

  3. #3
    Guss decarvk is offline
    MemberRank
    Jul 2008 Join Date
    /home/bed/Location
    381Posts

    Re: [Not Solved] [Dev] interface change

    yes I haven't made asset for my own button, but instead of just add my pixel offset, I wish to understand hos massang do that with their own.

    after some search I think there is a resource in group.tex witch have information for that but I haven't found more on this way at this time.

  4. #4
    [Solved] [Dev] interface change St34lth4ng3l is offline
    MemberRank
    Apr 2013 Join Date
    __FILE__Location
    899Posts

    Re: [Not Solved] [Dev] interface change

    Well, masang started to export their interface system to Group.tex, but honestly i don't really understand why/how they did it and how it's working. Their normal Interface system is quite basic and trivial, but it's much write work, like restoring/deleting the resource etc.
    Basically you have use following methods (i took CINFGameMain as an example):
    Code:
    HRESULT CINFGameMain::InitDeviceObjects()
    Initialize your Objects here.

    Code:
    HRESULT CINFGameMain::RestoreDeviceObjects()
    Restore your objects here

    Code:
    HRESULT CINFGameMain::DeleteDeviceObjects()
    Delete your objects here

    Code:
    HRESULT CINFGameMain::InvalidateDeviceObjects()
    Invalidate your objects here

    Code:
    void CINFGameMain::Tick()
    Let your objects tick here, like button clicks, position changes etc

    Code:
    void CINFGameMain::Render()
    Render your objects here

    You could create your own wrapper for this, so you don't have to put each object in these methods, but basically this should work.

  5. #5
    Guss decarvk is offline
    MemberRank
    Jul 2008 Join Date
    /home/bed/Location
    381Posts

    Re: [Not Solved] [Dev] interface change

    yeah all inf Object have these methods, code sample that I have give are from these methods in INFCommunity object

    the group.tex comm_me ressource handle the size of the textures used for bottom button of the community interface. used for positioning them next to them selves, I will write a group/tex ressource editor I think it's hte best way to add this button and edit the comunity BG (who is also in group.tex under ressource name: commuBG) to get a larger window.

  6. #6
    [Solved] [Dev] interface change Future is offline
    LegendRank
    Dec 2011 Join Date
    2,265Posts

    Re: [Not Solved] [Dev] interface change

    The best way would be to scrap their horrible attempts of an interface system and rewrite it.

    With the group.tex they tried to create interface groups and controls which you can use more than one time for positioning without hardcoding the positions, which is what they did pre ep4. As stealth said, the efforts needed to create new interface elements is no match with what you're trying to achieve.

    Temp solution would be an editor for the group.tex (got one half working) or hexing the stuff you need into the file (not advisable)

    Gesendet von meinem SM-G900F mit Tapatalk

  7. #7
    Guss decarvk is offline
    MemberRank
    Jul 2008 Join Date
    /home/bed/Location
    381Posts

    Re: [Not Solved] [Dev] interface change

    i'm writing an editor, actually writing the loading of resources, I will get full filled structure and made a data view for edit structure content with a simple windows form application.

    after that for save it's just a binary dump of my structure, so nothing hard.

    The best way would be to scrap their horrible attempts of an interface system and rewrite it.
    can't say better ^^ but it's take much more time than writing a craps tools that handle group.tex resources.

  8. #8
    Guss decarvk is offline
    MemberRank
    Jul 2008 Join Date
    /home/bed/Location
    381Posts

    Re: [Not Solved] [Dev] interface change

    little post to say it's not solved already but in good way, i'm currently working on my group.tex editor.

    actually result are I have a clean window with all data extracted, now I have to made the data editor



    and that will solve my actual problem

    edit:

    have to made save action and it's wil be done
    Last edited by decarvk; 17-02-17 at 03:38 PM.

  9. #9
    struct { int:-!!(1); } Aesir is offline
    MemberRank
    May 2015 Join Date
    MadnessLocation
    279Posts

    Re: [Not Solved] [Dev] interface change



    You may even consider using masang's crap for this, alas i didn't code a new one with my team because we're still busy on finishing the mapeditor (Unity is such a pain in the ass...)

  10. #10
    Guss decarvk is offline
    MemberRank
    Jul 2008 Join Date
    /home/bed/Location
    381Posts

    Re: [Solved] [Dev] interface change

    write my own tool don't hurt me, and it's easier to find structure with client source code that I did'nt got in past.

    after I made a simple table editor, next step is the map editor I have started on that one in past with ue4 for my part but leave this project cause of lack of time and lack of knowledge on map structure.

    and it's first time I see your tool like many one of masang lot of people doesn't have these one, if I get source of these on a day before finish to work on my own it's will free me sometime to work on the game rather than the tools.

    EDIT: after writing my groupTexResource editor I can now change the interface


    my tool have no showcase of your edit but if you are interested, I will be happy to trade this one versus a needed tool not written by my self.
    Last edited by decarvk; 18-02-17 at 02:22 PM.



Advertisement