private void OnSpeakerFormOpen(CUIEvent uiEvent) { uint key = uiEvent.m_eventParams.commonUInt32Param1; switch (key) { case 0x2739: case 0x273a: { ResHornInfo dataByKey = GameDataMgr.speakerDatabin.GetDataByKey(key); this.m_itemID = key; this.m_characterLimit = dataByKey.dwWordLimit; if (dataByKey == null) { return; } CUIFormScript script = Singleton <CUIManager> .instance.OpenForm(SPEAKER_FORM_PATH, false, false); if ((script == null) || (script.gameObject == null)) { return; } GameObject obj2 = Utility.FindChild(script.gameObject, "pnlBg/Title/speakerText"); GameObject obj3 = Utility.FindChild(script.gameObject, "pnlBg/Title/loudSpeakerText"); GameObject obj4 = Utility.FindChild(script.gameObject, "pnlBg/Model/speaker"); GameObject obj5 = Utility.FindChild(script.gameObject, "pnlBg/Model/loudspeaker"); InputField componetInChild = Utility.GetComponetInChild <InputField>(script.gameObject, "pnlBg/Panel_Main/InputField"); Utility.GetComponetInChild <CUITimerScript>(script.gameObject, "Timer").ReStartTimer(); if (key == 0x2739) { obj2.CustomSetActive(true); obj3.CustomSetActive(false); obj4.CustomSetActive(true); obj5.CustomSetActive(false); componetInChild.characterLimit = (int)this.m_characterLimit; } else { obj2.CustomSetActive(false); obj3.CustomSetActive(true); obj4.CustomSetActive(false); obj5.CustomSetActive(true); componetInChild.characterLimit = (int)this.m_characterLimit; } break; } } }
public static uint GetSpeakerVaildTime(CS_HORN_TYPE type) { ResHornInfo dataByKey = null; ListView <COMDT_CHAT_MSG_HORN> speakerList = Singleton <CLoudSpeakerSys> .instance.GetSpeakerList(type); if (type == CS_HORN_TYPE.CS_HORNTYPE_SMALL) { dataByKey = GameDataMgr.speakerDatabin.GetDataByKey(0x2739); } else { dataByKey = GameDataMgr.speakerDatabin.GetDataByKey(0x273a); } if (speakerList.Count == 0) { return(dataByKey.dwMaxShowSec); } return(dataByKey.dwMinShowSec); }
public static ResHornInfo GetRes(int speakerID) { if (speakerID == 10041) { if (CLoudSpeakerSys.speakerRes == null) { CLoudSpeakerSys.speakerRes = GameDataMgr.speakerDatabin.GetDataByKey(10041u); } return(CLoudSpeakerSys.speakerRes); } if (speakerID == 10042) { if (CLoudSpeakerSys.loudSpeakerRes == null) { CLoudSpeakerSys.loudSpeakerRes = GameDataMgr.speakerDatabin.GetDataByKey(10042u); } return(CLoudSpeakerSys.loudSpeakerRes); } return(null); }
public static ResHornInfo GetRes(int speakerID) { if (speakerID == 0x2739) { if (speakerRes == null) { speakerRes = GameDataMgr.speakerDatabin.GetDataByKey((uint)0x2739); } return(speakerRes); } if (speakerID != 0x273a) { return(null); } if (loudSpeakerRes == null) { loudSpeakerRes = GameDataMgr.speakerDatabin.GetDataByKey((uint)0x273a); } return(loudSpeakerRes); }
public void OpenSpeakerForm(uint itemID) { if (itemID == 10041u || itemID == 10042u) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { return; } CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM); if (useableContainer == null) { return; } if (useableContainer.GetUseableStackCount(2, itemID) == 0) { CMallFactoryShopController.ShopProduct product; if (itemID == 10041u) { product = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(GameDataMgr.globalInfoDatabin.GetDataByKey(212u).dwConfValue); } else { product = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(GameDataMgr.globalInfoDatabin.GetDataByKey(211u).dwConfValue); } if (product != null) { CUIEvent uIEvent = Singleton <CUIEventManager> .GetInstance().GetUIEvent(); uIEvent.m_eventID = enUIEventID.Mall_Buy_Product_Confirm; uIEvent.m_eventParams.commonUInt64Param1 = (ulong)product.Key; uIEvent.m_eventParams.commonUInt32Param1 = 1u; Singleton <CMallFactoryShopController> .GetInstance().BuyShopProduct(product, 1u, true, uIEvent); } return; } ResHornInfo dataByKey = GameDataMgr.speakerDatabin.GetDataByKey(itemID); this.m_itemID = itemID; this.m_characterLimit = dataByKey.dwWordLimit; if (dataByKey == null) { return; } CUIFormScript cUIFormScript = Singleton <CUIManager> .get_instance().OpenForm(CLoudSpeakerSys.SPEAKER_FORM_PATH, false, false); if (cUIFormScript == null || cUIFormScript.gameObject == null) { return; } GameObject obj = Utility.FindChild(cUIFormScript.gameObject, "pnlBg/Title/speakerText"); GameObject obj2 = Utility.FindChild(cUIFormScript.gameObject, "pnlBg/Title/loudSpeakerText"); GameObject obj3 = Utility.FindChild(cUIFormScript.gameObject, "pnlBg/Model/speaker"); GameObject obj4 = Utility.FindChild(cUIFormScript.gameObject, "pnlBg/Model/loudspeaker"); InputField componetInChild = Utility.GetComponetInChild <InputField>(cUIFormScript.gameObject, "pnlBg/Panel_Main/InputField"); CUITimerScript componetInChild2 = Utility.GetComponetInChild <CUITimerScript>(cUIFormScript.gameObject, "Timer"); componetInChild2.ReStartTimer(); if (itemID == 10041u) { obj.CustomSetActive(true); obj2.CustomSetActive(false); obj3.CustomSetActive(true); obj4.CustomSetActive(false); componetInChild.characterLimit = (int)this.m_characterLimit; } else { obj.CustomSetActive(false); obj2.CustomSetActive(true); obj3.CustomSetActive(false); obj4.CustomSetActive(true); componetInChild.characterLimit = (int)this.m_characterLimit; } } }
public void OpenSpeakerForm(uint itemID) { if ((itemID == 0x2739) || (itemID == 0x273a)) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM); if (useableContainer != null) { if (useableContainer.GetUseableStackCount(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, itemID) == 0) { CMallFactoryShopController.ShopProduct shopProduct = null; if (itemID == 0x2739) { shopProduct = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(GameDataMgr.globalInfoDatabin.GetDataByKey((uint)0xd4).dwConfValue); } else { shopProduct = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(GameDataMgr.globalInfoDatabin.GetDataByKey((uint)0xd3).dwConfValue); } if (shopProduct != null) { CUIEvent uIEvent = Singleton <CUIEventManager> .GetInstance().GetUIEvent(); uIEvent.m_eventID = enUIEventID.Mall_Buy_Product_Confirm; uIEvent.m_eventParams.commonUInt64Param1 = shopProduct.Key; uIEvent.m_eventParams.commonUInt32Param1 = 1; Singleton <CMallFactoryShopController> .GetInstance().BuyShopProduct(shopProduct, 1, true, uIEvent); } } else { ResHornInfo dataByKey = GameDataMgr.speakerDatabin.GetDataByKey(itemID); this.m_itemID = itemID; this.m_characterLimit = dataByKey.dwWordLimit; if (dataByKey != null) { CUIFormScript script = Singleton <CUIManager> .instance.OpenForm(SPEAKER_FORM_PATH, false, false); if ((script != null) && (script.gameObject != null)) { GameObject obj2 = Utility.FindChild(script.gameObject, "pnlBg/Title/speakerText"); GameObject obj3 = Utility.FindChild(script.gameObject, "pnlBg/Title/loudSpeakerText"); GameObject obj4 = Utility.FindChild(script.gameObject, "pnlBg/Model/speaker"); GameObject obj5 = Utility.FindChild(script.gameObject, "pnlBg/Model/loudspeaker"); InputField componetInChild = Utility.GetComponetInChild <InputField>(script.gameObject, "pnlBg/Panel_Main/InputField"); Utility.GetComponetInChild <CUITimerScript>(script.gameObject, "Timer").ReStartTimer(); if (itemID == 0x2739) { obj2.CustomSetActive(true); obj3.CustomSetActive(false); obj4.CustomSetActive(true); obj5.CustomSetActive(false); componetInChild.characterLimit = (int)this.m_characterLimit; } else { obj2.CustomSetActive(false); obj3.CustomSetActive(true); obj4.CustomSetActive(false); obj5.CustomSetActive(true); componetInChild.characterLimit = (int)this.m_characterLimit; } } } } } } } }