Announcement

Collapse
No announcement yet.

PROJECT: New Choose Civ Start Up Interface

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PROJECT: New Choose Civ Start Up Interface

    I noticed that when we do a start up we have to choose the number of civs and the color but then choose the civ we get a huge list of civs up to 63.

    I usualy play a game and sometimes want to face certain civs so I have to go to the cheat editor.


    So as an Idea, how about we add a new choose civ screen but instead have the interface be:

    The Diplomat Photo
    Just like in diplomacy, in the future I'm thinking of having flags there since its not copyrighted stuff and have my diplomod a standard part of the AE (I already have most of the flags)

    the player number
    which is capped based on the number of civs from the previous window/userprofile

    the pull down box
    with a list of civs like the Scenario editor.

    It will be a smaller interface, we should already have the code for it, and we can have more than the 63 civ list.


    the one issue of course is that the game populates the other civs at start up so I suggest that as a default all civs start as Wastelands/Barbs in the start up menu and the game randomizes all players above 0 if they are wastelands. I'm not sure how to confirm it but I think this is already how the game handles it.

    Suggestions? comments?
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

  • #2
    Sounds very nice! Can't wait to test it

    Comment


    • #3
      Martin, J, Fromafar, any one else who can help.

      I looked into the interface.cpp and ldl files I see that in


      spnewgamepopups.ldl has this for the tribe screen we now have with 63 tribes.
      Code:
      SPNewGameTribeScreen {
      
      	string	pattern	"uptg20e.tga"
      
      	string	xanchor	"center"
      
      	string	yanchor	"center"
      
      	int	widthpix	650
      
      	int	heightpix	600 # LOQ 2004-10-12: from 465
      
      
      
      	Name:CTP_GREY_TITLE_FONT {
      
      		string	parent	"c3_PopupTitle"
      
      		string xanchor "center"
      
      		string yanchor "top"
      
      		int	ypix	20
      
      		int widthpct 50
      
      		int heightpix 20
      
      		string	text	"str_ldl_Tribe"
      #		string	pattern	"uptg20e.tga"
      
      	}
      
      	BackButton:CTP2_STANDARD_FONT {
      
      		int	xpix	550
      
      		int	ypix	345
      
      		int	widthpix	40
      
      		int	heightpix	20
      
      #		string	imagebltflag	"chromakey"
      
      #		string	image0		"upba1807.tga"
      
      #		int	bevelwidth	0
      
      		string	text	"str_ldl_BACK"
      	}
      
      	Group {
      
      		TribeOne:TRIBE_CHECKBOX1 {
      
      			string	text	"str_ldl_col1"
      			int	ypix	45
      
      		}
      
      		TribeTwo:TRIBE_CHECKBOX2 {
      
      			string	text	"str_ldl_col2"
      			int	ypix	45
      
      		}
      
      		TribeThree:TRIBE_CHECKBOX3 {
      
      			string	text	"str_ldl_col3"
      			int	ypix	45
      
      		}
      
      		TribeFour:TRIBE_CHECKBOX4 {
      
      			string	text	"str_ldl_col4"
      			int	ypix	45
      
      		}
      
      	}

      I want to changeit from a list of buttons to a simple pulldown like in the scenario editor (from messing with the editor I see that it allows for more than 63 tribes)

      Code:
      	CivControls:SCEN_CONTROLS_BOX {
      
      [i]...some interface stuff...[/i]
      		Nation:CTP2_DROPDOWN {
      			int xpix 6
      			int ypix 68
      			int widthpix 120
      			int heightpix 24
      			string statustext "str_SE_Nation"
      			string tipwindow "str_SE_Nation"
      		}
      	}
      I cant find in the code that specifies that it has to be a button or a pulldown in spnewgametribescreen.cpp or the scenarioeditor.cpp. It looks like it populates etc but how o i determine it to go into a pulldown? Also why does the tribes.ldl have tribesgroups #1 through 4. I know we have multiple buttons but not sure how it populates all those buttons.

      EDIT: I found te dropdown reference in Scenario editor like this:
      Code:
      void ScenarioEditor::SetupNations()
      {	
      	
      	
      	sint32 i;
      	ctp2_DropDown *plgroup = (ctp2_DropDown *)aui_Ldl::GetObject(s_scenarioEditorBlock, "CivControls.Nation");
      
      	Assert(plgroup);
      	if(!plgroup ) return;
      
      	plgroup->Clear();
      
      
      	plgroup->SetActionFuncAndCookie(SetPlayerNation, (void *)0);
      
      
      	
      	
      	for(i = 0; i < g_theCivilisationDB->NumRecords(); i++) {
      		const MBCHAR *name = g_theStringDB->GetNameStr(g_theCivilisationDB->Get(i)->GetCountryName());
      
      		
      		AddDropDownItem(plgroup, "ScenNationItem", (MBCHAR *)name);
      
      
      
      	}
      
      	Player *p = g_player[g_selected_item->GetVisiblePlayer()];
      	if(p) {
      		 
      		plgroup->SetSelectedItem(p->m_civilisation->GetCivilisation()); 
      
      		m_placeNationFlag = p->m_civilisation->GetCivilisation();
      
      		ctp2_TextField *tf = (ctp2_TextField *)aui_Ldl::GetObject(s_scenarioEditorBlock, "CivExtraControls.LeaderField");
      		Assert(tf);
      		if(tf) {
      			tf->SetFieldText(p->m_civilisation->GetLeaderName());
      		}
      
      	}
      
      	
      	
      	ctp2_DropDown *govs = (ctp2_DropDown *)aui_Ldl::GetObject(s_scenarioEditorBlock, "TabGroup.Civ.SetGovernment");
      	for (i = 0; i < g_theGovernmentDB->NumRecords(); i++)
      	{
      		AddDropDownItem(govs, "ScenNationItem", (MBCHAR *)g_theStringDB->GetNameStr(g_theGovernmentDB->GetName(i)) );
      	}
      
      	if (p)
      	{
      		
      		ctp2_DropDown *govs = (ctp2_DropDown *)aui_Ldl::GetObject(s_scenarioEditorBlock, "TabGroup.Civ.SetGovernment");
      		govs->SetSelectedItem(p->GetGovernmentType());
      	}
      	UpdatePlayerSelect();
      
      }

      and sptribessceen uses
      Code:
      TribeSelector   s_checkBox;
      and other stuff. THe code doesn't match up. But why checkboxes and not pulldowns. I guess its not going to be an easy cut and paste. Should I build sonewtribe from scratch based on the scenario editor code?



      ##################

      Finally after I figure this out I want to make so when you seect a pulldown it shows the civ's diplomat photo, i think I know how to add that by following Martin's diplomacy additions but thats next.
      Last edited by Ekmek; August 30, 2006, 17:47.
      Formerly known as "E" on Apolyton

      See me at Civfanatics.com

      Comment


      • #4
        The 4 tribegroups correspond with the 4 button columns at the screen. The code to generate the buttons and distribute these over the columns (there may be less civilisations, e.g. in a scenario) is in spnewgametribescreen_Initialize.

        With the current user interface, you can select your civilisation with a single button click. More convenient than having to open a dropdown list with 64 items and scroll to the one you want. The drawback is that it requires an entire screen to select a single civilisation - and you can't choose your opponents.

        Maybe you could add a "select opponents" button to the "new game" screen that would open a new screen. Here you could use dropdown lists, or reuse the current design. Just make it possible to enable multiple buttons - each enabled button would define an opponent in the game.

        Comment


        • #5
          Better start with the MP civ choser. The problem with this huge screen with all the buttons is that the space for buttons is limited. Currently the maximum number of civilizations it can display is 64 or 63 or so. But we can put much more civs into the game.

          -Martin
          Civ2 military advisor: "No complaints, Sir!"

          Comment


          • #6
            the 63+ interface is one of my original intentions. I still slowly plowing through this (time is limited) but I still cant decide if a dropdown (like scenario editor) is better or just a scroll bar to the bank of buttons.

            And I do like the select opponents option as well but I think that would require the scenario editor spinner.
            Formerly known as "E" on Apolyton

            See me at Civfanatics.com

            Comment


            • #7
              Actually neither the dropdown menu nor a some sort of scrollable buttons are good. A list box like in the MP choser is optimal.

              -Martin
              Civ2 military advisor: "No complaints, Sir!"

              Comment


              • #8
                Based on my experience of finally figuring out the rules screen I am returning to this.

                Looking at multiplayer I see that the multiplayer window allows a good interface for setting up multiple players but when i change a civ it goes into the spnewgametribesscreen with its 64 buttons.

                so for now I'm looking at a dropdown. its what civ3 uses (i know that justifies nothing) but its the best thing i can think of to add an interface that allows more than 63 (or even unlimited) civs.

                so my intent is to have something like the attached picture


                I figure these three methods from scenarioeditor are the key. And I plan notto overwrite snnewgametribesscreen but instead just set the tribe through these methods. it looks like player select is the place to go but man its a bit confusing

                Code:
                void SPNewGameWindow::UpdatePlayerSelect()
                {
                	ctp2_DropDown *players = (ctp2_DropDown *)aui_Ldl::GetObject(s_scenarioEditorBlock, "TabGroup.Civ.PlayerSelect");
                	players->Clear();
                	const MBCHAR *plr_choice = g_theStringDB->GetNameStr("str_player_choice");
                	AddDropDownItem(players, "ScenNationItem", (MBCHAR *)plr_choice);
                
                    char str[k_MAX_NAME_LEN];
                	for (sint32 i = 1; i < k_MAX_PLAYERS; i++)
                	{
                		if(g_player[i])
                		{
                			g_player[i]->GetCivilisation()->GetCountryName(str);
                			AddDropDownItem(players, "ScenNationItem", str);
                		}
                	}
                
                	players->SetSelectedItem(0);
                }
                
                void SPNewGameWindow::SetupNations()
                {	
                	ctp2_DropDown *plgroup = (ctp2_DropDown *)aui_Ldl::GetObject(s_scenarioEditorBlock, "CivControls.Nation");
                
                	Assert(plgroup);
                	if(!plgroup ) return;
                
                	plgroup->Clear();
                
                
                	plgroup->SetActionFuncAndCookie(SetPlayerNation, (void *)0);
                
                
                	
                	sint32 i;
                	for(i = 0; i < g_theCivilisationDB->NumRecords(); i++) {
                		const MBCHAR *name = g_theStringDB->GetNameStr(g_theCivilisationDB->Get(i)->GetCountryName());
                
                		
                		AddDropDownItem(plgroup, "ScenNationItem", (MBCHAR *)name);
                
                
                
                	}
                
                	Player *p = g_player[g_selected_item->GetVisiblePlayer()];
                	if(p) {
                		 
                		plgroup->SetSelectedItem(p->m_civilisation->GetCivilisation()); 
                
                		m_placeNationFlag = p->m_civilisation->GetCivilisation();
                
                		ctp2_TextField *tf = (ctp2_TextField *)aui_Ldl::GetObject(s_scenarioEditorBlock, "CivExtraControls.LeaderField");
                		Assert(tf);
                		if(tf) {
                			tf->SetFieldText(p->m_civilisation->GetLeaderName());
                		}
                
                	}
                
                	
                	
                	ctp2_DropDown *govs = (ctp2_DropDown *)aui_Ldl::GetObject(s_scenarioEditorBlock, "TabGroup.Civ.SetGovernment");
                	for (i = 0; i < g_theGovernmentDB->NumRecords(); i++)
                	{
                		AddDropDownItem(govs, "ScenNationItem", (MBCHAR *)g_theStringDB->GetNameStr(g_theGovernmentDB->GetName(i)) );
                	}
                
                	if (p)
                	{
                		
                		ctp2_DropDown *govs = (ctp2_DropDown *)aui_Ldl::GetObject(s_scenarioEditorBlock, "TabGroup.Civ.SetGovernment");
                		govs->SetSelectedItem(p->GetGovernmentType());
                	}
                
                	
                	UpdatePlayerSelect();
                
                }
                
                void SPNewGameWindow::SetPlayerNation(aui_Control *control, uint32 action, uint32 data, void *cookie)
                {
                	if(action != AUI_DROPDOWN_ACTION_SELECT) return;
                	
                	if(!s_scenarioEditor || s_scenarioEditor->m_initializing)
                		return;
                
                	ctp2_DropDown *dd = (ctp2_DropDown *)control;
                
                	sint32 nation = dd->GetSelectedItem(); 
                
                	Player *p = g_player[g_selected_item->GetVisiblePlayer()];
                
                	switch(s_scenarioEditor->m_startLocMode) {
                		case SCEN_START_LOC_MODE_NONE:
                		case SCEN_START_LOC_MODE_PLAYER:
                		case SCEN_START_LOC_MODE_PLAYER_WITH_CIV:
                		{
                			if(!p) return;
                			p->m_civilisation->ResetCiv((CIV_INDEX)nation, p->m_civilisation->GetGender());
                			
                			ctp2_TextField *tf = (ctp2_TextField *)aui_Ldl::GetObject(s_scenarioEditorBlock, "CivExtraControls.LeaderField");
                			Assert(tf);
                			if(tf) {
                				tf->SetFieldText(p->m_civilisation->GetLeaderName());
                		}
                			break;
                		}
                		case SCEN_START_LOC_MODE_CIV:
                		{
                			s_scenarioEditor->m_placeNationFlag = nation;
                			break;
                		}
                	}
                	
                
                	
                	
                	UpdatePlayerSelect();
                
                }

                graphic is a mock up only, I'm no where near making this real yet
                Attached Files
                Formerly known as "E" on Apolyton

                See me at Civfanatics.com

                Comment


                • #9
                  with much angst I added these methods:

                  Code:
                  void spnewgamescreen_SetupNations()
                  {	
                  	ctp2_DropDown *plgroup = (ctp2_DropDown *)aui_Ldl::GetObject("CivSelect");
                  
                  	Assert(plgroup);
                  	if(!plgroup ) return;
                  
                  	plgroup->Clear();
                  
                  
                  	plgroup->SetActionFuncAndCookie(spnewgamescreen_SetPlayerNation, (void *)0);
                  
                  
                  	sint32 i;
                  	for(i = 0; i < g_theCivilisationDB->NumRecords(); i++) {
                  		const MBCHAR *name = g_theStringDB->GetNameStr(g_theCivilisationDB->Get(i)->GetCountryName());
                  
                  		
                  		spnewgamescreen_AddDropDownItem(plgroup, "ScenNationItem", (MBCHAR *)name);
                  
                  
                  	}
                  
                  }
                  
                  void spnewgamescreen_SetPlayerNation(aui_Control *control, uint32 action, uint32 data, void *cookie)
                  {
                  	spnewgamescreen_SetupNations();
                  
                  	if(action != AUI_DROPDOWN_ACTION_SELECT) return;
                  	
                  	ctp2_DropDown *dd = (ctp2_DropDown *)control;
                  
                  	sint32 nation = dd->GetSelectedItem(); 
                  	const sint32 size = 100;
                  	MBCHAR lname[ size + 1 ];
                  
                  	spnewgametribescreen_getLeaderName( lname );
                  
                  	spnewgametribescreen_setTribeIndex( nation, lname ); //emod added from spnewgametribescreen to circumvent but not replace.
                  
                  
                  }
                  
                  void spnewgamescreen_AddDropDownItem(ctp2_DropDown *dd, MBCHAR *ldlblock, const char * item)
                  {
                  	ctp2_ListItem * listItem    = static_cast
                          (aui_Ldl::BuildHierarchyFromRoot((MBCHAR *)ldlblock));
                  	ctp2_Static *   label       = static_cast
                          (listItem->GetChildByIndex(0));
                  
                  	label->SetText(item);
                  	dd->AddItem(listItem);
                  }
                  and this to the ldl

                  Code:
                  	CivSelect:CTP2_DROPDOWN {
                  			int xpix 310
                  			int ypix 80
                  			int widthpix 180
                  			int heightpix 39
                  			string statustext "str_ldl_ROMANS"
                  			string tipwindow "str_SE_Nation"
                  		}
                  ScenNationItem:CTP2_LIST_ITEM:CTP2_STANDARD_FONT {
                  	int widthpix 120
                  	int heightpix 22
                  
                  	box:CTP2_STANDARD_FONT {
                  		string objecttype "ctp2_static"
                  		string textblttype "center"
                  		string just        "center"
                  		bool vertcenter    true
                  		int widthpix 120
                  		int heightpix 18
                  	}
                  }

                  it starts etc but the dropdown doesnt appear its just blank. i also removed all m_spTribe button references

                  and this on line 159 is spnewgamewindow.cpp

                  Code:
                  	aui_Ldl::SetActionFuncAndCookie( ldlBlock, "CivSelect", spnewgamescreen_SetPlayerNation, NULL); //make a dropdown
                  I've attached the modified file sfor those interested.

                  still confused. i kind of wished it crashed so i knew where the problem was
                  Attached Files
                  Formerly known as "E" on Apolyton

                  See me at Civfanatics.com

                  Comment


                  • #10
                    E,

                    How about something like this? (I think this is what you meant first)



                    We could get new diplomat photos from wikipedia (non-commercial purpose), this one (Mexican Coat of Arms) looks fine for the Aztec Empire. http://en.wikipedia.org/wiki/Image:Mexico_COA.svg

                    However, would be nice also having another screen to select the AI's civilization
                    Last edited by LemurMadness; April 9, 2007, 11:30.

                    Comment


                    • #11
                      Lemur,

                      That looks like agood concept. I am hoping to find a way to pick your opponents at start-up too.

                      Unfortunately, the interface code is pretty jumbled therer is a lot of CTP1 left in there that is unused and it duplicates other code so it gets confusing. Plus I have yet to get a listbox or anything working. I had to do the entire rules screen code to get it to work (copying gameplay and graphics screen code). I hope I don't have to do it for this.

                      For leaderheads I just took flags from wikipedia. You'll be suprised to kno wthta I did take the mexico coat of arms and put it on a dark red flag to make an aztec flag (it looks pretty cool IMHO).

                      I'll probabaly put that stuff up soon.
                      Formerly known as "E" on Apolyton

                      See me at Civfanatics.com

                      Comment

                      Working...
                      X