Skip to content

Commit

Permalink
Merge pull request #1194 from mharis001/lobby-manager
Browse files Browse the repository at this point in the history
Add Lobby Manager
  • Loading branch information
PabstMirror authored Jun 3, 2021
2 parents 9191ad5 + f230ca8 commit 4369e19
Show file tree
Hide file tree
Showing 11 changed files with 633 additions and 35 deletions.
5 changes: 3 additions & 2 deletions addons/ui/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ class CfgFunctions {
};

PATHTO_FNC(addPauseMenuOption);
PATHTO_FNC(progressBar);
PATHTO_FNC(getFov);
PATHTO_FNC(getAspectRatio);
PATHTO_FNC(getFov);
PATHTO_FNC(getUISize);
PATHTO_FNC(notify);
PATHTO_FNC(openLobbyManager);
PATHTO_FNC(progressBar);
};

class ItemContextMenu {
Expand Down
19 changes: 19 additions & 0 deletions addons/ui/Display3DEN.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class Display3DEN {
class Controls {
class MenuStrip: ctrlMenuStrip {
class Items {
class Tools {
items[] += {QGVAR(LobbyManager)};
};
class GVAR(LobbyManager) {
text = CSTRING(LobbyManager);
data = QGVAR(LobbyManager);
shortcuts[] = {INPUT_CTRL_OFFSET + DIK_L};
action = QUOTE(call (uiNamespace getVariable 'CBA_fnc_openLobbyManager'));
enable = 1;
opensNewWindow = 1;
};
};
};
};
};
117 changes: 117 additions & 0 deletions addons/ui/LobbyManager.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
class GVAR(LobbyManager) {
idd = -1;
enableDisplay = 1;
movingEnable = 1;

class controlsBackground {
class Disable: ctrlStaticBackgroundDisable {};
class DisableTiles: ctrlStaticBackgroundDisableTiles {};
};

class controls {
class Background: ctrlStaticBackground {
x = (getResolution select 2) * 0.5 * pixelW - (140/2) * GRID_3DEN_W;
y = 0.5 - (120/2 - 5) * GRID_3DEN_H;
w = 140 * GRID_3DEN_W;
h = (120 - 10) * GRID_3DEN_H;
};
class BackgroundButtons: ctrlStaticFooter {
x = (getResolution select 2) * 0.5 * pixelW - (140/2) * GRID_3DEN_W;
y = 0.5 + (120/2 - 10 - 2) * GRID_3DEN_H;
w = 140 * GRID_3DEN_W;
h = 7 * GRID_3DEN_H;
};
class Title: ctrlStaticTitle {
text = CSTRING(LobbyManager);
x = (getResolution select 2) * 0.5 * pixelW - (140/2) * GRID_3DEN_W;
y = 0.5 - (120/2 - 5) * GRID_3DEN_H;
w = 140 * GRID_3DEN_W;
h = 5 * GRID_3DEN_H;
};
class Slots: ctrlTree {
idc = IDC_LM_SLOTS;
x = (getResolution select 2) * 0.5 * pixelW - (140/2 - 1) * GRID_3DEN_W;
y = 0.5 - (120/2 - 10 - 1) * GRID_3DEN_H;
w = 88 * GRID_3DEN_W;
h = (120 - 10 - 5 - 7 - 2) * GRID_3DEN_H;
sizeEx = 3.96 * (1 / (getResolution select 3)) * pixelGrid * 0.5;
colorBackground[] = {0, 0, 0, 0.3};
disableKeyboardSearch = 1;
};
class CallsignLabel: ctrlStatic {
text = "$STR_3DEN_Group_Attribute_Callsign_displayName";
tooltip = "$STR_3DEN_Group_Attribute_Callsign_tooltip";
x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50) * GRID_3DEN_W;
y = 0.5 - (120/2 - 10 - 1) * GRID_3DEN_H;
w = 49 * GRID_3DEN_W;
h = 5 * GRID_3DEN_H;
};
class Callsign: ctrlEdit {
idc = IDC_LM_CALLSIGN;
onLoad = QUOTE((_this select 0) ctrlEnable false);
x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50) * GRID_3DEN_W;
y = 0.5 - (120/2 - 10 - 1 - 5) * GRID_3DEN_H;
w = 49 * GRID_3DEN_W;
h = 5 * GRID_3DEN_H;
colorDisabled[] = {1, 1, 1, 1};
colorBackground[] = {0, 0, 0, 0.25};
};
class DescriptionLabel: CallsignLabel {
text = "$STR_3DEN_Object_Attribute_Description_displayName";
tooltip = "$STR_3DEN_Object_Attribute_Description_tooltip";
y = 0.5 - (120/2 - 10 - 1 - 10) * GRID_3DEN_H;
};
class Description: Callsign {
idc = IDC_LM_DESCRIPTION;
y = 0.5 - (120/2 - 10 - 1 - 5 - 10) * GRID_3DEN_H;
};
class MoveUp: ctrlButtonPictureKeepAspect {
idc = IDC_LM_MOVE_UP;
text = QPATHTOF(arrow_up_ca.paa);
tooltip = "$STR_USRACT_CAMERA_MOVE_UP";
x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50) * GRID_3DEN_W;
y = 0.5 + (120/2 - 10 - 7 - 1) * GRID_3DEN_H;
w = 5 * GRID_3DEN_W;
h = 5 * GRID_3DEN_H;
colorBackground[] = {0, 0, 0, 0};
};
class MoveDown: MoveUp {
idc = IDC_LM_MOVE_DOWN;
text = QPATHTOF(arrow_down_ca.paa);
tooltip = "$STR_USRACT_CAMERA_MOVE_DOWN";
x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50 + 5) * GRID_3DEN_W;
};
class Collapse: ctrlButtonCollapseAll {
idc = IDC_LM_COLLAPSE;
x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50 + 10) * GRID_3DEN_W;
y = 0.5 + (120/2 - 10 - 7 - 1) * GRID_3DEN_H;
w = 5 * GRID_3DEN_W;
h = 5 * GRID_3DEN_H;
};
class Expand: ctrlButtonExpandAll {
idc = IDC_LM_EXPAND;
x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50 + 15) * GRID_3DEN_W;
y = 0.5 + (120/2 - 10 - 7 - 1) * GRID_3DEN_H;
w = 5 * GRID_3DEN_W;
h = 5 * GRID_3DEN_H;
};
class WarningLabel: ctrlStructuredText {
idc = IDC_LM_WARNING;
x = (getResolution select 2) * 0.5 * pixelW - (140/2) * GRID_3DEN_W;
y = 0.5 + (120/2 - 10 - 1) * GRID_3DEN_H;
h = 5 * GRID_3DEN_H;
};
class ButtonOK: ctrlButtonOK {
x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 50 - 2) * GRID_3DEN_W;
y = 0.5 + (120/2 - 10 - 1) * GRID_3DEN_H;
w = 25 * GRID_3DEN_W;
h = 5 * GRID_3DEN_H;
};
class ButtonCancel: ctrlButtonCancel {
x = (getResolution select 2) * 0.5 * pixelW + (140/2 - 25 - 1) * GRID_3DEN_W;
y = 0.5 + (120/2 - 10 - 1) * GRID_3DEN_H;
w = 25 * GRID_3DEN_W;
h = 5 * GRID_3DEN_H;
};
};
};
9 changes: 0 additions & 9 deletions addons/ui/RscTitles.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
class RscText;
class RscProgress;
class RscMapControl;

class RscListBox;
class GVAR(ItemContextMenu): RscListBox {
colorBackground[] = {0.05,0.05,0.05,0.95};
};

class RscTitles {
class GVAR(ProgressBar) {
onLoad = uiNamespace setVariable ['GVAR(ProgressBar)', _this select 0];
Expand Down
Binary file added addons/ui/arrow_down_ca.paa
Binary file not shown.
Binary file added addons/ui/arrow_up_ca.paa
Binary file not shown.
30 changes: 28 additions & 2 deletions addons/ui/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,49 @@

class CfgPatches {
class ADDON {
name = CSTRING(component);
name = CSTRING(Component);
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"cba_common", "cba_arrays"};
author = "$STR_CBA_Author";
authors[] = {"Dr Eyeball", "commy2"};
authors[] = {"Dr Eyeball", "commy2", "mharis001"};
url = "$STR_CBA_URL";
VERSION_CONFIG;
};
};

class RscText;
class RscProgress;
class RscMapControl;
class ctrlTree;
class ctrlEdit;
class ctrlStatic;
class ctrlStaticTitle;
class ctrlStaticFooter;
class ctrlStructuredText;
class ctrlMenuStrip;
class ctrlButtonOK;
class ctrlButtonCancel;
class ctrlButtonExpandAll;
class ctrlButtonCollapseAll;
class ctrlButtonPictureKeepAspect;
class ctrlStaticBackground;
class ctrlStaticBackgroundDisable;
class ctrlStaticBackgroundDisableTiles;

class RscListBox;
class GVAR(ItemContextMenu): RscListBox {
colorBackground[] = {0.05, 0.05, 0.05, 0.95};
};

#include "CfgEventHandlers.hpp"
#include "CfgFunctions.hpp"
#include "RscTitles.hpp"
#include "CfgUIGrids.hpp"
#include "RscDisplayOptionsLayout.hpp"
#include "Display3DEN.hpp"
#include "LobbyManager.hpp"

//-----------------------------------------------------------------------------
// TODO: Delete these rsc/_flexiMenu_RscShortcutButton classes soon and transfer properties to menu classes, if any.
Expand Down
2 changes: 0 additions & 2 deletions addons/ui/fnc_initDisplayMultiplayerSetup.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "script_component.hpp"

#define SEPARATORS "@"

params ["_display"];

private _fnc_update = {
Expand Down
Loading

0 comments on commit 4369e19

Please sign in to comment.