Example #1
0
    public void UpdateDisplayItemData()
    {
        LogUtil.Log("UIPanelModeTypeChoice:UpdateDisplayItemData");

        UIColors.UpdateColors();

        UIUtil.SetLabelValue(labelDisplayItemStatus, GetStatusItemProgress());

        AppContentChoice choice = GetCurrentChoice();

        if (choice != null)
        {
            string choiceTitle    = "Loading...";
            string choiceQuestion = "Loading...";

            if (choice != null)
            {
                choiceTitle    = "Question";
                choiceQuestion = choice.display_name;
            }

            UIUtil.SetLabelValue(labelDisplayItemTitle, choiceTitle);
            UIUtil.SetLabelValue(labelDisplayItemQuestion, choiceQuestion);
        }
    }
Example #2
0
    public void ShowOverview()
    {
        HideStates();

        containerOverview.Show();

        ShowCamera();

        ShowLoaderSpinner();

        UpdateOverviewWorld();

        if (containerLoader.Has <GameObjectImageFill>())
        {
            GameObjectImageFill fill = containerLoader.Get <GameObjectImageFill>();
            fill.Reset();
        }

        // Update team display

        //LogUtil.Log("ShowOverview:");

        flowState = AppOverviewFlowState.GeneralTips;

        UIPanelDialogBackground.ShowDefault();

        UIUtil.SetLabelValue(labelOverviewType, AppContentStates.Current.display_name);

        AnimateInBottom(containerOverview);

        UIColors.UpdateColors();

        InvokeRepeating("ShowOverviewTip", 0, 15);
    }
Example #3
0
 bool userClose = true; //是否点击右上角的关闭按钮
 public BookShelf(Form form)
 {
     InitializeComponent();
     this.form = form;
     UIColors.SetControlColors(this);
     GetData();
 }
 public AddBlackWord(string word)
 {
     InitializeComponent();
     UIColors.SetControlColors(this);
     textBox1.Text = word;
     textBox2.Focus();
 }
    public override void SyncColors()
    {
        // Set initial color by mode

        if (AppModes.Instance.isAppModeGameTraining)
        {
            // purple
            UIColors.ColorToPurple(gameObject);
        }
        else if (AppModes.Instance.isAppModeGameChallenge)
        {
            // blue
            UIColors.ColorToBlue(gameObject);
        }
        else if (AppModes.Instance.isAppModeGameArcade)
        {
            // green
            UIColors.ColorToOrange(gameObject);
        }
        else
        {
            // green
            UIColors.ColorToGreen(gameObject);
        }
    }
    public override void SyncColors()
    {
        string colorTypeString = colorType.ToString();

        if (colorCustomTypes == null)
        {
            colorCustomTypes = new UIColorCustomType();
        }

        if (colorCustomTypes.ContainsKey(colorTypeString))
        {
            colorKey = colorCustomTypes.Get <string>(colorType.ToString());

            if (!string.IsNullOrEmpty(colorKey))
            {
                AppColor appColor = AppColors.Instance.GetById(colorKey);

                if (appColor != null)
                {
                    Color colorTo = appColor.GetColor();
                    colorTo.a = colorAlpha;
                    UIColors.ColorTo(
                        gameObject, colorTo);

                    foreach (Transform t in gameObject.transform)
                    {
                        UIColors.ColorTo(
                            t.gameObject, colorTo);
                    }
                }
            }
        }
    }
Example #7
0
        public RellowGame(
            IScreenTransformationMatrixProvider matrixScaleProvider,
            AssetsLoader assetsLoader,
            GameOrchestrator gameOrchestrator,
            SoundManager soundManager,
            ISettingsRepository settingsRepository,
            ILocalizedStringsRepository localizedStringsRepository)
        {
            _localizedStringsRepository = localizedStringsRepository;
            _matrixScaleProvider        = matrixScaleProvider ?? throw new ArgumentNullException(nameof(matrixScaleProvider));

            _gameButtonsManager = new GameButtonsManager(
                assetsLoader,
                localizedStringsRepository,
                new Vector2(60f, 800f));

            _scoreDifferentialPopups = new List <PopupText>();

            _soundManager       = soundManager ?? throw new ArgumentNullException(nameof(soundManager));
            _gameOrchestrator   = gameOrchestrator ?? throw new ArgumentNullException(nameof(gameOrchestrator));
            _settingsRepository = settingsRepository ?? throw new ArgumentNullException(nameof(settingsRepository));

            _currentGameState = GameStates.PlayingWaitingForInput;
            _gameColors       = new UIColors(_gameButtonsManager.SpawnableColors.Select(c => c.ColorGraphic).ToArray());

            _choiceTime = TimeSpan.FromSeconds(2.5);

            _backgroundRectangle = new Rectangle(0, 0, matrixScaleProvider.VirtualWidth, matrixScaleProvider.VirtualHeight);

            _scoreTextTitle = localizedStringsRepository.Get(GameStringsLoader.ScoreStringKey);

            _gameButtonsManager = new GameButtonsManager(
                assetsLoader,
                localizedStringsRepository,
                new Vector2(60f, 720f));
            _gameButtonsManager.OnLost += _gameButtonsManager_OnLost;
            _gameButtonsManager.OnWon  += _gameButtonsManager_OnWon;

            _writingFont = assetsLoader.WritingFont;

            _colorTextBackgroundRectangle = new Rectangle(
                0, 500,
                matrixScaleProvider.VirtualWidth,
                120);

            _numberOfVictories = 0;
            _score             = 0;

            _timeProgressBar = new ProgressBar(
                new Rectangle(
                    0, 0,
                    matrixScaleProvider.VirtualWidth,
                    matrixScaleProvider.VirtualHeight),
                _gameColors.TimerBarColor,
                (int)_choiceTime.TotalMilliseconds);

            UpdateScoreString();
            NewRound();
        }
Example #8
0
    public void UpdateResultItemData()
    {
        LogUtil.Log("UIPanelModeTypeChoice:UpdateResultItemData");

        UIUtil.SetLabelValue(labelResultItemStatus, GetStatusItemProgress());

        UIColors.UpdateColors();

        AppContentChoice choice = GetCurrentChoice();

        string typeValue = "CORRECT";
        string codeValue = "FALSE";

        if (isCorrect) //currentChoiceData.CheckChoices(true)) {
        {
            UIColors.UpdateColor(containerChoiceResultItem, UIColors.colorGreen);
            typeValue = "CORRECT!";
            GameAudioController.PlaySoundPlayerActionGood();
            choicesCorrect += 1;
        }
        else
        {
            UIColors.UpdateColor(containerChoiceResultItem, UIColors.colorRed);
            typeValue = "INCORRECT...";
            GameAudioController.PlaySoundPlayerActionBad();
        }

        foreach (AppContentChoiceItem choiceItem in choice.choices)
        {
            if (choiceItem != null)
            {
                if (choiceItem.IsTypeCorrect())
                {
                    codeValue = choiceItem.display;
                }
            }
        }

        if (choice != null)
        {
            string choiceResultType        = typeValue;
            string choiceResultValue       = codeValue;
            string choiceResultDescription = choice.description;
            string choiceResultDisplayName = choice.display_name;

            if (choice != null)
            {
                //choiceQuestion = choice.display_name + choice.code;
            }

            UIUtil.SetLabelValue(labelResultItemChoiceDisplayName, choiceResultDisplayName);
            UIUtil.SetLabelValue(labelResultItemChoiceDescription, choiceResultDescription);
            UIUtil.SetLabelValue(labelResultItemChoiceResultValue, choiceResultValue);
            UIUtil.SetLabelValue(labelResultItemChoiceResultType, choiceResultType);
        }
    }
Example #9
0
    // DISPLAY ITEM

    public void ShowDisplayItem()
    {
        LogUtil.Log("UIPanelModeTypeChoice:ShowDisplayItem");

        HideStates();

        StartCoroutine(ShowDisplayItemCo());

        UIColors.UpdateColors();
    }
    public void ShowContent()
    {
        UIPanelDialogBackground.ShowDefault();

        AnimateInBottom(containerContent);

        ContentPause();

        UIColors.UpdateColors();
    }
Example #11
0
 public override void SyncColors()
 {
     if (!string.IsNullOrEmpty(colorKey))
     {
         Color colorTo = GameProfileCharacters.currentCustom.GetCustomColor(colorKey);
         colorTo.a = colorAlpha;
         UIColors.ColorTo(
             gameObject, colorTo);
     }
 }
Example #12
0
 private void CheckIfSelected(SOTower selectedTower)
 {
     if (selectedTower == tower)
     {
         UIColors.Highlight(towerButton);
     }
     else
     {
         UIColors.UnHighlight(towerButton);
     }
 }
    private void Select(Button select)
    {
        var previous = selected;

        this.selected = select;
        if (previous != null)
        {
            UIColors.UnHighlight(previous);
        }
        UIColors.Highlight(selected);
    }
Example #14
0
 void Init()
 {
     UIColors.SetControlColors(this);
     checkBox_night_mode.Checked = UIColors.IsNightMode;
     site = Tools.source.Site;
     label_source.Text       = "当前来源:" + site;
     tools                   = new Tools();
     tools.HTMLGetCompleted += Tools_HTMLGetCompleted;
     GetChapters(Tools.source.ID, novelName);
     GetBlackWords();
     GetContent();
 }
Example #15
0
    public PlayerTurnData(PutPlayRequestData lastPutPlay, ClientController.PlayerState role)
    {
        this.lastPlay       = lastPutPlay;
        this.playedThisTurn = false;
        this.role           = role;
        playingRole         = role;

        int colorToGet = nextUiColor;

        IncrementeNextUIColor();
        _uiColor = (UIColors)colorToGet;
    }
Example #16
0
    public void ShowOverview()
    {
        HideStates();

        UIPanelDialogBackground.ShowDefault();

        //LogUtil.Log("UIPanelModeTypeChoice:ShowOverview:flowState:" + flowState);

        AnimateInBottom(containerChoiceOverview);

        ContentPause();

        UIColors.UpdateColors();
    }
Example #17
0
        public MainWindowViewModel()
        {
            DBHelper = new PostgreSQLDBHelper();

            // PostgreSQL の方がつながっていなければオフラインの sqlite に切り替え。
            if (!DBHelper.Connected)
            {
                DBHelper = new DatabaseHelper("Diarydb");
                SwitchDBCommand.Execute(DBType.Local);
            }

            LoadCommand.Execute();

            UIColors.ChangeTheme((ColorTheme)Enum.ToObject(typeof(ColorTheme), Properties.Settings.Default.ColorTheme));
        }
Example #18
0
 public Search()
 {
     InitializeComponent();
     Width = listView2.Left;
     comboBox_Source.SelectedIndex = 0;
     MySqlite.InitDB();
     if (!File.Exists(MySqlite.path))
     {
         Tools.CreateTable();  //不存在数据库,创建新表
     }
     UIColors.SetControlColors(this);
     webTools = new Tools();
     //网络请求结束的事件
     webTools.HTMLGetCompleted += Tools_HTMLGetCompleted;
 }
Example #19
0
 public ModifyBlackWords(string word, string instead, string type)
 {
     InitializeComponent();
     UIColors.SetControlColors(this);
     textBox_source.Text        = word;
     textBox_sourceinstead.Text = instead;
     textBox_des.Text           = word;
     textBox_desinstead.Text    = instead;
     textBox_des.Focus();
     textBox_des.SelectAll();
     if (type == "正则表达式")
     {
         radioButton2.Checked = true;
     }
 }
Example #20
0
    public void ShowOverview()
    {
        HideStates();

        flowState = AppOverviewFlowState.Mode;

        UIPanelDialogBackground.ShowDefault();

        UIUtil.SetLabelValue(labelOverviewType, AppContentStates.Current.display_name);

        AnimateInBottom(containerOverview);

        ContentPause();

        UIColors.UpdateColors();
    }
Example #21
0
    IEnumerator ShowDisplayItemCo()
    {
        yield return(new WaitForEndOfFrame());

        UIPanelDialogBackground.ShowDefault();

        //LogUtil.Log("UIPanelModeTypeChoice:ShowDisplayItem:flowState:" + flowState);

        AnimateInBottom(containerChoiceDisplayItem);

        loadDataChoice();

        UIColors.UpdateColors();

        ContentPause();
    }
Example #22
0
    public void ShowTips()
    {
        HideStates();

        flowState = AppOverviewFlowState.GeneralTips;

        UIPanelDialogBackground.ShowDefault();

        UIUtil.SetLabelValue(labelOverviewType, AppContentStates.Current.display_name);

        //LogUtil.Log("UIPanelModeTypeChoice:ShowOverview:flowState:" + flowState);

        AnimateInBottom(containerOverviewGameplayTips);

        UIColors.UpdateColors();
    }
Example #23
0
    public void ShowOverview()
    {
        HideStates();

        // Update team display
        //LogUtil.Log("ShowOverview:");

        flowState = AppOverviewFlowState.Mode;

        UIPanelDialogBackground.ShowDefault();

        UpdateOverviewWorld();

        UIUtil.SetLabelValue(labelOverviewType, AppContentStates.Current.display_name);

        AnimateInBottom(containerOverview);

        GameCustomController.BroadcastCustomSync();

        foreach (GameCustomPlayer customPlayer in gameObject.GetList <GameCustomPlayer>())
        {
            if (customPlayer.isActorTypeEnemy)
            {
                GameTeam team = GameTeams.Current;

                if (team != null)
                {
                    UIUtil.SetLabelValue(labelOverviewTeamEnemy, team.display_name);

                    GameCustomCharacterData customInfo = new GameCustomCharacterData();
                    customInfo.actorType         = GameCustomActorTypes.enemyType;
                    customInfo.presetColorCode   = team.data.GetColorPreset().code;
                    customInfo.presetTextureCode = team.data.GetTexturePreset().code;
                    customInfo.type     = GameCustomTypes.teamType;
                    customInfo.teamCode = team.code;

                    customPlayer.Load(customInfo);
                }
            }
        }

        ContentPause();

        UIColors.UpdateColors();
    }
Example #24
0
    public void ShowOverview()
    {
        HideStates();

        containerOverview.Show();

        ShowCamera();

        // Update team display

        //LogUtil.Log("ShowOverview:");

        flowState = AppOverviewFlowState.GeneralTips;

        UIPanelDialogBackground.ShowDefault();

        UIUtil.SetLabelValue(labelOverviewType, AppContentStates.Current.display_name);

        AnimateInBottom(containerOverview);

        UIColors.UpdateColors();

        InvokeRepeating("ShowOverviewTip", 0, 15);
    }
Example #25
0
 private void Start()
 {
     UIColors.Highlight(buttonBuy);
 }
Example #26
0
 private void checkBox_night_mode_CheckedChanged(object sender, EventArgs e)
 {
     UIColors.SetNightMode(checkBox_night_mode.Checked);
     UIColors.SetControlColors(this);
 }
Example #27
0
 public virtual void ColorTo(GameObject inst, Color colorTo)
 {
     UIColors.AnimateColor(inst, colorTo);
 }
 public AddBlackWord()
 {
     InitializeComponent();
     UIColors.SetControlColors(this);
 }
Example #29
0
 public BlackWords()
 {
     InitializeComponent();
     UIColors.SetControlColors(this);
     GetData();
 }
Example #30
0
    public void UpdateDisplayStateResultsData()
    {
        LogUtil.Log("UIPanelModeTypeChoice:UpdateDisplayStateResultsData");

        UIColors.UpdateColors();

        UIUtil.SetLabelValue(labelResultsStatus, "Results");

        GameAudioController.PlaySoundPlayerActionGood();

        //double timeCompleted = 30; // TODO
        double coins         = 500;
        double choiceTotal   = choices.Count;
        double choicesResult = choicesCorrect / choiceTotal;

        coins = choicesCorrect * 100;

        string scoreFractionValue   = string.Format("{0}/{1}", choicesCorrect, choiceTotal);
        string scorePercentageValue = choicesResult.ToString("P0");
        //string scoreTitleValue = ;
        //string scoreTypeValue = "4/5";
        string scoreCoinsValue = coins.ToString("N0");

        UIUtil.SetSliderValue(sliderScore, choicesResult);

        UIUtil.SetLabelValue(labelResultsScoreFractionValue, scoreFractionValue);
        UIUtil.SetLabelValue(labelResultsScorePercentageValue, scorePercentageValue);
        //UIUtil.SetLabelValue(labelResultsTitle, choiceResultValue);
        //UIUtil.SetLabelValue(labelResultsType, choiceResultType);
        UIUtil.SetLabelValue(labelResultsCoinsValue, scoreCoinsValue);

        // REWARDS

        GameProfileRPGs.Current.AddCurrency(coins);

        GamePlayerProgress.SetStatCoins(coins);
        GamePlayerProgress.SetStatCoinsEarned(coins);

        double xpEarned = coins * 2;

        GamePlayerProgress.SetStatXP(xpEarned);

        GameProfileCharacters.Current.CurrentCharacterAddGamePlayerProgressXP(xpEarned);
        GameProfileCharacters.Current.CurrentCharacterAddGamePlayerProgressEnergy(1f); // refill
        GameProfileCharacters.Current.CurrentCharacterAddGamePlayerProgressHealth(1f); // refill

        GameController.ProcessLevelStats();


        /*
         * AppContentChoice choice = GetCurrentChoice();
         *
         * if(choice != null) {
         *
         *  string choiceTitle = "Loading...";
         *  string choiceQuestion = "Loading...";
         *
         *  if(choice != null) {
         *      choiceTitle = "Question";
         *      choiceQuestion = choice.display_name + choice.code;
         *  }
         *
         *  UIUtil.SetLabelValue(labelDisplayItemTitle, choiceTitle);
         *  UIUtil.SetLabelValue(labelDisplayItemQuestion, choiceQuestion);
         * }
         */
    }