Skip to content

Commit

Permalink
Use sectors mechanic for displaying current score (#58)
Browse files Browse the repository at this point in the history
* Use BIS_fnc_respawnTickets for simple score display UI

* Initialize score display UI with 0 tickets
  • Loading branch information
3Mydlo3 authored Jan 26, 2024
1 parent 0741799 commit ef011a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addons/score/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ if (isServer) then {
[QEGVAR(common,showMessage), [_msg, [3]]] call CBA_fnc_globalEvent;
call FUNC(monitorTimeouts);
}, [], GVAR(idleTimeMax)] call CBA_fnc_waitAndExecute;

// Initialize score display UI
[WEST, 0] call BIS_fnc_respawnTickets;
[EAST, 0] call BIS_fnc_respawnTickets;
};

[QGVAR(scoreChanged), {
Expand Down
3 changes: 3 additions & 0 deletions addons/score/functions/fnc_addKillersScore.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ private _time = [daytime] call BIS_fnc_timeToString;
GVAR(killersScore) = GVAR(killersScore) + _scoreChange;
publicVariable QGVAR(killersScore);

// For display purposes using properly set-up sector modules
[EAST, _scoreChange] call BIS_fnc_respawnTickets;

GVAR(killersScoreChange) = GVAR(killersScoreChange) + _scoreChange;
publicVariable QGVAR(killersScoreChange);
[{
Expand Down
3 changes: 3 additions & 0 deletions addons/score/functions/fnc_addPoliceScore.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ private _time = [daytime] call BIS_fnc_timeToString;
GVAR(policeScore) = GVAR(policeScore) + _scoreChange;
publicVariable QGVAR(policeScore);

// For display purposes using properly set-up sector modules
[WEST, _scoreChange] call BIS_fnc_respawnTickets;

GVAR(policeScoreChange) = GVAR(policeScoreChange) + _scoreChange;
publicVariable QGVAR(policeScoreChange);
[{
Expand Down

0 comments on commit ef011a8

Please sign in to comment.