diff --git a/mpmissions/Exile.Altis/ExAdClient/Grinding/Functions/fn_grindLock.sqf b/mpmissions/Exile.Altis/ExAdClient/Grinding/Functions/fn_grindLock.sqf index 26496e2..ec341e4 100644 --- a/mpmissions/Exile.Altis/ExAdClient/Grinding/Functions/fn_grindLock.sqf +++ b/mpmissions/Exile.Altis/ExAdClient/Grinding/Functions/fn_grindLock.sqf @@ -21,51 +21,56 @@ if(vehicle player != player)exitWith{false}; ExAd_GRINDING_OBJECT = _this select 0; ExAd_GRINDING = true; -call ExileClient_gui_interactionMenu_unhook; + +{ + ExileClientInteractionObject removeAction _x; +} +forEach ExileClientInteractionHandles; + if(isClass(configFile >> "CfgVehicles" >> "Sound_Factory10")) then { _soundSrc = createSoundSource ["Sound_Factory10", position ExAd_GRINDING_OBJECT, [], 0]; }; player playActionNow "medicStart"; - ExAd_DRAW3D_HANDLER = addMissionEventHandler ["Draw3D", { private ["_object","_progress"]; _height = ExAd_GRINDING_PROGRESSBAR_POS; - _object = if(isNil "ExAd_GRINDING_OBJECT")then{cursorTarget}else{ExAd_GRINDING_OBJECT}; + _object = if(isNil "ExAd_GRINDING_OBJECT")then{ExileClientInteractionObject}else{ExAd_GRINDING_OBJECT}; _progress = 1 min ((_object getVariable ["ExAd_Grinding_progress", 1]) / ExAd_GRINDING_OBJECT_MAX); - drawLine3D [cursorTarget modelToWorld [-0.5, -0.15, _height], cursorTarget modelToWorld [0.5, -0.15, _height], [0,0,0,1]]; - drawLine3D [cursorTarget modelToWorld [-0.5, -0.15, _height - 0.05], cursorTarget modelToWorld [0.5, -0.15, _height - 0.05], [0,0,0,1]]; - drawLine3D [cursorTarget modelToWorld [-0.5, 0.15, _height], cursorTarget modelToWorld [0.5, 0.15, _height], [0,0,0,1]]; - drawLine3D [cursorTarget modelToWorld [-0.5, 0.15, _height - 0.05], cursorTarget modelToWorld [0.5, 0.15, _height - 0.05], [0,0,0,1]]; + drawLine3D [_object modelToWorld [-0.5, -0.15, _height], _object modelToWorld [0.5, -0.15, _height], [0,0,0,1]]; + drawLine3D [_object modelToWorld [-0.5, -0.15, _height - 0.05], _object modelToWorld [0.5, -0.15, _height - 0.05], [0,0,0,1]]; + drawLine3D [_object modelToWorld [-0.5, 0.15, _height], _object modelToWorld [0.5, 0.15, _height], [0,0,0,1]]; + drawLine3D [_object modelToWorld [-0.5, 0.15, _height - 0.05], _object modelToWorld [0.5, 0.15, _height - 0.05], [0,0,0,1]]; - drawLine3D [cursorTarget modelToWorld [-0.5, -0.15, _height], cursorTarget modelToWorld [-0.5, -0.15, _height - 0.05], [0,0,0,1]]; - drawLine3D [cursorTarget modelToWorld [0.5, -0.15, _height], cursorTarget modelToWorld [0.5, -0.15, _height - 0.05], [0,0,0,1]]; - drawLine3D [cursorTarget modelToWorld [-0.5, 0.15, _height], cursorTarget modelToWorld [-0.5, 0.15, _height - 0.05], [0,0,0,1]]; - drawLine3D [cursorTarget modelToWorld [0.5, -0.15, _height], cursorTarget modelToWorld [0.5, -0.15, _height - 0.05], [0,0,0,1]]; + drawLine3D [_object modelToWorld [-0.5, -0.15, _height], _object modelToWorld [-0.5, -0.15, _height - 0.05], [0,0,0,1]]; + drawLine3D [_object modelToWorld [0.5, -0.15, _height], _object modelToWorld [0.5, -0.15, _height - 0.05], [0,0,0,1]]; + drawLine3D [_object modelToWorld [-0.5, 0.15, _height], _object modelToWorld [-0.5, 0.15, _height - 0.05], [0,0,0,1]]; + drawLine3D [_object modelToWorld [0.5, -0.15, _height], _object modelToWorld [0.5, -0.15, _height - 0.05], [0,0,0,1]]; for "_i" from 1 to 49 do { - drawLine3D [cursorTarget modelToWorld [-0.5, -0.15, _height - (0.001 * _i)], cursorTarget modelToWorld [((-0.5) + _progress), -0.15, _height - (0.001 * _i)], [1,0.482,0,1]]; - drawLine3D [cursorTarget modelToWorld [0.5, 0.15, _height - (0.001 * _i)], cursorTarget modelToWorld [((0.5) - _progress), 0.15, _height - (0.001 * _i)], [1,0.482,0,1]]; + drawLine3D [_object modelToWorld [-0.5, -0.15, _height - (0.001 * _i)], _object modelToWorld [((-0.5) + _progress), -0.15, _height - (0.001 * _i)], [1,0.482,0,1]]; + drawLine3D [_object modelToWorld [0.5, 0.15, _height - (0.001 * _i)], _object modelToWorld [((0.5) - _progress), 0.15, _height - (0.001 * _i)], [1,0.482,0,1]]; - drawLine3D [cursorTarget modelToWorld [0.5, -0.15, _height - (0.001 * _i)], cursorTarget modelToWorld [((-0.5) + _progress), -0.15, _height - (0.001 * _i)], [0.55,0.55,0.55,1]]; - drawLine3D [cursorTarget modelToWorld [-0.5, 0.15, _height - (0.001 * _i)], cursorTarget modelToWorld [((0.5) - _progress), 0.15, _height - (0.001 * _i)], [0.55,0.55,0.55,1]]; + drawLine3D [_object modelToWorld [0.5, -0.15, _height - (0.001 * _i)], _object modelToWorld [((-0.5) + _progress), -0.15, _height - (0.001 * _i)], [0.55,0.55,0.55,1]]; + drawLine3D [_object modelToWorld [-0.5, 0.15, _height - (0.001 * _i)], _object modelToWorld [((0.5) - _progress), 0.15, _height - (0.001 * _i)], [0.55,0.55,0.55,1]]; } }]; _ticker = 1; -while{(ExAd_GRINDING_OBJECT == cursorTarget) && ExAd_GRINDING}do{ +while{(ExAd_GRINDING_OBJECT == ExileClientInteractionObject) && ExAd_GRINDING}do{ UISleep 1; + if(random[0,50,100] < 1)exitWith{ player removeItem "Exile_Item_Grinder"; - ['Whoops', [STR_ExAd_GRINDING_NOTI_BROKE]] call ExileClient_gui_notification_event_addNotification; + ["ErrorTitleAndText", ["ExAd - Grinding", STR_ExAd_GRINDING_NOTI_BROKE]] call ExileClient_gui_toaster_addTemplateToast; false }; if!("Exile_Magazine_Battery" in (magazines player))exitWith{ - ['Whoops', [STR_ExAd_GRINDING_NOTI_EMPTY_BAT]] call ExileClient_gui_notification_event_addNotification; + ["ErrorTitleAndText", ["ExAd - Grinding", STR_ExAd_GRINDING_NOTI_EMPTY_BAT]] call ExileClient_gui_toaster_addTemplateToast; false }; @@ -73,14 +78,15 @@ while{(ExAd_GRINDING_OBJECT == cursorTarget) && ExAd_GRINDING}do{ player removeItem "Exile_Magazine_Battery"; ["grindProgress", [netId ExAd_GRINDING_OBJECT]] call ExAd_fnc_serverDispatch; - ['Success', [STR_ExAd_GRINDING_NOTI_PROGRESS]] call ExileClient_gui_notification_event_addNotification; + ["SuccessTitleAndText", ["ExAd - Grinding", STR_ExAd_GRINDING_NOTI_PROGRESS]] call ExileClient_gui_toaster_addTemplateToast; player playActionNow "medicStart"; }; if(ExAd_GRINDING_OBJECT getVariable ["ExAd_Grinding_progress", 0] > ExAd_GRINDING_OBJECT_MAX)exitWith{ UISleep 2; - ['Success', [STR_ExAd_GRINDING_NOTI_FINISHED]] call ExileClient_gui_notification_event_addNotification; + ["SuccessTitleAndText", ["ExAd - Grinding", STR_ExAd_GRINDING_NOTI_FINISHED]] call ExileClient_gui_toaster_addTemplateToast; + ["grindProgress", [netId ExAd_GRINDING_OBJECT]] call ExAd_fnc_serverDispatch; }; _ticker = _ticker + 1; }; diff --git a/mpmissions/Exile.Altis/ExAdClient/VirtualGarage/CustomCode/ExileServer_system_territory_database_load.sqf b/mpmissions/Exile.Altis/ExAdClient/VirtualGarage/CustomCode/ExileServer_system_territory_database_load.sqf index 7e9f8ad..5fe53ba 100644 --- a/mpmissions/Exile.Altis/ExAdClient/VirtualGarage/CustomCode/ExileServer_system_territory_database_load.sqf +++ b/mpmissions/Exile.Altis/ExAdClient/VirtualGarage/CustomCode/ExileServer_system_territory_database_load.sqf @@ -9,7 +9,7 @@ * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. */ -private["_territoryID","_data","_id","_owner","_position","_radius","_level","_flagTexture","_flagStolen","_flagStolenBy","_flagStealMessage","_lastPayed","_buildRights","_moderators","_flagObject"]; +private["_territoryID","_data","_id","_owner","_position","_radius","_level","_flagTexture","_flagStolen","_flagStolenBy","_lastPayed","_buildRights","_moderators","_flagObject"]; _territoryID = _this; _data = format ["loadTerritory:%1", _territoryID] call ExileServer_system_database_query_selectSingle; _id = _data select 0; @@ -26,12 +26,14 @@ _level = _data select 7; _flagTexture = _data select 8; _flagStolen = _data select 9; _flagStolenBy = _data select 10; -_flagStealMessage = _data select 11; -_lastPayed = _data select 12; -_buildRights = _data select 13; -_moderators = _data select 14; +_lastPayed = _data select 11; +_buildRights = _data select 12; +_moderators = _data select 13; _flagObject = createVehicle ["Exile_Construction_Flag_Static",_position, [], 0, "CAN_COLLIDE"]; -_flagObject setFlagTexture _flagTexture; +if (_flagStolen isEqualTo 0) then +{ + _flagObject setFlagTexture _flagTexture; +}; ExileLocations pushBack _flagObject; _flagObject setVariable ["ExileTerritoryName", _name, true]; _flagObject setVariable ["ExileDatabaseID", _id]; @@ -43,6 +45,9 @@ _flagObject setVariable ["ExileTerritoryLevel", _level, true]; _flagObject setVariable ["ExileTerritoryLastPayed", _lastPayed]; _flagObject call ExileServer_system_territory_maintenance_recalculateDueDate; _flagObject setVariable ["ExileTerritoryNumberOfConstructions", _data select 15, true]; +_flagObject setVariable ["ExileRadiusShown", false, true]; +_flagObject setVariable ["ExileFlagStolen",_flagStolen,true]; +_flagObject setVariable ["ExileFlagTexture",_flagTexture]; //////////////////////// ///// ExAd START ///// @@ -52,4 +57,5 @@ _flagObject setVariable ["ExAdVGVeh", _vehicles, true]; //////////////////////// ///// ExAd END ///// //////////////////////// + true \ No newline at end of file