1232 {
1233 UAInterface input = GetInputInterface();
1234 if (!input)
1235 {
1236 return;
1237 }
1238
1239 Weapon_Base weapon;
1240 int FOVcount;
1241 bool controllerPressIn;
1242 bool controllerPressOut;
1243
1245 {
1246 weapon = Weapon_Base.Cast(optic.GetHierarchyParent());
1247 FOVcount = optic.GetStepFOVCount();
1248 controllerPressIn = input.
SyncedPress_ID(UAZoomInOpticsControllerHelper);
1249
1251 {
1254 optic.SetStepFOVIndex(0);
1255 }
1257 {
1258 if (controllerPressIn)
1259 {
1260 if (!optic.StepFOVUp())
1261 {
1262 if (FOVcount > 0)
1263 {
1264 optic.SetStepFOVIndex(0);
1265 }
1266
1267 if (weapon && weapon.CanEnterIronsights())
1268 {
1271 }
1272 }
1273 }
1274 else
1275 {
1276 optic.StepFOVUp();
1277 }
1278 }
1279 }
1280
1282 {
1283 weapon = Weapon_Base.Cast(optic.GetHierarchyParent());
1284 FOVcount = optic.GetStepFOVCount();
1285 controllerPressOut = input.
SyncedPress_ID(UAZoomOutOpticsControllerHelper);
1287 {
1288 if (!optic.StepFOVDown())
1289 {
1290 if (controllerPressOut)
1291 {
1292 if (FOVcount > 0 && (!weapon || !weapon.CanEnterIronsights()))
1293 {
1294 optic.SetStepFOVIndex(FOVcount - 1);
1295 }
1296 }
1297
1298 if (weapon && weapon.CanEnterIronsights())
1299 {
1302 }
1303 }
1304 }
1306 {
1308 if (FOVcount > 0)
1309 {
1310 optic.SetStepFOVIndex(FOVcount - 1);
1311 }
1312 }
1313 }
1314 }
void SetIronsights(bool value)
void SwitchOptics(ItemOptics optic, bool state)
proto native bool SyncedPress_ID(int action, bool check_focus=true)
Returns true just in frame, when action was invoked (button was pressed)