Adding Convars to the Multiplayer Advanced Tab/ru

From Valve Developer Community
Jump to: navigation, search

На этой странице обсуждается, как добавить свои собственные convar в раздел «Дополнительно» на вкладке «Многопользовательский режим» в меню «Параметры».

По умолчанию на этой вкладке не должно быть ничего для вашего мода. Чтобы добавить в него переменные, создайте файл user_default.scr и поместите его в папку cfg внутри папки мода. Или просто отредактируйте "settings.scr", также в папке cfg. Этот файл идёт в комплекте с модом

Добавьте в него следующее:

// NOTE:  THIS FILE IS AUTOMATICALLY REGENERATED, 
//DO NOT EDIT THIS HEADER, YOUR COMMENTS WILL BE LOST IF YOU DO
// User options script
//
// Format:
//  Version [float]
//  Options description followed by 
//  Options defaults
//
// Option description syntax:
//
//  "cvar" { "Prompt" { type [ type info ] } { default } }
//
//  type = 
//   BOOL   (a yes/no toggle)
//   STRING
//   NUMBER
//   LIST
//
// type info:
// BOOL                 no type info
// NUMBER       min max range, use -1 -1 for no limits
// STRING       no type info
// LIST          delimited list of options value pairs
//
//
// default depends on type
// BOOL is "0" or "1"
// NUMBER is "value"
// STRING is "value"
// LIST is "index", where index "0" is the first element of the list


// Half-Life User Info Configuration Layout Script (stores last settings chosen, too)
// File generated:  Tue May 26 04:33:22 AM
//
//
// Cvar	-	Setting

VERSION 1.0

DESCRIPTION INFO_OPTIONS
{
	"r_drawviewmodel" //the convar
	{
		"Draw the viewmodel"  //the description
		{ BOOL }  //the type of convar
		{ "1" }  //the boolean value
	}	
	
	"viewmodel_fov"  //the convar
	{
		"Adjust the field of view"  //the description
		{ SLIDER 54 70 }  //the type of convar
		{ "1" }  //the boolean value
	}	
}

Там есть 2 примера переменных. Один - «ползунок», а второй - boolean. Само собой разумеется, как добавить свой собственный.