cs起源吧 关注:85,050贴子:1,798,172
  • 7回复贴,共1

CS起源不完全修改教程第九弹 - 团队菜单修改

取消只看楼主收藏回复

CS起源不完全修改教程第八弹 - 观察员界面和观察员菜单修改
https://tieba.baidu.com/p/6689458779
CS起源不完全修改教程第九弹
团队菜单修改(InGameUI窗体修改2)
再次说明,每个教程都可以沿用以前教程中的内容,比如本弹教程中,虽然我没打算和大家一起修改为全屏的团队菜单、购买菜单等,但是大家仍然可以用第四弹、第七弹教程的内容,和自己丰富的想象力,制作出完美的全屏菜单。


IP属地:山东1楼2020-05-20 21:05回复
    1.介绍
    先预览一下原版的团队菜单(这张图是以前截的):

    团队菜单分为两部分,TeamMenu和ClassMenu,分别对应选择阵营和选择人物。我们一起来加个背景,并将匪徒和特警的按钮改成图片模式。暂时没什么好的思路,我们就按照永恒之心2的菜单来吧。


    IP属地:山东2楼2020-05-20 21:05
    收起回复
      2. 阵营选择界面背景修改
      改了这么长时间想必各位对res文件修改已经烂熟于心了,所以我们就不多做介绍,直接开干。为了给大家展示另一种思路,这里我们摒弃第七弹修改背景的方法。偷点懒,我就直接照搬永恒之心2了(大家不必担心道德问题,永恒之心2的界面也是我做的,大家可以随意参考)。
      用GCFScape打开cstrike_pak_dir.vpk,提取resource\ui\teammenu.res,放到followme\resource\ui下边,用文本编辑器打开这个文件。
      在最上边增加一个图片框:
      "TeamBackground"
      {
      "ControlName" "ImagePanel"
      "fieldName" "TeamBackground"
      "xpos" "0"
      "ypos" "0"
      "zpos" "-10"
      "wide" "640"
      "tall" "480"
      "visible" "1"
      "enabled" "1"
      "scaleImage" "1"
      "autoResize" "0"
      "pinCorner" "0"
      "image" "panel_bg"
      }

      接着制作panel_bg.vmt,放到followme\materials\vgui下边:
      "UnlitGeneric"
      {
      "$basetexture""vgui/panel_bg"
      "$translucent"1
      $additive 0
      }

      打开PS,新建一个1024*768的画布,画一个缺角的矩形,描边颜色随意:

      画一个灰色矩形作为标题栏,并添加浮雕特效:

      将缺角矩形及其内部选中,切换到通道面板,新建一个Alpha通道,将这部分填充为灰色(白色为不透明,黑色为透明,透明度用灰度控制):

      将这个文件保存为TGA格式,勾选Alpha通道,并将其制作成panel_bg.vtf,放到followme\materials\vgui下边,进入游戏预览一下:

      效果已经出来了,不过有几个问题,一是这个背景图片太大了,二是原来的面板背景还能看见。
      我们先来修改一下"TeamBackground"的坐标和宽高,这个要反复进入游戏预览才能改好,因为我们制作的图片还留有一个透明的边框。反复预览后,我们修改"TeamBackground"的x坐标为13,y坐标为13,宽为620,高为455:

      差不多了,现在就该解决第二个问题了,这里有两种方法,一种是修改clientscheme.res,将Bg.color的alpha值改为0,让其全透明(参考第六弹教程);另一种是将默认的背景图片替换成全透明的。
      这里我们采用第二种方法,因为第七弹教程中我们通过修改控件实现了修改窗体背景,如果这一弹通过修改clientscheme.res实现背景透明的话,之前的MOTD修改就白费了,同时我想让大家了解另一种思路。
      阵营菜单并不能像MOTD窗口那样简单补全缺少的控件,这是引擎的一个BUG,如果补全了,会造成动态生成的控件和已有控件重名而不正常,就像这样:

      接下贴


      IP属地:山东3楼2020-05-20 21:10
      回复
        承前帖
        因此我们可以将前边改过的MOTD窗口中补全后没有修改名字的四个角的图片,改一个名字,再用PS制作一个Alpha通道全黑的图片,制作成为hidepanel.vtf,放到followme\materials\vgui\gfx\vgui下边,然后按照下图改名:

        现在我们进游戏看一下效果:

        反恐LOGO有什么好办法修改吗?限于引擎BUG和修改范围,只能使用全透明的cs_logo.vtf将其隐藏,标题错位就可以修改自己的背景图片,也可以修改"joinTeam"控件的坐标,这里我选择了修改背景图片。
        如果这里没看懂的话,试一试就明白了。


        IP属地:山东4楼2020-05-20 21:12
        回复
          3.阵营选择界面控件修改
          接着来,先给"team"控件增加一个"zpos" "-3",接着讲"terbutton"(匪徒按钮)修改成如下数据:
          "terbutton"
          {
          "ControlName" "Button"
          "fieldName" "terbutton"
          "xpos" "58"
          "ypos" "90"
          "zpos" "2"
          "wide" "260"
          "tall" "260"
          "autoResize" "0"
          "pinCorner" "2"
          "visible" "1"
          "enabled" "1"
          "tabPosition" "3"
          "labelText" ""
          "tooltiptext" "Terrorist"
          "dulltext" "0"
          "brighttext" "0"
          "wrap" "0"
          "command" "jointeam 2"
          "Default" "0"
          "selected" "0"
          "paintborder" "0 0 0 0"
          "sound_armed" "ui/hint.wav"
          "sound_depressed" "ui//freeze_cam.wav"
          "defaultBgColor_override" "0 0 0 165"
          "armedBgColor_override" "0 0 0 0"
          "depressedBgColor_override" "0 0 0 0"
          }

          并在"terbutton"的上方添加一个图片框:
          "terBackground"
          {
          "ControlName" "ImagePanel"
          "fieldName" "terBackground"
          "xpos" "58"
          "ypos" "90"
          "zpos" "1"
          "wide" "260"
          "tall" "260"
          "visible" "1"
          "enabled" "1"
          "scaleImage" "1"
          "autoResize" "0"
          "pinCorner" "0"
          "image" "team_t"
          "zpos" "-1"
          }

          制作team_t.vtf和vmt文件,放到followme\materials\vgui下边,我们进游戏看看效果:

          是我们想要的,接着制作CT按钮,修改"ctbutton":
          "ctbutton"
          {
          "ControlName" "Button"
          "fieldName" "ctbutton"
          "xpos" "325"
          "ypos" "90"
          "zpos" "2"
          "wide" "260"
          "tall" "260"
          "autoResize" "0"
          "pinCorner" "2"
          "visible" "1"
          "enabled" "1"
          "tabPosition" "4"
          "labelText" ""
          "tooltiptext" "Counter Terrorist"
          "dulltext" "0"
          "brighttext" "0"
          "wrap" "0"
          "command" "jointeam 3"
          "Default" "0"
          "selected" "0"
          "paintborder" "0 0 0 0"
          "sound_armed" "ui/hint.wav"
          "sound_depressed" "ui//freeze_cam.wav"
          "defaultBgColor_override" "0 0 0 165"
          "armedBgColor_override" "0 0 0 0"
          "depressedBgColor_override" "0 0 0 0"
          }

          在其上方添加一个图片框:
          "ctBackground"
          {
          "ControlName" "ImagePanel"
          "fieldName" "ctBackground"
          "xpos" "325"
          "ypos" "90"
          "zpos" "1"
          "wide" "260"
          "tall" "260"
          "visible" "1"
          "enabled" "1"
          "scaleImage" "1"
          "autoResize" "0"
          "pinCorner" "0"
          "image" "team_ct"
          "zpos" "-1"
          }

          制作team_ct图片,进游戏看看:

          剩下的就是完善了,将后边的地图介绍删除,将自动选择和观察按钮放到下边:
          将"MapInfo"控件的宽高全部设为0,修改"autobutton"控件为如下参数:
          "autobutton"
          {
          "ControlName" "Button"
          "fieldName" "autobutton"
          "xpos" "118"
          "ypos" "360"
          "zpos" "2"
          "wide" "400"
          "tall" "25"
          "autoResize" "0"
          "pinCorner" "2"
          "visible" "1"
          "enabled" "1"
          "tabPosition" "1"
          "labelText" "#Cstrike_Team_AutoAssign"
          "textAlignment" "center"
          "dulltext" "0"
          "brighttext" "0"
          "command" "jointeam 0"
          "Default" "1"
          "paintborder" "0 0 0 0"
          "sound_armed" "ui/hint.wav"
          "sound_depressed" "ui//freeze_cam.wav"
          "defaultBgColor_override" "134 95 0 210"
          "armedBgColor_override" "255 180 0 210"
          "depressedBgColor_override" "174 123 0 210"
          }


          IP属地:山东5楼2020-05-20 21:16
          回复
            承前帖
            修改"specbutton"控件为如下参数:
            "specbutton"
            {
            "ControlName" "Button"
            "fieldName" "specbutton"
            "xpos" "118"
            "ypos" "390"
            "zpos" "2"
            "wide" "400"
            "tall" "25"
            "autoResize" "0"
            "pinCorner" "2"
            "visible" "1"
            "enabled" "1"
            "tabPosition" "2"
            "labelText" "#Cstrike_Menu_Spectate"
            "textAlignment" "center"
            "dulltext" "0"
            "brighttext" "0"
            "command" "jointeam 1"
            "paintborder" "0 0 0 0"
            "sound_armed" "ui/hint.wav"
            "sound_depressed" "ui//freeze_cam.wav"
            "defaultBgColor_override" "134 95 0 210"
            "armedBgColor_override" "255 180 0 210"
            "depressedBgColor_override" "174 123 0 210"
            }

            修改"CancelButton"控件为如下参数:
            "CancelButton"
            {
            "ControlName" "Button"
            "fieldName" "CancelButton"
            "xpos" "118"
            "ypos" "420"
            "zpos" "2"
            "wide" "400"
            "tall" "25"
            "autoResize" "0"
            "pinCorner" "2"
            "visible" "1"
            "enabled" "1"
            "tabPosition" "0"
            "labelText" "#Cstrike_Cancel"
            "textAlignment" "center"
            "dulltext" "0"
            "brighttext" "0"
            "Command" "vguicancel"
            "paintborder" "0 0 0 0"
            "sound_armed" "ui/hint.wav"
            "sound_depressed" "ui//freeze_cam.wav"
            "defaultBgColor_override" "134 95 0 210"
            "armedBgColor_override" "255 180 0 210"
            "depressedBgColor_override" "174 123 0 210"
            }

            保存预览:

            大工告成!


            IP属地:山东6楼2020-05-20 21:17
            回复
              4.人物选择界面修改
              用GCFScape打开cstrike_pak_dir.vpk,提取resource\ui\classmenu_ct.res和classmenu_ter.res,放到followme\resource\ui下边,这两个文件分别代表CT选择界面和T选择界面,我们先用文本编辑器打开classmenu_ct.res。
              和阵营界面一样,我们增加一个图片框作为背景,这里我将背景制作成蓝色边框,以区别匪徒和特警:
              "ClassCTBackground"
              {
              "ControlName" "ImagePanel"
              "fieldName" "ClassCTBackground"
              "xpos" "15"
              "ypos" "15"
              "zpos" "-10"
              "wide" "610"
              "tall" "450"
              "visible" "1"
              "enabled" "1"
              "scaleImage" "1"
              "autoResize" "0"
              "pinCorner" "0"
              "image" "ct_bg"
              }

              给所有按钮下边添加声音和颜色:
              "paintborder" "0 0 0 0"
              "sound_armed" "ui/hint.wav"
              "sound_depressed" "ui/freeze_cam.wav"
              "defaultBgColor_override" "134 95 0 210"
              "armedBgColor_override" "255 180 0 210"
              "depressedBgColor_override" "174 123 0 210"

              进入游戏预览一下:

              同理制作匪徒的菜单:
              "ClassTerBackground"
              {
              "ControlName" "ImagePanel"
              "fieldName" "ClassTerBackground"
              "xpos" "15"
              "ypos" "15"
              "zpos" "-10"
              "wide" "610"
              "tall" "450"
              "visible" "1"
              "enabled" "1"
              "scaleImage" "1"
              "autoResize" "0"
              "pinCorner" "0"
              "image" "ter_bg"
              }


              大功告成。这一弹教程主要是换一种思路来修改InGameUI窗体,而且这也是最实用的一种,后续我们会用这种方法来修改购买菜单。就到这里吧。


              IP属地:山东7楼2020-05-20 21:20
              回复
                补充:
                阵营选择菜单修改成图片模式后,我们发现按键盘无法选择阵营,怎么解决呢?
                用文本编辑器打开followme\resource\ui\teammenu.res在"terbutton"下边再添加一个按钮:
                "tbutton_select"
                {
                "ControlName" "Button"
                "fieldName" "tbutton_select"
                "xpos" "61"
                "ypos" "95"
                "zpos" "1"
                "wide" "0"
                "tall" "0"
                "autoResize" "0"
                "pinCorner" "2"
                "visible" "1"
                "enabled" "1"
                "labelText" "&1"
                "command" "jointeam 2"
                "zpos" "-1"
                }

                在这个按钮中,我们让按钮名字为&1,也就是1为快捷键,这样就可以通过按键盘来触发按钮了。同理我们在"ctbutton"上边也加一个类似的按钮:
                "ctbutton_select"
                {
                "ControlName" "Button"
                "fieldName" "ctbutton_select"
                "xpos" "330"
                "ypos" "95"
                "zpos" "1"
                "wide" "0"
                "tall" "0"
                "autoResize" "0"
                "pinCorner" "2"
                "visible" "1"
                "enabled" "1"
                "labelText" "&2"
                "command" "jointeam 3"
                "zpos" "-1"
                }

                这样就解决了阵营界面无法通过键盘来快速选择团队。


                IP属地:山东9楼2020-05-22 16:29
                回复