1207 {
1208 UAInterface input = GetInputInterface();
1209 if (!input)
1210 {
1211 return;
1212 }
1213
1214 Weapon_Base weapon;
1215 int FOVcount;
1216 bool controllerPressIn;
1217 bool controllerPressOut;
1218
1220 {
1221 weapon = Weapon_Base.Cast(optic.GetHierarchyParent());
1222 FOVcount = optic.GetStepFOVCount();
1223 controllerPressIn = input.
SyncedPress_ID(UAZoomInOpticsControllerHelper);
1224
1226 {
1229 optic.SetStepFOVIndex(0);
1230 }
1232 {
1233 if (controllerPressIn)
1234 {
1235 if (!optic.StepFOVUp())
1236 {
1237 if (FOVcount > 0)
1238 {
1239 optic.SetStepFOVIndex(0);
1240 }
1241
1242 if (weapon && weapon.CanEnterIronsights())
1243 {
1246 }
1247 }
1248 }
1249 else
1250 {
1251 optic.StepFOVUp();
1252 }
1253 }
1254 }
1255
1257 {
1258 weapon = Weapon_Base.Cast(optic.GetHierarchyParent());
1259 FOVcount = optic.GetStepFOVCount();
1260 controllerPressOut = input.
SyncedPress_ID(UAZoomOutOpticsControllerHelper);
1262 {
1263 if (!optic.StepFOVDown())
1264 {
1265 if (controllerPressOut)
1266 {
1267 if (FOVcount > 0 && (!weapon || !weapon.CanEnterIronsights()))
1268 {
1269 optic.SetStepFOVIndex(FOVcount - 1);
1270 }
1271 }
1272
1273 if (weapon && weapon.CanEnterIronsights())
1274 {
1277 }
1278 }
1279 }
1281 {
1283 if (FOVcount > 0)
1284 {
1285 optic.SetStepFOVIndex(FOVcount - 1);
1286 }
1287 }
1288 }
1289 }
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)