class VCCUserData { public string PlayerID; // 座標チャンネル上のユーザーを識別するID public string VoiceID; // 音声チャンネル上のユーザーを識別するID public string ChannelSessionCode; public string UserCode; // uid, vket_id といった名称でJSONに書かれている英数字 public string UserType; // login or guest public string UserName; public string IconURL; public int TableOrder; // ユーザーテーブル上での順番 public bool IsChannelCreator; // 現在のチャンネル作成者かどうか // #11976 ボイスチャットの一段階目をオミットする // public VCCViewIconOnlyUser IconOnlyView; public VCCViewNameUser NameView; public VCCUserData() { IsChannelCreator = false; // IconOnlyView = new VCCViewIconOnlyUser(); NameView = new VCCViewNameUser(); } public void InitAsDummy(string _VoiceID) { PlayerID = "Dummy_%d" % hsMathRandom(99999); VoiceID = _VoiceID; UserCode = PlayerID; UserType = "guest"; UserName = PlayerID; } public bool Load(list UserList, string IconOnlyLayerName, string UserListLayerName, VCCTableUILayout Layout_la, VCCTableUILayout Layout_po, VCCTableUILayout Layout_xr) { // if(!IconOnlyView.Load(this, TableOrder, IsChannelCreator, UserList, IconOnlyLayerName, Layout_la, Layout_po)) return false; if(!NameView.Load(this, TableOrder, IsChannelCreator, UserList, UserListLayerName, Layout_la, Layout_po, Layout_xr)) return false; return true; } public void SetMicState(int MicState) { // IconOnlyView.SetMicState(MicState); NameView.SetMicState(MicState); } public void UpdateGUIPos(int Order, list UserList, VCCTableUILayout Layout_la, VCCTableUILayout Layout_po, VCCTableUILayout Layout_xr) { TableOrder = Order; // IconOnlyView.UpdateGUIPos(Order, UserList); NameView.UpdateGUIPos(Order, UserList, Layout_la, Layout_po, Layout_xr); } public void UpdateGUIResource() { // IconOnlyView.UpdateGUIResource(this); NameView.UpdateGUIResource(this); } public void Release() { // IconOnlyView.Release(); NameView.Release(); } public void ShowTempBlockUI(bool IsBlocked) { // IconOnlyView.ShowTempBlockUI(IsBlocked); NameView.ShowTempBlockUI(IsBlocked); } } class VCCViewIconOnlyUser { string TargetLayerName; string PlayerID; public string hud_voicechat_user_icon_n; string hud_voicechat_mute; string hud_voicechat_user_talking; string hud_voicechat_leader_icon; string temp_block_icon_image; string Toggle_VCC_User_Leader_Icon; string Toggle_VCC_User_Is_Blocked; public bool Load(VCCUserData UserData, int TableOrder, bool IsChannelCreator, list UserList, string LayerName, VCCTableUILayout Layout_la, VCCTableUILayout Layout_po, VCCTableUILayout Layout_xr) { TargetLayerName = LayerName; PlayerID = UserData.PlayerID; Toggle_VCC_User_Leader_Icon = "Toggle_VCC_User_Leader_Icon_%s" % PlayerID; Toggle_VCC_User_Is_Blocked = "Toggle_VCC_User_Is_Blocked_%s" % PlayerID; _Load(UserData, TableOrder, false, 60, IsChannelCreator, UserList); _Load(UserData, TableOrder, true, 150, IsChannelCreator, UserList); _Show(IsChannelCreator); return true; } public void SetMicState(int MicState) { // ミュートバッチの更新 if(MicState == 0) { hsCanvasResetToggleDefault("Toggle_VCC_MuteBatch_ON_OFF_%s" % PlayerID); } else { hsCanvasResetToggleDefault("Toggle_VCC_MuteBatch_ON_OFF_%s" % PlayerID); hsCanvasToggleChange("Toggle_VCC_MuteBatch_ON_OFF_%s" % PlayerID); } // 発声中の強調表示を更新 } public void UpdateGUIPos(int Order, list UserList) { _UpdatePos(Order, false, 60, UserList); _UpdatePos(Order, true, 150, UserList); } public void UpdateGUIResource(VCCUserData UserData) { string iconURL = (UserData.IconURL.IsEmpty())? "gui2024/menu/mypage/mypage_icon_none.png" : UserData.IconURL; hsCanvasSetGUIImage(TargetLayerName, hud_voicechat_user_icon_n, iconURL); _Show(UserData.IsChannelCreator); } public void Release() { _Release(false); _Release(true); } public void ShowTempBlockUI(bool IsBlocked) { hsCanvasResetToggleDefault(Toggle_VCC_User_Is_Blocked); if(IsBlocked) { hsCanvasToggleChange(Toggle_VCC_User_Is_Blocked); } } void _Load(VCCUserData UserData, int UserIndex, bool IsPortrait, int YOffset, bool IsChannelCreator, list UserList) { int MaxColCount = 3; int col = UserIndex / MaxColCount; int row = UserIndex - col * MaxColCount; hud_voicechat_user_icon_n = "hud_voicechat_user_icon_%s" % UserData.PlayerID; hud_voicechat_mute = "hud_voicechat_mute_%s" % UserData.PlayerID; hud_voicechat_user_talking = "hud_voicechat_user_talking_%s" % UserData.PlayerID; hud_voicechat_leader_icon = "hud_voicechat_leader_icon_%s" % UserData.PlayerID; temp_block_icon_image = "temp_block_icon_image_%s" % UserData.PlayerID; string iconURL = (UserData.IconURL.IsEmpty())? "gui2024/menu/mypage/mypage_icon_none.png" : UserData.IconURL; // 自身よりもひとつ前のアイコンのGUIの位置を参照して自身のY座標を計算する(スクロールでずれてしまうため) // アイコン以外のGUIについてはアイコンからの相対座標をAddGUIの時に考慮する必要がある float IconPosY = (IsPortrait)? 380 : 126; if(UserIndex != 0) { int PrevIndex = UserIndex - 1; VCCUserData PrevUser = UserList[PrevIndex]; float PrevX; float PrevY; // #11976 ボイスチャットの一段階目をオミットする // if(hsCanvasGetGUIPos(TargetLayerName, IsPortrait, PrevUser.IconOnlyView.hud_voicechat_user_icon_n, PrevX, PrevY)) { // 一つ前のGUIが同じ行かどうか bool IsSameLine = ((PrevIndex + 1) % 3 != 0); if(IsSameLine) { // 一つ前のGUIと同じ行なのでY座標もそろえる IconPosY = PrevY; } else { // 一つ前のGUIの一行下なので一つ分Y座標を下げる IconPosY = PrevY + YOffset; } } } // GUIを生成する if(IsPortrait) { int XOffset = 160; hsAddGUIButton( TargetLayerName, IsPortrait, hud_voicechat_user_icon_n, "", "", "", true, 2, 204 + row * XOffset, IconPosY, 140, 140, 0.5, 0.5, "LT", true, 0.0, iconURL, "", "", "", 140, 140, 300, 32, 0, 0, 0, 0, 0, 0, 0, 0 ); hsAddGUIImage( TargetLayerName, IsPortrait, hud_voicechat_mute, "", "", "", true, 3, 254 + row * XOffset, 50 + IconPosY, 65, 65, 0.5, 0.5, "LT", true, 0.0, "gui2024/hud/hud_voicechat_mute.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(TargetLayerName, hud_voicechat_mute, "Toggle_VCC_MuteBatch_ON_OFF_%s" % PlayerID, true); hsAddGUIImage( TargetLayerName, IsPortrait, hud_voicechat_user_talking, "", "", "", true, 1, 204 + row * XOffset, IconPosY, 291, 291, 0.5, 0.5, "LT", true, 0.0, "gui2024/voicechat/hud_voicechat_user_talking.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(TargetLayerName, hud_voicechat_user_talking, "Toggle_VCC_Talking_ON_OFF_%s" % PlayerID, false); // チャンネル作成者の王冠マークを生成 hsAddGUIImage( TargetLayerName, IsPortrait, hud_voicechat_leader_icon, "", "", "", true, 3, 204 + row * XOffset, -60 + IconPosY, 100, 50, 0.5, 0.5, "LT", true, 0.0, "gui2024/voicechat/hud_voicechat_leader_icon.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(TargetLayerName, hud_voicechat_leader_icon, Toggle_VCC_User_Leader_Icon, false); // 一時ブロック hsAddGUIImage( TargetLayerName, IsPortrait, temp_block_icon_image, "", "", "", true, 6, 204 + row * XOffset, IconPosY, 140, 140, 0.5, 0.5, "LT", true, 0.0, "gui2024/voicechat/voicechat_icon_block.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(TargetLayerName, temp_block_icon_image, Toggle_VCC_User_Is_Blocked, false); } else { int XOffset = 57; hsAddGUIButton( TargetLayerName, IsPortrait, hud_voicechat_user_icon_n, "", "", "", true, 2, 61 + row * XOffset, IconPosY, 51, 51, 0.5, 0.5, "LT", true, 0.0, iconURL, "", "", "", 51, 51, 300, 32, 0, 0, 0, 0, 0, 0, 0, 0 ); hsAddGUIImage( TargetLayerName, IsPortrait, hud_voicechat_mute, "", "", "", true, 3, 77 + row * XOffset, 17 + IconPosY, 25, 25, 0.5, 0.5, "LT", true, 0.0, "gui2024/hud/hud_voicechat_mute.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(TargetLayerName, hud_voicechat_mute, "Toggle_VCC_MuteBatch_ON_OFF_%s" % PlayerID, true); hsAddGUIImage( TargetLayerName, IsPortrait, hud_voicechat_user_talking, "", "", "", true, 1, 61 + row * XOffset, IconPosY, 105, 105, 0.5, 0.5, "LT", true, 0.0, "gui2024/voicechat/hud_voicechat_user_talking.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(TargetLayerName, hud_voicechat_user_talking, "Toggle_VCC_Talking_ON_OFF_%s" % PlayerID, false); // チャンネル作成者の王冠マークを生成 hsAddGUIImage( TargetLayerName, IsPortrait, hud_voicechat_leader_icon, "", "", "", true, 3, 61 + row * XOffset, -21 + IconPosY, 40, 20, 0.5, 0.5, "LT", true, 0.0, "gui2024/voicechat/hud_voicechat_leader_icon.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(TargetLayerName, hud_voicechat_leader_icon, Toggle_VCC_User_Leader_Icon, false); // 一時ブロック hsAddGUIImage( TargetLayerName, IsPortrait, temp_block_icon_image, "", "", "", true, 6, 61 + row * XOffset, IconPosY, 51, 51, 0.5, 0.5, "LT", true, 0.0, "gui2024/voicechat/voicechat_icon_block.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(TargetLayerName, temp_block_icon_image, Toggle_VCC_User_Is_Blocked, false); } } void _UpdatePos(int UserIndex, bool IsPortrait, int YOffset, list UserList) { int MaxColCount = 3; int col = UserIndex / MaxColCount; int row = UserIndex - col * MaxColCount; // 自身よりもひとつ前のアイコンのGUIの位置を参照して自身のY座標を計算する(スクロールでずれてしまうため) // アイコン以外のGUIについてはアイコンからの相対座標をAddGUIの時に考慮する必要がある float IconPosY = (IsPortrait)? 380 : 126; if(UserIndex != 0) { int PrevIndex = UserIndex - 1; VCCUserData PrevUser = UserList[PrevIndex]; float PrevX; float PrevY; // #11976 ボイスチャットの一段階目をオミットする // if(hsCanvasGetGUIPos(TargetLayerName, IsPortrait, PrevUser.IconOnlyView.hud_voicechat_user_icon_n, PrevX, PrevY)) { // 一つ前のGUIが同じ行かどうか bool IsSameLine = ((PrevIndex + 1) % 3 != 0); if(IsSameLine) { // 一つ前のGUIと同じ行なのでY座標もそろえる IconPosY = PrevY; } else { // 一つ前のGUIの一行下なので一つ分Y座標を下げる IconPosY = PrevY + YOffset; } } } // GUIの位置を更新する if(IsPortrait) { int XOffset = 160; hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_user_icon_n, 204 + row * XOffset, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_mute, 254 + row * XOffset, 50 + IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_user_talking, 204 + row * XOffset, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_leader_icon, 204 + row * XOffset, -60 + IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, temp_block_icon_image, 204 + row * XOffset, IconPosY); } else { int XOffset = 57; hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_user_icon_n, 61 + row * XOffset, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_mute, 77 + row * XOffset, 17 + IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_user_talking, 61 + row * XOffset, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_leader_icon, 61 + row * XOffset, -21 + IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, temp_block_icon_image, 61 + row * XOffset, IconPosY); } } void _Release(bool IsPortrait) { system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, hud_voicechat_user_icon_n); system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, hud_voicechat_mute); system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, hud_voicechat_user_talking); system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, hud_voicechat_leader_icon); system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, temp_block_icon_image); } void _Show(bool Show) { hsCanvasResetToggleDefault(Toggle_VCC_User_Leader_Icon); if(Show) { hsCanvasToggleChange(Toggle_VCC_User_Leader_Icon); } } } class VCCViewNameUser { string TargetLayerName; string PlayerID; public string hud_voicechat_user_icon; public string hud_voicechat_grab_button; string hud_voicechat_mute; string hud_voicechat_user_talking; string hud_voicechat_leader_icon; string hud_voicechat_name; string temp_block_icon_image; string temp_block_text_image; string Toggle_VCC_User_Leader_Icon; string Toggle_VCC_User_Is_Blocked; public bool Load(VCCUserData UserData, int TableOrder, bool IsChannelCreator, list UserList, string LayerName, VCCTableUILayout Layout_la, VCCTableUILayout Layout_po, VCCTableUILayout Layout_xr) { TargetLayerName = LayerName; PlayerID = UserData.PlayerID; Toggle_VCC_User_Leader_Icon = "Toggle_VCC_User_Leader_Icon_%s" % PlayerID; Toggle_VCC_User_Is_Blocked = "Toggle_VCC_User_Is_Blocked_%s" % PlayerID; _Load(UserData, TableOrder, "la", 35, IsChannelCreator, UserList, Layout_la); _Load(UserData, TableOrder, "po", 80, IsChannelCreator, UserList, Layout_po); _Load(UserData, TableOrder, "xr", 35, IsChannelCreator, UserList, Layout_xr); _Show(IsChannelCreator); return true; } public void SetMicState(int MicState) { // ミュートバッチの更新 if(MicState == 0) { hsCanvasResetToggleDefault("Toggle_VCC_MuteBatch_ON_OFF_%s" % PlayerID); } else { hsCanvasResetToggleDefault("Toggle_VCC_MuteBatch_ON_OFF_%s" % PlayerID); hsCanvasToggleChange("Toggle_VCC_MuteBatch_ON_OFF_%s" % PlayerID); } // 発声中の強調表示を更新 if(MicState == 2) { hsCanvasResetToggleDefault("Toggle_VCC_Talking_ON_OFF_%s" % PlayerID); hsCanvasToggleChange("Toggle_VCC_Talking_ON_OFF_%s" % PlayerID); } else { hsCanvasResetToggleDefault("Toggle_VCC_Talking_ON_OFF_%s" % PlayerID); } } public void UpdateGUIPos(int Order, list UserList, VCCTableUILayout Layout_la, VCCTableUILayout Layout_po, VCCTableUILayout Layout_xr) { _UpdatePos(Order, false, 35, UserList, Layout_la); _UpdatePos(Order, true, 80, UserList, Layout_po); if(hsSystemIsVRMode()) _UpdatePos(Order, false, 35, UserList, Layout_xr); } public void UpdateGUIResource(VCCUserData UserData) { string iconURL = (UserData.IconURL.IsEmpty())? "gui2024/menu/mypage/mypage_icon_none.png" : UserData.IconURL; hsCanvasSetGUIImage(TargetLayerName, hud_voicechat_user_icon, iconURL); hsCanvasSetGUIText(TargetLayerName, hud_voicechat_name, UserData.UserName); _Show(UserData.IsChannelCreator); } public void Release() { _Release(false); _Release(true); } public void ShowTempBlockUI(bool IsBlocked) { hsCanvasResetToggleDefault(Toggle_VCC_User_Is_Blocked); if(IsBlocked) { hsCanvasToggleChange(Toggle_VCC_User_Is_Blocked); } } void _Load(VCCUserData UserData, int UserIndex, string LayoutMode, int YOffset, bool IsChannelCreator, list UserList, VCCTableUILayout Layout) { hud_voicechat_user_icon = "hud_voicechat_user_icon_%s" % UserData.PlayerID; hud_voicechat_grab_button = "hud_voicechat_grab_button_%s" % UserData.PlayerID; hud_voicechat_mute = "hud_voicechat_mute_%s" % UserData.PlayerID; hud_voicechat_user_talking = "hud_voicechat_user_talking_%s" % UserData.PlayerID; hud_voicechat_leader_icon = "hud_voicechat_leader_icon_%s" % UserData.PlayerID; hud_voicechat_name = "hud_voicechat_name_%s" % UserData.PlayerID; temp_block_icon_image = "temp_block_icon_image_%s" % UserData.PlayerID; temp_block_text_image = "temp_block_text_image_%s" % UserData.PlayerID; string iconURL = (UserData.IconURL.IsEmpty())? "gui2024/menu/mypage/mypage_icon_none.png" : UserData.IconURL; string UserName = UserData.UserName; string LayerName = TargetLayerName; if(LayoutMode == "xr") LayerName = TargetLayerName + "_webxr"; // トグルの設定 for(int i = 0; i < Layout.ToggleList.Count; i++) { VCCUserListToggle Toggle = Layout.ToggleList[i]; system.Canvas_AddGUIToggle(LayerName, hud_voicechat_user_icon, Toggle.Name, Toggle.InitFlag); system.Canvas_AddGUIToggle(LayerName, hud_voicechat_grab_button, Toggle.Name, Toggle.InitFlag); system.Canvas_AddGUIToggle(LayerName, hud_voicechat_mute, Toggle.Name, Toggle.InitFlag); system.Canvas_AddGUIToggle(LayerName, hud_voicechat_user_talking, Toggle.Name, Toggle.InitFlag); system.Canvas_AddGUIToggle(LayerName, hud_voicechat_leader_icon, Toggle.Name, Toggle.InitFlag); system.Canvas_AddGUIToggle(LayerName, hud_voicechat_name, Toggle.Name, Toggle.InitFlag); system.Canvas_AddGUIToggle(LayerName, temp_block_icon_image, Toggle.Name, Toggle.InitFlag); system.Canvas_AddGUIToggle(LayerName, temp_block_text_image, Toggle.Name, Toggle.InitFlag); } bool IsPortrait = false; if(LayoutMode == "po") IsPortrait = true; // 自身よりもひとつ前のアイコンのGUIの位置を参照して自身のY座標を計算する(スクロールでずれてしまうため) // アイコン以外のGUIについてはアイコンからの相対座標をAddGUIの時に考慮する必要がある float IconPosY = (IsPortrait)? (260 + Layout.Y) : 92; if(LayoutMode == "xr") IconPosY = -270; if(UserIndex != 0) { int PrevIndex = UserIndex - 1; VCCUserData PrevUser = UserList[PrevIndex]; float PrevX; float PrevY; if(hsCanvasGetGUIPos(LayerName, IsPortrait, PrevUser.NameView.hud_voicechat_user_icon, PrevX, PrevY)) { // 一つ前のGUIの一行下なので一つ分Y座標を下げる IconPosY = PrevY + YOffset; } } // GUIを生成する if(IsPortrait) { hsAddGUIButton( LayerName, IsPortrait, hud_voicechat_user_icon, "", "", "", true, 4, 103 + Layout.X, IconPosY, 72, 72, 0.5, 0.5, "LT", true, 0.0, iconURL, "", "", "", 90, 90, 300, 32, 0, 0, 0, 0, 0, 0, 0, 0 ); hsAddGUIImage( LayerName, IsPortrait, hud_voicechat_mute, "", "", "", true, 5, 146 + Layout.X, 23 + IconPosY, 45, 45, 0.5, 0.5, "LT", true, 0.0, "gui2024/hud/hud_voicechat_mute.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(LayerName, hud_voicechat_mute, "Toggle_VCC_MuteBatch_ON_OFF_%s" % PlayerID, true); hsAddGUIImage( LayerName, IsPortrait, hud_voicechat_user_talking, "", "", "", true, 3, 103 + Layout.X, IconPosY, 154, 154, 0.5, 0.5, "LT", true, 0.0, "gui2024/voicechat/hud_voicechat_user_talking.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(LayerName, hud_voicechat_user_talking, "Toggle_VCC_Talking_ON_OFF_%s" % PlayerID, false); hsAddGUIText( LayerName, IsPortrait, hud_voicechat_name, true, 1, 416 + Layout.X, IconPosY, 475, 90, 0.5, 0.5, "LT", true, 0.0, UserName, "BIZUDPGothic", 35, 1.0, 1.0, 1.0, 1.0, "LM", 0, 0, false, false, 1.0, 1.0, 1.0, 1.0 ); hsAddGUIButton( LayerName, IsPortrait, hud_voicechat_grab_button, "", "", "", true, 4, 416 + Layout.X, IconPosY, 475, 90, 0.5, 0.5, "LT", true, 0.0, "", "", "", "", 475, 90, 300, 32, 0, 0, 0, 0, 0, 0, 0, 0 ); // チャンネル作成者の王冠マークを生成 hsAddGUIImage( LayerName, IsPortrait, hud_voicechat_leader_icon, "", "", "", true, 5, 103 + Layout.X, -42 + IconPosY, 60, 30, 0.5, 0.5, "LT", true, 0.0, "gui2024/voicechat/hud_voicechat_leader_icon.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(LayerName, hud_voicechat_leader_icon, Toggle_VCC_User_Leader_Icon, false); // 一時ブロック hsAddGUIImage( LayerName, IsPortrait, temp_block_icon_image, "", "", "", true, 6, 103 + Layout.X, IconPosY, 90, 90, 0.5, 0.5, "LT", true, 0.0, "gui2024/voicechat/voicechat_icon_block.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(LayerName, temp_block_icon_image, Toggle_VCC_User_Is_Blocked, false); hsAddGUIImage( LayerName, IsPortrait, temp_block_text_image, "", "", "", true, 6, 416 + Layout.X, IconPosY, 475, 90, 0.5, 0.5, "LT", true, 0.0, "gui2024/voicechat/voicechat_name_block.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(LayerName, temp_block_text_image, Toggle_VCC_User_Is_Blocked, false); } else { hsAddGUIButton( LayerName, IsPortrait, hud_voicechat_user_icon, "", "", "", true, 4, 39 + Layout.X, IconPosY, 32, 32, 0.5, 0.5, Layout.Ancor, true, 0.0, iconURL, "", "", "", 32, 32, 300, 32, 0, 0, 0, 0, 0, 0, 0, 0 ); hsAddGUIImage( LayerName, IsPortrait, hud_voicechat_mute, "", "", "", true, 5, 56 + Layout.X, 8 + IconPosY, 25, 25, 0.5, 0.5, Layout.Ancor, true, 0.0, "gui2024/hud/hud_voicechat_mute.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(LayerName, hud_voicechat_mute, "Toggle_VCC_MuteBatch_ON_OFF_%s" % PlayerID, true); hsAddGUIImage( LayerName, IsPortrait, hud_voicechat_user_talking, "", "", "", true, 3, 39 + Layout.X, IconPosY, 67, 67, 0.5, 0.5, Layout.Ancor, true, 0.0, "gui2024/voicechat/hud_voicechat_user_talking.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(LayerName, hud_voicechat_user_talking, "Toggle_VCC_Talking_ON_OFF_%s" % PlayerID, false); hsAddGUIText( LayerName, IsPortrait, hud_voicechat_name, true, 1, 142 + Layout.X, IconPosY, 152, 16, 0.5, 0.5, Layout.Ancor, true, 0.0, UserName, "BIZUDPGothic", 12, 1.0, 1.0, 1.0, 1.0, "LM", 0, 0, false, false, 1.0, 1.0, 1.0, 1.0 ); hsAddGUIButton( LayerName, IsPortrait, hud_voicechat_grab_button, "", "", "", true, 4, 142 + Layout.X, IconPosY, 152, 32 + 3, 0.5, 0.5, Layout.Ancor, true, 0.0, "", "", "", "", 152, 32 + 3, 300, 32, 0, 0, 0, 0, 0, 0, 0, 0 ); // チャンネル作成者の王冠マークを生成 hsAddGUIImage( LayerName, IsPortrait, hud_voicechat_leader_icon, "", "", "", true, 5, 39 + Layout.X, -12 + IconPosY, 30, 15, 0.5, 0.5, Layout.Ancor, true, 0.0, "gui2024/voicechat/hud_voicechat_leader_icon.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(LayerName, hud_voicechat_leader_icon, Toggle_VCC_User_Leader_Icon, false); // 一時ブロック hsAddGUIImage( LayerName, IsPortrait, temp_block_icon_image, "", "", "", true, 6, 39 + Layout.X, IconPosY, 32, 32, 0.5, 0.5, Layout.Ancor, true, 0.0, "gui2024/voicechat/voicechat_icon_block.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(LayerName, temp_block_icon_image, Toggle_VCC_User_Is_Blocked, false); hsAddGUIImage( LayerName, IsPortrait, temp_block_text_image, "", "", "", true, 6, 142 + Layout.X, IconPosY, 152, 16, 0.5, 0.5, Layout.Ancor, true, 0.0, "gui2024/voicechat/voicechat_name_block.png", 0, 0, 0, 0, 0, 0, 0, 0 ); system.Canvas_AddGUIToggle(LayerName, temp_block_text_image, Toggle_VCC_User_Is_Blocked, false); } } void _UpdatePos(int UserIndex, bool IsPortrait, int YOffset, list UserList, VCCTableUILayout Layout) { // 自身よりもひとつ前のアイコンのGUIの位置を参照して自身のY座標を計算する(スクロールでずれてしまうため) // アイコン以外のGUIについてはアイコンからの相対座標をAddGUIの時に考慮する必要がある float IconPosY = (IsPortrait)? (352 + Layout.Y) : 120; if(UserIndex != 0) { int PrevIndex = UserIndex - 1; VCCUserData PrevUser = UserList[PrevIndex]; float PrevX; float PrevY; if(hsCanvasGetGUIPos(TargetLayerName, IsPortrait, PrevUser.NameView.hud_voicechat_user_icon, PrevX, PrevY)) { // 一つ前のGUIの一行下なので一つ分Y座標を下げる IconPosY = PrevY + YOffset; } } // GUIの位置を更新する if(IsPortrait) { hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_user_icon, 103 + Layout.X, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_mute, 146 + Layout.X, 23 + IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_user_talking, 103 + Layout.X, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_name, 416 + Layout.X, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_grab_button, 416 + Layout.X, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_leader_icon, 103 + Layout.X, -42 + IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, temp_block_icon_image, 103 + Layout.X, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, temp_block_text_image, 416 + Layout.X, IconPosY); } else { hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_user_icon, 39 + Layout.X, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_mute, 56 + Layout.X, 8 + IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_user_talking, 39 + Layout.X, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_name, 142 + Layout.X, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_grab_button, 142 + Layout.X, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, hud_voicechat_leader_icon, 39 + Layout.X, -12 + IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, temp_block_icon_image, 39 + Layout.X, IconPosY); hsCanvasSetGUIPos(TargetLayerName, IsPortrait, temp_block_text_image, 142 + Layout.X, IconPosY); } } void _Release(bool IsPortrait) { system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, hud_voicechat_user_icon); system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, hud_voicechat_mute); system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, hud_voicechat_user_talking); system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, hud_voicechat_leader_icon); system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, hud_voicechat_name); system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, hud_voicechat_grab_button); system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, temp_block_icon_image); system.Canvas_ReleaseGUI(TargetLayerName, IsPortrait, temp_block_text_image); } void _Show(bool Show) { hsCanvasResetToggleDefault(Toggle_VCC_User_Leader_Icon); if(Show) { hsCanvasToggleChange(Toggle_VCC_User_Leader_Icon); } } }