Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///Windows
- if keyboard_check(ord("P")) && global.typing = 0
- {
- isrecruit=1;
- }
- if keyboard_check(ord("O")) && global.typing = 0
- {
- global.randactinit = 2;
- global.pauser = "on";
- }
- if keyboard_check_pressed(ord("I")) && global.typing = 0
- {
- global.randactinit = 1;
- global.pauser = "on";
- }
- ////// Open Windows
- //Travel Window
- if mouse_check_button_pressed(mb_left) && global.randactstore = 0 && global.incity = 0
- {
- if (mouse_x>7 && mouse_x<118) && (mouse_y>136 && mouse_y<179)
- {
- if global.windowtype = "travelset"
- {
- win = 0;
- }
- if global.windowtype = ""
- {
- win = 1;
- }
- if win = 0
- {
- global.windowtype = "";
- global.pauser = "off";
- with (but_progress){
- instance_destroy()}
- with (but_autosort){
- instance_destroy()}
- }
- if win = 1
- {
- global.windowtype = "travelset";
- global.pauser = "off";
- }
- }
- }
- //Position Window
- if mouse_check_button_pressed(mb_left) && global.randactstore = 0
- {
- if (mouse_x>7 && mouse_x<118) && (mouse_y>44 && mouse_y<87)
- {
- if global.windowtype = "positionset"
- {
- win = 0;
- }
- if global.windowtype = ""
- {
- win = 1;
- }
- if win = 0
- {
- global.windowtype = "";
- global.pauser = "off";
- with (but_progress){
- instance_destroy()}
- with (but_autosort){
- instance_destroy()}
- }
- if win = 1
- {
- global.windowtype = "positionsetinit";
- global.pauser = "on";
- }
- }
- }
- //City Wander Window
- if mouse_check_button_pressed(mb_left) && global.randactstore = 0 && global.incity = 1
- {
- if (mouse_x>7 && mouse_x<118) && (mouse_y>228 && mouse_y<271)
- {
- if global.windowtype = ""
- {
- win = 1;
- }
- if win = 1
- {
- global.windowtype = "randcity";
- global.randcityinit = 1;
- global.daystogame -= 1;
- global.logpass="You spend (1) Day wandering town.";
- win = 0;
- }
- }
- }
- //City General Store
- if mouse_check_button_pressed(mb_left) && global.incity = 1
- {
- if (mouse_x>7 && mouse_x<118) && (mouse_y>136 && mouse_y<180)
- {
- if global.windowtype = ""
- {
- win = 1;
- }
- if win = 1
- {
- global.citystoreinit = 1;
- global.windowtype = "citystore";
- win = 0;
- }
- }
- }
- ////// Yes No Window
- //Return to normal delay
- if mouse_check_button_released(mb_left) && drawYN = 1
- {
- if (mouse_x>401 && mouse_x<451) && (mouse_y>160 && mouse_y<185)
- {
- global.qpass=global.qpassy;
- global.question = "";
- }
- if (mouse_x>471 && mouse_x<511) && (mouse_y>160 && mouse_y<185)
- {
- global.qpass=global.qpassn;
- global.question = "";
- }
- }
- if drawYN = 1
- {
- if keyboard_check(ord("Y"))
- {
- global.qpass = "true";
- global.question = "";
- }
- if keyboard_check(ord("N"))
- {
- global.qpass = "false";
- global.question = "";
- }
- }
- /////Check Window
- if mouse_check_button_pressed(mb_left) && drawCheck = 1
- {
- if (mouse_x>436 && mouse_x<486) && (mouse_y>160 && mouse_y<185)
- {
- global.qpass="ok";
- drawCheck = 0;
- global.question = "";
- show_debug_message("OK clicked");
- }
- }
- //City Time Elapse Y/N
- if mouse_check_button_released(mb_left) && drawYN = 1 && global.qpass !=""
- {
- if global.qpass="lapseday"
- {
- global.logpass="You spend (1) Day doing nothing.";
- global.daystogame -= 1;
- global.qpass="";
- }
- if global.qpass="nolapse"
- {
- global.qpass="";
- }
- drawYN = 0;
- }
- if mouse_check_button_released(mb_left) && global.incity = 1 && global.windowtype = "" && drawYN = 0
- {
- if (mouse_x>657 && mouse_x<793) && (mouse_y>7 && mouse_y<33)
- {
- global.question = "You have "+string(global.daystogame)+"days left.#Do you wish to wait (1) Day?";
- global.qpassy="lapseday";
- global.qpassn="nolapse";
- drawYN = 1;
- }
- }
- ////// Choice Window
- //Indent Selected Button
- //if mouse_check_button_pressed(mb_left) && global.windowtype = "choice"
- if mouse_check_button_pressed(mb_left) && global.windowtype = "randact" || global.windowtype = "recruit"
- {
- if (mouse_x>global.choicebutton1x && mouse_x<global.choicebutton1x+24) && (mouse_y>global.choicebutton1y && mouse_y<global.choicebutton1y+28)
- {
- global.pressbutttemp = 1;
- global.choicebutton1x += indentamount;
- global.choicebutton1y += indentamount;
- }
- if (mouse_x>global.choicebutton2x && mouse_x<global.choicebutton2x+24) && (mouse_y>global.choicebutton2y && mouse_y<global.choicebutton2y+28)
- {
- global.pressbutttemp = 2
- global.choicebutton2x += indentamount;
- global.choicebutton2y += indentamount;
- }
- if (mouse_x>global.choicebutton3x && mouse_x<global.choicebutton3x+24) && (mouse_y>global.choicebutton3y && mouse_y<global.choicebutton3y+28)
- {
- global.pressbutttemp = 3
- global.choicebutton3x += indentamount;
- global.choicebutton3y += indentamount;
- }
- }
- //Unindent Button if not selected
- //if mouse_check_button_released(mb_left) && global.windowtype = "choice"
- if mouse_check_button_released(mb_left) && global.windowtype = "randact" || global.windowtype = "recruit"
- {
- if global.pressbutttemp = 1
- {
- if (mouse_x>global.choicebutton1x && mouse_x<global.choicebutton1x+24) && (mouse_y>global.choicebutton1y && mouse_y<global.choicebutton1y+28)
- {
- global.pressbutt=1;
- global.pressbutttemp = 0;
- global.choicebutton1x -= indentamount;
- global.choicebutton1y -= indentamount;
- }
- else
- {
- global.pressbutttemp = 0;
- global.choicebutton1x -= indentamount;
- global.choicebutton1y -= indentamount;
- }
- }
- if global.pressbutttemp = 2
- {
- if (mouse_x>global.choicebutton2x && mouse_x<global.choicebutton2x+24) && (mouse_y>global.choicebutton2y && mouse_y<global.choicebutton2y+28)
- {
- global.pressbutt = 2;
- global.pressbutttemp = 0;
- global.choicebutton2x -= indentamount;
- global.choicebutton2y -= indentamount;
- }
- else
- {
- global.pressbutttemp = 0;
- global.choicebutton2x -= indentamount;
- global.choicebutton2y -= indentamount;
- }
- }
- if global.pressbutttemp = 3
- {
- if (mouse_x>global.choicebutton3x && mouse_x<global.choicebutton3x+24) && (mouse_y>global.choicebutton3y && mouse_y<global.choicebutton3y+28)
- {
- global.pressbutt = 3;
- global.pressbutttemp = 0;
- global.choicebutton3x -= indentamount;
- global.choicebutton3y -= indentamount;
- }
- else
- {
- global.pressbutttemp = 0;
- global.choicebutton3x -= indentamount;
- global.choicebutton3y -= indentamount;
- }
- }
- }
- ////End Choice Window
- //////Travel Window
- //Indent Selected Button
- if mouse_check_button_pressed(mb_left) && global.windowtype = "travelset"
- {
- if (mouse_x>speedbutt1x && mouse_x<speedbutt1x+24) && (mouse_y>speedbutt1y && mouse_y<speedbutt1y+28)
- {
- global.pressbutt = 1;
- speedbutt1x += indentamount;
- speedbutt1y += indentamount;
- }
- if (mouse_x>speedbutt2x && mouse_x<speedbutt2x+24) && (mouse_y>speedbutt2y && mouse_y<speedbutt2y+28)
- {
- global.pressbutt = 2
- speedbutt2x += indentamount;
- speedbutt2y += indentamount;
- }
- if (mouse_x>speedbutt3x && mouse_x<speedbutt3x+24) && (mouse_y>speedbutt3y && mouse_y<speedbutt3y+28)
- {
- global.pressbutt = 3
- speedbutt3x += indentamount;
- speedbutt3y += indentamount;
- }
- if (mouse_x>speedbutt4x && mouse_x<speedbutt4x+24) && (mouse_y>speedbutt4y && mouse_y<speedbutt4y+28)
- {
- global.pressbutt = 4
- speedbutt4x += indentamount;
- speedbutt4y += indentamount;
- }
- }
- //Button Work
- if mouse_check_button_released(mb_left) && global.windowtype = "travelset"
- {
- if (mouse_x>speedbutt1x && mouse_x<speedbutt1x+24) && (mouse_y>speedbutt1y && mouse_y<speedbutt1y+28) && global.pressbutt = 1
- {
- global.speed = 125;
- global.logpass="Speed set to Overly Cautious.";
- }
- if (mouse_x>speedbutt2x && mouse_x<speedbutt2x+24) && (mouse_y>speedbutt2y && mouse_y<speedbutt2y+28) && global.pressbutt = 2
- {
- global.speed = 200;
- global.logpass="Speed set to Normal";
- }
- if (mouse_x>speedbutt3x && mouse_x<speedbutt3x+24) && (mouse_y>speedbutt3y && mouse_y<speedbutt3y+28) && global.pressbutt = 3
- {
- global.speed = 275;
- global.logpass="Speed set to Reckless";
- }
- if (mouse_x>speedbutt4x && mouse_x<speedbutt4x+24) && (mouse_y>speedbutt4y && mouse_y<speedbutt4y+28) && global.pressbutt = 4
- {
- global.speed = 0;
- obj_startup.timerstore=0;
- global.logpass="The bus takes a pitstop.";
- }
- }
- //Unindent Button if not selected
- if mouse_check_button_released(mb_left) && global.windowtype = "travelset"
- {
- if global.pressbutt = 1
- {
- global.pressbutt = 0
- speedbutt1x -= indentamount;
- speedbutt1y -= indentamount;
- }
- if global.pressbutt = 2
- {
- global.pressbutt = 0
- speedbutt2x -= indentamount;
- speedbutt2y -= indentamount;
- }
- if global.pressbutt = 3
- {
- global.pressbutt = 0
- speedbutt3x -= indentamount;
- speedbutt3y -= indentamount;
- }
- if global.pressbutt = 4
- {
- global.pressbutt = 0
- speedbutt4x -= indentamount;
- speedbutt4y -= indentamount;
- }
- }
- ////End Travel
- ////Position Settings
- if global.windowtype = "positionsetinit"
- {
- global.windowtype = "positionset";
- global.butt_text="Autosort";
- global.butt_spr=9;
- global.butt_return=2;
- instance_create(300,20,but_autosort);
- }
- if mouse_check_button_released(mb_left) && global.pressbutt = 2 && global.windowtype = "positionset"
- {
- show_debug_message("AUTO PLACING PLAYERS");
- global.pressbutt = -1;
- for (var i = 14; i > -1; i--;)
- {
- rosterset=asset_get_index("player"+string(i));
- rosterset.pos="";
- }
- //place Pitcher
- topstat=-1;
- topplayer=-1;
- for (var i = 14; i > -1; i--;)
- {
- rosterset=asset_get_index("player"+string(i));
- if rosterset.fullname != "" && rosterset.pos = ""
- {
- if rosterset.thr > topstat
- {
- topplayer=i;
- topstat=rosterset.thr;
- }
- }
- }
- rosterset=asset_get_index("player"+string(topplayer));
- rosterset.pos = "P";
- rosterset.boxcolor=global.posbox[0,3];
- //place Catcher
- topstat=-1;
- topplayer=-1;
- for (var i = 14; i > -1; i--;)
- {
- rosterset=asset_get_index("player"+string(i));
- if rosterset.fullname != "" && rosterset.pos = ""
- {
- if rosterset.ref > topstat
- {
- topplayer=i;
- topstat=rosterset.ref;
- }
- }
- }
- rosterset=asset_get_index("player"+string(topplayer));
- rosterset.pos = "C";
- rosterset.boxcolor=global.posbox[1,3];
- //place DesiHit
- topstat=-1;
- topplayer=-1;
- for (var i = 14; i > -1; i--;)
- {
- rosterset=asset_get_index("player"+string(i));
- if rosterset.fullname != "" && rosterset.pos = ""
- {
- if rosterset.pow > topstat
- {
- topplayer=i;
- topstat=rosterset.pow;
- }
- }
- }
- rosterset=asset_get_index("player"+string(topplayer));
- rosterset.pos = "DH";
- rosterset.boxcolor=global.posbox[9,3];
- //place First Base
- topstat=-1;
- topplayer=-1;
- for (var i = 14; i > -1; i--;)
- {
- rosterset=asset_get_index("player"+string(i));
- if rosterset.fullname != "" && rosterset.pos = ""
- {
- if rosterset.ref > topstat
- {
- topplayer=i;
- topstat=rosterset.ref;
- }
- }
- }
- rosterset=asset_get_index("player"+string(topplayer));
- rosterset.pos = "1B";
- rosterset.boxcolor=global.posbox[2,3];
- //place Short Stop
- topstat=-1;
- topplayer=-1;
- for (var i = 14; i > -1; i--;)
- {
- rosterset=asset_get_index("player"+string(i));
- if rosterset.fullname != "" && rosterset.pos = ""
- {
- if rosterset.ref > topstat
- {
- topplayer=i;
- topstat=rosterset.ref;
- }
- }
- }
- rosterset=asset_get_index("player"+string(topplayer));
- rosterset.pos = "SS";
- rosterset.boxcolor=global.posbox[5,3];
- //place Second Base
- topstat=-1;
- topplayer=-1;
- for (var i = 14; i > -1; i--;)
- {
- rosterset=asset_get_index("player"+string(i));
- if rosterset.fullname != "" && rosterset.pos = ""
- {
- if rosterset.ref > topstat
- {
- topplayer=i;
- topstat=rosterset.ref;
- }
- }
- }
- rosterset=asset_get_index("player"+string(topplayer));
- rosterset.pos = "2B";
- rosterset.boxcolor=global.posbox[3,3];
- //place Center Field
- topstat=-1;
- topplayer=-1;
- for (var i = 14; i > -1; i--;)
- {
- rosterset=asset_get_index("player"+string(i));
- if rosterset.fullname != "" && rosterset.pos = ""
- {
- if rosterset.thr > topstat
- {
- topplayer=i;
- topstat=rosterset.thr;
- }
- }
- }
- rosterset=asset_get_index("player"+string(topplayer));
- rosterset.pos = "CF";
- rosterset.boxcolor=global.posbox[7,3];
- //place Left Field
- topstat=-1;
- topplayer=-1;
- for (var i = 14; i > -1; i--;)
- {
- rosterset=asset_get_index("player"+string(i));
- if rosterset.fullname != "" && rosterset.pos = ""
- {
- if rosterset.thr > topstat
- {
- topplayer=i;
- topstat=rosterset.thr;
- }
- }
- }
- rosterset=asset_get_index("player"+string(topplayer));
- rosterset.pos = "LF";
- rosterset.boxcolor=global.posbox[6,3];
- //place Third Base
- topstat=-1;
- topplayer=-1;
- for (var i = 14; i > -1; i--;)
- {
- rosterset=asset_get_index("player"+string(i));
- if rosterset.fullname != "" && rosterset.pos = ""
- {
- if rosterset.ref > topstat
- {
- topplayer=i;
- topstat=rosterset.ref;
- }
- }
- }
- rosterset=asset_get_index("player"+string(topplayer));
- rosterset.pos = "3B";
- rosterset.boxcolor=global.posbox[4,3];
- //place Right Field
- topstat=-1;
- topplayer=-1;
- for (var i = 14; i > -1; i--;)
- {
- rosterset=asset_get_index("player"+string(i));
- if rosterset.fullname != "" && rosterset.pos = ""
- {
- if rosterset.thr > topstat
- {
- topplayer=i;
- topstat=rosterset.thr;
- }
- }
- }
- rosterset=asset_get_index("player"+string(topplayer));
- rosterset.pos = "RF";
- rosterset.boxcolor=global.posbox[8,3];
- }
- //Pick up
- if mouse_check_button_pressed(mb_left) && global.windowtype = "positionset" && cursorplayer = -1
- {
- for (var i = 9; i > -1; i--;)
- {
- if (mouse_x>global.posbox[i,0]-10 && mouse_x<global.posbox[i,0]+22) && (mouse_y>global.posbox[i,1]-10 && mouse_y<global.posbox[i,1]+22)
- {
- show_debug_message("Picking Up Position");
- pospick = global.posbox[i,2];
- for (var v = 14; v > -1; v--;)
- {
- rosterset=asset_get_index("player"+string(v));
- if rosterset.pos=pospick
- {
- show_debug_message("Pickup Pos Player Found");
- playpick = v;
- cursorpickup=1;
- rosterset.pos="";
- rosterset.boxcolor=c_gray;
- }
- }
- }
- }
- }
- //pickup list
- if mouse_check_button_pressed(mb_left) && global.windowtype = "positionset" && cursorplayer = -1
- {
- for (var i = 14; i > -1; i--;)
- {
- if (mouse_x>134 && mouse_x<247) && (mouse_y>20+(16*i) && mouse_y<39+(16*i))
- {
- show_debug_message("Pick Up List");
- playpick = global.playerlist[i];
- rosterset=asset_get_index("player"+string(global.playerlist[i]));
- rosterset.boxcolor=c_gray;
- if playpick = 15
- {
- cursorpickup=0;
- }
- else
- {
- cursorpickup=1;
- }
- rosterset.pos="";
- }
- }
- }
- //Put Down
- if mouse_check_button_pressed(mb_left) && global.windowtype = "positionset" && cursorplayer != -1
- {
- for (var i = 9; i > -1; i--;)
- {
- if (mouse_x>global.posbox[i,0]-10 && mouse_x<global.posbox[i,0]+22) && (mouse_y>global.posbox[i,1]-10 && mouse_y<global.posbox[i,1]+22)
- {
- show_debug_message("Detecting Position of Placement");
- posdetect=global.posbox[i,2];
- rosterset=asset_get_index("player"+string(cursorplayer));
- show_debug_message("player "+rosterset.fullname+" changed color from "+string(rosterset.boxcolor)+" to "+string(global.posbox[i,3]));
- rosterset.pos=global.posbox[i,2];
- rosterset.boxcolor=global.posbox[i,3];
- posboxstore=i;
- }
- }
- if posdetect != ""
- {
- rosterset=asset_get_index("player"+string(cursorplayer));
- global.logpass=rosterset.fullname +" is now " + posdetect;
- posdetect="";
- playerdetect = -1;
- cursorplayer = -1;
- playpick=1;
- pospick="";
- }
- else
- {
- show_debug_message("Spot Not Detected");
- rosterset.pos = "";
- posdetect="";
- playerdetect = -1;
- cursorplayer = -1;
- playpick=1;
- pospick="";
- }
- }
- if cursorpickup = 1
- {
- cursorplayer = playpick;
- cursorpickup = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement