Moddage / TF2-Gamemode

Team Fortress 2 Gamemode for Garry's Mod
https://steamcommunity.com/sharedfiles/filedetails/?id=1417447538
7 stars 4 forks source link

(Civilian 2) Upgrade Station GUI, and F4 to say you're ready GUI, i need assistance. #12

Open siobhan-saoirse opened 4 years ago

siobhan-saoirse commented 4 years ago

Meanwhile Civilian 2 does have instant upgrade, but it needs to be just like TF2, when you go in the upgrade station, it only upgrades the weapon your holding instantly. It should be like this:

  1. I may not be able to make it just like TF2's. I am a minor gLua coder and i may need help with some code.
  2. Partnership in Civilian 2 is already active, but there hasn't been any changes lately from our contributors.
  3. I have no idea how to make it look like it is in TF2.
siobhan-saoirse commented 4 years ago

I apologize for no explanation when i made this issue. I need help with the project most of the time to fix some issues.

siobhan-saoirse commented 4 years ago

I did once make the GUI, but i cancelled development on it because i had no idea how to make it just like the TF2 vgui, and other reasons.

siobhan-saoirse commented 4 years ago

Civilian 2 1.0 just released, but it still needs work. Wearables are broken. the "table" of "model_player_per_class" is no longer a table, eyelander viewmodel is broken, incorrect loop on some taunts, and such more.

siobhan-saoirse commented 4 years ago

Civilian 2 is still in early development, and most of the code is written by myself, Lead, and such others.

siobhan-saoirse commented 4 years ago

Working on a legacy gamemode like Team Fortress 2 Gamemode can be hard at such times.

siobhan-saoirse commented 4 years ago
function UpgradeGUI()
    if !string.find(game.GetMap(), "mvm_") then return end
    -- code goes here
end
LeadKiller commented 4 years ago

The easiest way I know of to create an interactive TF2 styled menu is to use a Derma Frame or Panel.

siobhan-saoirse commented 4 years ago

Thanks.

siobhan-saoirse commented 4 years ago
local PANEL = {}

local W = ScrW()
local H = ScrH()
local WScale = W/0
local Scale = H/480

function PANEL:Init()
    self:SetPaintBackgroundEnabled(false)
    self:SetVisible(true)
end

function PANEL:PerformLayout()
    self:SetPos(0,0)
    self:SetSize(W,H)
end

function PANEL:Paint()
    local param

    if not LocalPlayer():Alive() or (LocalPlayer():IsHL2() and !GetConVar("hud_show_ctf_as_hl2"):GetBool()) or GetConVar("hud_forcehl2hud"):GetBool() or GetConVarNumber("cl_drawhud")==0 or GAMEMODE.ShowScoreboard or !string.find(game.GetMap(), "ctf_") then return end

    surface.SetDrawColor(255,255,255,255)

    surface.SetTexture(objectives_flagpanel_bg_left)
    surface.DrawTexturedRect(320*WScale-140*Scale, (480-75)*Scale, 280*Scale, 80*Scale)

    surface.SetTexture(objectives_flagpanel_bg_right)
    surface.DrawTexturedRect(320*WScale-140*Scale, (480-75)*Scale, 280*Scale, 80*Scale)

    surface.SetTexture(objectives_flagpanel_bg_outline)
    surface.DrawTexturedRect(320*WScale-140*Scale, (480-75)*Scale, 280*Scale, 80*Scale)

    surface.SetTexture(objectives_flagpanel_bg_playingto)
    surface.DrawTexturedRect(320*WScale-75*Scale, (480-31)*Scale, 150*Scale, 38*Scale)

    -- Blue score
    param = {
        text=team.GetScore(TEAM_BLU),
        font="HudFontBig",
        pos={320*WScale-128*Scale, (480-46+17.5)*Scale},
        color=Colors.Black,
        xalign=TEXT_ALIGN_LEFT,
        yalign=TEXT_ALIGN_CENTER,
    }
    draw.Text(param)
    param.pos[1] = param.pos[1]-2*WScale
    param.pos[2] = param.pos[2]-Scale
    param.color=Colors.TanLight
    draw.Text(param)

    -- Red score
    param = {
        text=team.GetScore(TEAM_RED),
        font="HudFontBig",
        pos={320*WScale+132*Scale, (480-46+17.5)*Scale},
        color=Colors.Black,
        xalign=TEXT_ALIGN_RIGHT,
        yalign=TEXT_ALIGN_CENTER,
    }

    draw.Text(param)
    param.pos[1] = param.pos[1]-2*WScale
    param.pos[2] = param.pos[2]-Scale
    param.color=Colors.TanLight
    draw.Text(param)

    -- Playing to :
    param = {
        text="Playing to: ∞",
        font="HudFontSmall",
        pos={320*WScale, (480-28+15)*Scale},
        color=Colors.TanLight,
        xalign=TEXT_ALIGN_CENTER,
        yalign=TEXT_ALIGN_CENTER,
    }

    draw.Text(param)
end

if HudUpgradePanel then HudUpgradePanel:Remove() end
HudUpgradePanel = vgui.CreateFromTable(vgui.RegisterTable(PANEL, "DPanel"))

I've read the hudupgradepanel.res file, and i don't think i can do much about it.

siobhan-saoirse commented 3 years ago

It's been months since i've asked a question about this. Neither have i still implemented the Upgrade VGUI.

siobhan-saoirse commented 3 years ago

Since i don't really know the VGUI language, i don't think i could do much about it. It's very confusing to look at and i never thought i would be very confused like this.

siobhan-saoirse commented 3 years ago

The way it's designed is confusing for me and i don't think it's possible to implement this without any support. image