Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace %20 with space when displaying mission name #1150

Merged
merged 2 commits into from
Jun 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like _fnc_replace is bad name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How so? It is CBA_fnc_replace fetched from ui namespace in case the host started the game with -world=empty.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh sorry I just missed assigning line 😕 🤦‍♂️

private _value = _ctrlMissions lbValue _i;
private _data = _ctrlMissions lbData _i;
private _color = _ctrlMissions lbColor _i;
Expand Down