void SendMsg() { ComLoading.Open(); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.GET_COMBO, new GetComboParam(Core.Data.playerManager.PlayerID)); task.ErrorOccured = (BaseHttpRequest b, string error) => { ConsoleEx.DebugLog("______Error =" + error.ToString()); ComLoading.Close(); }; task.afterCompleted = (BaseHttpRequest request, BaseResponse response) => { ComLoading.Close(); if (response.status != BaseResponse.ERROR) { isFristOpenClient = false; ComboResponse resp = response as ComboResponse; RTPlayer player = Core.Data.playerManager.RTData; player.TotalCombo = resp.data.combo.total; player.TotalGambleWin = resp.data.gamble.win; player.TotalGambleLose = resp.data.gamble.lose; UIOptionController.CreatOptionCtrl(DBUIController.mDBUIInstance._TopRoot); } else { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getNetworkErrorString(response.errorCode)); } }; task.DispatchToRealHandler(); }
public void open(string combo_name, Dictionary <int, string> select_options, Rect anchor, float height, KerbalXWindow parent_win, ComboResponse selection_callback) { if (active_anchor != combo_name) { active_anchor = combo_name; sel_options = select_options; response = selection_callback; anchor_rect = anchor; parent_window = parent_win; list_height = height; } }
//Uses the ComboBox class to setup a drop down menu. protected void combobox(string combo_name, Dictionary <int, string> select_options, int selected_id, float list_width, float list_height, DryUI win, ComboResponse resp ) { section(list_width, w => { float h = 22f + select_options.Count * 17; if (h > list_height) { h = list_height; } if (GUILayout.Button(select_options[selected_id], GUI.skin.textField, width(w - 20f))) { gameObject.AddOrGetComponent <ComboBox>().open(combo_name, select_options, anchors[combo_name], h, win, resp); } track_rect(combo_name, GUILayoutUtility.GetLastRect()); if (GUILayout.Button("\\/", width(20f))) { gameObject.AddOrGetComponent <ComboBox>().open(combo_name, select_options, anchors[combo_name], h, win, resp); } }); }