Loading

Paste #pb6cuve2a

  1. /* Display "Configure" or "Settings" button: */
  2. _game_mode != GM_NORMAL // not in a game, and thus, display the "Configure" button
  3. _game_mode == GM_NORMAL // in a game, check if something is selected or not
  4.  
  5. this->selected_slot == INVALID_COMPANY // nothing is selected, and thus, display the "Configure" button
  6. this->selected_slot != INVALID_COMPANY // something is selected, check IsEditable
  7.  
  8. /* all slots are editable in a normal game, except invalid, human companies or when no gs script is running */
  9. IsEditable(this->selected_slot) = false // invalid, or human company or (none) gs script in this slot, and thus, display the "Configure" button
  10. IsEditable(this->selected_slot) = true  // slot is either orange, red or green, check if it's AI or GS slot
  11.  
  12. this->selected_slot != OWNER_DEITY // it's an AI slot, check IsValidAiID
  13. this->selected_slot == OWNER_DEITY // it's a GS slot, and thus, display the "Settings" button
  14.  
  15. /* Check for orange and red AI slots */
  16. Company::IsValidAiID(selected_slot) = false // AI slot is orange, and thus, "Configure"
  17. Company::IsValidAiID(selected_slot) = true  // AI slot is either red or green, check IsDead
  18.  
  19. Company::Get(selected_slot)->ai_instance->IsDead() = true  // AI slot is red, and thus, display the "Configure" button
  20. Company::Get(selected_slot)->ai_instance->IsDead() = false // AI slot is green, and thus, display the "Settings" button

Version history

Revision # Author Created at
pllqjeyt8 Anonymous 24 Apr 2016, 16:54:47 UTC Diff
pcjfb5zge Anonymous 24 Apr 2016, 16:49:56 UTC Diff
p2bqmlcma Anonymous 24 Apr 2016, 16:49:44 UTC Diff

Comments