/// <summary> /// 获取标签生成器 /// </summary> protected override TagBuilder GetTagBuilder() { var builder = new AlertBuilder(); Config(builder); return(builder); }
private void OnFurniList(DataInterceptedEventArgs e) { e.Continue(); IEnumerable <CHItem> items = CHItem.Parse(e.Packet) .Where(i => i.TypeId == 3 && !Photos.ContainsKey(i.Id)); int itemCount = items.Count(); HabboAlert alert = AlertBuilder.CreateAlert(HabboAlertType.Bubble, (itemCount == 0 ? Constants.SCANNING_EMPTY : itemCount.ToString()) + (itemCount == 1 ? Constants.SCANNING_SINGLE : Constants.SCANNING_MULTI) + Constants.SCANNING_INVENTORY_DONE) .WithImageUrl(Constants.BASE_URL + Constants.BUBBLE_ICON_URL); Connection.SendToClientAsync(alert.ToPacket(In.NotificationDialog)); //TODO: Show user the queueu in photo processing pipeline _isProcessingItems = true; //Send all photo items in inventory to photo data processing pipeline. foreach (CHItem item in items) { var photoItem = PhotoItem.Create(item.Id, item.ExtraData, Hotel, SessionUsername, roomId: null); _photoPublishingQueue.Enqueue(photoItem); } }
public static string Error(string title, string text, int width = -1) { using (var ab = new AlertBuilder(AlertType.Error, title, width)) { ab.AppendRow(text); return(ab.ToString()); } }
void GameWon() { // TODO: Load game winning scene AlertBuilder.GameWonAlert(); Debug.LogWarning("All enemies captured! You win!"); }
public static string Title(string header, string title, int width = -1) { using (var ab = new AlertBuilder(AlertType.Title, header, width)) { ab.AppendRow(title); return(ab.ToString()); } }
public static string Usage(string text, int width = -1) { using (var ab = new AlertBuilder(AlertType.Usage, null, width)) { ab.AppendRow(text); return(ab.ToString()); } }
public override void TeleportToJail() { AlertBuilder.StarfishEscapeWarningAlert(BREAKOUT_DELAY); m_Agent.Warp(GameController.Current.Jail.RandomLocation()); m_BreakoutFlag = true; m_BreakoutTimer = Time.timeSinceLevelLoad + BREAKOUT_DELAY; }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { AlertBarManager.Alert("Default", AlertBuilder.Build() .WithTitle("TestTitle") .WithMessage("Hello") .WithAction("Klick mich", () => MessageBox.Show("Hier ist die Antwort: 42"), true) //.AsStickyInfo() .WithBackground(Colors.Pink)); }
protected void BreakEnemyOut() { var jail = GameController.Current.Jail; Enemy.Animator.SetBool("starfish_smash", false); Enemy.Animator.SetTrigger("starfish_walk"); Enemy.Agent.speed = m_StarEnemy.WalkSpeed; m_TimerFlag = true; m_BreakoutState = true; AlertBuilder.StarfishBreakoutAlert(); }
public void ReleaseEnemy(BaseEnemy enemy) { if (m_JailEnemies.Count <= 0) { throw new UnityException("No enemies to release from jail"); } AlertBuilder.EnemyEscapedAlert(enemy.GetType().ToString()); m_FreeEnemies.Add(enemy); m_JailEnemies.Find(x => x.Equals(enemy)).Enabled(true); m_JailEnemies.Remove(enemy); GameController.Current.UpdateScore(); }
public override IDisposable Alert(AlertConfig config) { var activity = this.TopActivityFunc(); if (activity is AppCompatActivity) { return(this.ShowDialog <AlertAppCompatDialogFragment, AlertConfig>((AppCompatActivity)activity, config)); } if (activity is FragmentActivity) { return(this.ShowDialog <AlertDialogFragment, AlertConfig>((FragmentActivity)activity, config)); } return(this.Show(activity, AlertBuilder.Build(activity, config))); }
public void ReleaseRandomEnemy() { if (m_JailEnemies.Count <= 0) { throw new UnityException("No enemies to release from jail"); } int randEnemy = Random.Range(0, m_JailEnemies.Count); AlertBuilder.EnemyEscapedAlert(m_JailEnemies[randEnemy].GetType().ToString()); m_FreeEnemies.Add(m_JailEnemies[randEnemy]); m_JailEnemies[randEnemy].Enabled(true); m_JailEnemies.RemoveAt(randEnemy); GameController.Current.UpdateScore(); }
private async void OnItems(DataInterceptedEventArgs e) { e.Continue(); IEnumerable <HWallItem> items = HWallItem.Parse(e.Packet) .Where(i => i.TypeId == 3 && !Photos.ContainsKey(i.Id) && !_roomPhotoQueue.Contains(i.Id)); IEnumerable <int> unknownIds = await Api.BatchCheckExistingIdsAsync(items.Select(i => i.Id), Hotel).ConfigureAwait(false); int itemCount = items.Count(); int unknownCount = unknownIds.Count(); string alertMessage = (itemCount == 0 ? Constants.SCANNING_EMPTY : itemCount.ToString()) + (itemCount == 0 || itemCount > 1 ? Constants.SCANNING_MULTI : Constants.SCANNING_SINGLE) + Constants.SCANNING_WALLITEMS_DONE; if (unknownCount > 0) { alertMessage += " " + unknownCount + Constants.SCANNING_WALLITEMS_UNDISC; } HabboAlert alert = AlertBuilder.CreateAlert(HabboAlertType.Bubble, alertMessage) .WithImageUrl(Constants.BASE_URL + Constants.BUBBLE_ICON_URL); await Connection.SendToClientAsync(alert.ToPacket(In.NotificationDialog)).ConfigureAwait(false); _isProcessingItems = true; foreach (HWallItem item in items) { if (unknownIds.Contains(item.Id)) { _roomPhotoQueue.Enqueue(item.Id); _roomPhotoItems.TryAdd(item.Id, item); } else { //TODO: Another pipeline. await GetKnownPhotoByIdAsync(item.Id); } } }
public override IDisposable ActionSheet(ActionSheetConfig config) { return(this.Present(AlertBuilder.ActionSheetBuild(config))); }
public override IDisposable Alert(AlertConfig config) { return(this.Present(AlertBuilder.AlertBuild(config))); }
protected override Dialog CreateDialog(AlertConfig config) { return(AlertBuilder.Build(this.Activity as AppCompatActivity, config).Create()); }