Exemplo n.º 1
0
bool MatchJoinList::init()
{
    if (!Layer::init())
    {
        return false;
    }
    auto root = CSLoader::createNode("LayerJoinList.csb");
    this->addChild(root);
    btn_join = dynamic_cast<Button *>(CSLoader::seekNodeByName(root, "image_join"));
    btn_join->addClickEventListener(std::bind(&MatchJoinList::click_join, this));
    btn_cancel_match = dynamic_cast<Button *>(CSLoader::seekNodeByName(root, "btn_cancel_match"));
    btn_cancel_match->setVisible(false);
    btn_cancel_match->addClickEventListener(std::bind(&MatchJoinList::click_cancel_match,this));
    auto listview = dynamic_cast<ListView *>(CSLoader::seekNodeByName(root, "ListView_1"));
    
    auto pSize = listview->getContentSize();
    tableview = TableView::create(this, pSize);
    tableview->setAnchorPoint(listview->getAnchorPoint());
    tableview->setContentOffset(Vec2(0, 0));
    tableview->setVerticalFillOrder(TableView::VerticalFillOrder::TOP_DOWN);
    tableview->setPosition(listview->getPosition());
    tableview->setDelegate(this);
//    tableview->setTag(TAG_TABLEVIEW);
    tableview->setColor(Color3B::RED);
    this->addChild(tableview,255);
    listview->removeFromParentAndCleanup(true);
//    text1 = dynamic_cast<Text *>(CSLoader::seekNodeByName(root, "Text_1")) ;
    
    refresh(nullptr);
    
    dispatch_.register_event(EVENT_GET_TOURNAMENTIFO_LIST,BIND_FUNC(this, MatchJoinList::refresh));
    dispatch_.register_event(EVENT_TO_GET_TOURNAMENTIFO,BIND_FUNC(this, MatchJoinList::send_get_jion_list));
    return true;
}
Exemplo n.º 2
0
	void Camera::OnAttaching(const std::shared_ptr<SceneNode> &node)
	{
		Component::OnAttaching(node);
		Camera::Ptr selfPtr = shared_from_this();
		node->GetSignal()->Connect(SceneNode::EVENT_TRANSFORM_CHANGE, selfPtr, 
			BIND_FUNC(selfPtr, &Camera::OnSceneNodeTransformChange));
	}
Exemplo n.º 3
0
void LayerUserInfo::register_events()
{
    
    dispatch_.register_event(REQ_MOMENT_BLOCK_LIST,
                             BIND_FUNC(this, LayerUserInfo::handle_all_block_user_list));
    dispatch_.register_event(REQ_ADD_FRIEND,
                             BIND_FUNC(this, LayerUserInfo::handle_add_friend));
    dispatch_.register_event(REQ_DELETE_FRIEND,
                             BIND_FUNC(this, LayerUserInfo::handle_delete_friend));
    dispatch_.register_event(REQ_SHIELD_FRIEND,
                             BIND_FUNC(this, LayerUserInfo::handle_block_user));
    dispatch_.register_event(REQ_DEAL_REQUEST,
                             BIND_FUNC(this, LayerUserInfo::handle_deal_request));
    //SearchFriend
    dispatch_.register_event(REQ_GET_FRIENDS_LIST,
                             BIND_FUNC(this, LayerUserInfo::handle_get_friends_list));
    dispatch_.register_event(REQ_GIFT_DIAMOUNT, BIND_FUNC(this, LayerUserInfo::receiverDiamond));
}
Exemplo n.º 4
0
//#include "File"
bool NodeShopListCell::init()
{
    if ( !Node::init() )
    {
        return false;
    }
    
    root_ = CSLoader::createNode("NodeShopListCell.csb");
    this->addChild(root_);
    
    text_shop_desc_ = dynamic_cast<Text*>(CSLoader::seekNodeByName(root_, "text_shop_desc"));
    text_shop_desc_->setString("");
    
    text_diamond_num_ = dynamic_cast<Text*>(CSLoader::seekNodeByName(root_, "text_diamond_num"));
    text_money_num_ = dynamic_cast<Text*>(CSLoader::seekNodeByName(root_, "text_money_num"));
    image_icon_diamond_ = dynamic_cast<ImageView*>(CSLoader::seekNodeByName(root_, "image_icon_diamond"));
    image_shop_cell_bg_normal_ = dynamic_cast<ImageView*>(CSLoader::seekNodeByName(root_, "image_shop_cell_bg_normal"));
    dispatch_.register_event(EVENT_DOWLOAD_FILE,
                             BIND_FUNC(this, NodeShopListCell::handle_download_event));
    return true;
}
Exemplo n.º 5
0
bool LayerFriendSearch::init()
{
    if(!BaseLayer::init()) {
        return false;
    }
    
    auto root = CSLoader::createNode("LayerGroupSearch.csb");
    this->addChild(root);
    
    auto text_cancel = dynamic_cast<Button*>(CSLoader::seekNodeByName(root, "btn_back"));
    auto text_title = dynamic_cast<Text*>(CSLoader::seekNodeByName(root, "text_title"));
    auto btn_search = dynamic_cast<Button*>(CSLoader::seekNodeByName(root, "btn_search"));
    
    auto tf_keyword = dynamic_cast<TextField*>(CSLoader::seekNodeByName(root, "tf_keyword"));
    tf_keyword_ = GameTools::createEditBoxFromTextField(this, tf_keyword);
    tf_keyword_->setPlaceHolder(tools::local_string("friend_search_word", "请输入玩家昵称或ID").c_str());
    tf_keyword_->setDelegate(this);
    tf_keyword_->setInputMode(EditBox::InputMode::SINGLE_LINE);
    tf_keyword_->setReturnType(EditBox::KeyboardReturnType::SEARCH);
    
    image_search_icon_ = dynamic_cast<ImageView*>(CSLoader::seekNodeByName(root, "image_search_icon"));
    
    text_title->setString(tools::local_string("search_friend", "搜索玩家"));
    
    text_cancel->addClickEventListener(std::bind(&LayerFriendSearch::text_cancel_click, this, std::placeholders::_1));
    
    auto listview = dynamic_cast<ListView*>(CSLoader::seekNodeByName(root, "listview"));
    tableview_ = TableView::create(this, listview->getContentSize());
    tableview_->setAnchorPoint(listview->getAnchorPoint());
    tableview_->setContentOffset(Vec2(0, 0));
    tableview_->setVerticalFillOrder(TableView::VerticalFillOrder::TOP_DOWN);
    tableview_->setPosition(listview->getPosition());
    tableview_->setDelegate(this);
    root->addChild(tableview_);
    
    listview->removeFromParent();
    
    dispatch_.register_event(EVENT_HANDLE_REQ_SEARCH_USER, BIND_FUNC(this, LayerFriendSearch::update_table_view));
    return true;
}
Exemplo n.º 6
0
void LayerGroupList::register_events()
{
    dispatch_.register_event(REQ_SEARCH_GROUP, BIND_FUNC(this, LayerGroupList::handle_search_group));
}
Exemplo n.º 7
0
void BuyChipLayer::register_events()
{
    dispatch_.register_event(REQ_GET_PERMISSION,
                             BIND_FUNC(this, BuyChipLayer::handle_get_permission));
}
Exemplo n.º 8
0
void InvitationManager::register_events()
{
    dispatch_.register_event(RECEIVE_REQUEST_LIST,
                             BIND_FUNC(this, InvitationManager::handle_receive_request_list));
}