Pararena2/Sources/TeamSetUp.c

1 line
19 KiB
C
Raw Normal View History

/*============================================================*/ /*============================================================*/ /*== ==*/ /*== Team Set-Up Routines ==*/ /*== ==*/ /*============================================================*/ /*============================================================*/ /*======================================================== Includes */ #include "Globals.h" #include "UnivUtilities.h" #include "TeamSetUp.h" #include "MainWindow.h" #include "Menu.h" /*======================================================== Local Variables */ Rect leftStandRect, rightStandRect, teamsLabelRect, teamsPopUpRect; Rect iconRects[8]; MenuHandle teamsPopUp; short leftSelected, rightSelected, teamsPopUpWidth, popUpItemSelected; /*======================================================== Functions */ /*======================================================== WhosOnFirst */ void WhosOnFirst (void) { if (leftPlayerNumber == kHumanPlayer) { leftGoalIsPlayers = TRUE; thePlayer.persona = kHumanPlayer; theOpponent.persona = rightPlayerNumber; thePlayer.whichGoal = kLeftGoal; theOpponent.whichGoal = kRightGoal; disableBoardCursor = FALSE; leftGoalLeague = isLeague; if (netGameInSession) rightGoalLeague = theirLeague; else rightGoalLeague = kProfessional; if (arenaSize == kLargeArena) { thePlayer.initXPos = kLgInitLeftXPos; thePlayer.initZPos = kLgInitLeftZPos; theOpponent.initXPos = kLgInitRightXPos; theOpponent.initZPos = kLgInitRightZPos; } else { thePlayer.initXPos = kSmInitLeftXPos; thePlayer.initZPos = kSmInitLeftZPos; theOpponent.initXPos = kSmInitRightXPos; theOpponent.initZPos = kSmInitRightZPos; } } else if (rightPlayerNumber == kHumanPlayer) { leftGoalIsPlayers = FALSE; thePlayer.persona = kHumanPlayer; theOpponent.persona = leftPlayerNumber; thePlayer.whichGoal = kRightGoal; theOpponent.whichGoal = kLeftGoal; disableBoardCursor = FALSE; rightGoalLeague = isLeague; if (netGameInSession) leftGoalLeague = theirLeague; else leftGoalLeague = kProfessional; if (arenaSize == kLargeArena) { thePlayer.initXPos = kLgInitRightXPos; thePlayer.initZPos = kLgInitRightZPos; theOpponent.initXPos = kLgInitLeftXPos; theOpponent.initZPos = kLgInitLeftZPos; } else { thePlayer.initXPos = kSmInitRightXPos; thePlayer.initZPos = kSmInitRightZPos; theOpponent.initXPos = kSmInitLeftXPos; theOpponent.initZPos = kSmInitLeftZPos; } } else { leftGoalIsPlayers = TRUE; thePlayer.persona = leftPlayerNumber; theOpponent.persona = rightPlayerNumber; thePlayer.whichGoal = kLeftGoal; theOpponent.whichGoal = kRightGoal; leftGoalLeague = kProfessional; rightGoalLeague = kProfessional; disableBoardCursor = TRUE; if (arenaSize == kLargeArena) { thePlayer.initXPos = kLgInitLeftXPos; thePlayer.initZPos = kLgInitLeftZPos; theOpponent.initXPos = kLgInitRightXPos; theOpponent.initZPos = kLgInitRightZPos; } else { thePlayer.initXPos = kSmInitLeftXPos; thePlayer.initZPos = kSmInitLeftZPos; theOpponent.initXPos = kSmInitRightXPos; theOpponent.initZPos = kSmInitRightZPos; } } } /*======================================================== UpdateLeftStand */ void UpdateLeftStand (DialogPtr theDialog) { Rect theRect; CIconHandle theCIcon; Handle itemHandle, theIcon; short itemType; GetDItem(theDialog, kLeftStandItem, &itemType, &itemHandle, &theRect); if (isColor) { if ((leftSelected == kNetHuman) && (!canNetwork)) theCIcon = GetCIcon(1009); else theCIcon = GetCIcon(1001 + leftSelected); PlotCIcon(&theRect, theCIcon); DisposCIcon(theCIcon); } else { if ((leftSelected == kNetHuman) && (!canNetwork)) theIcon = GetIcon(1009); else theIcon = GetIcon(1001 + leftSelected); PlotIcon(&theRect, theIcon); } } /*======================================================== UpdateRightStand */ void UpdateRightStand (DialogPtr theDialog) { Rect theRect; CIconHan