Ooooookay, many thanks it works ! Effectively, I was doing a LOT of inutile things, that was easier than I expected...
Thanks again !
Thanks again !
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
int nombreBoutons = 0;
Button* boutons[9];
Button *Buttonpoint;
for (int n = 0; n < 9; n++){
GUIControl *control = gAffichageRessourcesColonie.Controls[n];
if (control.AsButton != null) {
boutons[nombreBoutons].Buttonpoint.Visible=false;
nombreBoutons++;
}
}
Button* boutons = new Button[myGui.ControlCount];
int nombreBoutons = 0;
for (int n = 0; n < myGui.ControlCount; n++){
GUIControl *control = myGui.Controls[n];
if (control.AsButton != null) {
boutons[nombreBoutons] = control.AsButton;
nombreBoutons++;
}
}
boutonvisible=Random(nombreBoutons - 1) + 1 // to not choose the button with ID=0
boutons[boutonvisible].Visible=true;
Button* boutons = new Button[myGui.ControlCount];
int nombreBoutons = 0;
for (int n = 0; n < myGui.ControlCount; n++){
GUIControl *control = myGui.Controls[n];
if (control.AsButton != null) {
boutons[nombreBoutons] = control.AsButton;
nombreBoutons++;
}
}
for (int m = 0; n < nombreBoutons ; m++)
{
boutons[m].Visible=false;
}
function OKpersotrouve_OnClick(GUIControl *control, MouseButton button) // I need to reinitialize the array when I click on this button
{
persosexpedition = null;
persosexpedition = new Character(MAXPERSOSEXPEDITION);
for (i=0 ; i < nbpersosexpedition ; i++) // nbpersosexpedition is the variable which counts how many characters have been selected to go in expedition
if (persosexpedition[i].Room==7) // THIS LINE CRASHES, don't know why...
// persosexpedition[i] is positionned correctly in the room 7
{
int PosX = 58; // Position X de base à définir
for (int s=0 ; s < nbpersosexpedition ; s++)
{
if (persosexpedition[s].Room == 6) // si le character est présent dans la room je le positionne
{
if (s<16)
{
persosexpedition[s].x = PosX;
persosexpedition[s].y = 950;
PosX += 95 ; // Décalage horizontal en pixels pour le prochain
}
if (s>=16)
{
persosexpedition[s].x = PosX;
persosexpedition[s].y = 1070;
PosX += 95 ;
}
}
}
}
void AjouteDansExpedition(this Character*)
{
if ( indexpersosexpedition < MAXPERSOSEXPEDITION)
{
persosexpedition[indexpersosexpedition] = this; // ajoute le character dans le tableau
indexpersosexpedition++; // passe à l'index suivant
}
}
function cAmy_AnyClick()
{
if (mouse.Mode==eModeWalkto)
{
playerID=cAmy.GetProperty("PersonnageID");
if (personnage[playerID].Zombivant==0)
{
gInterfacepersos.Visible=true;
Fondinterfacepersos.NormalGraphic=1517;
Interfacepersonom.Text=personnage[playerID].Nom;
}
else
{
gInterfacepersoszombivant.Visible=true;
Fondinterfacepersoszombivant.NormalGraphic=1527;
Interfacezombinom.Text=personnage[playerID].Nom;
}
}
else
{
playerID=cAmy.GetProperty("PersonnageID");
if (personnage[playerID].Expedition==false)
{
nbpersosexpedition++;
personnage[playerID].Expedition=true;
personnage[playerID].CHAR_FRAME=24;
personnage[playerID].Acteur.LockViewFrame(personnage[playerID].CHAR_VIEW, personnage[playerID].CHAR_LOOP, personnage[playerID].CHAR_FRAME);
}
else
{
nbpersosexpedition--;
personnage[playerID].Expedition=false;
personnage[playerID].Changementetat();
personnage[playerID].Acteur.LockViewFrame(personnage[playerID].CHAR_VIEW, personnage[playerID].CHAR_LOOP, personnage[playerID].CHAR_FRAME);
}
}
}
Sorry I'm surely not clear enough, I'm going eat something and aybe it will be better after...
int nbpersoscolonie; // counts the number of characters that appear in the room
Character* persoscolonie[]; // the character array
function OK_OnClick(button* OK_button)
{
if [amy has been selected]
{
cAmy.ChangeRoom(6);
persoscolonie[nbpersoscolonie]=cAmy;
nbpersoscolonie++;
}
// and again for each of the 50 characters, so the 6 selected characters are identified and placed in room 6
void UpdatePositionsJoueurs()
{
int PosX = 13; // X coord. basic (for the 1st character)
for (int s=0 ; s < nbpersoscolonie ; s++)
{
if (persoscolonie[s].Room == 6) // if this character is in room 6, he will be placed correctly
{
if (s<20) // because if the player has a team with more than 20 characters, they will be placed on two lines. So there is the first line
{
persoscolonie[s].x = PosX;
persoscolonie[s].y = 840;
PosX += 95 ; // Décalage horizontal en pixels pour le prochain
}
if (s>=20) // second line if needed
{
persoscolonie[s].x = PosX;
persoscolonie[s].y = 960;
}
}
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.053 seconds with 14 queries.