Advertisement
Mr-A

A-Engine <interface.cpp> v0.07

Aug 5th, 2014
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 68.28 KB | None | 0 0
  1. //==========Interface.cpp===========
  2.  
  3.  
  4. #include "Interface.h"
  5. #include <math.h>
  6. #include "Eval.h"
  7. #include "globals.h"
  8.  
  9.  
  10. struct comp_by_zpos
  11. {
  12.     //bool operator() (const objcopy * lhs, const objcopy * rhs) { return lhs->posz < rhs->posz; }
  13.     bool operator() (const objcopy * lhs, const objcopy * rhs)
  14.     {
  15.         if (lhs->rndrbackid!=4321 && rhs->rndrbackid!=4321)
  16.         {
  17.             if (lhs->deleteobj)
  18.                 return true;
  19.             else if (rhs->deleteobj)
  20.                 return false;
  21.             if (lhs->rndrngpriority!=rhs->rndrngpriority)
  22.             {
  23.                 return lhs->rndrngpriority > rhs->rndrngpriority;
  24.             }
  25.             else
  26.             {
  27.                 return lhs->posz <= rhs->posz;
  28.             }
  29.         }
  30.         if (lhs->rndrbackid!=4321) return false;
  31.         if (rhs->rndrbackid!=4321) return true;
  32.  
  33.         if (lhs->deleteobj&&rhs->deleteobj) return false;
  34.         if (lhs->deleteobj) return false;
  35.         if (rhs->deleteobj) return true;
  36.         if (lhs->rndrngpriority!=rhs->rndrngpriority)
  37.         {
  38.             return lhs->rndrngpriority > rhs->rndrngpriority;
  39.         }
  40.         else
  41.         {
  42.             return lhs->posz <= rhs->posz;
  43.         }
  44.     }
  45. };
  46.  
  47.  
  48. void BlitTexture(spritegrid griddy, int x, int y)
  49. {
  50.     glBindTexture( GL_TEXTURE_2D, griddy.grid );
  51.  
  52.     glBegin(GL_QUADS);
  53.     glTexCoord2f(0, 0);
  54.     glVertex2f(x, y);
  55.  
  56.     glTexCoord2f(1, 0);
  57.     glVertex2f(x+griddy.gw, y);
  58.  
  59.     glTexCoord2f(1, 1);
  60.     glVertex2f(x+griddy.gw, y+griddy.gh);
  61.  
  62.     glTexCoord2f(0, 1);
  63.     glVertex2f(x, y+griddy.gh);
  64.     glEnd();
  65.  
  66.     glColor4f(1.0f, 1.f, 1.f, 1.0f);
  67. }
  68.  
  69.  
  70. LoadMenuStuff::LoadMenuStuff(LOAD * LOADED)
  71. {
  72.     //initiate input data
  73.     P_INPUTDATA.resize(4);
  74.     P_INPUTDATA[0].resize(8);         //player 1 data
  75.     P_INPUTDATA[1].resize(8);         //player 2 data
  76.     P_INPUTDATA[2].resize(8);         //player 3 data
  77.     P_INPUTDATA[3].resize(8);         //player 4 data
  78.     for (int a=0; a<4; a++)
  79.     {
  80.         for (int b=0; b<8; b++)
  81.         {
  82.             P_INPUTDATA[a][b]=0;
  83.         }
  84.     }
  85.  
  86.     //initiate _menusdata
  87.     _menusdata.initLite();
  88.     _menusdata.LoadLOADTXTLite(); //this function loads everything but the content of load.txt
  89.  
  90.     //Load system.a
  91.     fstream SYS_FILE("obj\\system.a");
  92.     std::string tempqwer; //stores the the data of a statement in the tag
  93.     std::string tempabcd; //stores the content of a tag inside {}
  94.     std::string tempasdf; //stores the lines of a tag..etc
  95.     std::string systemd;  //stores the whole text in system.a
  96.     size_t tagposition;
  97.  
  98.     while (SYS_FILE.good())
  99.     {
  100.         getline(SYS_FILE, tempasdf);
  101.         systemd += tempasdf; //add lines of system.a into this var
  102.     }
  103.  
  104.  
  105.     if (systemd.find("{selection_menu}")!=std::string::npos)  //if this tag was found in system.a
  106.     {
  107.         //set tempasdf to the content of the tag
  108.         tempasdf=systemd.substr(systemd.find("{selection_menu}")+16, systemd.find("{/selection_menu}")-16-systemd.find("{selection_menu}"));
  109.     }
  110.  
  111.     tagposition=tempasdf.find("menu_bg=");
  112.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  113.     {
  114.         tempqwer=tempasdf.substr(tagposition+8, tempasdf.find(";", tagposition)-8-tagposition);  //content of the tag
  115.  
  116.         //we actually load the bg into _menusdata
  117.         _menusdata.LoadBG(tempqwer, 0);
  118.     }
  119.  
  120.     tagposition=tempasdf.find("click_to_join=");
  121.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  122.     {
  123.         tempqwer=tempasdf.substr(tagposition+14, tempasdf.find(";", tagposition)-14-tagposition);//content of the tag
  124.  
  125.         //Load A.file to _menusdata
  126.         _menusdata.LoadOBJ(tempqwer, 0);
  127.         _menusdata.OBJECTS[0].LOADED=&_menusdata;
  128.     }
  129.  
  130.     tagposition=tempasdf.find("highlight1=");
  131.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  132.     {
  133.         tempqwer=tempasdf.substr(tagposition+11, tempasdf.find(";", tagposition)-11-tagposition);//content of the tag
  134.  
  135.         //we load the highlight .a file into _menusdata
  136.         _menusdata.LoadOBJ(tempqwer,1);
  137.         _menusdata.OBJECTS[1].LOADED=&_menusdata;
  138.     }
  139.     tagposition=tempasdf.find("highlight2=");
  140.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  141.     {
  142.         tempqwer=tempasdf.substr(tagposition+11, tempasdf.find(";", tagposition)-11-tagposition);//content of the tag
  143.  
  144.         //we load the highlight .a file into _menusdata
  145.         _menusdata.LoadOBJ(tempqwer,2);
  146.         _menusdata.OBJECTS[2].LOADED=&_menusdata;
  147.     }
  148.     tagposition=tempasdf.find("highlight3=");
  149.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  150.     {
  151.         tempqwer=tempasdf.substr(tagposition+11, tempasdf.find(";", tagposition)-11-tagposition);//content of the tag
  152.  
  153.         //we load the highlight .a file into _menusdata
  154.         _menusdata.LoadOBJ(tempqwer,3);
  155.         _menusdata.OBJECTS[3].LOADED=&_menusdata;
  156.     }
  157.     tagposition=tempasdf.find("highlight4=");
  158.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  159.     {
  160.         tempqwer=tempasdf.substr(tagposition+11, tempasdf.find(";", tagposition)-11-tagposition);//content of the tag
  161.  
  162.         //we load the highlight .a file into _menusdata
  163.         _menusdata.LoadOBJ(tempqwer,4);
  164.         _menusdata.OBJECTS[4].LOADED=&_menusdata;
  165.     }
  166.  
  167.     tagposition=tempasdf.find("common=");
  168.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  169.     {
  170.         tempqwer=tempasdf.substr(tagposition+7, tempasdf.find(";", tagposition)-7-tagposition);//content of the tag
  171.  
  172.         //we load the common .a file into _menusdata
  173.         _menusdata.LoadOBJ(tempqwer,5);
  174.         _menusdata.OBJECTS[5].LOADED=&_menusdata;
  175.     }
  176.  
  177.     tagposition=tempasdf.find("stance=");
  178.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  179.     {
  180.         tempqwer=tempasdf.substr(tagposition+7, tempasdf.find(";", tagposition)-7-tagposition);//content of the tag
  181.  
  182.         //we load the common .a file into _menusdata
  183.         _menusdata.LoadOBJ(tempqwer,6);
  184.         _menusdata.OBJECTS[6].LOADED=&_menusdata;
  185.     }
  186.  
  187.     tagposition=tempasdf.find("stageselect_key=");
  188.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  189.     {
  190.         tempqwer=tempasdf.substr(tagposition+16, tempasdf.find(";", tagposition)-16-tagposition);//content of the tag
  191.         _bg_key=Evaluate(tempqwer);
  192.     }
  193.     tagposition=tempasdf.find("init_char_key1=");
  194.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  195.     {
  196.         tempqwer=tempasdf.substr(tagposition+15, tempasdf.find(";", tagposition)-15-tagposition);//content of the tag
  197.         SelectionCurr_key[0]=Evaluate(tempqwer);
  198.     }
  199.     tagposition=tempasdf.find("init_char_key2=");
  200.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  201.     {
  202.         tempqwer=tempasdf.substr(tagposition+15, tempasdf.find(";", tagposition)-15-tagposition);//content of the tag
  203.         SelectionCurr_key[1]=Evaluate(tempqwer);
  204.     }
  205.     tagposition=tempasdf.find("init_char_key3=");
  206.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  207.     {
  208.         tempqwer=tempasdf.substr(tagposition+15, tempasdf.find(";", tagposition)-15-tagposition);//content of the tag
  209.         SelectionCurr_key[2]=Evaluate(tempqwer);
  210.     }
  211.     tagposition=tempasdf.find("init_char_key4=");
  212.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  213.     {
  214.         tempqwer=tempasdf.substr(tagposition+15, tempasdf.find(";", tagposition)-15-tagposition);//content of the tag
  215.         SelectionCurr_key[3]=Evaluate(tempqwer);
  216.     }
  217.  
  218.     tagposition=tempasdf.find("next_button=");
  219.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  220.     {
  221.         tempqwer=tempasdf.substr(tagposition+12, tempasdf.find(";", tagposition)-12-tagposition);//content of the tag
  222.  
  223.         if ("<u_a>"==tempqwer)  tempqwer="0";
  224.         if ("<d_a>"==tempqwer)  tempqwer="1";
  225.         if ("<l_a>"==tempqwer)  tempqwer="2";
  226.         if ("<r_a>"==tempqwer)  tempqwer="3";
  227.         if ("<a>"==tempqwer)  tempqwer="4";
  228.         if ("<d>"==tempqwer)  tempqwer="5";
  229.         if ("<j>"==tempqwer)  tempqwer="6";
  230.         if ("<s>"==tempqwer)  tempqwer="7";
  231.  
  232.         _nextbutton=Evaluate(tempqwer);
  233.     }
  234.     tagposition=tempasdf.find("back_button=");
  235.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  236.     {
  237.         tempqwer=tempasdf.substr(tagposition+12, tempasdf.find(";", tagposition)-12-tagposition);//content of the tag
  238.         if ("<u_a>"==tempqwer)  tempqwer="0";
  239.         if ("<d_a>"==tempqwer)  tempqwer="1";
  240.         if ("<l_a>"==tempqwer)  tempqwer="2";
  241.         if ("<r_a>"==tempqwer)  tempqwer="3";
  242.         if ("<a>"==tempqwer)  tempqwer="4";
  243.         if ("<d>"==tempqwer)  tempqwer="5";
  244.         if ("<j>"==tempqwer)  tempqwer="6";
  245.         if ("<s>"==tempqwer)  tempqwer="7";
  246.         _backbutton=Evaluate(tempqwer);
  247.     }
  248.  
  249.     tagposition=tempasdf.find("init_bg_key=");
  250.     if (tagposition!=std::string::npos)                                                                  //if the tag was found
  251.     {
  252.         tempqwer=tempasdf.substr(tagposition+12, tempasdf.find(";", tagposition)-12-tagposition);//content of the tag
  253.         _currbgkey=Evaluate(tempqwer);
  254.     }
  255.  
  256.     for (int a=1; a<11; a++)
  257.     {
  258.         tagposition=tempasdf.find("player_origin"+stringify(a)+"=");
  259.         if (tagposition!=std::string::npos)                                                                  //if the tag was found
  260.         {
  261.             tempqwer=tempasdf.substr(tagposition+14+stringify(a).length(), tempasdf.find(";", tagposition)-(14+stringify(a).length())-tagposition);//content of the tag
  262.             LOADED->_playermenuorigins[(a-1)*2]=Evaluate(tempqwer.substr(0, tempqwer.find(",")));                          //Evaluate the first x parameter and assign it
  263.             LOADED->_playermenuorigins[1+((a-1)*2)]=Evaluate(tempqwer.substr(tempqwer.find(",")+1));                       //Evaluate the second y parameter and assign it
  264.         }
  265.     }
  266.  
  267.     for (int a=1; a<5; a++)
  268.     {
  269.         size_t tagposition=tempasdf.find("click_to_join"+stringify(a)+"[");                                          //store the position of the tag
  270.         if (tagposition!=std::string::npos)                                                                  //if this tag was found in the {selection_menu} block
  271.         {
  272.  
  273.             tempabcd=tempasdf.substr(tagposition+15, tempasdf.find("]", tagposition)-15-tagposition);//copy the content of "click_to_join[]"
  274.             tempasdf.erase(tagposition, tempasdf.find("]", tagposition)-tagposition+1);              //erase what copied
  275.             tagposition=tempabcd.find("when_join=");                                                 //store the position of the tag "when_join="
  276.             tempqwer=tempabcd.substr(tagposition+10, tempabcd.find(";", tagposition)-10-tagposition);//content of tag "when_join="
  277.             _clicktojoinfrms[a+4-1]=Evaluate(tempqwer);
  278.  
  279.             tagposition=tempabcd.find("position=");                                                  //store the position of the tag "position="
  280.             tempqwer=tempabcd.substr(tagposition+9, tempabcd.find(";", tagposition)-9-tagposition);  //content of tag "position="
  281.  
  282.             _clicktojoinpos[a-1]=Evaluate(tempqwer.substr(0, tempqwer.find(",")));                           //Evaluate the first x parameter and assign it
  283.             _clicktojoinpos[a+4-1]=Evaluate(tempqwer.substr(tempqwer.find(",")+1));                          //Evaluate the second y parameter and assign it
  284.  
  285.             tagposition=tempabcd.find("init_frame=");
  286.             tempqwer=tempabcd.substr(tagposition+11, tempabcd.find(";", tagposition)-11-tagposition);//content of tag "init_frame="
  287.             _clicktojoinfrms[a-1]=Evaluate(tempqwer);
  288.  
  289.             //_menusdata.CreateOBJECTCOPY(0, tempposx, tempposy, Evaluate(tempqwer));
  290.  
  291.         }
  292.     }
  293.  
  294.  
  295.     for (int a=1; a<5; a++)
  296.     {
  297.         size_t tagposition=tempasdf.find("highlight"+stringify(a)+"[");                          //store the position of the tag
  298.         if (tagposition!=std::string::npos)                                                                  //if this tag was found in the {selection_menu} block
  299.         {
  300.  
  301.             tempabcd=tempasdf.substr(tagposition+11, tempasdf.find("]", tagposition)-11-tagposition);//copy the content of "highlight[]"
  302.             tempasdf.erase(tagposition, tempasdf.find("]", tagposition)-tagposition+1);              //erase what copied
  303.             tagposition=tempabcd.find("when_choose=");                                               //store the position of the tag "when_choose="
  304.             tempqwer=tempabcd.substr(tagposition+12, tempabcd.find(";", tagposition)-12-tagposition);//content of tag "when_choose="
  305.             _highlightframes[a+4-1]=Evaluate(tempqwer);
  306.  
  307.  
  308.             tagposition=tempabcd.find("init_frame=");
  309.             tempqwer=tempabcd.substr(tagposition+11, tempabcd.find(";", tagposition)-11-tagposition);//content of tag "init_frame="
  310.             _highlightframes[a-1]=Evaluate(tempqwer);
  311.         }
  312.     }
  313.  
  314.  
  315.     tagposition=tempasdf.find("[id=");
  316.     while (tagposition!=std::string::npos)
  317.     {
  318.         tempabcd=tempasdf.substr(tagposition,tempasdf.find("[/id]",tagposition)-tagposition);          //copy the content of "[id=x][/d]"
  319.         tagposition=tempabcd.find("key=");                                                                 //store the position of the tag "key="
  320.         tempqwer=tempabcd.substr(tagposition+4, tempabcd.find(";", tagposition)-4-tagposition);            //content of tag "key="
  321.         Chars_index=Evaluate(tempqwer);
  322.         Chars[Chars_index].flags[0]=tempabcd.find("|USEPLAYERORIGIN|")!=std::string::npos?true:false;           //we check the switch and declare true or false
  323.         Chars[Chars_index].key=Chars_index;                                                                //Evaluate and assign
  324.         tempasdf.erase(tempasdf.find("[id="), tempasdf.find("[/id]", tagposition)-tempasdf.find("[id=")+1);//erase what copied
  325.         tagposition=tempabcd.find("[id=");                                                                 //store the position of the tag "[id="
  326.         tempqwer=tempabcd.substr(tagposition+4, tempabcd.find("]", tagposition)-4-tagposition);            //content of tag "[id="
  327.         Chars[Chars_index].id=Evaluate(tempqwer);                                                          //Evaluate the parameter and assign it
  328.  
  329.  
  330.         tagposition=tempabcd.find("highlight_position=");                                                  //store the position of the tag "position="
  331.         tempqwer=tempabcd.substr(tagposition+19, tempabcd.find(";", tagposition)-19-tagposition);          //content of tag "position="
  332.         Chars[Chars_index].posx=Evaluate(tempqwer.substr(0, tempqwer.find(",")));                          //Evaluate the first x parameter and assign it
  333.         Chars[Chars_index].posy=Evaluate(tempqwer.substr(tempqwer.find(",")+1));                           //Evaluate the second y parameter and assign it
  334.  
  335.  
  336.         tagposition=tempabcd.find("left=");                                                                //store the position of the tag "left="
  337.         if (tagposition!=std::string::npos)
  338.         {
  339.             tempqwer=tempabcd.substr(tagposition+5, tempabcd.find(";", tagposition)-5-tagposition);        //content of tag "left="
  340.             Chars[Chars_index].left=Evaluate(tempqwer);                                                    //Evaluate and assign
  341.         }
  342.  
  343.         tagposition=tempabcd.find("right=");                                                               //store the position of the tag "right="
  344.         if (tagposition!=std::string::npos)
  345.         {
  346.             tempqwer=tempabcd.substr(tagposition+6, tempabcd.find(";", tagposition)-6-tagposition);        //content of tag "right="
  347.             Chars[Chars_index].right=Evaluate(tempqwer);                                                   //Evaluate and assign
  348.         }
  349.  
  350.         tagposition=tempabcd.find("up=");                                                                  //store the position of the tag "up="
  351.         if (tagposition!=std::string::npos)
  352.         {
  353.             tempqwer=tempabcd.substr(tagposition+3, tempabcd.find(";", tagposition)-3-tagposition);        //content of tag "up="
  354.             Chars[Chars_index].up=Evaluate(tempqwer);                                                      //Evaluate and assign
  355.         }
  356.  
  357.         tagposition=tempabcd.find("down=");                                                                //store the position of the tag "down="
  358.         if (tagposition!=std::string::npos)
  359.         {
  360.             tempqwer=tempabcd.substr(tagposition+5, tempabcd.find(";", tagposition)-5-tagposition);        //content of tag "down="
  361.             Chars[Chars_index].down=Evaluate(tempqwer);                                                    //Evaluate and assign
  362.         }
  363.  
  364.         tagposition=tempabcd.find("when_highlight=");                                                      //store the position of the tag "when_highlight="
  365.         if (tagposition!=std::string::npos)
  366.         {
  367.             tempqwer=tempabcd.substr(tagposition+15, tempabcd.find(";", tagposition)-15-tagposition);      //content of tag "when_highlight="
  368.             Chars[Chars_index].highlight=Evaluate(tempqwer);                                               //Evaluate and assign
  369.         }
  370.         tagposition=tempabcd.find("when_choose=");                                                         //store the position of the tag "when_choose="
  371.         if (tagposition!=std::string::npos)
  372.         {
  373.             tempqwer=tempabcd.substr(tagposition+12, tempabcd.find(";", tagposition)-12-tagposition);      //content of tag "when_choose="
  374.             Chars[Chars_index].whenchoose=Evaluate(tempqwer);                                              //Evaluate and assign
  375.         }
  376.  
  377.  
  378.         tagposition=tempabcd.find("show_stance=");                                                         //store the position of the tag "show_stance="
  379.         if (tagposition!=std::string::npos)
  380.         {
  381.             tempqwer=tempabcd.substr(tagposition+12, tempabcd.find(";", tagposition)-12-tagposition);      //content of tag "show_stance="
  382.             Chars[Chars_index]._showstance=Evaluate(tempqwer);                                              //Evaluate and assign
  383.         }
  384.  
  385.         tagposition=tempabcd.find("destroy_stance=");                                                          //store the position of the tag "show_stance="
  386.         if (tagposition!=std::string::npos)
  387.         {
  388.             tempqwer=tempabcd.substr(tagposition+15, tempabcd.find(";", tagposition)-15-tagposition);      //content of tag "destroy_stance="
  389.             Chars[Chars_index]._destroystance=Evaluate(tempqwer);                                              //Evaluate and assign
  390.         }
  391.  
  392.         tagposition=tempabcd.find("disjoin=");                                                         //store the position of the tag "show_stance="
  393.         if (tagposition!=std::string::npos)
  394.         {
  395.             tempqwer=tempabcd.substr(tagposition+8, tempabcd.find(";", tagposition)-8-tagposition);      //content of tag "disjoin="
  396.             Chars[Chars_index]._disjoin=Evaluate(tempqwer);                                              //Evaluate and assign
  397.         }
  398.  
  399.         //Chars_index++;                                                                                       //done, so we increment the index value
  400.         tagposition=tempasdf.find("[id=");                                             //we check again if any other [id= tags exists
  401.     }
  402.  
  403.     tagposition=tempasdf.find("]", tempasdf.find("[bgid="));
  404.     while (tagposition!=std::string::npos)
  405.     {
  406.         tempabcd=tempasdf.substr(tagposition+1,tempasdf.find("[/bgid]",tagposition)-1-tagposition);        //copy the content of "[id=x][/d]"
  407.  
  408.         tagposition=tempabcd.find("key=");                                                                 //store the position of the tag "key="
  409.         tempqwer=tempabcd.substr(tagposition+4, tempabcd.find(";", tagposition)-4-tagposition);            //content of tag "key="
  410.         Chars_index=Evaluate(tempqwer);
  411.         Chars[Chars_index].key=Chars_index;                                                                //Evaluate and assign
  412.         tempasdf.erase(tempasdf.find("[bgid="), tempasdf.find("[/bgid]", tagposition)-tempasdf.find("[bgid=")+1);//erase what copied
  413.         tagposition=tempabcd.find("[bgid=");                                                               //store the position of the tag "[id="
  414.         tempqwer=tempabcd.substr(tagposition+6, tempabcd.find("]", tagposition)-6-tagposition);            //content of tag "[id="
  415.         Chars[Chars_index].id=Evaluate(tempqwer);                                                          //Evaluate the parameter and assign it
  416.         Chars[Chars_index].isbg=true;
  417.         Chars[Chars_index].flags[0]=tempabcd.find("|USEPLAYERORIGIN|")!=std::string::npos?true:false;           //we check the switch and declare true or false
  418.         tagposition=tempabcd.find("highlight_position=");                                                  //store the position of the tag "position="
  419.         tempqwer=tempabcd.substr(tagposition+19, tempabcd.find(";", tagposition)-19-tagposition);          //content of tag "position="
  420.         Chars[Chars_index].posx=Evaluate(tempqwer.substr(0, tempqwer.find(",")));                          //Evaluate the first x parameter and assign it
  421.         Chars[Chars_index].posy=Evaluate(tempqwer.substr(tempqwer.find(",")+1));                           //Evaluate the second y parameter and assign it
  422.  
  423.  
  424.         tagposition=tempabcd.find("left=");                                                                //store the position of the tag "left="
  425.         if (tagposition!=std::string::npos)
  426.         {
  427.             tempqwer=tempabcd.substr(tagposition+5, tempabcd.find(";", tagposition)-5-tagposition);        //content of tag "left="
  428.             Chars[Chars_index].left=Evaluate(tempqwer);                                                    //Evaluate and assign
  429.         }
  430.  
  431.         tagposition=tempabcd.find("right=");                                                               //store the position of the tag "right="
  432.         if (tagposition!=std::string::npos)
  433.         {
  434.             tempqwer=tempabcd.substr(tagposition+6, tempabcd.find(";", tagposition)-6-tagposition);        //content of tag "right="
  435.             Chars[Chars_index].right=Evaluate(tempqwer);                                                   //Evaluate and assign
  436.         }
  437.  
  438.         tagposition=tempabcd.find("up=");                                                                  //store the position of the tag "up="
  439.         if (tagposition!=std::string::npos)
  440.         {
  441.             tempqwer=tempabcd.substr(tagposition+3, tempabcd.find(";", tagposition)-3-tagposition);        //content of tag "up="
  442.             Chars[Chars_index].up=Evaluate(tempqwer);                                                      //Evaluate and assign
  443.         }
  444.  
  445.         tagposition=tempabcd.find("down=");                                                                //store the position of the tag "down="
  446.         if (tagposition!=std::string::npos)
  447.         {
  448.             tempqwer=tempabcd.substr(tagposition+5, tempabcd.find(";", tagposition)-5-tagposition);        //content of tag "down="
  449.             Chars[Chars_index].down=Evaluate(tempqwer);                                                    //Evaluate and assign
  450.         }
  451.  
  452.         tagposition=tempabcd.find("when_highlight=");                                                      //store the position of the tag "when_highlight="
  453.         if (tagposition!=std::string::npos)
  454.         {
  455.             tempqwer=tempabcd.substr(tagposition+15, tempabcd.find(";", tagposition)-15-tagposition);      //content of tag "when_highlight="
  456.             Chars[Chars_index].highlight=Evaluate(tempqwer);                                               //Evaluate and assign
  457.         }
  458.         tagposition=tempabcd.find("when_choose=");                                                         //store the position of the tag "when_choose="
  459.         if (tagposition!=std::string::npos)
  460.         {
  461.             tempqwer=tempabcd.substr(tagposition+12, tempabcd.find(";", tagposition)-12-tagposition);      //content of tag "when_choose="
  462.             Chars[Chars_index].whenchoose=Evaluate(tempqwer);                                              //Evaluate and assign
  463.         }
  464.  
  465.  
  466.         //Chars_index++;                                                                                       //done, so we increment the index value
  467.         tagposition=tempasdf.find("]", tempasdf.find("[bgid="));                                             //we check again if any other [id= tags exists
  468.     }
  469.  
  470.     tagposition=tempasdf.find("back_button[");
  471.     while (tagposition!=std::string::npos)
  472.     {
  473.         tempabcd=tempasdf.substr(tagposition+1,tempasdf.find("]",tagposition)-1-tagposition);              //copy the content of "back_button[]"
  474.         tempasdf.erase(tempasdf.find("back_button["), tempasdf.find("]", tagposition)-tempasdf.find("back_button[")+1);//erase what copied
  475.  
  476.         tagposition=tempabcd.find("key=");                                                                 //store the position of the tag "key="
  477.         tempqwer=tempabcd.substr(tagposition+4, tempabcd.find(";", tagposition)-4-tagposition);            //content of tag "key="
  478.         Chars_index=Evaluate(tempqwer);
  479.         Chars[Chars_index].key=Chars_index;                                                                //Evaluate and assign
  480.         Chars[Chars_index].id=6402;                                                        //Evaluate the parameter and assign it
  481.  
  482.         tagposition=tempabcd.find("highlight_position=");                                                  //store the position of the tag "position="
  483.         tempqwer=tempabcd.substr(tagposition+19, tempabcd.find(";", tagposition)-19-tagposition);          //content of tag "position="
  484.         Chars[Chars_index].posx=Evaluate(tempqwer.substr(0, tempqwer.find(",")));                          //Evaluate the first x parameter and assign it
  485.         Chars[Chars_index].posy=Evaluate(tempqwer.substr(tempqwer.find(",")+1));                           //Evaluate the second y parameter and assign it
  486.  
  487.  
  488.  
  489.         tagposition=tempabcd.find("left=");                                                                //store the position of the tag "left="
  490.         if (tagposition!=std::string::npos)
  491.         {
  492.             tempqwer=tempabcd.substr(tagposition+5, tempabcd.find(";", tagposition)-5-tagposition);        //content of tag "left="
  493.             Chars[Chars_index].left=Evaluate(tempqwer);                                                    //Evaluate and assign
  494.         }
  495.  
  496.         tagposition=tempabcd.find("right=");                                                               //store the position of the tag "right="
  497.         if (tagposition!=std::string::npos)
  498.         {
  499.             tempqwer=tempabcd.substr(tagposition+6, tempabcd.find(";", tagposition)-6-tagposition);        //content of tag "right="
  500.             Chars[Chars_index].right=Evaluate(tempqwer);                                                   //Evaluate and assign
  501.         }
  502.  
  503.         tagposition=tempabcd.find("up=");                                                                  //store the position of the tag "up="
  504.         if (tagposition!=std::string::npos)
  505.         {
  506.             tempqwer=tempabcd.substr(tagposition+3, tempabcd.find(";", tagposition)-3-tagposition);        //content of tag "up="
  507.             Chars[Chars_index].up=Evaluate(tempqwer);                                                      //Evaluate and assign
  508.         }
  509.  
  510.         tagposition=tempabcd.find("down=");                                                                //store the position of the tag "down="
  511.         if (tagposition!=std::string::npos)
  512.         {
  513.             tempqwer=tempabcd.substr(tagposition+5, tempabcd.find(";", tagposition)-5-tagposition);        //content of tag "down="
  514.             Chars[Chars_index].down=Evaluate(tempqwer);                                                    //Evaluate and assign
  515.         }
  516.  
  517.         tagposition=tempabcd.find("when_highlight=");                                                      //store the position of the tag "when_highlight="
  518.         if (tagposition!=std::string::npos)
  519.         {
  520.             tempqwer=tempabcd.substr(tagposition+15, tempabcd.find(";", tagposition)-15-tagposition);      //content of tag "when_highlight="
  521.             Chars[Chars_index].highlight=Evaluate(tempqwer);                                               //Evaluate and assign
  522.         }
  523.         tagposition=tempabcd.find("when_choose=");                                                     //store the position of the tag "when_choose="
  524.         if (tagposition!=std::string::npos)
  525.         {
  526.             tempqwer=tempabcd.substr(tagposition+12, tempabcd.find(";", tagposition)-12-tagposition);      //content of tag "when_choose="
  527.             Chars[Chars_index].whenchoose=Evaluate(tempqwer);                                               //Evaluate and assign
  528.         }
  529.  
  530.         //Chars_index++;                                                                                       //done, so we increment the index value
  531.         tagposition=tempasdf.find("back_button[");                                             //we check again if any other [id= tags exists
  532.     }
  533.  
  534.     tagposition=tempasdf.find("gamestart_button[");
  535.     while (tagposition!=std::string::npos)
  536.     {
  537.         tempabcd=tempasdf.substr(tagposition+1,tempasdf.find("]",tagposition)-1-tagposition);              //copy the content of "menu_bg"
  538.         tempasdf.erase(tempasdf.find("gamestart_button["), tempasdf.find("]", tagposition)-tempasdf.find("gamestart_button[")+1);//erase what copied
  539.         tagposition=tempabcd.find("key=");                                                                 //store the position of the tag "key="
  540.         tempqwer=tempabcd.substr(tagposition+4, tempabcd.find(";", tagposition)-4-tagposition);            //content of tag "key="
  541.         Chars_index=Evaluate(tempqwer);
  542.         Chars[Chars_index].key=Chars_index;                                                                //Evaluate and assign
  543.         Chars[Chars_index].id=6435727;                                                         //Evaluate the parameter and assign it
  544.  
  545.  
  546.         tagposition=tempabcd.find("highlight_position=");                                                  //store the position of the tag "position="
  547.         tempqwer=tempabcd.substr(tagposition+19, tempabcd.find(";", tagposition)-19-tagposition);          //content of tag "position="
  548.         Chars[Chars_index].posx=Evaluate(tempqwer.substr(0, tempqwer.find(",")));                          //Evaluate the first x parameter and assign it
  549.         Chars[Chars_index].posy=Evaluate(tempqwer.substr(tempqwer.find(",")+1));                           //Evaluate the second y parameter and assign it
  550.  
  551.         tagposition=tempabcd.find("left=");                                                                //store the position of the tag "left="
  552.         if (tagposition!=std::string::npos)
  553.         {
  554.             tempqwer=tempabcd.substr(tagposition+5, tempabcd.find(";", tagposition)-5-tagposition);        //content of tag "left="
  555.             Chars[Chars_index].left=Evaluate(tempqwer);                                                    //Evaluate and assign
  556.         }
  557.  
  558.         tagposition=tempabcd.find("right=");                                                               //store the position of the tag "right="
  559.         if (tagposition!=std::string::npos)
  560.         {
  561.             tempqwer=tempabcd.substr(tagposition+6, tempabcd.find(";", tagposition)-6-tagposition);        //content of tag "right="
  562.             Chars[Chars_index].right=Evaluate(tempqwer);                                                   //Evaluate and assign
  563.         }
  564.  
  565.         tagposition=tempabcd.find("up=");                                                                  //store the position of the tag "up="
  566.         if (tagposition!=std::string::npos)
  567.         {
  568.             tempqwer=tempabcd.substr(tagposition+3, tempabcd.find(";", tagposition)-3-tagposition);        //content of tag "up="
  569.             Chars[Chars_index].up=Evaluate(tempqwer);                                                      //Evaluate and assign
  570.         }
  571.  
  572.         tagposition=tempabcd.find("down=");                                                                //store the position of the tag "down="
  573.         if (tagposition!=std::string::npos)
  574.         {
  575.             tempqwer=tempabcd.substr(tagposition+5, tempabcd.find(";", tagposition)-5-tagposition);        //content of tag "down="
  576.             Chars[Chars_index].down=Evaluate(tempqwer);                                                    //Evaluate and assign
  577.         }
  578.         tagposition=tempabcd.find("when_highlight=");                                                      //store the position of the tag "when_highlight="
  579.         if (tagposition!=std::string::npos)
  580.         {
  581.             tempqwer=tempabcd.substr(tagposition+15, tempabcd.find(";", tagposition)-15-tagposition);      //content of tag "when_highlight="
  582.             Chars[Chars_index].highlight=Evaluate(tempqwer);                                               //Evaluate and assign
  583.         }
  584.         tagposition=tempabcd.find("when_choose=");                                                     //store the position of the tag "when_choose="
  585.         if (tagposition!=std::string::npos)
  586.         {
  587.             tempqwer=tempabcd.substr(tagposition+12, tempabcd.find(";", tagposition)-12-tagposition);      //content of tag "when_choose="
  588.             Chars[Chars_index].whenchoose=Evaluate(tempqwer);                                               //Evaluate and assign
  589.         }
  590.         //Chars_index++;                                                                                       //done, so we increment the index value
  591.         tagposition=tempasdf.find("gamestart_button[");                                             //we check again if any other [id= tags exists                                            //we check again if any other [id= tags exists
  592.     }
  593.  
  594.  
  595.     tagposition=tempasdf.find("settings_button[");
  596.     while (tagposition!=std::string::npos)
  597.     {
  598.         tempabcd=tempasdf.substr(tagposition+1,tempasdf.find("]",tagposition)-1-tagposition);              //copy the content of "menu_bg"
  599.         tempasdf.erase(tempasdf.find("settings_button["), tempasdf.find("]", tagposition)-tempasdf.find("settings_button[")+1);//erase what copied
  600.         tagposition=tempabcd.find("key=");                                                                 //store the position of the tag "key="
  601.         tempqwer=tempabcd.substr(tagposition+4, tempabcd.find(";", tagposition)-4-tagposition);            //content of tag "key="
  602.         Chars_index=Evaluate(tempqwer);
  603.         Chars[Chars_index].key=Chars_index;                                                                //Evaluate and assign
  604.         Chars[Chars_index].id=5377195;                                                         //Evaluate the parameter and assign it
  605.  
  606.  
  607.         tagposition=tempabcd.find("highlight_position=");                                                  //store the position of the tag "position="
  608.         tempqwer=tempabcd.substr(tagposition+19, tempabcd.find(";", tagposition)-19-tagposition);          //content of tag "position="
  609.         Chars[Chars_index].posx=Evaluate(tempqwer.substr(0, tempqwer.find(",")));                          //Evaluate the first x parameter and assign it
  610.         Chars[Chars_index].posy=Evaluate(tempqwer.substr(tempqwer.find(",")+1));                           //Evaluate the second y parameter and assign it
  611.  
  612.         tagposition=tempabcd.find("left=");                                                                //store the position of the tag "left="
  613.         if (tagposition!=std::string::npos)
  614.         {
  615.             tempqwer=tempabcd.substr(tagposition+5, tempabcd.find(";", tagposition)-5-tagposition);        //content of tag "left="
  616.             Chars[Chars_index].left=Evaluate(tempqwer);                                                    //Evaluate and assign
  617.         }
  618.  
  619.         tagposition=tempabcd.find("right=");                                                               //store the position of the tag "right="
  620.         if (tagposition!=std::string::npos)
  621.         {
  622.             tempqwer=tempabcd.substr(tagposition+6, tempabcd.find(";", tagposition)-6-tagposition);        //content of tag "right="
  623.             Chars[Chars_index].right=Evaluate(tempqwer);                                                   //Evaluate and assign
  624.         }
  625.  
  626.         tagposition=tempabcd.find("up=");                                                                  //store the position of the tag "up="
  627.         if (tagposition!=std::string::npos)
  628.         {
  629.             tempqwer=tempabcd.substr(tagposition+3, tempabcd.find(";", tagposition)-3-tagposition);        //content of tag "up="
  630.             Chars[Chars_index].up=Evaluate(tempqwer);                                                      //Evaluate and assign
  631.         }
  632.  
  633.         tagposition=tempabcd.find("down=");                                                                //store the position of the tag "down="
  634.         if (tagposition!=std::string::npos)
  635.         {
  636.             tempqwer=tempabcd.substr(tagposition+5, tempabcd.find(";", tagposition)-5-tagposition);        //content of tag "down="
  637.             Chars[Chars_index].down=Evaluate(tempqwer);                                                    //Evaluate and assign
  638.         }
  639.         tagposition=tempabcd.find("when_highlight=");                                                      //store the position of the tag "when_highlight="
  640.         if (tagposition!=std::string::npos)
  641.         {
  642.             tempqwer=tempabcd.substr(tagposition+15, tempabcd.find(";", tagposition)-15-tagposition);      //content of tag "when_highlight="
  643.             Chars[Chars_index].highlight=Evaluate(tempqwer);                                               //Evaluate and assign
  644.         }
  645.         tagposition=tempabcd.find("when_choose=");                                                     //store the position of the tag "when_choose="
  646.         if (tagposition!=std::string::npos)
  647.         {
  648.             tempqwer=tempabcd.substr(tagposition+12, tempabcd.find(";", tagposition)-12-tagposition);      //content of tag "when_choose="
  649.             Chars[Chars_index].whenchoose=Evaluate(tempqwer);                                               //Evaluate and assign
  650.         }
  651.         //Chars_index++;                                                                                       //done, so we increment the index value
  652.         tagposition=tempasdf.find("settings_button[");                                             //we check again if any other [id= tags exists                                            //we check again if any other [id= tags exists
  653.     }
  654.  
  655.  
  656.     _menusdata.CreateOBJECTCOPY(0, _clicktojoinpos[0], _clicktojoinpos[4], _clicktojoinfrms[0]);
  657.     _menusdata.CreateOBJECTCOPY(1, 10000, 10000, _highlightframes[0]);
  658.     _menusdata.CreateOBJECTCOPY(2, 10000, 10000, _highlightframes[1]);
  659.     _menusdata.CreateOBJECTCOPY(3, 10000, 10000, _highlightframes[2]);
  660.     _menusdata.CreateOBJECTCOPY(4, 10000, 10000, _highlightframes[3]);
  661.  
  662.     _menusdata.CreateOBJECTCOPY(6, 10000, 10000, 0);
  663.     _menusdata.CreateOBJECTCOPY(6, 10000, 10000, 0);
  664.     _menusdata.CreateOBJECTCOPY(6, 10000, 10000, 0);
  665.     _menusdata.CreateOBJECTCOPY(6, 10000, 10000, 0);
  666.     _menusdata.CreateOBJECTCOPY(6, 10000, 10000, 0);
  667.     _menusdata.CreateOBJECTCOPY(6, 10000, 10000, 0);
  668.     _menusdata.CreateOBJECTCOPY(6, 10000, 10000, 0);
  669.     _menusdata.CreateOBJECTCOPY(6, 10000, 10000, 0);
  670.     _menusdata.CreateOBJECTCOPY(6, 10000, 10000, 0);
  671.     _menusdata.CreateOBJECTCOPY(6, 10000, 10000, 0);
  672.  
  673.     _menusdata.ON_SCREEN_REAL_OBJS[1].deleteobj=true;
  674.     _menusdata.ON_SCREEN_REAL_OBJS[2].deleteobj=true;
  675.     _menusdata.ON_SCREEN_REAL_OBJS[3].deleteobj=true;
  676.     _menusdata.ON_SCREEN_REAL_OBJS[4].deleteobj=true;
  677.     _menusdata.ON_SCREEN_REAL_OBJS[5].deleteobj=true;
  678.     _menusdata.ON_SCREEN_REAL_OBJS[6].deleteobj=true;
  679.     _menusdata.ON_SCREEN_REAL_OBJS[7].deleteobj=true;
  680.     _menusdata.ON_SCREEN_REAL_OBJS[8].deleteobj=true;
  681.     _menusdata.ON_SCREEN_REAL_OBJS[9].deleteobj=true;
  682.     _menusdata.ON_SCREEN_REAL_OBJS[10].deleteobj=true;
  683.     _menusdata.ON_SCREEN_REAL_OBJS[11].deleteobj=true;
  684.     _menusdata.ON_SCREEN_REAL_OBJS[12].deleteobj=true;
  685.     _menusdata.ON_SCREEN_REAL_OBJS[13].deleteobj=true;
  686.     _menusdata.ON_SCREEN_REAL_OBJS[14].deleteobj=true;
  687. }
  688.  
  689.  
  690. void LoadMenuStuff::Update_Interface( LOAD *LOADED )
  691. {
  692.     if (MenuID==10)
  693.     {
  694.  
  695.         for (int p_no=0; p_no<4; p_no++)
  696.         {
  697.             P_INPUTDATA[p_no][0]=LOADED->PKEYS[p_no][0]&&P_INPUTDATA[p_no][0]==0?1:P_INPUTDATA[p_no][0];
  698.             P_INPUTDATA[p_no][0]=!LOADED->PKEYS[p_no][0]&&P_INPUTDATA[p_no][0]==2?0:P_INPUTDATA[p_no][0];
  699.  
  700.             P_INPUTDATA[p_no][1]=LOADED->PKEYS[p_no][1]&&P_INPUTDATA[p_no][1]==0?1:P_INPUTDATA[p_no][1];
  701.             P_INPUTDATA[p_no][1]=!LOADED->PKEYS[p_no][1]&&P_INPUTDATA[p_no][1]==2?0:P_INPUTDATA[p_no][1];
  702.  
  703.             P_INPUTDATA[p_no][2]=LOADED->PKEYS[p_no][2]&&P_INPUTDATA[p_no][2]==0?1:P_INPUTDATA[p_no][2];
  704.             P_INPUTDATA[p_no][2]=!LOADED->PKEYS[p_no][2]&&P_INPUTDATA[p_no][2]==2?0:P_INPUTDATA[p_no][2];
  705.  
  706.             P_INPUTDATA[p_no][3]=LOADED->PKEYS[p_no][3]&&P_INPUTDATA[p_no][3]==0?1:P_INPUTDATA[p_no][3];
  707.             P_INPUTDATA[p_no][3]=!LOADED->PKEYS[p_no][3]&&P_INPUTDATA[p_no][3]==2?0:P_INPUTDATA[p_no][3];
  708.  
  709.             P_INPUTDATA[p_no][4]=LOADED->PKEYS[p_no][4]&&P_INPUTDATA[p_no][4]==0?1:P_INPUTDATA[p_no][4];
  710.             P_INPUTDATA[p_no][4]=!LOADED->PKEYS[p_no][4]&&P_INPUTDATA[p_no][4]==2?0:P_INPUTDATA[p_no][4];
  711.  
  712.             P_INPUTDATA[p_no][5]=LOADED->PKEYS[p_no][5]&&P_INPUTDATA[p_no][5]==0?1:P_INPUTDATA[p_no][5];
  713.             P_INPUTDATA[p_no][5]=!LOADED->PKEYS[p_no][5]&&P_INPUTDATA[p_no][5]==2?0:P_INPUTDATA[p_no][5];
  714.         }
  715.  
  716.         for (int objcopIndex=0; objcopIndex<_menusdata.ON_SCREEN_OBJCOUNT; objcopIndex++)
  717.         {
  718.             if (_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno!=4321)
  719.             {
  720.                 int abcd=_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno;
  721.                 if (P_INPUTDATA[_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno-1][0]==1)
  722.                 {
  723.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_UP_C=true;
  724.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_UP=true;
  725.                 }
  726.                 else if (P_INPUTDATA[_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno-1][0]==2)
  727.                 {
  728.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_UP_C=false;
  729.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_UP=true;
  730.                 }
  731.                 else
  732.                 {
  733.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_UP_C=false;
  734.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_UP=false;
  735.                 }
  736.                 if (P_INPUTDATA[_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno-1][1]==1)
  737.                 {
  738.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_DOWN_C=true;
  739.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_DOWN=true;
  740.                 }
  741.                 else if (P_INPUTDATA[_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno-1][1]==2)
  742.                 {
  743.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_DOWN_C=false;
  744.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_DOWN=true;
  745.                 }
  746.                 else
  747.                 {
  748.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_DOWN_C=false;
  749.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_DOWN=false;
  750.                 }
  751.                 if (P_INPUTDATA[_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno-1][2]==1)
  752.                 {
  753.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_LEFT_C=true;
  754.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_LEFT=true;
  755.                 }
  756.                 else if (P_INPUTDATA[_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno-1][2]==2)
  757.                 {
  758.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_LEFT_C=false;
  759.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_LEFT=true;
  760.                 }
  761.                 else
  762.                 {
  763.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_LEFT_C=false;
  764.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_LEFT=false;
  765.                 }
  766.                 if (P_INPUTDATA[_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno-1][3]==1)
  767.                 {
  768.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_RIGHT_C=true;
  769.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_RIGHT=true;
  770.                 }
  771.                 else if (P_INPUTDATA[_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno-1][3]==2)
  772.                 {
  773.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_RIGHT_C=false;
  774.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_RIGHT=true;
  775.                 }
  776.                 else
  777.                 {
  778.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_RIGHT_C=false;
  779.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_RIGHT=false;
  780.                 }
  781.                 if (P_INPUTDATA[_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno-1][4]==1)
  782.                 {
  783.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_ATTACK_C=true;
  784.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_ATTACK=true;
  785.                 }
  786.                 else if (P_INPUTDATA[_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno-1][4]==2)
  787.                 {
  788.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_ATTACK_C=false;
  789.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_ATTACK=true;
  790.                 }
  791.                 else
  792.                 {
  793.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_ATTACK_C=false;
  794.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_ATTACK=false;
  795.                 }
  796.                 if (P_INPUTDATA[_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno-1][5]==1)
  797.                 {
  798.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_DEFEND_C=true;
  799.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_DEFEND=true;
  800.                 }
  801.                 else if (P_INPUTDATA[_menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].playerno-1][5]==2)
  802.                 {
  803.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_DEFEND_C=false;
  804.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_DEFEND=true;
  805.                 }
  806.                 else
  807.                 {
  808.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_DEFEND_C=false;
  809.                     _menusdata.ON_SCREEN_REAL_OBJS[objcopIndex].P_DEFEND=false;
  810.                 }
  811.             }
  812.         }
  813.  
  814.         for (int p_no=0; p_no<4; p_no++)                                                  //loop on the players
  815.         {
  816.             /*0 means that the buttons isn't held nor clicked,
  817.             1 means that the buttons is clicked
  818.             2 means that the buttons has been clicked but is still being held */
  819.  
  820.             int indexno=0;
  821.             for (int a=0; a<4; a++)
  822.             {
  823.                 if (_humanplayersjoining[a]==p_no)                   //find the player number in game
  824.                     indexno=a+1;
  825.             }
  826.             if (_menusdata.OBJECTS[indexno].Frames[_menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe].menuflags[10])
  827.             {
  828.  
  829.                 if (P_INPUTDATA[p_no][0]==1)
  830.                 {
  831.                     P_INPUTDATA[p_no][0]=2;
  832.                     if (_humanplayersjoining[0]==p_no||_humanplayersjoining[1]==p_no
  833.                             ||_humanplayersjoining[2]==p_no||_humanplayersjoining[3]==p_no)
  834.                     {
  835.                         if (Chars[SelectionCurr_key[p_no]].up!=4321 && Chars[SelectionCurr_key[p_no]].up!=_bg_key)
  836.                         {
  837.                             SelectionCurr_key[p_no]=Chars[SelectionCurr_key[p_no]].up;
  838.                             if (Chars[SelectionCurr_key[p_no]].isbg) _currbgkey=SelectionCurr_key[p_no];
  839.                             if (Chars[SelectionCurr_key[p_no]].flags[0])
  840.                             {
  841.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx+_playerorigins[(indexno-1)*2];
  842.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy+_playerorigins[1+(indexno-1)*2];
  843.                             }
  844.                             else
  845.                             {
  846.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx;
  847.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy;
  848.                             }
  849.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].previousframe=
  850.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe;
  851.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe=Chars[SelectionCurr_key[p_no]].highlight;
  852.                             if (_charschoices[indexno-1]==4321)
  853.                                 _menusdata.ON_SCREEN_REAL_OBJS[5+p_no].deleteobj=true;
  854.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].newframe=true;
  855.                         }
  856.                         else if(Chars[SelectionCurr_key[p_no]].up==_bg_key && indexno==1)
  857.                         {
  858.                             SelectionCurr_key[p_no]=_currbgkey;
  859.                             if (Chars[SelectionCurr_key[p_no]].flags[0])
  860.                             {
  861.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx+_playerorigins[(indexno-1)*2];
  862.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy+_playerorigins[1+(indexno-1)*2];
  863.                             }
  864.                             else
  865.                             {
  866.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx;
  867.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy;
  868.                             }
  869.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].previousframe=
  870.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe;
  871.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe=Chars[SelectionCurr_key[p_no]].highlight;
  872.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].newframe=true;
  873.                         }
  874.                     }
  875.                 }
  876.  
  877.                 if (P_INPUTDATA[p_no][1]==1)
  878.                 {
  879.                     P_INPUTDATA[p_no][1]=2;
  880.                     if (_humanplayersjoining[0]==p_no||_humanplayersjoining[1]==p_no
  881.                             ||_humanplayersjoining[2]==p_no||_humanplayersjoining[3]==p_no)
  882.                     {
  883.                         if (Chars[SelectionCurr_key[p_no]].down!=4321 && Chars[SelectionCurr_key[p_no]].down!=_bg_key)
  884.                         {
  885.                             SelectionCurr_key[p_no]=Chars[SelectionCurr_key[p_no]].down;
  886.                             if (Chars[SelectionCurr_key[p_no]].isbg) _currbgkey=SelectionCurr_key[p_no];
  887.                             if (Chars[SelectionCurr_key[p_no]].flags[0])
  888.                             {
  889.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx+_playerorigins[(indexno-1)*2];
  890.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy+_playerorigins[1+(indexno-1)*2];
  891.                             }
  892.                             else
  893.                             {
  894.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx;
  895.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy;
  896.                             }
  897.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].previousframe=
  898.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe;
  899.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe=Chars[SelectionCurr_key[p_no]].highlight;
  900.                             if (_charschoices[indexno-1]==4321)
  901.                                 _menusdata.ON_SCREEN_REAL_OBJS[5+p_no].deleteobj=true;
  902.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].newframe=true;
  903.                         }
  904.                         else if(Chars[SelectionCurr_key[p_no]].down==_bg_key && indexno==1)
  905.                         {
  906.                             SelectionCurr_key[p_no]=_currbgkey;
  907.                             if (Chars[SelectionCurr_key[p_no]].flags[0])
  908.                             {
  909.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx+_playerorigins[(indexno-1)*2];
  910.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy+_playerorigins[1+(indexno-1)*2];
  911.                             }
  912.                             else
  913.                             {
  914.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx;
  915.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy;
  916.                             }
  917.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].previousframe=
  918.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe;
  919.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe=Chars[SelectionCurr_key[p_no]].highlight;
  920.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].newframe=true;
  921.                         }
  922.                     }
  923.                 }
  924.  
  925.                 if (P_INPUTDATA[p_no][2]==1)
  926.                 {
  927.                     P_INPUTDATA[p_no][2]=2;
  928.                     if (_humanplayersjoining[0]==p_no||_humanplayersjoining[1]==p_no
  929.                             ||_humanplayersjoining[2]==p_no||_humanplayersjoining[3]==p_no)
  930.                     {
  931.                         if (Chars[SelectionCurr_key[p_no]].left!=4321 && Chars[SelectionCurr_key[p_no]].left!=_bg_key)
  932.                         {
  933.                             SelectionCurr_key[p_no]=Chars[SelectionCurr_key[p_no]].left;
  934.                             if (Chars[SelectionCurr_key[p_no]].isbg) _currbgkey=SelectionCurr_key[p_no];
  935.                             if (Chars[SelectionCurr_key[p_no]].flags[0])
  936.                             {
  937.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx+_playerorigins[(indexno-1)*2];
  938.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy+_playerorigins[1+(indexno-1)*2];
  939.                             }
  940.                             else
  941.                             {
  942.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx;
  943.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy;
  944.                             }
  945.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].previousframe=
  946.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe;
  947.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe=Chars[SelectionCurr_key[p_no]].highlight;
  948.                             if (_charschoices[indexno-1]==4321)
  949.                                 _menusdata.ON_SCREEN_REAL_OBJS[5+p_no].deleteobj=true;
  950.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].newframe=true;
  951.                         }
  952.                         else if(Chars[SelectionCurr_key[p_no]].left==_bg_key && indexno==1)
  953.                         {
  954.                             SelectionCurr_key[p_no]=_currbgkey;
  955.                             if (Chars[SelectionCurr_key[p_no]].flags[0])
  956.                             {
  957.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx+_playerorigins[(indexno-1)*2];
  958.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy+_playerorigins[1+(indexno-1)*2];
  959.                             }
  960.                             else
  961.                             {
  962.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx;
  963.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy;
  964.                             }
  965.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].previousframe=
  966.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe;
  967.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe=Chars[SelectionCurr_key[p_no]].highlight;
  968.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].newframe=true;
  969.                         }
  970.                     }
  971.                 }
  972.  
  973.                 if (P_INPUTDATA[p_no][3]==1)
  974.                 {
  975.                     P_INPUTDATA[p_no][3]=2;
  976.                     if (_humanplayersjoining[0]==p_no||_humanplayersjoining[1]==p_no
  977.                             ||_humanplayersjoining[2]==p_no||_humanplayersjoining[3]==p_no)
  978.                     {
  979.                         if (Chars[SelectionCurr_key[p_no]].right!=4321 && Chars[SelectionCurr_key[p_no]].right!=_bg_key)
  980.                         {
  981.                             SelectionCurr_key[p_no]=Chars[SelectionCurr_key[p_no]].right;
  982.                             if (Chars[SelectionCurr_key[p_no]].isbg) _currbgkey=SelectionCurr_key[p_no];
  983.                             if (Chars[SelectionCurr_key[p_no]].flags[0])
  984.                             {
  985.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx+_playerorigins[(indexno-1)*2];
  986.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy+_playerorigins[1+(indexno-1)*2];
  987.                             }
  988.                             else
  989.                             {
  990.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx;
  991.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy;
  992.                             }
  993.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].previousframe=
  994.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe;
  995.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe=Chars[SelectionCurr_key[p_no]].highlight;
  996.                             if (_charschoices[indexno-1]==4321)
  997.                                 _menusdata.ON_SCREEN_REAL_OBJS[5+p_no].deleteobj=true;
  998.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].newframe=true;
  999.  
  1000.                         }
  1001.                         else if(Chars[SelectionCurr_key[p_no]].right==_bg_key && indexno==1)
  1002.                         {
  1003.                             SelectionCurr_key[p_no]=_currbgkey;
  1004.                             if (Chars[SelectionCurr_key[p_no]].flags[0])
  1005.                             {
  1006.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx+_playerorigins[(indexno-1)*2];
  1007.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy+_playerorigins[1+(indexno-1)*2];
  1008.                             }
  1009.                             else
  1010.                             {
  1011.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posx=Chars[SelectionCurr_key[p_no]].posx;
  1012.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].posz=Chars[SelectionCurr_key[p_no]].posy;
  1013.                             }
  1014.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].previousframe=
  1015.                                 _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe;
  1016.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].currframe=Chars[SelectionCurr_key[p_no]].highlight;
  1017.                             _menusdata.ON_SCREEN_REAL_OBJS[indexno].newframe=true;
  1018.                         }
  1019.                     }
  1020.                 }
  1021.             }
  1022.  
  1023.             if (P_INPUTDATA[p_no][_nextbutton]==1)
  1024.             {
  1025.                 P_INPUTDATA[p_no][_nextbutton]=2;
  1026.                 if (Chars[SelectionCurr_key[p_no]].id==6435727 && _humanplayersjoining[0]==p_no)
  1027.                 {
  1028.                     //LOAD STUFFIES!
  1029.                     LOADNOW=true;
  1030.                     for (int p_index=0; p_index < 4; p_index++)
  1031.                     {
  1032.                         if (_humanplayersjoining[p_index]!=4321)
  1033.                         {
  1034.                             _objectstoload+=stringify(_charschoices[p_index])+"~"+stringify(_humanplayersjoining[p_index])+":";
  1035.                         }
  1036.                     }
  1037.                     //OBJECTSTOLOAD=_objectstoload;
  1038.                     return;
  1039.                 }
  1040.  
  1041.                 /*if (_humanplayersjoining[0]==p_no||_humanplayersjoining[1]==p_no
  1042.                   ||_humanplayersjoining[2]==p_no||_humanplayersjoining[3]==p_no){
  1043.  
  1044.                     _menusdata.ON_SCREEN_REAL_OBJS[_humanplayersjoining[p_no]+1].currframe=Chars[SelectionCurr_key[p_no]].whenchoose;
  1045.                     _menusdata.ON_SCREEN_REAL_OBJS[_humanplayersjoining[p_no]+1].newframe=true;
  1046.                 }else{*/
  1047.                 for (int b=0; b<4; b++)
  1048.                 {
  1049.                     if (_humanplayersjoining[b]==p_no && _charschoices[b]==4321)
  1050.                     {
  1051.                         if (_menusdata.OBJECTS[_menusdata.ON_SCREEN_REAL_OBJS[b+1].id].Frames[_menusdata.ON_SCREEN_REAL_OBJS[b+1].currframe].menuflags[0])
  1052.                         {
  1053.                             _menusdata.ON_SCREEN_REAL_OBJS[b+1].currframe=Chars[SelectionCurr_key[b]].whenchoose;
  1054.                             _menusdata.ON_SCREEN_REAL_OBJS[b+1].newframe=true;
  1055.                             _charschoices[b]=Chars[SelectionCurr_key[p_no]].id;
  1056.                             break;
  1057.                         }
  1058.                         if (_menusdata.OBJECTS[_menusdata.ON_SCREEN_REAL_OBJS[b+1].id].Frames[_menusdata.ON_SCREEN_REAL_OBJS[b+1].currframe].menuflags[1])
  1059.                         {
  1060.                             continue;
  1061.                         }
  1062.                     }
  1063.                     if (_humanplayersjoining[b]==4321  && !(_humanplayersjoining[0]==p_no||_humanplayersjoining[1]==p_no
  1064.                                                             ||_humanplayersjoining[2]==p_no||_humanplayersjoining[3]==p_no))
  1065.                     {
  1066.                         _humanplayersjoining[b]=p_no;
  1067.                         _menusdata.ON_SCREEN_REAL_OBJS[0].currframe=_clicktojoinfrms[b+4];
  1068.                         _menusdata.ON_SCREEN_REAL_OBJS[0].newframe=true;
  1069.                         _menusdata.ON_SCREEN_REAL_OBJS[0].playerno=p_no+1;
  1070.                         SelectionCurr_key[p_no]=0;
  1071.                         _menusdata.ON_SCREEN_REAL_OBJS[b+1].posx=Chars[SelectionCurr_key[p_no]].posx;
  1072.                         _menusdata.ON_SCREEN_REAL_OBJS[b+1].posz=Chars[SelectionCurr_key[p_no]].posy;
  1073.                         _menusdata.ON_SCREEN_REAL_OBJS[b+1].deleteobj=false;
  1074.  
  1075.                         _menusdata.ON_SCREEN_REAL_OBJS[b+1].currframe=Chars[SelectionCurr_key[p_no]]._whnhighlght;
  1076.                         _menusdata.ON_SCREEN_REAL_OBJS[b+1].playerno=p_no+1;
  1077.                         _menusdata.ON_SCREEN_REAL_OBJS[b+1].newframe=true;
  1078.                         break;
  1079.                     }
  1080.                 }
  1081.             }
  1082.             if (P_INPUTDATA[p_no][_backbutton]==1)
  1083.             {
  1084.                 P_INPUTDATA[p_no][_backbutton]=2;
  1085.                 for (int b=0; b<4; b++)
  1086.                 {
  1087.                     if (_humanplayersjoining[b]==p_no)
  1088.                     {
  1089.                         if (_menusdata.OBJECTS[_menusdata.ON_SCREEN_REAL_OBJS[b+1].id].Frames[_menusdata.ON_SCREEN_REAL_OBJS[b+1].currframe].menuflags[3])
  1090.                         {
  1091.  
  1092.                         }
  1093.                     }
  1094.                 }
  1095.             }
  1096.         }
  1097.  
  1098.  
  1099.  
  1100.         for (int b=_menusdata.ON_SCREEN_OBJCOUNT-(_menusdata.OBJSBEHIND_INDEX); b<_menusdata.ON_SCREEN_OBJCOUNT; b++)
  1101.         {
  1102.             if (_menusdata.ON_SCREEN_OBJS[b]->deleteobj==false)
  1103.             {
  1104.                 _menusdata.OBJECTS[_menusdata.ON_SCREEN_OBJS[b]->id].Blit(_menusdata.ON_SCREEN_OBJS[b]);
  1105.             }
  1106.         }
  1107.         _menusdata.BACKGROUNDS[0].Blit(&_menusdata);
  1108.  
  1109.         int humanplayers=0;
  1110.         for (int a=0; a<4; a++)
  1111.             if (_humanplayersjoining[a]==4321)
  1112.                 //humanplayers++;
  1113.                 //if (_menusdata.ON_SCREEN_REAL_OBJS[0].deleteobj && humanplayers<4){
  1114.                 if (_menusdata.ON_SCREEN_REAL_OBJS[0].deleteobj)
  1115.                 {
  1116.                     _menusdata.ON_SCREEN_REAL_OBJS[0].deleteobj=false;
  1117.                     _menusdata.ON_SCREEN_REAL_OBJS[0].currframe=_clicktojoinfrms[a];
  1118.                     _menusdata.ON_SCREEN_REAL_OBJS[0].posx=_clicktojoinpos[a];
  1119.                     _menusdata.ON_SCREEN_REAL_OBJS[0].posy=_clicktojoinpos[a+4];
  1120.                     _menusdata.ON_SCREEN_REAL_OBJS[0].newframe=true;
  1121.                 }
  1122.  
  1123.  
  1124.  
  1125.         for (int x=0; x < _menusdata.ON_SCREEN_OBJCOUNT; x++)
  1126.         {
  1127.             if (!(_menusdata.ON_SCREEN_REAL_OBJS[x].deleteobj || _menusdata.ON_SCREEN_REAL_OBJS[x].deleted))
  1128.             {
  1129.                 _menusdata.OBJECTS[_menusdata.ON_SCREEN_REAL_OBJS[x].id].UpdateStat(&_menusdata.ON_SCREEN_REAL_OBJS[x]);
  1130.                 _menusdata.OBJECTS[_menusdata.ON_SCREEN_REAL_OBJS[x].id].UpdateMove(&_menusdata.ON_SCREEN_REAL_OBJS[x]);
  1131.                 if (_menusdata.OBJECTS[_menusdata.ON_SCREEN_REAL_OBJS[x].id].Frames[_menusdata.ON_SCREEN_REAL_OBJS[x].currframe].menuflags[8])  //if |DISJOIN|
  1132.                 {
  1133.                     for (int playernoindx=0; playernoindx<4; playernoindx++)
  1134.                     {
  1135.                         if (_humanplayersjoining[playernoindx]==_menusdata.ON_SCREEN_REAL_OBJS[x].playerno-1)
  1136.                         {
  1137.                             _humanplayersjoining[playernoindx]=4321;
  1138.                             _menusdata.ON_SCREEN_REAL_OBJS[playernoindx+1].posx=10000;
  1139.                             _menusdata.ON_SCREEN_REAL_OBJS[playernoindx+1].posz=10000;
  1140.                             _menusdata.ON_SCREEN_REAL_OBJS[playernoindx+1].deleteobj=true;
  1141.                             _menusdata.ON_SCREEN_REAL_OBJS[0].deleteobj=false;
  1142.                             _menusdata.ON_SCREEN_REAL_OBJS[0].currframe=_clicktojoinfrms[playernoindx];
  1143.                             //_menusdata.ON_SCREEN_REAL_OBJS[0].posx=_clicktojoinpos[playernoindx];
  1144.                             //_menusdata.ON_SCREEN_REAL_OBJS[0].posy=_clicktojoinpos[playernoindx+4];
  1145.                             _menusdata.ON_SCREEN_REAL_OBJS[0].newframe=true;
  1146.                             _menusdata.OBJECTS[_menusdata.ON_SCREEN_REAL_OBJS[0].id].UpdateStat(&_menusdata.ON_SCREEN_REAL_OBJS[x]);
  1147.                             _menusdata.OBJECTS[_menusdata.ON_SCREEN_REAL_OBJS[0].id].UpdateMove(&_menusdata.ON_SCREEN_REAL_OBJS[x]);
  1148.                             _menusdata.ON_SCREEN_REAL_OBJS[4+_menusdata.ON_SCREEN_REAL_OBJS[x].playerno].deleteobj=true;
  1149.                             _charschoices[playernoindx]=4321;
  1150.                         }
  1151.                     }
  1152.                 }
  1153.                 if (_menusdata.OBJECTS[_menusdata.ON_SCREEN_REAL_OBJS[x].id].Frames[_menusdata.ON_SCREEN_REAL_OBJS[x].currframe].menuflags[9])  //if |SHOWSTANCE|
  1154.                 {
  1155.                     if (_menusdata.ON_SCREEN_REAL_OBJS[4+_menusdata.ON_SCREEN_REAL_OBJS[x].playerno].deleteobj&&Chars[SelectionCurr_key[_menusdata.ON_SCREEN_REAL_OBJS[x].playerno-1]]._showstance!=4321
  1156.                        )
  1157.                     {
  1158.                         _menusdata.ON_SCREEN_REAL_OBJS[4+_menusdata.ON_SCREEN_REAL_OBJS[x].playerno].deleteobj=false;
  1159.                         _menusdata.ON_SCREEN_REAL_OBJS[4+_menusdata.ON_SCREEN_REAL_OBJS[x].playerno].posx=LOADED->_playermenuorigins[_menusdata.ON_SCREEN_REAL_OBJS[x].playerno*2];
  1160.                         _menusdata.ON_SCREEN_REAL_OBJS[4+_menusdata.ON_SCREEN_REAL_OBJS[x].playerno].posz=LOADED->_playermenuorigins[1+_menusdata.ON_SCREEN_REAL_OBJS[x].playerno*2];
  1161.                         _menusdata.ON_SCREEN_REAL_OBJS[4+_menusdata.ON_SCREEN_REAL_OBJS[x].playerno].currframe=Chars[SelectionCurr_key[_menusdata.ON_SCREEN_REAL_OBJS[x].playerno-1]]._showstance;
  1162.  
  1163.                         _menusdata.ON_SCREEN_REAL_OBJS[4+_menusdata.ON_SCREEN_REAL_OBJS[x].playerno].newframe=true;
  1164.                     }
  1165.                 }
  1166.  
  1167.                 _menusdata.OBJECTS[_menusdata.ON_SCREEN_REAL_OBJS[x].id].BlitShadow(&_menusdata.ON_SCREEN_REAL_OBJS[x]);
  1168.             }
  1169.         }
  1170.  
  1171.  
  1172.         for (int a=_menusdata.ON_SCREEN_OBJCOUNT-1; a >14; a--)
  1173.         {
  1174.  
  1175.             if (_menusdata.ON_SCREEN_REAL_OBJS[a].deleteobj && _menusdata.ON_SCREEN_REAL_OBJS[a].deleted==false)
  1176.             {
  1177.                 if (_menusdata.ON_SCREEN_REAL_OBJS[a].rndrbackid!=4321)
  1178.                     _menusdata.OBJSBEHIND_INDEX--;
  1179.                 _menusdata.DELETED_OBJS[_menusdata.D_O_INDEX++]=a;
  1180.                 _menusdata.ON_SCREEN_REAL_OBJS[a].deleted=true;
  1181.  
  1182.             }
  1183.         }
  1184.  
  1185.  
  1186.         std::sort((_menusdata.ON_SCREEN_OBJS).begin(), (_menusdata.ON_SCREEN_OBJS).begin()+(_menusdata.ON_SCREEN_OBJCOUNT), comp_by_zpos());
  1187.  
  1188.         for (int b=0; b<_menusdata.ON_SCREEN_OBJCOUNT; b++)
  1189.         {
  1190.             if (_menusdata.ON_SCREEN_OBJS[b]->deleteobj==false && _menusdata.ON_SCREEN_OBJS[b]->rndrbackid==4321)
  1191.             {
  1192.                 _menusdata.OBJECTS[_menusdata.ON_SCREEN_OBJS[b]->id].Blit(_menusdata.ON_SCREEN_OBJS[b]);
  1193.             }
  1194.         }
  1195.  
  1196.  
  1197.     }
  1198. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement