public void popGameOpts()
        {
            if (world.displayMessages == false)
            {
                return;
            }

            GameObject     obj      = Instantiate(prefabIOOpts) as GameObject;
            PopupIOOptions specific = obj.GetComponent <PopupIOOptions>();

            specific.ui  = ui;
            specific.map = ui.world.map;
            specific.bDismiss.onClick.AddListener(delegate { specific.dismiss(); });
            specific.bEdgeScroll.onClick.AddListener(delegate { specific.toggleEdgeScroll(); });
            specific.bSoundEffects.onClick.AddListener(delegate { specific.toggleSoundEffects(); });
            ui.addBlocker(specific.gameObject);
        }
Esempio n. 2
0
        public void startup(PopupGameOptions opts)
        {
            Log("Called startup");

            Params param = new Params();

            //param.loadFromFile();

            //Apply the choices the user made in the choice screen
            param.overmind_powerRegen           *= opts.powerGainPercent / 100f;
            param.person_suspicionPerEvidence   *= opts.susGainPercent / 100f;
            param.awareness_master_speed        *= opts.awarenessGainSpeed / 100f;
            param.unit_investigatorsPerProvince *= opts.investigatorCount / 100f;
            param.mapGen_sizeX       = opts.sizeX;
            param.mapGen_sizeY       = opts.sizeY;
            param.mapGen_burnInSteps = opts.burnIn;
            param.unit_investigatorsSeeEnthralled = opts.investigatorsSee ? 1 : 0;
            param.useLightbringer                 = opts.allowLightbringer ? 1 : 0;
            param.useAwareness                    = opts.useAwareness ? 1 : 0;
            param.usePaladins                     = opts.usePaladins ? 1 : 0;
            param.overmind_maxEnthralled          = opts.nAgents;
            param.overmind_allowDirectEnthralling = opts.politicalStart ? 1:0;
            param.unit_armyHPMult                 = opts.armyHPMult / 100d;
            param.society_bonusSecurityMult       = opts.bonusSecurity / 100d;

            World.log("Opts use awareness " + opts.useAwareness);

            map = new Map(param);
            GraphicalMap.map   = map;
            GraphicalMap.world = this;

            map.seed      = opts.currentSeed;
            map.automatic = automatic;

            if (opts.useSimplified)
            {
                map.simplified = true;
                map.param.overmind_allowDirectEnthralling = 0;
                map.agentsOnly = true;
                if (opts.difficultySetting > 0)
                {
                    map.param.usePaladins = 1;
                }
            }
            else
            {
                map.agentsOnly = false;
            }
            if (param.overmind_allowDirectEnthralling == 0)
            {
                param.flashEnthrallables = false;
            }

            Property_Prototype.loadProperties(map);
            EconTrait.loadTraits(map);
            staticMap = map;
            map.world = this;
            map.globalist.buildBasicElements();
            Eleven.random = new System.Random(opts.currentSeed);
            map.gen();
            if (advancedEdition)
            {
                map.param.option_useAdvancedGraphics = 1;
            }
            PopupIOOptions.load(map);
            if (!advancedEdition)//Force it down, even if the IO options deceive you, if you are not actually the advanced edition
            {
                map.param.option_useAdvancedGraphics = 0;
            }



            //ui.setToWorld();
            displayMessages = !automatic;
            Log("Got to end of initial startup");
            ui.checkData();

            ui.setToVoting();
            ui.setToWorld();
            //bQuicksave();

            musicPlayer.stopTheme();

            if (map.simplified)
            {
                printSimplifiedMessage();
            }
            else if (map.automatic)
            {
                map.overmind.autoAI.popAIModeMessage();
            }
            map.hintSystem.popHint(HintSystem.hintType.INFILTRATION);
        }
 public void autoDismiss()
 {
     World.autodismissAutosave = 1;
     PopupIOOptions.saveState();
     ui.removeBlocker(this.gameObject);
 }