DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ SetLockOnAttachedMaterials()

void SetLockOnAttachedMaterials ( string part_name,
bool lock_slot )
protected

См. определение в файле Construction.c строка 911

912 {
913 string main_part_name = GetConstructionPart( part_name ).GetMainPartName();
914 string cfg_path = "cfgVehicles" + " " + GetParent().GetType() + " "+ "Construction" + " " + main_part_name + " " + part_name + " " + "Materials";
915
916 if ( GetGame().ConfigIsExisting( cfg_path ) )
917 {
918 int child_count = GetGame().ConfigGetChildrenCount( cfg_path );
919
920 for ( int i = 0; i < child_count; i++ )
921 {
922 string child_name;
923 GetGame().ConfigGetChildName( cfg_path, i, child_name );
924
925 //get type, quantity from material
926 string config_path;
927 string type;
928 string slot_name;
929 config_path = cfg_path + " " + child_name + " " + "type";
930 GetGame().ConfigGetText( config_path, type );
931 config_path = cfg_path + " " + child_name + " " + "slot_name";
932 GetGame().ConfigGetText( config_path, slot_name );
933 config_path = cfg_path + " " + child_name + " " + "quantity";
934 float quantity = GetGame().ConfigGetFloat( config_path );
935 config_path = cfg_path + " " + child_name + " " + "lockable";
936 bool lockable = GetGame().ConfigGetInt( config_path );
937
938 //get material
939 ItemBase attachment = ItemBase.Cast( GetParent().FindAttachmentBySlotName( slot_name ) );
940
941 //material still attached
942 if ( lockable ) //if lockable
943 {
944 if ( attachment )
945 {
946 InventoryLocation inventory_location = new InventoryLocation;
947 attachment.GetInventory().GetCurrentInventoryLocation( inventory_location );
948 if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + Object.GetDebugName(GetParent()) + " SetLockOnAttachedMaterials lock=" + lock_slot +" slot=" + inventory_location.GetSlot());
949 GetParent().GetInventory().SetSlotLock( inventory_location.GetSlot(), lock_slot );
950 }
951 }
952 }
953 }
954 }
class BaseBuildingBase extends ItemBase bsbDebugPrint(string s)
Определения BaseBuildingBase.c:1292
ConstructionPart GetConstructionPart(string part_name)
Определения Construction.c:280
proto bool ConfigGetChildName(string path, int index, out string name)
Get name of subclass in config class on path.
proto native float ConfigGetFloat(string path)
Get float value from config on path.
proto native int ConfigGetInt(string path)
Get int value from config on path.
proto bool ConfigGetText(string path, out string value)
Get string value from config on path.
proto native int ConfigGetChildrenCount(string path)
Get count of subclasses in config class on path.
string GetMainPartName()
Определения ConstructionPart.c:35
proto native int GetSlot()
returns slot id if current type is Attachment
InventoryLocation.
Определения InventoryLocation.c:29
Определения InventoryItem.c:731
static bool IsBaseBuildingLogEnable()
Определения Debug.c:698
Определения Debug.c:594
Определения ObjectTyped.c:2
proto native CGame GetGame()
BaseBuildingBase GetParent()
Get parent of the Effect.
Определения Construction.c:40

Перекрестные ссылки bsbDebugPrint(), CGame::ConfigGetChildName(), CGame::ConfigGetChildrenCount(), CGame::ConfigGetFloat(), CGame::ConfigGetInt(), CGame::ConfigGetText(), GetConstructionPart(), GetGame(), ConstructionPart::GetMainPartName(), GetParent(), InventoryLocation::GetSlot() и LogManager::IsBaseBuildingLogEnable().