时间,电量,房间号,桌布,小细节修补

master
罗家炜 2025-04-25 16:50:32 +08:00
parent 8707a270f3
commit 9d1848df9c
14 changed files with 477 additions and 86 deletions

View File

@ -388,6 +388,11 @@ function M:InitView(url, isHideIpAdds)
) )
end end
end--]] end--]]
-------------------------lingmeng---------------------------
_view:GetChild('text_roomId').text = string.format("房间:%s", self._room.room_id)
local text_time = _view:GetChild('text_time')
local ProgressBar_battery = _view:GetChild('ProgressBar_jiangxi')
------------------------------------------------------------
end end
function M:continue_game(continue) function M:continue_game(continue)

View File

@ -1,6 +1,7 @@
local MJPlayerSelfCardInfoView = import(".MJPlayerSelfCardInfoView") local MJPlayerSelfCardInfoView = import(".MJPlayerSelfCardInfoView")
local MJPlayerCardInfoView = require("main.majiang.MJPlayerCardInfoView_jiangxi") local MJPlayerCardInfoView = require("main.majiang.MJPlayerCardInfoView_jiangxi")
local MJMainView = require("main.majiang.MJMainView") local MJMainView = require("main.majiang.MJMainView")
local TableBG = require("Game.Data.TableBG")
local EXClearingView = import(".EXClearingView") local EXClearingView = import(".EXClearingView")
local TX_GameEvent = import(".GameEvent") local TX_GameEvent = import(".GameEvent")
local HuTipView = import("main.majiang.HuTipView") local HuTipView = import("main.majiang.HuTipView")
@ -8,6 +9,13 @@ local SettingView = import(".EXSettingView")
local PlayerInfoView = import(".EXPlayerInfoView") local PlayerInfoView = import(".EXPlayerInfoView")
local M = {} local M = {}
local bg_config = {
{ id = 1, url = "extend/majiang/nancheng/bg/bg1", thumb = "ui://Extend_MJ_NanCheng/bg1" },
{ id = 2, url = "extend/majiang/nancheng/bg/bg2", thumb = "ui://Extend_MJ_NanCheng/bg2" },
{ id = 3, url = "extend/majiang/nancheng/bg/bg3", thumb = "ui://Extend_MJ_NanCheng/bg3" },
{ id = 4, url = "extend/majiang/nancheng/bg/bg4", thumb = "ui://Extend_MJ_NanCheng/bg4" }
}
--- Create a new ZZ_MainView --- Create a new ZZ_MainView
function M.new() function M.new()
setmetatable(M, { __index = MJMainView }) setmetatable(M, { __index = MJMainView })
@ -30,11 +38,14 @@ function M:InitView(url)
-- else -- else
-- MJMainView.InitView(self, "ui://Main_Majiang/Main_" .. room.room_config.people_num .. "_s2") -- MJMainView.InitView(self, "ui://Main_Majiang/Main_" .. room.room_config.people_num .. "_s2")
-- end -- end
MJMainView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num)) local use_custom_bg = true
MJMainView.InitView(self, string.format("ui://Main_Majiang/Main_new_%d_jiangxi", room.room_config.people_num),
use_custom_bg)
if use_custom_bg then
TableBG.LoadTableBG(1, self._room.game_id, self._root_view, bg_config)
end
self._hu_tip = HuTipView.new(self) self._hu_tip = HuTipView.new(self)
self._view:GetChild('wanfa_text').text = room.room_config.people_num .. '人个旧麻将 ' .. room.score_times .. ''
self.selectLaiziBtn = self._view:GetChild('selectlaizi') self.selectLaiziBtn = self._view:GetChild('selectlaizi')
self.Laizi1Btn = self._view:GetChild('selectgang1') self.Laizi1Btn = self._view:GetChild('selectgang1')
self.Laizi2Btn = self._view:GetChild('selectgang2') self.Laizi2Btn = self._view:GetChild('selectgang2')
@ -47,6 +58,10 @@ function M:InitView(url)
--[[ --[[
MJMainView.InitView(self, "ui://Main_Majiang/Main_new_" .. room.room_config.people_num) MJMainView.InitView(self, "ui://Main_Majiang/Main_new_" .. room.room_config.people_num)
--]] --]]
local config = ExtendManager.GetExtendConfig(room.game_id)
local mode = config:GetGameInfo()
local gamePlay = mode:LoadConfigToDetail(json.encode(room.room_config.config))
self._view:GetChild('wanfa_text').text = gamePlay
self.jing = self._view:GetChild('jing') self.jing = self._view:GetChild('jing')
@ -637,11 +652,9 @@ function M:__FangziTip(tip, weight)
local _chipeng_tip = info._view_FZTips local _chipeng_tip = info._view_FZTips
local _ctr_tips = info._ctr_tip local _ctr_tips = info._ctr_tip
print("lingmengfz")
local _lit_fanzi = _chipeng_tip:GetChild("list") local _lit_fanzi = _chipeng_tip:GetChild("list")
_lit_fanzi:SetVirtual() _lit_fanzi:SetVirtual()
local _tlist = tip.tip_map_id local _tlist = tip.tip_map_id
print("lingmengfz2")
_lit_fanzi.itemRenderer = function(index, obj) _lit_fanzi.itemRenderer = function(index, obj)
local type = obj:GetController('type') local type = obj:GetController('type')
if index == tip.tip_num then if index == tip.tip_num then
@ -690,7 +703,6 @@ function M:__FangziTip(tip, weight)
end end
_ctr_tips.selectedIndex = 1 _ctr_tips.selectedIndex = 1
_lit_fanzi.numItems = tip.tip_num + 1 _lit_fanzi.numItems = tip.tip_num + 1
print("lingmengfzend", _ctr_tips.selectedIndex)
end end
function M:__TipAction(context) function M:__TipAction(context)

View File

@ -9,54 +9,51 @@ local M = MJMainRightPanelView
local function __init(self, mainView, view) local function __init(self, mainView, view)
local mainView = mainView._view
-- local right_panel = 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()
local btn_setting = right_panel:GetChild("btn_setting") -- local room = DataManager.CurrenRoom
btn_setting.onClick:Set(function() -- _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
-- if mainView.dismiss_room_cd_time > 0 then
-- GameApplication.Instance:ShowTips("您还处于解散冷却时间当中,请稍后重试!")
-- else
-- _gamectr:AskDismissRoom()
-- end
-- end
-- end)
-- end)
-- self._tex_data = right_panel:GetChild("tex_data")
self._tex_time = mainView:GetChild("text_time")
self._pb_batteryLevel = mainView:GetChild("ProgressBar_jiangxi")
-- self._xinhao = right_panel:GetController("xinhao")0
-- self.ctr_xh = right_panel:GetChild("gcm_xinhao"):GetController("c1")
-- self.ctr_wifi = right_panel:GetChild("gcm_wifi"):GetController("c1")
-- self._tex_ping = right_panel:GetChild("gcm_xinhao"):GetChild("n7")
local _settingView = mainView:NewSettingView() -- self.ctr_log = right_panel:GetController("log")
_settingView.stateIndex = (mainView._room.curren_round >= 1 and mainView._allow_dissmiss) and 2 or 1 -- local btn_log = right_panel:GetChild("btn_log")
_settingView.cd_time = mainView.dismiss_room_cd_time -- btn_log.onClick:Set(function()
_settingView:Show() -- if self.onLogCallback then
-- self.onLogCallback()
local room = DataManager.CurrenRoom -- end
_settingView.onCallback:Add(function(context) -- end)
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
if mainView.dismiss_room_cd_time > 0 then
GameApplication.Instance:ShowTips("您还处于解散冷却时间当中,请稍后重试!")
else
_gamectr:AskDismissRoom()
end
end
end)
end)
self._tex_data = right_panel:GetChild("tex_data")
self._tex_time = right_panel:GetChild("tex_time")
self._pb_batteryLevel = right_panel:GetChild("pb_batteryLevel")
self._xinhao = right_panel:GetController("xinhao")
self.ctr_xh = right_panel:GetChild("gcm_xinhao"):GetController("c1")
self.ctr_wifi = right_panel:GetChild("gcm_wifi"):GetController("c1")
self._tex_ping = right_panel:GetChild("gcm_xinhao"):GetChild("n7")
self.ctr_log = right_panel:GetController("log")
local btn_log = right_panel:GetChild("btn_log")
btn_log.onClick:Set(function()
if self.onLogCallback then
self.onLogCallback()
end
end)
self._total_time = 0 self._total_time = 0
self:__UpdateTime() self:__UpdateTime()
@ -72,30 +69,28 @@ function MJMainRightPanelView.new(mainView,view)
return self return self
end end
function M:__UpdateTime() function M:__UpdateTime()
self._tex_data.text = os.date("%Y-%m-%d") -- self._tex_data.text = os.date("%Y-%m-%d")
self._tex_time.text = os.date("%H:%M") self._tex_time.text = os.date("%H:%M")
if Application.platform == RuntimePlatform.IPhonePlayer or Application.platform == RuntimePlatform.Android then if Application.platform == RuntimePlatform.IPhonePlayer or Application.platform == RuntimePlatform.Android then
self._pb_batteryLevel.value = GameApplication.Instance:GetBatteryLevel() self._pb_batteryLevel.value = GameApplication.Instance:GetBatteryLevel()
end end
local NetworkReachability = UnityEngine.NetworkReachability -- local NetworkReachability = UnityEngine.NetworkReachability
local _client = ControllerManager.GameNetClinet -- local _client = ControllerManager.GameNetClinet
if not _client then return end -- if not _client then return end
local ping = _client:getAveragePingTime() -- local ping = _client:getAveragePingTime()
if not ping then return end -- if not ping then return end
ping = math.floor(ping / 2) -- ping = math.floor(ping / 2)
if ping > 300 then ping =300 end -- if ping > 300 then ping = 300 end
if ping <= 100 then -- if ping <= 100 then
self.ctr_xh.selectedIndex = 0 -- self.ctr_xh.selectedIndex = 0
elseif ping <= 300 then -- elseif ping <= 300 then
self.ctr_xh.selectedIndex = 1 -- self.ctr_xh.selectedIndex = 1
else -- else
self.ctr_xh.selectedIndex = 2 -- self.ctr_xh.selectedIndex = 2
end -- end
self._tex_ping.text = ping .. "ms" -- self._tex_ping.text = ping .. "ms"
end end
return M return M

View File

@ -121,10 +121,13 @@ function M:UpdateHandCard(getcard, mp)
mp = mp or false mp = mp or false
self._view_handCardList:RemoveChildren() self._view_handCardList:RemoveChildren()
self._view_getCard:RemoveChildren()
for i = 0, self._player.hand_left_count - 1 do for i = 0, self._player.hand_left_count - 1 do
-- if i >= self._view_handCardList.numItems then if getcard and i == self._player.hand_left_count - 1 then
self._view_getCard:AddItemFromPool()
else
self._view_handCardList:AddItemFromPool() self._view_handCardList:AddItemFromPool()
-- end end
end end
self._ctr_getCard.selectedIndex = getcard and 1 or 0 self._ctr_getCard.selectedIndex = getcard and 1 or 0
end end

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 69a1e2eddb6fe654fba6333733286741
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 KiB

View File

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 212abbcecaeffdf4ead6ce8bb5debd2b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

View File

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 9f99178be87d3b1498d1b6ddd4e40710
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 04b54a024a1fdbf469636024ca79c4e3
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

View File

@ -0,0 +1,92 @@
fileFormatVersion: 2
guid: 75370d382061b634d9adca525a43046c
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant: