Skip to content

Commit

Permalink
Bear slot UI & add readme (#11)
Browse files Browse the repository at this point in the history
* Add Readme
* Add Bear Slotting UI Project
  • Loading branch information
Sniperhid authored Dec 5, 2016
1 parent 7249bdc commit 94d6493
Show file tree
Hide file tree
Showing 6 changed files with 327 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 1Tac Misc Project

This project contains various config patches, and small tweaks intended for the Team One Tactical (1Tac) Arma 3 community.
1 change: 1 addition & 0 deletions addons/tm_slotting_ui/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x\tac1\addons\tm_slotting_ui
157 changes: 157 additions & 0 deletions addons/tm_slotting_ui/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
#include "script_component.hpp"

class CfgPatches
{
class ADDON
{
name = "Slotting UI Improvements";
author = "Bear, Snippers";
url = "http://www.teamonetactical.com";
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"tac1_tm_main","A3_UI_F"};
VERSION_CONFIG;
};
};

class CfgScriptPaths
{
BEAR_MPLOBBY = "x\tac1\addons\tm_slotting_ui\scripts\";
};
class RscStandardDisplay;
class RscText;
class RscActiveText;
class RscListBox;
class RscListNBox;
class RscButtonMenu;
class RscChatListDefault
{
x = "safezoneX + (19.8 * (((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
};
class RscDisplayRemoteMissions: RscStandardDisplay
{
scriptName = "RscDisplayRemoteMissions";
scriptPath = "BEAR_MPLOBBY";
class controls
{
delete ButtonLog;
};
};
class RscDisplayMultiplayerSetup: RscStandardDisplay
{
scriptName = "RscDisplayMultiplayerSetup";
scriptPath = "BEAR_MPLOBBY";
onLoad = "[""onLoad"",_this,""RscDisplayMultiplayerSetup"",'GUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')";
onUnload = "[""onUnload"",_this,""RscDisplayMultiplayerSetup"",'GUI'] call (uinamespace getvariable 'BIS_fnc_initDisplay')";
class controlsbackground
{
class RolesBackground: RscText
{
colorBackground[] = {0,0,0,0.3};
idc = 1085;
x = "4.8 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (SafezoneX)";
y = "6.8 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY)";
w = "(14.9 * ( ((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
h = "SafezoneH - (9 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))";
};
class ChatBackground: RscText
{
colorBackground[] = {0,0,0,0.3};
idc = 1086;
x = "safezoneX + (19.8 * ( ((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
y = "17.2 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY) + 0.7*(safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
w = "(19 * ( ((safezoneW / safezoneH) min 1.2) / 40)) + 0.55*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
h = "(5.6 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))+ 0.3*(safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
};
class PlayersPoolBackground: RscText
{
colorBackground[] = {0,0,0,0.3};
idc = 1087;
x = "safezoneX + (19.8 * ( ((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
y = "6.8 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY)";
w = "(19 * ( ((safezoneW / safezoneH) min 1.2) / 40)) + 0.55*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
h = "(10.3 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)) + 0.7*(safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
};
class SideBackground: RscText
{
colorBackground[] = {0,0,0,0.3};
idc = 1084;
x = "1.2 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (SafezoneX)";
y = "6.8 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY)";
w = "(3.5 * ( ((safezoneW / safezoneH) min 1.2) / 40))";
h = "SafezoneH - (9 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))";
};
};
class controls
{
class CA_ValueRoles: RscListBox
{
idc = 109;
colorAI[] = {0.67,0.24,0.24,1};
colorNobody[] = {1,1,1,0.25};
x = "4.8 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (SafezoneX)";
w = "(14.9 * ( ((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
h = "SafezoneH - (9 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))";
colorSelectBackground[] = {1,1,1,0.15};
colorSelectBackground2[] = {1,1,1,0.15};
y = "6.8 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY)";
};
class CA_ValuePool: RscListNBox
{
idc = 114;
canDrag = 1;
rows = 25;
sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
x = "safezoneX + (19.8 * ( ((safezoneW / safezoneH) min 1.2) / 40)) + 0.45*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
w = "(19 * ( ((safezoneW / safezoneH) min 1.2) / 40)) + 0.55*(safezoneW - ((safezoneW / safezoneH) min 1.2))";
h = "(10.3 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)) + 0.7*(safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
colorSelectBackground[] = {1,1,1,0.15};
colorSelectBackground2[] = {1,1,1,0.15};
colorPictureSelected[] = {1,1,1,1};
y = "6.8 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY)";
};
class CA_B_EnableAll: RscButtonMenu
{
y = "SafezoneY + SafezoneH - (2 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))";
w = "6.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
};
class CA_B_Kick: RscButtonMenu
{
y = "SafezoneY + SafezoneH - (2 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25))";
w = "6.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
x = "safezoneX + SafezoneW - (13.6 * (((safezoneW / safezoneH) min 1.2) / 40)) - ((safezoneX + SafezoneW - (7.25 * (((safezoneW / safezoneH) min 1.2) / 40))) - (safezoneX + SafezoneW - (13.6 * (((safezoneW / safezoneH) min 1.2) / 40))))";
size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
};
class CA_B_West: RscActiveText
{
text = " ";
textHeight = 0.67;
};
class CA_B_East: CA_B_West
{
text = " ";
};
class CA_B_Guerrila: CA_B_West
{
text = " ";
};
class CA_B_Civilian: CA_B_West
{
text = " ";
};
class CA_B_Virtual: CA_B_West
{
text = " ";
};
};
};
class cfgMods
{
author = "76561198014669991";
timepacked = "1442491890";
};
//};
5 changes: 5 additions & 0 deletions addons/tm_slotting_ui/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#define COMPONENT tm_slotting_ui

#include "\x\tac1\addons\tm_main\script_mod.hpp"
#include "\x\tac1\addons\tm_main\script_macros.hpp"

44 changes: 44 additions & 0 deletions addons/tm_slotting_ui/scripts/RscDisplayMultiplayerSetup.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
_mode = _this select 0;
_params = _this select 1;
_class = _this select 2;

disableSerialization;

switch _mode do
{
case "onLoad":
{
_display = _params select 0;

//Be sure chat is shown in case it was switched off in one of the preceding displays
showChat true;

//--- set player's name
(_display displayctrl 701) ctrlSetText profileName;
[_display, 701] call (uinamespace getvariable 'BIS_fnc_setIDCStreamFriendly');

//toUpper Title
_control = _display displayctrl 1000;
_control ctrlSetText (toUpper (ctrlText _control));

//Count players - works but can be done better (wait until ListBox is filled, than count), or use event handler for changing count of ListBox
_display displayaddeventhandler
[
"mousemoving",
"
_display = _this select 0;
(_display displayctrl 1015) ctrlsettext str ((lnbSize (_display displayctrl 114)) select 0);
"
];

//Move focus to Roles, since OK button is disabled. We don't want to move focus to Disconnect button on client.
ctrlSetFocus (_display displayctrl 109);
};

case "onUnload": {

//Hide chat to be sure it's hidden when returning back to Create Game
showChat false;
};

};
117 changes: 117 additions & 0 deletions addons/tm_slotting_ui/scripts/RscDisplayRemoteMissions.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
disableserialization;

_mode = _this select 0;
_params = _this select 1;
_class = _this select 2;

switch _mode do {

case "onLoad": {
_display = _params select 0;

//--- set player's name
(_display displayctrl 109) ctrlSetText profileName;
[_display, 109] call (uinamespace getvariable 'BIS_fnc_setIDCStreamFriendly');

//Sets title and button texts toUpper
["RscDisplayRemoteMissions",["RscText","RscTitle"],["PlayersName"]] call bis_fnc_toUpperDisplayTexts;

//Hide chat, show mission summary
showChat false;
_missionSummary = (_display displayctrl 2300);
_missionSummary ctrlSetFade 0;
_missionSummary ctrlCommit 0;
_missionSummary ctrlEnable true;

//Mission Summary button
_button = _display displayctrl 1085;
//_button ctrladdeventhandler ["buttonclick","with uinamespace do {['missionSummaryButton',_this,''] call RscDisplayRemoteMissions_script};"];
_button ctrlSetBackgroundColor [1,1,1,1];
_button ctrlSetTextColor [0,0,0,1];

//Chat button
//_button = _display displayctrl 1086;
//_button ctrladdeventhandler ["buttonclick","with uinamespace do {['chatButton',_this,''] call RscDisplayRemoteMissions_script};"];

//count missions
//_vel = lbSize (_display displayctrl 102);

//debuglog _vel;

//don't count New-Editor and New-Wizard
//_size = _size - 2;
//if(_size < 0) then {_size = 0;};
//(_display displayctrl 1014) ctrlSetText (str _vel);

//(_display displayctrl 101) ctrladdeventhandler ["lbselchanged","with uinamespace do {['mapChanged',_this,''] call RscDisplayRemoteMissions_script};"];
};

//--- Mission Summary button
case "missionSummaryButton": {

_missionSummaryButton = _params select 0;
_display = ctrlparent _missionSummaryButton;
_chatButton = _display displayctrl 1086;

//Hide chat, show mission summary
showChat false;
_missionSummary = (_display displayctrl 2300);
_missionSummary ctrlSetFade 0;
_missionSummary ctrlCommit 0;
_missionSummary ctrlEnable true;

//Set focus to MISSION SUMMARY button (change background and text colours of the tabs)
_missionSummaryButton ctrlSetBackgroundColor [1,1,1,1];
_missionSummaryButton ctrlSetTextColor [0,0,0,1];
_chatButton ctrlSetBackgroundColor [0,0,0,1];
_chatButton ctrlSetTextColor [1,1,1,1];
};

//--- Chat button
case "chatButton": {

_chatButton = _params select 0;
_display = ctrlparent _chatButton;
_missionSummaryButton = _display displayctrl 1085;

//Show chat, hide mission summary
showChat true;
_missionSummary = (_display displayctrl 2300);
_missionSummary ctrlSetFade 1;
_missionSummary ctrlCommit 0;
_missionSummary ctrlEnable false;

//Set focus to CHAT button (change background and text colours of the tabs)
_chatButton ctrlSetBackgroundColor [1,1,1,1];
_chatButton ctrlSetTextColor [0,0,0,1];
_missionSummaryButton ctrlSetBackgroundColor [0,0,0,1];
_missionSummaryButton ctrlSetTextColor [1,1,1,1];

};

/*
case "mapChanged": {
[] spawn
{
//_ctrl = _params select 0;
_display = ctrlparent (_params select 0);
sleep 0.2;
//count missions
_size = lbSize (_display displayctrl 102);
//don't count New-Editor and New-Wizard
_size = _size - 2;
if(_size < 0) then {_size = 0;};
(_display displayctrl 1014) ctrlSetText (str _size);
};
};
*/

case "onUnload": {

//Hide chat to be sure it's hidden when returning back to Server List
showChat false;
};

};

0 comments on commit 94d6493

Please sign in to comment.