diff --git a/fk101/.gitignore b/fk101/.gitignore index 61c1565d..678313bf 100644 --- a/fk101/.gitignore +++ b/fk101/.gitignore @@ -4,13 +4,14 @@ !lua_probject/ !wb_unity_pro/ !wb_new_ui/ +!wb_new_ui/assets !.vscode/ !wb_unity_pro_ios/ !xcode/ !lua_probject/** !wb_unity_pro/** -!wb_new_ui/** +!wb_new_ui/assets/** !.vscode/** !wb_unity_pro_ios** !xcode/** diff --git a/fk101/lua_probject/base_project/Game/View/MainRightPanelView.lua b/fk101/lua_probject/base_project/Game/View/MainRightPanelView.lua index b94bf18e..d943a2de 100644 --- a/fk101/lua_probject/base_project/Game/View/MainRightPanelView.lua +++ b/fk101/lua_probject/base_project/Game/View/MainRightPanelView.lua @@ -6,37 +6,39 @@ local MainRightPanelView = { local M = MainRightPanelView local function __init(self, mainView, view) - local right_panel = view local btn_setting = right_panel:GetChild('btn_setting') - btn_setting.onClick:Set( - function() - local _settingView = mainView:NewSettingView() - _settingView.stateIndex = (mainView._room.curren_round >= 1 and mainView._allow_dissmiss) and 2 or 1 - _settingView.cd_time = mainView.dismiss_room_cd_time - _settingView:Show() + if btn_setting then + btn_setting.onClick:Set( + function() + local _settingView = mainView:NewSettingView() + _settingView.stateIndex = (mainView._room.curren_round >= 1 and mainView._allow_dissmiss) and 2 or 1 + _settingView.cd_time = mainView.dismiss_room_cd_time + _settingView:Show() - local room = DataManager.CurrenRoom - _settingView.onCallback:Add( - function(context) - local _gamectr = ControllerManager.GetController(GameController) - if (room.CurnrenState == StateType.Ready) then - _gamectr:LevelRoom( - function(response) - if (response.ReturnCode == 0) then - ViewManager.ChangeView(ViewManager.View_Lobby) - GameApplication.Instance:ShowTips('房间已解散!') + local room = DataManager.CurrenRoom + _settingView.onCallback:Add( + function(context) + local _gamectr = ControllerManager.GetController(GameController) + if (room.CurnrenState == StateType.Ready) then + _gamectr:LevelRoom( + function(response) + if (response.ReturnCode == 0) then + ViewManager.ChangeView(ViewManager.View_Lobby) + GameApplication.Instance:ShowTips('房间已解散!') + end end - end - ) - else - _gamectr:AskDismissRoom() + ) + else + _gamectr:AskDismissRoom() + end end - end - ) - end - ) + ) + end + ) + end + self._tex_data = right_panel:GetChild('tex_data') self._tex_time = right_panel:GetChild('tex_time') @@ -64,7 +66,7 @@ end --- Create a new MainRightPanelView function MainRightPanelView.new(mainView, view) - local self = setmetatable({}, {__index = M}) + local self = setmetatable({}, { __index = M }) self.class = 'MainRightPanelView' -- 显示选项,1是正常,2的ping没有括号 self._opt = 1 @@ -114,6 +116,7 @@ function M:_ShowTime() end self._tex_ping.text = str_ping end + -- function M:OnUpdate(deltaTime) self:__UpdateTime() diff --git a/fk101/lua_probject/base_project/Game/View/MainView.lua b/fk101/lua_probject/base_project/Game/View/MainView.lua index 35eb0d5a..1f28f830 100644 --- a/fk101/lua_probject/base_project/Game/View/MainView.lua +++ b/fk101/lua_probject/base_project/Game/View/MainView.lua @@ -259,6 +259,37 @@ function M:InitView(url, isHideIpAdds) _btn_wxyqhy.visible = false end + local btn_setting = _view:GetChild('btn_setting') + if btn_setting then + btn_setting.onClick:Set( + function() + local _settingView = self:NewSettingView() + _settingView.stateIndex = (self._room.curren_round >= 1 and self._allow_dissmiss) and 2 or 1 + _settingView.cd_time = self.dismiss_room_cd_time + _settingView:Show() + + local room = DataManager.CurrenRoom + _settingView.onCallback:Add( + function(context) + local _gamectr = ControllerManager.GetController(GameController) + if (room.CurnrenState == StateType.Ready) then + _gamectr:LevelRoom( + function(response) + if (response.ReturnCode == 0) then + ViewManager.ChangeView(ViewManager.View_Lobby) + GameApplication.Instance:ShowTips('房间已解散!') + end + end + ) + else + _gamectr:AskDismissRoom() + end + end + ) + end + ) + end + self:EventInit() self._popEvent = true self._left_time = 0 diff --git a/fk101/lua_probject/base_project/Game/View/ResultView.lua b/fk101/lua_probject/base_project/Game/View/ResultView.lua index 1dd1651f..e7cf58eb 100644 --- a/fk101/lua_probject/base_project/Game/View/ResultView.lua +++ b/fk101/lua_probject/base_project/Game/View/ResultView.lua @@ -2,102 +2,94 @@ ResultView = {} local M = ResultView -setmetatable(M, {__index = BaseWindow}) -local self = setmetatable({}, {__index = M}) +setmetatable(M, { __index = BaseWindow }) +local self = setmetatable({}, { __index = M }) function M:InitView() - self:InitMaPai() - self:InitMaPaiShowPanel() - + self:InitMaPai() + self:InitMaPaiShowPanel() end - function M:InitMaPaiShowPanel() - self.mapaiTypeCtr=self._view:GetController("matype") - if self.mapaiTypeCtr then - self.mapaiTypeCtr.selectedIndex=0 - end - - - self.mapaiTypeBgShowCtr=self._view:GetController("matypebgshow") - if self.mapaiTypeBgShowCtr then - self.mapaiTypeBgShowCtr.selectedIndex=0 - end - - self.mapaiTypeShowCtr=self._view:GetController("matypeshow") - if self.mapaiTypeShowCtr then - self.mapaiTypeShowCtr.selectedIndex=0 - end + self.mapaiTypeCtr = self._view:GetController("matype") + if self.mapaiTypeCtr then + self.mapaiTypeCtr.selectedIndex = 0 + end + + + self.mapaiTypeBgShowCtr = self._view:GetController("matypebgshow") + if self.mapaiTypeBgShowCtr then + self.mapaiTypeBgShowCtr.selectedIndex = 0 + end + + self.mapaiTypeShowCtr = self._view:GetController("matypeshow") + if self.mapaiTypeShowCtr then + self.mapaiTypeShowCtr.selectedIndex = 0 + end end function M:InitMaPai() - self.maPaiCtr=self._view:GetController("mapai") - if self.maPaiCtr then - self.maPaiCtr.selectedIndex=0 - end - - - self.maPaiList={} - - for i=1,8 do - local tempMP=self._view:GetChild("niao"..i) - if tempMP then - table.insert(self.maPaiList,tempMP) - end - - end - + self.maPaiCtr = self._view:GetController("mapai") + if self.maPaiCtr then + self.maPaiCtr.selectedIndex = 0 + end + + + self.maPaiList = {} + + for i = 1, 8 do + local tempMP = self._view:GetChild("niao" .. i) + if tempMP then + table.insert(self.maPaiList, tempMP) + end + end end -function M:IsMapaiShow(niao,isShow) - if niao then - niao.visible=isShow - end +function M:IsMapaiShow(niao, isShow) + if niao then + niao.visible = isShow + end end - -function M:SetMaPaiValue(niao,value) - if niao then - niao.icon='ui://Main_Majiang/' ..get_majiang_prefix(DataManager.CurrenRoom.game_id).."201_"..value - end +function M:SetMaPaiValue(niao, value) + if niao then + niao.icon = 'ui://Main_Majiang/' .. get_majiang_prefix(DataManager.CurrenRoom.game_id) .. "201_" .. value + end end -function M:SetMaPaiColor(niao,num) - niao:GetController("color").selectedIndex=num +function M:SetMaPaiColor(niao, num) + niao:GetController("color").selectedIndex = num end function M:HideAllMapai() - for i=1,#self.maPaiList do - self:IsMapaiShow(self.maPaiList[i],false) - self:SetMaPaiColor(self.maPaiList[i],0) - end + for i = 1, #self.maPaiList do + self:IsMapaiShow(self.maPaiList[i], false) + self:SetMaPaiColor(self.maPaiList[i], 0) + end end - - function M:ShowSelectMaPai(niaoList) - if niaoList and #niaoList>0 then - self.maPaiCtr.selectedIndex=1 - self:HideAllMapai() - for i=1,#niaoList do - self:IsMapaiShow(self.maPaiList[i],true) - self:SetMaPaiValue(self.maPaiList[i],niaoList[i].card) - if niaoList[i].score>0 then - self:SetMaPaiColor(self.maPaiList[i],2) - end - end - else - self.maPaiCtr.selectedIndex=0 - end + if niaoList and #niaoList > 0 then + self.maPaiCtr.selectedIndex = 1 + self:HideAllMapai() + for i = 1, #niaoList do + self:IsMapaiShow(self.maPaiList[i], true) + self:SetMaPaiValue(self.maPaiList[i], niaoList[i].card) + if niaoList[i].score > 0 then + self:SetMaPaiColor(self.maPaiList[i], 2) + end + end + else + self.maPaiCtr.selectedIndex = 0 + end end - -function M:init(url,isBigFull) +function M:init(url, isBigFull) BaseWindow.init(self, url) - - self:InitView() - + + self:InitView() + local btn_share = self._view:GetChild('btn_share') if btn_share ~= nil then btn_share.onClick:Set( @@ -127,23 +119,26 @@ function M:init(url,isBigFull) local big_result = self._view:GetChild('big_result') if big_result ~= nil then - if isBigFull then - - else - self._full = true - big_result:AddRelation(self._view, RelationType.Size) - big_result.width = self._view.width - big_result.height = self._view.height - end - + if isBigFull then + + else + self._full = true + big_result:AddRelation(self._view, RelationType.Size) + big_result.width = self._view.width + big_result.height = self._view.height + end + local btn_share_copy = big_result:GetChild('btn_share_copy') - btn_share_copy.onClick:Set( - function() - big_result:GetController('share').selectedIndex = 0 - self:__ShareResultStr() - end - ) + if btn_share_copy then + btn_share_copy.onClick:Set( + function() + big_result:GetController('share').selectedIndex = 0 + self:__ShareResultStr() + end + ) + end + local btn_share_link = big_result:GetChild('btn_share_link') btn_share_link.onClick:Set( @@ -193,7 +188,6 @@ function M:init(url,isBigFull) end end - -- 分享数据至聊天室,需在扩展填充数据,GenerateRoomResultInfo() function M:__ShareResultInfo() local info = self._resultInfo @@ -312,9 +306,11 @@ function M:InitBigResult(room, fontsize) local item = player_list:AddItemFromPool() item:GetChild('txt_name').text = player_info.nick + if item:GetChild('txt_userid') then + item:GetChild('txt_userid').text = player_info.userId + end - local head = item:GetChild('head') - ImageLoad.Load(player_info.head_url, head._iconObject) + -- ImageLoad.Load(player_info.head_url, item:GetChild('head')._iconObject) if player_info.entrust ~= nil and player_info.entrust == true then item:GetController('entrust').selectedIndex = 1 @@ -362,18 +358,18 @@ function M:InitBigResult(room, fontsize) pitem:GetChild('txt_key').text = player_info.param[i].key pitem:GetChild('txt_value').text = player_info.param[i].value - if fontsize ~= nil and fontsize > 0 then - pitem:GetChild('txt_key').textFormat.size = fontsize - pitem:GetChild('txt_value').textFormat.size = fontsize - else - if big then - pitem:GetChild('txt_key').textFormat.size = 30 - pitem:GetChild('txt_value').textFormat.size = 12 - else - pitem:GetChild('txt_key').textFormat.size = 24 - pitem:GetChild('txt_value').textFormat.size = 8 - end - end + -- if fontsize ~= nil and fontsize > 0 then + -- pitem:GetChild('txt_key').textFormat.size = fontsize + -- pitem:GetChild('txt_value').textFormat.size = fontsize + -- else + -- if big then + -- pitem:GetChild('txt_key').textFormat.size = 30 + -- pitem:GetChild('txt_value').textFormat.size = 12 + -- else + -- pitem:GetChild('txt_key').textFormat.size = 24 + -- pitem:GetChild('txt_value').textFormat.size = 8 + -- end + -- end end end @@ -395,6 +391,10 @@ function M:InitBigResult(room, fontsize) else item:GetController('self').selectedIndex = 0 end + + if item:GetChild('head') and item:GetChild('head')._iconObject then + ImageLoad.Load(player_info.head_url,item:GetChild('head')._iconObject) + end end local btn_continue_game = big_result:GetChild('btn_continue_game') diff --git a/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/PlayerSelfCardInfoView.lua b/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/PlayerSelfCardInfoView.lua index 1ed74449..4a441833 100644 --- a/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/PlayerSelfCardInfoView.lua +++ b/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/PlayerSelfCardInfoView.lua @@ -24,6 +24,7 @@ function M:onTouchBegin(context) self:ShowHuTip(card.card_item) end card.btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_",card.card_item) + card.btn_card.height = card.btn_card.width/97*287 card.btn_card.sortingOrder = 100 local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x,context.inputEvent.y)) card.btn_card.xy = Vector2.New(card.btn_card.x+20 ,card.btn_card.y-50) @@ -44,7 +45,8 @@ function M:__OnDragEnd(context) local _room = DataManager.CurrenRoom card.btn_card.sortingOrder = 0 - if (button.y < self._data_outLinePos - button.height * 0.66 and _room.curren_outcard_seat == _room.self_player.seat) then + card.btn_card.height = card.btn_card.width/95*119 + if (button.y < self._data_outLinePos - self.card_hight * 0.66 and _room.curren_outcard_seat == _room.self_player.seat) then button.touchable = false self.outcard_button = card self:UpdateIsOnClick(false) @@ -79,7 +81,7 @@ function M:__OnDragEnd(context) maxmark =#self.card_list-1 end end - if xy.x < self.card_list[minmark].btn_card.x and #CountCards < 10 and xy.y > self._data_outLinePos then + if xy.x < self.card_list[minmark].btn_card.x and #CountCards < 10 and xy.y > self._data_outLinePos - self.card_hight * 0.66 then list_remove(self.card_list, card) local num = 0 for i=1,#self.card_list do @@ -105,7 +107,7 @@ function M:__OnDragEnd(context) card.index_Y =1 table.insert(self.card_list,1,card) isChangeCard = true - elseif xy.x > (self.card_list[maxmark].btn_card.x + button.width) and #CountCards < 10 and xy.y > self._data_outLinePos then + elseif xy.x > (self.card_list[maxmark].btn_card.x + self.card_width) and #CountCards < 10 and xy.y > self._data_outLinePos - self.card_hight * 0.66 then list_remove(self.card_list, card) local num = 0 for i=1,#self.card_list do @@ -134,7 +136,7 @@ function M:__OnDragEnd(context) for i=1,#CountCards do local card_view = CountCards[i][1] if card_view ~= nil then - if xy.x > card_view.old_postion.x and xy.x < (card_view.old_postion.x + (button.width * 2)) and xy.y > self._data_outLinePos then + if xy.x > card_view.old_postion.x and xy.x < (card_view.old_postion.x + self.card_width) and xy.y > self._data_outLinePos - self.card_hight * 0.66 then if card ~= card_view and #CountCards[i] < 4 and card.index_X ~= card_view.index_X then MoveCardPos = i MoveCardY = #CountCards[i]+1 @@ -149,12 +151,12 @@ function M:__OnDragEnd(context) -- print("lingmeng end", button.y, MoveCard, button.y > self._data_outLinePos, -- button.x + button.width / 2 > card.old_postion.x and -- button.x + button.width / 2 < (card.old_postion.x + button.width) and button.y > self._data_outLinePos) - if xy.x > card.old_postion.x and xy.x < (card.old_postion.x + (button.width * 2)) and button.y > self._data_outLinePos then + if xy.x > card.old_postion.x and xy.x < (card.old_postion.x + self.card_width) and button.y > self._data_outLinePos - self.card_hight * 0.66 then if #CountCards[card.index_X] > 1 then for i = 1, #CountCards[card.index_X] do local _cv = CountCards[card.index_X][i] if _cv ~= card then - if xy.y > _cv.btn_card.y and xy.y < (_cv.btn_card.y + button.height) then + if xy.y > _cv.btn_card.y and xy.y < (_cv.btn_card.y + self.card_hight) then --向下移動 if i < card.index_Y then MoveCardindex = -1 @@ -170,13 +172,13 @@ function M:__OnDragEnd(context) MoveCard = true list_remove(self.card_list, card) end - elseif i == #CountCards[card.index_X] and button.y + button.height / 2 < _cv.btn_card.y then + elseif i == #CountCards[card.index_X] and button.y + self.card_hight / 2 < _cv.btn_card.y then MoveCardindex = 1 MoveCardPos = card.index_X MoveCardY = _cv.index_Y MoveCard = true list_remove(self.card_list, card) - elseif i == 1 and button.y + button.height / 2 > (_cv.btn_card.y + button.width * 2) then + elseif i == 1 and button.y + self.card_hight / 2 > (_cv.btn_card.y + button.width * 2) then MoveCardindex = -1 MoveCardPos = card.index_X MoveCardY = _cv.index_Y diff --git a/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/main/ZPMainView.lua b/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/main/ZPMainView.lua index 707b48db..13271e09 100644 --- a/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/main/ZPMainView.lua +++ b/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/main/ZPMainView.lua @@ -86,11 +86,11 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) local typeface = _data['game_cardsize'] local _gamectr = self._gamectr if typeface == 0 then - self._room.change_card_size = 2 + self._room.change_card_size = 1.03 elseif typeface == 1 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 elseif typeface == 2 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 end else self._room.change_card_size = change_card_size @@ -300,11 +300,11 @@ end -- 设置 更新 手牌大小 function M:UpdateCardSize(index) if index == 0 then - self._room.change_card_size = 2 + self._room.change_card_size = 1.03 elseif index == 1 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 elseif index == 2 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 end local info = self._player_card_info[1] info:UpdateCardSize() diff --git a/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/main/ZPPlayerSelfCardInfoView.lua b/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/main/ZPPlayerSelfCardInfoView.lua index eb065028..5bf0c66e 100644 --- a/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/main/ZPPlayerSelfCardInfoView.lua +++ b/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/main/ZPPlayerSelfCardInfoView.lua @@ -482,25 +482,6 @@ function M:UpdateCardSize() self:UpdateHandCardsPos() end -function M:UpdateOutLine() - if self:getCardSize() == 1.3 then - self._data_outLinePos = 90 - (125 * 3) - elseif self:getCardSize() == 1.2 then - self._data_outLinePos = 90 - (116 * 3) - elseif self:getCardSize() == 0.8 then - self._data_outLinePos = 100 - (93 * 3) - elseif self:getCardSize() == 1.5 then - self._data_outLinePos = 90 - (143 * 3) - elseif self:getCardSize() == 1.6 then - self._data_outLinePos = 90 - (152 * 3) - elseif self:getCardSize() == 1.8 then - self._data_outLinePos = 135 - (170 * 3) - elseif self:getCardSize() == 2 then - self._data_outLinePos = 160 - (195 * 3) - end - self._view_outLine.y = self._data_outLinePos + self._area_handcard_list.height - 80 -end - function M:UpdateIsOnClick(isOut) self._view.touchable = isOut end diff --git a/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/main/ZPSettingView.lua b/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/main/ZPSettingView.lua index 58080559..f6ccb824 100644 --- a/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/main/ZPSettingView.lua +++ b/fk101/lua_probject/extend_project/extend/zipai/changdepaohuzi/main/ZPSettingView.lua @@ -27,9 +27,9 @@ function ZPSettingView.new(blur_view, index, open_social,cardIndex) self.cd_time = 0 self._btn_dismiss_room_enable = false self._close_destroy = true - self.bigSize = 1.2 + self.bigSize = 1.03 self.mediumSize = 1 - self.smallSize = 0.8 + self.smallSize = 1 self._full = true self._anim_pop = 2 self._open_social = open_social @@ -84,7 +84,7 @@ function M:init(url) elseif room.change_card_size == self.mediumSize then size.selectedIndex = 1 elseif room.change_card_size == self.smallSize then - size.selectedIndex = 2 + size.selectedIndex = 1 end else room.change_card_size = 0 @@ -94,14 +94,14 @@ function M:init(url) if room.change_card_display ~= nil then local _str = string.sub(room.change_card_display, 1, 1) local n = tonumber(_str) - if n == 1 then + if n == 6 then c1.selectedIndex = 1 - elseif n == 2 then + elseif n == 1 then c1.selectedIndex = 0 elseif n == 8 then c1.selectedIndex = 3 else - c1.selectedIndex = 2 + c1.selectedIndex = 0 end end if self._open_social then @@ -245,16 +245,16 @@ function M:UpdateIndex() local _str = string.sub(room.change_card_display, 1, 1) local n = tonumber(_str) if n == 7 then - n = 2 + n = 6 end - if n == 1 then + if n == 6 then c1.selectedIndex = 1 - elseif n == 2 then + elseif n == 1 then c1.selectedIndex = 0 elseif n == 8 then c1.selectedIndex = 3 else - c1.selectedIndex = 2 + c1.selectedIndex = 0 end end end @@ -267,7 +267,7 @@ function M:UpdateCardSizeIndex() elseif room.change_card_size == self.mediumSize then size.selectedIndex = 1 elseif room.change_card_size == self.smallSize then - size.selectedIndex = 2 + size.selectedIndex = 1 end else size.selectedIndex = 0 @@ -299,7 +299,6 @@ function M:FillBgSection(cb, game_id, default_bg, room, qihu) cb(config.url) ctr_bg.selectedIndex = i - 1 if qihu ~= nil then - -- self._blur_view:GetChild('di_text').text = room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起' self._blur_view:GetController('bg_state').selectedIndex = i - 1 end end @@ -316,7 +315,6 @@ function M:FillBgSection(cb, game_id, default_bg, room, qihu) index = ctr_bg.selectedIndex end if qihu ~= nil then - -- self._blur_view:GetChild('di_text').text = room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起' if index < 3 then self._blur_view:GetController('bg_state').selectedIndex = index else @@ -324,6 +322,7 @@ function M:FillBgSection(cb, game_id, default_bg, room, qihu) end end end + function M:Destroy() local bg_id = self._view:GetController('bg').selectedIndex + 1 if self._bg ~= bg_id then diff --git a/fk101/lua_probject/extend_project/extend/zipai/runbeard/PlayerSelfCardInfoView.lua b/fk101/lua_probject/extend_project/extend/zipai/runbeard/PlayerSelfCardInfoView.lua index 584a2e9d..96a4ff26 100644 --- a/fk101/lua_probject/extend_project/extend/zipai/runbeard/PlayerSelfCardInfoView.lua +++ b/fk101/lua_probject/extend_project/extend/zipai/runbeard/PlayerSelfCardInfoView.lua @@ -24,6 +24,7 @@ function M:onTouchBegin(context) self:ShowHuTip(card.card_item) end card.btn_card:GetChild("icon").icon = self:getCardItem("ui://Main_RunBeard/203_",card.card_item) + card.btn_card.height = card.btn_card.width/97*287 card.btn_card.sortingOrder = 100 local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x,context.inputEvent.y)) card.btn_card.xy = Vector2.New(card.btn_card.x+20 ,card.btn_card.y-50) @@ -39,13 +40,13 @@ function M:__OnDragEnd(context) self.outcard_button = nil end local button = context.sender - + local xy = self._area_handcard_list:GlobalToLocal(Vector2.New(context.inputEvent.x, context.inputEvent.y)) local card = button.data local _room = DataManager.CurrenRoom card.btn_card.sortingOrder = 0 - -- print("button.y"..button.y .. "_room.curren_outcard_seat".._room.curren_outcard_seat) - if (button.y < -380 and _room.curren_outcard_seat == _room.self_player.seat) then + card.btn_card.height = card.btn_card.width/95*119 + if (button.y < self._data_outLinePos - button.height * 0.66 and _room.curren_outcard_seat == _room.self_player.seat) then button.touchable = false self.outcard_button = card self:UpdateIsOnClick(false) @@ -80,8 +81,8 @@ function M:__OnDragEnd(context) maxmark =#self.card_list-1 end end - if button.x+button.width/2 < self.card_list[minmark].btn_card.x and #CountCards<10 then - list_remove(self.card_list,card) + if xy.x < self.card_list[minmark].btn_card.x and #CountCards < 10 and xy.y > self._data_outLinePos then + list_remove(self.card_list, card) local num = 0 for i=1,#self.card_list do if card.index_X == self.card_list[i].index_X and card.index_Y < self.card_list[i].index_Y then @@ -106,8 +107,8 @@ function M:__OnDragEnd(context) card.index_Y =1 table.insert(self.card_list,1,card) isChangeCard = true - elseif button.x+button.width/2 > (self.card_list[maxmark].btn_card.x +button.width) and #CountCards<10 then - list_remove(self.card_list,card) + elseif xy.x > (self.card_list[maxmark].btn_card.x + self.card_width) and #CountCards < 10 and xy.y > self._data_outLinePos then + list_remove(self.card_list, card) local num = 0 for i=1,#self.card_list do if card.index_X == self.card_list[i].index_X then @@ -134,10 +135,9 @@ function M:__OnDragEnd(context) local MoveCardY = 0 for i=1,#CountCards do local card_view = CountCards[i][1] - if card_view~=nil then - if button.x+button.width/2 > card_view.old_postion.x and button.x+button.width/2 < (card_view.old_postion.x+button.width) then - if card ~= card_view and #CountCards[i] <4 and card.index_X ~= card_view.index_X then - + if card_view ~= nil then + if xy.x > card_view.old_postion.x and xy.x < (card_view.old_postion.x + self.card_width) and xy.y > self._data_outLinePos then + if card ~= card_view and #CountCards[i] < 4 and card.index_X ~= card_view.index_X then MoveCardPos = i MoveCardY = #CountCards[i]+1 MoveCard = true @@ -147,40 +147,43 @@ function M:__OnDragEnd(context) end end local MoveCardindex = 0 - -- local MoveCardY = 0 - if button.x+button.width/2 > card.old_postion.x and button.x+button.width/2 < (card.old_postion.x+button.width) then - if #CountCards[card.index_X]>1 then - for i=1,#CountCards[card.index_X] do + -- local MoveCardY = 0 + -- print("lingmeng end", button.y, MoveCard, button.y > self._data_outLinePos, + -- button.x + button.width / 2 > card.old_postion.x and + -- button.x + button.width / 2 < (card.old_postion.x + button.width) and button.y > self._data_outLinePos) + if xy.x > card.old_postion.x and xy.x < (card.old_postion.x + self.card_width) and button.y > self._data_outLinePos then + if #CountCards[card.index_X] > 1 then + for i = 1, #CountCards[card.index_X] do local _cv = CountCards[card.index_X][i] if _cv ~= card then - if button.y+button.height/2 > _cv.btn_card.y and button.y+button.height/2 < (_cv.btn_card.y+button.height) then + if xy.y > _cv.btn_card.y and xy.y < (_cv.btn_card.y + button.height) then --向下移動 - if ((button.y+button.height/2) +20) > (card.old_postion.y+button.height) then - MoveCardindex = -1 - MoveCardPos = card.index_X - MoveCardY = _cv.index_Y - MoveCard = true - list_remove(self.card_list,card) - --向上移動 - elseif ((button.y+button.height/2) -20) < card.old_postion.y then - MoveCardindex = 1 - MoveCardPos = card.index_X - MoveCardY = _cv.index_Y - MoveCard = true - list_remove(self.card_list,card) - end - elseif i == #CountCards[card.index_X] and button.y+button.height/2 < _cv.btn_card.y then - MoveCardindex = 1 - MoveCardPos = card.index_X - MoveCardY = _cv.index_Y - MoveCard = true - list_remove(self.card_list,card) - elseif i == 1 and button.y+button.height/2 > (_cv.btn_card.y+button.width) then - MoveCardindex = -1 - MoveCardPos = card.index_X - MoveCardY = _cv.index_Y - MoveCard = true - list_remove(self.card_list,card) + if i < card.index_Y then + MoveCardindex = -1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list, card) + --向上移動 + elseif i > card.index_Y then + MoveCardindex = 1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list, card) + end + elseif i == #CountCards[card.index_X] and button.y + button.height / 2 < _cv.btn_card.y then + MoveCardindex = 1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list, card) + elseif i == 1 and button.y + button.height / 2 > (_cv.btn_card.y + button.width * 2) then + MoveCardindex = -1 + MoveCardPos = card.index_X + MoveCardY = _cv.index_Y + MoveCard = true + list_remove(self.card_list, card) end end end @@ -269,7 +272,9 @@ function M:UpdateOutCardList(outcard,isShow,isMopai,seat) end self._area_outcard_list:RemoveChildren(0,-1,true) local outcards =UIPackage.CreateObjectFromURL("ui://Main_RunBeard/Gcm_OutCard") - + outcards.onClick:Set(function() + outcards.alpha = 1.3 - outcards.alpha + end) if outcard==0 then outcards:GetChild("icon").icon ="ui://Main_RunBeard/202_1_300" else diff --git a/fk101/lua_probject/extend_project/extend/zipai/runbeard/main/ZPMainView.lua b/fk101/lua_probject/extend_project/extend/zipai/runbeard/main/ZPMainView.lua index eb96f051..c5a2cd0a 100644 --- a/fk101/lua_probject/extend_project/extend/zipai/runbeard/main/ZPMainView.lua +++ b/fk101/lua_probject/extend_project/extend/zipai/runbeard/main/ZPMainView.lua @@ -63,13 +63,15 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) local _gamectr = self._gamectr _gamectr:SendChangeTypeFace(typeface) - if typeface == 1 then + + --printlog("jefe InitView "..typeface) + if typeface == 2 then if isdisplay then - self._room.change_card_display = '7_' + self._room.change_card_display = '6_' else - self._room.change_card_display = '2_' + self._room.change_card_display = '6_' end - elseif typeface == 2 then + elseif typeface == 1 then self._room.change_card_display = '1_' elseif typeface == 3 then self._room.change_card_display = '3_' @@ -87,11 +89,11 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) local typeface = _data['game_cardsize'] local _gamectr = self._gamectr if typeface == 0 then - self._room.change_card_size = 2 + self._room.change_card_size = 1.03 elseif typeface == 1 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 elseif typeface == 2 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 end else self._room.change_card_size = change_card_size @@ -271,9 +273,9 @@ end function M:UpdateCardDisplay(index) local _gamectr = self._gamectr _gamectr:SendChangeTypeFace(index) - if index == 1 then - self._room.change_card_display = '2_' - elseif index == 2 then + if index == 2 then + self._room.change_card_display = '6_' + elseif index == 1 then self._room.change_card_display = '1_' elseif index == 3 then self._room.change_card_display = '3_' @@ -301,11 +303,11 @@ end -- 设置 更新 手牌大小 function M:UpdateCardSize(index) if index == 0 then - self._room.change_card_size = 2 + self._room.change_card_size = 1.03 elseif index == 1 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 elseif index == 2 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 end local info = self._player_card_info[1] info:UpdateCardSize() diff --git a/fk101/lua_probject/extend_project/extend/zipai/runbeard/main/ZPSettingView.lua b/fk101/lua_probject/extend_project/extend/zipai/runbeard/main/ZPSettingView.lua index 58080559..de38d124 100644 --- a/fk101/lua_probject/extend_project/extend/zipai/runbeard/main/ZPSettingView.lua +++ b/fk101/lua_probject/extend_project/extend/zipai/runbeard/main/ZPSettingView.lua @@ -27,11 +27,12 @@ function ZPSettingView.new(blur_view, index, open_social,cardIndex) self.cd_time = 0 self._btn_dismiss_room_enable = false self._close_destroy = true - self.bigSize = 1.2 + self.bigSize = 1.03 self.mediumSize = 1 - self.smallSize = 0.8 + self.smallSize = 1 self._full = true self._anim_pop = 2 + self._close_zone = true self._open_social = open_social self._cardType=cardIndex self:init('ui://Main_RunBeard/New_SettingWindow') @@ -84,7 +85,7 @@ function M:init(url) elseif room.change_card_size == self.mediumSize then size.selectedIndex = 1 elseif room.change_card_size == self.smallSize then - size.selectedIndex = 2 + size.selectedIndex = 1 end else room.change_card_size = 0 @@ -94,14 +95,14 @@ function M:init(url) if room.change_card_display ~= nil then local _str = string.sub(room.change_card_display, 1, 1) local n = tonumber(_str) - if n == 1 then + if n == 6 then c1.selectedIndex = 1 - elseif n == 2 then + elseif n == 1 then c1.selectedIndex = 0 elseif n == 8 then c1.selectedIndex = 3 else - c1.selectedIndex = 2 + c1.selectedIndex = 0 end end if self._open_social then @@ -245,16 +246,16 @@ function M:UpdateIndex() local _str = string.sub(room.change_card_display, 1, 1) local n = tonumber(_str) if n == 7 then - n = 2 + n = 6 end - if n == 1 then + if n == 6 then c1.selectedIndex = 1 - elseif n == 2 then + elseif n == 1 then c1.selectedIndex = 0 elseif n == 8 then c1.selectedIndex = 3 else - c1.selectedIndex = 2 + c1.selectedIndex = 0 end end end @@ -267,7 +268,7 @@ function M:UpdateCardSizeIndex() elseif room.change_card_size == self.mediumSize then size.selectedIndex = 1 elseif room.change_card_size == self.smallSize then - size.selectedIndex = 2 + size.selectedIndex = 1 end else size.selectedIndex = 0 diff --git a/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/EXMainView.lua b/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/EXMainView.lua index 6915bd49..8155b9c1 100644 --- a/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/EXMainView.lua +++ b/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/EXMainView.lua @@ -1,4 +1,5 @@ local SettingView = import('.main.ZPSettingView') +-- local SettingView = require('main.zipai.ZPSettingView') local PlayerSelfCardInfoView = import('.PlayerSelfCardInfoView') local PlayerCardInfoView = import('.PlayerCardInfoView') local ZPMainView = import('.main.ZPMainView') diff --git a/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/PlayerSelfCardInfoView.lua b/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/PlayerSelfCardInfoView.lua index 22462dbb..ad7b3f9d 100644 --- a/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/PlayerSelfCardInfoView.lua +++ b/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/PlayerSelfCardInfoView.lua @@ -1,4 +1,4 @@ -local PlayerSelfCardInfoView = import(".main.ZPPlayerSelfCardInfoView") +local PlayerSelfCardInfoView = require("main.zipai.ZPPlayerSelfCardInfoView") local CardCheck = import(".main.CardCheck") local M = {} -- diff --git a/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/main/ZPMainView.lua b/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/main/ZPMainView.lua index 21e8868f..457b6d5c 100644 --- a/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/main/ZPMainView.lua +++ b/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/main/ZPMainView.lua @@ -62,13 +62,13 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) local _gamectr = self._gamectr _gamectr:SendChangeTypeFace(typeface) - if typeface == 1 then + if typeface == 2 then if isdisplay then - self._room.change_card_display = '7_' + self._room.change_card_display = '6_' else - self._room.change_card_display = '2_' + self._room.change_card_display = '6_' end - elseif typeface == 2 then + elseif typeface == 1 then self._room.change_card_display = '1_' elseif typeface == 3 then self._room.change_card_display = '3_' @@ -86,11 +86,11 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) local typeface = _data['game_cardsize'] local _gamectr = self._gamectr if typeface == 0 then - self._room.change_card_size = 2 + self._room.change_card_size = 1.03 elseif typeface == 1 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 elseif typeface == 2 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 end else self._room.change_card_size = change_card_size @@ -269,9 +269,9 @@ end function M:UpdateCardDisplay(index) local _gamectr = self._gamectr _gamectr:SendChangeTypeFace(index) - if index == 1 then - self._room.change_card_display = '2_' - elseif index == 2 then + if index == 2 then + self._room.change_card_display = '6_' + elseif index == 1 then self._room.change_card_display = '1_' elseif index == 3 then self._room.change_card_display = '3_' @@ -299,11 +299,11 @@ end -- 设置 更新 手牌大小 function M:UpdateCardSize(index) if index == 0 then - self._room.change_card_size = 2 + self._room.change_card_size = 1.03 elseif index == 1 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 elseif index == 2 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 end local info = self._player_card_info[1] info:UpdateCardSize() diff --git a/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/main/ZPSettingView.lua b/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/main/ZPSettingView.lua index 58080559..987bd755 100644 --- a/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/main/ZPSettingView.lua +++ b/fk101/lua_probject/extend_project/extend/zipai/yueyangwaihuzi/main/ZPSettingView.lua @@ -27,11 +27,12 @@ function ZPSettingView.new(blur_view, index, open_social,cardIndex) self.cd_time = 0 self._btn_dismiss_room_enable = false self._close_destroy = true - self.bigSize = 1.2 + self.bigSize = 1.03 self.mediumSize = 1 - self.smallSize = 0.8 + self.smallSize = 1 self._full = true self._anim_pop = 2 + self._close_zone = true self._open_social = open_social self._cardType=cardIndex self:init('ui://Main_RunBeard/New_SettingWindow') @@ -94,14 +95,14 @@ function M:init(url) if room.change_card_display ~= nil then local _str = string.sub(room.change_card_display, 1, 1) local n = tonumber(_str) - if n == 1 then + if n == 6 then c1.selectedIndex = 1 - elseif n == 2 then + elseif n == 1 then c1.selectedIndex = 0 elseif n == 8 then c1.selectedIndex = 3 else - c1.selectedIndex = 2 + c1.selectedIndex = 0 end end if self._open_social then @@ -245,16 +246,16 @@ function M:UpdateIndex() local _str = string.sub(room.change_card_display, 1, 1) local n = tonumber(_str) if n == 7 then - n = 2 + n = 6 end - if n == 1 then + if n == 6 then c1.selectedIndex = 1 - elseif n == 2 then + elseif n == 1 then c1.selectedIndex = 0 elseif n == 8 then c1.selectedIndex = 3 else - c1.selectedIndex = 2 + c1.selectedIndex = 0 end end end @@ -267,7 +268,7 @@ function M:UpdateCardSizeIndex() elseif room.change_card_size == self.mediumSize then size.selectedIndex = 1 elseif room.change_card_size == self.smallSize then - size.selectedIndex = 2 + size.selectedIndex = 1 end else size.selectedIndex = 0 @@ -299,7 +300,6 @@ function M:FillBgSection(cb, game_id, default_bg, room, qihu) cb(config.url) ctr_bg.selectedIndex = i - 1 if qihu ~= nil then - -- self._blur_view:GetChild('di_text').text = room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起' self._blur_view:GetController('bg_state').selectedIndex = i - 1 end end @@ -316,7 +316,6 @@ function M:FillBgSection(cb, game_id, default_bg, room, qihu) index = ctr_bg.selectedIndex end if qihu ~= nil then - -- self._blur_view:GetChild('di_text').text = room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起' if index < 3 then self._blur_view:GetController('bg_state').selectedIndex = index else diff --git a/fk101/lua_probject/main_project/main/zipai/ZPMainView.lua b/fk101/lua_probject/main_project/main/zipai/ZPMainView.lua index dfc30ed7..b416c7b1 100644 --- a/fk101/lua_probject/main_project/main/zipai/ZPMainView.lua +++ b/fk101/lua_probject/main_project/main/zipai/ZPMainView.lua @@ -86,11 +86,11 @@ function M:InitView(url, isdisplay, open_social, change_card_size, qihu) local typeface = _data['game_cardsize'] local _gamectr = self._gamectr if typeface == 0 then - self._room.change_card_size = 2 + self._room.change_card_size = 1.03 elseif typeface == 1 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 elseif typeface == 2 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 end else self._room.change_card_size = change_card_size @@ -254,11 +254,11 @@ end -- 设置 更新 手牌大小 function M:UpdateCardSize(index) if index == 0 then - self._room.change_card_size = 2 + self._room.change_card_size = 1.03 elseif index == 1 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 elseif index == 2 then - self._room.change_card_size = 1.8 + self._room.change_card_size = 1 end local info = self._player_card_info[1] info:UpdateCardSize() diff --git a/fk101/lua_probject/main_project/main/zipai/ZPPlayerSelfCardInfoView.lua b/fk101/lua_probject/main_project/main/zipai/ZPPlayerSelfCardInfoView.lua index 2fb28d8b..f8af437e 100644 --- a/fk101/lua_probject/main_project/main/zipai/ZPPlayerSelfCardInfoView.lua +++ b/fk101/lua_probject/main_project/main/zipai/ZPPlayerSelfCardInfoView.lua @@ -54,12 +54,13 @@ function M:init() self._isDrg = false self.card_list = {} -- 牌的btn code type pos 等等 self.cards_count = 0 -- 牌的总列数 - self.card_width = 87 - self.card_hight = 110 + self.card_width = 198 + self.card_hight = 250 self.outcard_button = nil self._room = DataManager.CurrenRoom self._area_handcard_list = view:GetChild('area_handcard_list') self._area_outcard_list = view:GetChild('area_outcard_list') + -- self._bgview = view:GetController("bgview") self._area_fz_list = view:GetChild('area_fz_list') self._area_qipai_list = view:GetChild('windcard_list') self._view_outLine = view:GetChild('n38') @@ -145,6 +146,8 @@ function M:ShowHuTip(card) selfplayeTable.paoCount = _aplayer.paoCount selfplayeTable.hu_xi = _aplayer.hu_xi local player = membe_deep_clone(selfplayeTable) + player.tiCount = _aplayer.tiCount + player.paoCount = _aplayer.paoCount if card ~= nil then list_remove(player.handcard_list, card) end @@ -156,12 +159,15 @@ end function M:SetNotPutCard() - local tempNotPutList=DataManager.CurrenRoom.self_player.currentNotPutCardList - if tempNotPutList and #tempNotPutList>0 then - for i=1,#tempNotPutList do - self:UpdateKan(tempNotPutList[i]) - end - end + if DataManager.CurrenRoom.self_player == nil then + return + end + local tempNotPutList = DataManager.CurrenRoom.self_player.currentNotPutCardList + if tempNotPutList and #tempNotPutList > 0 then + for i = 1, #tempNotPutList do + self:UpdateKan(tempNotPutList[i]) + end + end end --手牌 @@ -197,13 +203,13 @@ function M:InitHandCard(isPlayAni, index) local pokerListNum = 0 for j = 1, #pokerList[i] do local card_code = pokerList[i][j] - local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card') + local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Hand_Card') btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code) btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize()) - self.card_width = 87 * self:getCardSize() - self.card_hight = 110 * self:getCardSize() - local x, y = 500, (j * 75) - 500 + self.card_width = btn_card.width * self:getCardSize() + self.card_hight = btn_card.height * self:getCardSize() + local x, y = 500, (j * 85) - 500 btn_card:SetXY(x, y) self._area_handcard_list:AddChild(btn_card) self._area_handcard_list:SetChildIndex(btn_card, 5 - j) @@ -245,12 +251,12 @@ function M:InitHandCard(isPlayAni, index) for i = 1, #pokerList do for j = 1, #pokerList[i] do local card_code = pokerList[i][j] - local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card') + local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Hand_Card') btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code) btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize()) - self.card_width = 87 * self:getCardSize() - self.card_hight = 110 * self:getCardSize() + self.card_width = btn_card.width * self:getCardSize() + self.card_hight = btn_card.height * self:getCardSize() self._area_handcard_list:AddChild(btn_card) self._area_handcard_list:SetChildIndex(btn_card, 5 - j) local card_view = NewCardView(btn_card, card_code, i, j) @@ -292,12 +298,12 @@ function M:UpdateHandCards(list) end for i = 1, #list do local card_code = list[i].card_item - local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Card') + local btn_card = UIPackage.CreateObjectFromURL('ui://Main_RunBeard/Btn_Hand_Card') btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_code) btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize()) - self.card_width = 87 * self:getCardSize() - self.card_hight = 110 * self:getCardSize() + self.card_width = btn_card.width * self:getCardSize() + self.card_hight = btn_card.height * self:getCardSize() local card_view = NewCardView(btn_card, card_code, list[i].index_X, list[i].index_Y) --存牌堆 self.card_list[#self.card_list + 1] = card_view @@ -439,9 +445,13 @@ function M:UpdateCardDisplay() local card_view = self.card_list[i] card_view.btn_card:RemoveFromParent() card_view.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_view.card_item) + self.card_width = card_view.btn_card.width * self:getCardSize() + self.card_hight = card_view.btn_card.height * self:getCardSize() self._area_handcard_list:AddChild(card_view.btn_card) card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3) end + self:UpdateOutLine() + self:UpdateHandCardsPos() end --更新手牌大小 function M:UpdateCardSize() @@ -456,8 +466,8 @@ function M:UpdateCardSize() card_view.btn_card:GetChild('icon').icon = self:getCardItem('ui://Main_RunBeard/201_', card_view.card_item) card_view.btn_card:GetChild('icon'):SetScale(self:getCardSize(), self:getCardSize()) card_view.btn_card:GetChild('n6'):SetScale(self:getCardSize(), self:getCardSize()) - self.card_width = 87 * self:getCardSize() - self.card_hight = 110 * self:getCardSize() + self.card_width = card_view.btn_card.width * self:getCardSize() + self.card_hight = card_view.btn_card.height * self:getCardSize() self._area_handcard_list:AddChild(card_view.btn_card) card_view.btn_card:TweenMove(self:GetHandCardPos(card_view, #CountCards), 0.3) end @@ -466,12 +476,12 @@ function M:UpdateCardSize() end function M:UpdateOutLine() - if self:getCardSize() == 1.8 then - self._data_outLinePos = 135 - (170 * 3) - elseif self:getCardSize() == 2 then - self._data_outLinePos = 160 - (195 * 3) + if self:getCardSize() == 1.03 then + self._data_outLinePos = 90 - (125 * 3) + elseif self:getCardSize() == 1 then + self._data_outLinePos = 147 - (197 * 3) end - self._view_outLine.y = self._data_outLinePos + self._area_handcard_list.height - 80 + self._view_outLine.y = self._data_outLinePos - 80 end function M:UpdateIsOnClick(isOut) @@ -731,21 +741,18 @@ end --计算手牌位置 function M:GetHandCardPos(cards_view, cards) local x, y = 0, 0 - local card_width = self.card_width -- 牌的宽度 + local card_width = self.card_width - (self._room.change_card_display == "1_" and 8 or 1) -- 牌的宽度 + local card_clounm = self._room.change_card_display == "1_" and 0 or 30 local middle_x = self._area_handcard_list.width / 2 local start_x = middle_x - (cards / 2 * (card_width)) x = start_x + (card_width) * (cards_view.index_X - 1) - if self:getCardSize() == 1 then - y = 90 - (85 * cards_view.index_Y) - elseif self:getCardSize() == 1.2 then - y = 70 - (100 * cards_view.index_Y) - elseif self:getCardSize() == 0.8 then - y = 100 - (65 * cards_view.index_Y) - elseif self:getCardSize() == 1.8 then - y = 105 - (162 * cards_view.index_Y) - elseif self:getCardSize() == 2 then - y = 105 - (180 * cards_view.index_Y) + -- local card_height = self.card_hight + -- y = 90 - card_height * 0.66 * cards_view.index_Y + if self:getCardSize() == 1.03 then + y = 147 - ((203-card_clounm) * cards_view.index_Y) + elseif self:getCardSize() == 1 then + y = 147 - ((197-card_clounm) * cards_view.index_Y) end return Vector2.New(x, y) end @@ -871,9 +878,12 @@ end --得到设置的牌大小 function M:getCardSize() if self._room.change_card_size ~= nil then + if self._room.change_card_size ~= 1.03 and self._room.change_card_size ~= 1 then + self._room.change_card_size = 1 + end return self._room.change_card_size else - return 1.6 + return 1 end end diff --git a/fk101/lua_probject/main_project/main/zipai/ZPSettingView.lua b/fk101/lua_probject/main_project/main/zipai/ZPSettingView.lua index bccc2cb2..6be51784 100644 --- a/fk101/lua_probject/main_project/main/zipai/ZPSettingView.lua +++ b/fk101/lua_probject/main_project/main/zipai/ZPSettingView.lua @@ -15,10 +15,10 @@ local ZPSettingView = { } local M = ZPSettingView -function ZPSettingView.new(blur_view, index, open_social) - setmetatable(SettingView, {__index = BaseWindow}) - setmetatable(M, {__index = SettingView}) - local self = setmetatable({}, {__index = M}) +function ZPSettingView.new(blur_view, index, open_social, cardIndex) + setmetatable(SettingView, { __index = BaseWindow }) + setmetatable(M, { __index = SettingView }) + local self = setmetatable({}, { __index = M }) self.class = 'ZPSettingView' self._currenIndex = 0 self._blur_view = blur_view @@ -27,12 +27,14 @@ function ZPSettingView.new(blur_view, index, open_social) self.cd_time = 0 self._btn_dismiss_room_enable = false self._close_destroy = true - self.bigSize = 1.2 + self.bigSize = 1.03 self.mediumSize = 1 - self.smallSize = 0.8 + self.smallSize = 1 self._full = true self._anim_pop = 2 + self._close_zone = true self._open_social = open_social + self._cardType = cardIndex self:init('ui://Main_RunBeard/New_SettingWindow') return self end @@ -71,15 +73,18 @@ function M:init(url) local room = DataManager.CurrenRoom local c1 = self._view:GetController('cards') + if self._cardType then + c1.selectedIndex = self._cardType + end + local size = self._view:GetController('size') if room.change_card_size ~= nil then - if room.change_card_size == self.bigSize then size.selectedIndex = 0 elseif room.change_card_size == self.mediumSize then size.selectedIndex = 1 elseif room.change_card_size == self.smallSize then - size.selectedIndex = 2 + size.selectedIndex = 1 end else room.change_card_size = 0 @@ -88,14 +93,14 @@ function M:init(url) if room.change_card_display ~= nil then local _str = string.sub(room.change_card_display, 1, 1) local n = tonumber(_str) - if n == 1 then + if n == 6 then c1.selectedIndex = 1 - elseif n == 2 then + elseif n == 1 then c1.selectedIndex = 0 elseif n == 8 then c1.selectedIndex = 3 else - c1.selectedIndex = 2 + c1.selectedIndex = 0 end end if self._open_social then @@ -239,16 +244,16 @@ function M:UpdateIndex() local _str = string.sub(room.change_card_display, 1, 1) local n = tonumber(_str) if n == 7 then - n = 2 + n = 6 end - if n == 1 then + if n == 6 then c1.selectedIndex = 1 - elseif n == 2 then + elseif n == 1 then c1.selectedIndex = 0 elseif n == 8 then c1.selectedIndex = 3 else - c1.selectedIndex = 2 + c1.selectedIndex = 0 end end end @@ -261,7 +266,7 @@ function M:UpdateCardSizeIndex() elseif room.change_card_size == self.mediumSize then size.selectedIndex = 1 elseif room.change_card_size == self.smallSize then - size.selectedIndex = 2 + size.selectedIndex = 1 end else size.selectedIndex = 0 @@ -293,7 +298,6 @@ function M:FillBgSection(cb, game_id, default_bg, room, qihu) cb(config.url) ctr_bg.selectedIndex = i - 1 if qihu ~= nil then - -- self._blur_view:GetChild('di_text').text = room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起' self._blur_view:GetController('bg_state').selectedIndex = i - 1 end end @@ -310,7 +314,6 @@ function M:FillBgSection(cb, game_id, default_bg, room, qihu) index = ctr_bg.selectedIndex end if qihu ~= nil then - -- self._blur_view:GetChild('di_text').text = room.room_config:GetGameName() .. ' ' .. qihu .. '胡息起' if index < 3 then self._blur_view:GetController('bg_state').selectedIndex = index else diff --git a/fk101/wb_new_ui/.objs/metas/35sf1c1f/r05e8u.info b/fk101/wb_new_ui/.objs/metas/35sf1c1f/r05e8u.info index ebad36e5..e150aacc 100644 --- a/fk101/wb_new_ui/.objs/metas/35sf1c1f/r05e8u.info +++ b/fk101/wb_new_ui/.objs/metas/35sf1c1f/r05e8u.info @@ -1,8 +1,5 @@ { "objectStatus": { - "n183_yfzf": { - "collapsed": true - }, "n193_syh3": { "locked": true, "hidden": true diff --git a/fk101/wb_new_ui/.objs/workspace.json b/fk101/wb_new_ui/.objs/workspace.json index 8baf6a4f..12f720ce 100644 --- a/fk101/wb_new_ui/.objs/workspace.json +++ b/fk101/wb_new_ui/.objs/workspace.json @@ -1,13 +1,66 @@ { - "doc.openedDocs": [], - "libview.iconScale": 0, - "libview.currentGroup": "", - "libview.expandedNodes": [ - "27vd145b", - "/", - "27vd145b", - "/conMui/" - ], "libview.firstColumnWidth": 413, - "libview.twoColumn": false + "libview.iconScale": 0, + "doc.openedDocs": [ + "ui://5cdldr01qaqf9c", + "ui://5cdldr01qaqf61", + "ui://442j0uepygxga", + "ui://5cdldr01qaqfo", + "ui://c7j2rnvqtpf01p", + "ui://c7j2rnvqtpf06k", + "ui://c7j2rnvqtpf08q", + "ui://c7j2rnvqtpf06t", + "ui://z3z0ysurygxgd", + "ui://442j0uepygxgd", + "ui://c7j2rnvqtpf06p", + "ui://v6yvqp7waen81b0", + "ui://5cdldr01qaqfe0", + "ui://5cdldr01qaqfcn", + "ui://5cdldr01qaqf4n", + "ui://35sf1c1fr05e9k", + "ui://5cdldr01qaqfa2", + "ui://5cdldr01qaqf46", + "ui://5cdldr01qaqf4w", + "ui://5cdldr01qaqf4t", + "ui://5cdldr01qaqf3y", + "ui://5cdldr01qaqf4e" + ], + "auxline1": true, + "canvasColor": 10066329, + "auxline2": true, + "doc.activeDoc": "ui://442j0uepygxgd", + "libview.twoColumn": false, + "libview.expandedNodes": [ + "442j0uep", + "/", + "442j0uep", + "/component/", + "442j0uep", + "/component/create_room/", + "z3z0ysur", + "/", + "z3z0ysur", + "/component/", + "z3z0ysur", + "/component/create_room/", + "z3z0ysur", + "/component/create_room/images/", + "z3z0ysur", + "/font/", + "z3z0ysur", + "/images/", + "z3z0ysur", + "/mgr/", + "z3z0ysur", + "/mgr/imgs/", + "z3z0ysur", + "/mgr/imgs/game/", + "5cdldr01", + "/" + ], + "snapToGrid": true, + "backgroundColor": 6710886, + "libview.currentGroup": "", + "gridSize": 30, + "gridColor": 80 } \ No newline at end of file diff --git a/fk101/wb_new_ui/assets/Extend_Poker_RunBeard/component/clearing/clearing.xml b/fk101/wb_new_ui/assets/Extend_Poker_RunBeard/component/clearing/clearing.xml index 28de3843..65e4e87e 100644 --- a/fk101/wb_new_ui/assets/Extend_Poker_RunBeard/component/clearing/clearing.xml +++ b/fk101/wb_new_ui/assets/Extend_Poker_RunBeard/component/clearing/clearing.xml @@ -1,12 +1,12 @@ - + - + @@ -23,20 +23,20 @@