# PropSelect

- **Ortam:** İstemci
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/PropSelect
- **Çeviri tarihi:** 2025-09-08

## Açıklama

Sandbox araçlarında oyuncunun bir listeden model seçmesine olanak tanımak için kullanılır. Yalnızca Sandbox'ta kullanılmasına rağmen, bu oyun moduna özel **değildir**.

Materyal seçme alternatifi için ayrıca [MatSelect](https://gmod.tr/wiki/MatSelect) sayfasına bakın.

## Ebeveyn

Bu sayfada listelenmeyen metotları vb. [ContextBase](https://gmod.tr/wiki/ContextBase)'dan türetir.

## Uygular

Aşağıdaki kancaları/metotları uygular veya geçersiz kılar. Bunları geçersiz kılmak isterseniz, muhtemelen orijinal fonksiyonu da çağırmak istersiniz.

- [Panel:Clear](https://gmod.tr/wiki/Panel:Clear)
- [ContextBase:TestForChanges](https://gmod.tr/wiki/ContextBase:TestForChanges)
- [PANEL:Init](https://gmod.tr/wiki/PANEL:Init)
- [PANEL:PerformLayout](https://gmod.tr/wiki/PANEL:PerformLayout)

## Olaylar

PropSelect:[OnRightClick](https://gmod.tr/wiki/PropSelect.OnRightClick)( [Panel](https://gmod.tr/wiki/Panel) pnl )

Oyuncu bir modele sağ tıkladığında çağrılır. Varsayılan olarak, bu, oyuncunun model yolunu kopyalamasına olanak tanıyan bir menü açar.

PropSelect:[OnSelect](https://gmod.tr/wiki/PropSelect:OnSelect)( [Panel](https://gmod.tr/wiki/Panel) pnl, [String](https://gmod.tr/wiki/string) model )

Oyuncu bir model seçtiğinde çağrılır.

PropSelect:[SelectModel](https://gmod.tr/wiki/PropSelect:SelectModel)( [SpawnIcon](https://gmod.tr/wiki/SpawnIcon) icon )

Bu dahili olarak kullanılır - kullanabiliyor olsanız da muhtemelen kullanmamalısınız. Bunun yerine PropSelect:FindAndSelectButton kullanın. Belirtilen bir spawnicon panelini seçer.

## Metotlar

PropSelect:[AddModel](https://gmod.tr/wiki/PropSelect:AddModel)( [string](https://gmod.tr/wiki/string) model, [table](https://gmod.tr/wiki/table) convars )

Seçim listesine yeni bir model ekler.

PropSelect:[AddModelEx](https://gmod.tr/wiki/PropSelect:AddModelEx)( [string](https://gmod.tr/wiki/string) value, [string](https://gmod.tr/wiki/string) model, [number](https://gmod.tr/wiki/number) skin )

Seçim listesine yeni bir model ekler.

PropSelect:[FindAndSelectButton](https://gmod.tr/wiki/PropSelect:FindAndSelectButton)( [string](https://gmod.tr/wiki/string) mdl )

Giriş model yoluna göre bir SpawnIcon paneli bulur ve seçer.

[SpawnIcon](https://gmod.tr/wiki/SpawnIcon) PropSelect:[FindModelByValue](https://gmod.tr/wiki/PropSelect:FindModelByValue)( [string](https://gmod.tr/wiki/string) mdl )

Giriş model yoluna göre bir SpawnIcon paneli bulur.

### Örnek

Panelin örnek kullanımı.

```lua
local frame = vgui.Create( "DFrame" )
frame:SetSize( 500, 500 )
frame:Center()
frame:MakePopup()

local PropSelect = vgui.Create( "PropSelect", frame )
PropSelect:Dock( TOP )

--PropSelect:SetConVar( "my_convar_name" )

local items = {
	"models/props_c17/FurnitureWashingmachine001a.mdl",
	"models/props_junk/PlasticCrate01a.mdl",
	"models/props_junk/wood_pallet001a.mdl"
}

for k, model in pairs( items ) do
	PropSelect:AddModelEx( model, model, 0 )
end

function PropSelect:OnSelect( model, pnl )
	print( "Seçilen model", model, pnl )
end
```

**Çıktı:**

![image.png](https://gmod.tr/api/uploads/wiki/1a403f2f761a07948aa4.png)

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/PropSelect
