void handlerChangeTab(TAB_MODE mode) { if (tabMode != mode) { tabMode = mode; UpdateSkill(); UpdateExp(); UpdateMoney(); } }
void DrawChannels(float width, float height) { return; int columns = 4; int rowCount = (int)Mathf.Ceil((float)channels.Count / (float)columns); float rowWidth = width - scrollBarWidth - 1; float buttonHeight = LINE_HEIGHT * 2f; float buttonWidth = rowWidth / columns; float totalHeight = Mathf.Max(height, buttonHeight * rowCount); channelScrollViewVector = GUI.BeginScrollView(new Rect(0, 0, width, height), channelScrollViewVector, new Rect(0, 0, rowWidth, totalHeight), false, true); for (int i = 0; i < channels.Count; i++) { float buttonLeft = i % columns * buttonWidth; float buttonTop = (i / columns) * buttonHeight; Channel channel = channels[i]; if (selectedChannelUrl == channel.GetUrl()) { Color c = GUI.backgroundColor; GUI.backgroundColor = Color.green; if (GUI.Button(new Rect(buttonLeft, buttonTop, buttonWidth, buttonHeight), "#" + channel.GetUrlWithoutAppPrefix())) { tabMode = TAB_MODE.CHAT; } GUI.backgroundColor = c; } else { if (GUI.Button(new Rect(buttonLeft, buttonTop, buttonWidth, buttonHeight), "#" + channel.GetUrlWithoutAppPrefix())) { Jiver.Join(channel.GetUrl()); Jiver.Connect(); messages.Clear(); tabMode = TAB_MODE.CHAT; channelName = "Connecting..."; } } } GUI.EndScrollView(); }
void SelectTab(TAB_MODE tab) { tabMode = tab; if (tabMode == TAB_MODE.CHANNEL) { btnChannel.GetComponent <Image>().overrideSprite = uiTheme.chatChannelButtonOn; btnChannel.GetComponentInChildren <Text>().color = uiTheme.chatChannelButtonOnColor; btnClan.GetComponent <Image>().overrideSprite = null; btnClan.GetComponentInChildren <Text>().color = uiTheme.chatChannelButtonOffColor; } else { btnChannel.GetComponent <Image>().overrideSprite = null; btnChannel.GetComponentInChildren <Text>().color = uiTheme.chatChannelButtonOffColor; btnClan.GetComponent <Image>().overrideSprite = uiTheme.chatChannelButtonOn; btnClan.GetComponentInChildren <Text>().color = uiTheme.chatChannelButtonOnColor; } }
void DrawTabs(float width, float height) { if (GUI.Button(new Rect(0, 0, width * 0.5f, height), channelName)) { tabMode = TAB_MODE.CHAT; } if (GUI.Button(new Rect(width * 0.5f, 0, width * 0.5f, height), "Channels")) { if (tabMode == TAB_MODE.CHAT) { tabMode = TAB_MODE.CHANNEL; Jiver.QueryChannelList(); } else { tabMode = TAB_MODE.CHAT; } } }
void SelectTab(TAB_MODE tab) { tabMode = tab; if (tabMode == TAB_MODE.CHANNEL) { btnChannel.GetComponent<Image>().overrideSprite = uiTheme.chatChannelButtonOn; btnChannel.GetComponentInChildren<Text>().color = uiTheme.chatChannelButtonOnColor; btnClan.GetComponent<Image>().overrideSprite = null; btnClan.GetComponentInChildren<Text>().color = uiTheme.chatChannelButtonOffColor; } else { btnChannel.GetComponent<Image>().overrideSprite = null; btnChannel.GetComponentInChildren<Text>().color = uiTheme.chatChannelButtonOffColor; btnClan.GetComponent<Image>().overrideSprite = uiTheme.chatChannelButtonOn; btnClan.GetComponentInChildren<Text>().color = uiTheme.chatChannelButtonOnColor; } }