Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
siobhan-saoirse opened this issue Mar 1, 2020 · 13 comments
Labels
question Further information is requested

Comments

@siobhan-saoirse
Copy link

No description provided.

@siobhan-saoirse
Copy link
Author

siobhan-saoirse commented Mar 5, 2020

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:

  • Touching the upgrade station will open the GUI and will show the list of upgrades you need to get.
  • It will show infinite cash in the GUI, meaning that currency is not implemented just yet.
    It should make the "instant-upgrade" system entirely obselete. but theres some problems.
  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
Copy link
Author

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
Copy link
Author

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.

  • How am i able to make the GUI?
  • How am i able to show weapon icon and upgrades?

@siobhan-saoirse
Copy link
Author

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 siobhan-saoirse changed the title (Civilian 2) Upgrade Station GUI (Civilian 2) Upgrade Station GUI, need assistance Mar 5, 2020
@siobhan-saoirse siobhan-saoirse changed the title (Civilian 2) Upgrade Station GUI, need assistance (Civilian 2) Upgrade Station GUI, and F4 to say you're ready GUI, i need assistance. Mar 5, 2020
@siobhan-saoirse
Copy link
Author

siobhan-saoirse commented Mar 5, 2020

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

@siobhan-saoirse
Copy link
Author

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

@siobhan-saoirse
Copy link
Author

function UpgradeGUI()
	if !string.find(game.GetMap(), "mvm_") then return end
	-- code goes here
end

@LeadKiller
Copy link
Collaborator

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

  • With any Derma element, you can override .Paint and use the width and height parameters with surface.DrawTexturedRect to use the correct vgui textures in the back.
  • This also allows for customizable text using surface.DrawText using Team Fortress 2 fonts and being able to customize them using the default font system.
  • Team Fortress 2's resource/ui/ folder contains most VGUI elements which can be easily read by humans.
  • The upgrade panel is located in resource/ui/hudupgradepanel.res.
  • resource/sourcescheme.res is also important to know which colors and fonts you should use.

@siobhan-saoirse
Copy link
Author

Thanks.

@siobhan-saoirse
Copy link
Author

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.

@LeadKiller LeadKiller added the question Further information is requested label Mar 14, 2020
@siobhan-saoirse
Copy link
Author

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

@siobhan-saoirse
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants