Skip to content

Commit

Permalink
Replace %20 with space when displaying mission name (#1150)
Browse files Browse the repository at this point in the history
* replace %20 with space

* replace %20 on briefing/map
  • Loading branch information
commy2 authored Jun 3, 2019
1 parent 9c02b92 commit c25bd18
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions addons/ui/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class Extended_DisplayLoad_EventHandlers {
class RscDisplayRemoteMissions {
ADDON = QUOTE(_this call (uiNamespace getVariable 'FUNC(initDisplayRemoteMissions)'));
};
class RscDiary {
ADDON = QUOTE(_this call (uiNamespace getVariable 'FUNC(initDisplayDiary)'));
};
class Display3DEN {
ADDON = QUOTE(_this call (uiNamespace getVariable 'FUNC(initDisplay3DEN)'));
};
Expand Down
1 change: 1 addition & 0 deletions addons/ui/XEH_preStart.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ PREP(initDisplayMultiplayerSetup);
PREP(initDisplayOptionsLayout);
PREP(initDisplayPassword);
PREP(initDisplayRemoteMissions);
PREP(initDisplayDiary);
PREP(initDisplay3DEN);
PREP(initDisplayCurator);

Expand Down
11 changes: 11 additions & 0 deletions addons/ui/fnc_initDisplayDiary.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "script_component.hpp"

_this spawn {
isNil {
params ["_display"];

private _missionName = _display displayCtrl IDC_DIARY_MISSION_NAME;
private _text = [ctrlText _missionName, "%20", " "] call CBA_fnc_replace;
_missionName ctrlSetText _text;
};
};
5 changes: 5 additions & 0 deletions addons/ui/fnc_initDisplayMultiplayerSetup.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ private _fnc_update = {
// value determines which slot is linked to the lb entry
_playerList lbSetValue [_playerList lbAdd _text, _value];
};

// replace %20 with space
private _missionName = _display displayCtrl IDC_MPSETUP_NAME;
private _text = [ctrlText _missionName, "%20", " "] call (uiNamespace getVariable "CBA_fnc_replace");
_missionName ctrlSetText _text;
};

_display setVariable [QFUNC(update), _fnc_update];
Expand Down
4 changes: 3 additions & 1 deletion addons/ui/fnc_initDisplayRemoteMissions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ private _fnc_storeMapMissions = {_this spawn {isNil { // delay a frame
private _ctrlMissions = _display displayCtrl IDC_SERVER_MISSION;

private _missions = [];
private _fnc_replace = uiNamespace getVariable "CBA_fnc_replace";

for "_i" from 0 to (lbSize _ctrlMissions - 1) do {
private _name = _ctrlMissions lbText _i;
private _name = [_ctrlMissions lbText _i, "%20", " "] call _fnc_replace; // replace %20 with space
private _value = _ctrlMissions lbValue _i;
private _data = _ctrlMissions lbData _i;
private _color = _ctrlMissions lbColor _i;
Expand Down

0 comments on commit c25bd18

Please sign in to comment.