Jump to content
chernaruski

Exile Plants by nflug (modified by Kuchenplatte)

Recommended Posts

https://github.com/ReDBaroN1/Exile-Plants

I used the plant addon from the above. but it can not return the item which I select  it only toast me "there is no such item". I guess  problem comes from the follwing  part

////////////////////////////////////////////////////////
//// the following codes  cannot return the item I selected , it only toast me "there is no such item"
switch _menu do {
    case "uniform": {
        _item = _uniformList lbData _index;
    };

    case "vest": {
        _item = _vestList lbData _index;
    };

    case "backpack": {
        _item = _backpackList lbData _index;
    };
};

["InfoTitleAndText", format[" item selected IS %1!",_item]] call ExileClient_gui_toaster_addTemplateToast;
 diag_log format["plant_test %1",_item];
if(_item isEqualTo "") exitWith {hint "Kein Item mit diesem Namen gefunden!";
        ["InfoTitleAndText", format["%1 there is no such item!",_item]] call ExileClient_gui_toaster_addTemplateToast;


};

 

the whole script is here

 

Spoiler

/*--------------------------------------------------------------------
    Author: nflug (ofpectag: ACRYL)
    File: fn_plantsUse.sqf
    Modified: Kuchenplatte
    <Acryl-Gaming.de>
    Written by nflug - modified and edited by Kuchenplatte
    You're not allowed to use this file without permission from the author!
--------------------------------------------------------------------*/

private _index = -1;
private _menu  = "";

private _display = findDisplay 602;

private _uniformList  = _display displayCtrl 633;
private _vestList     = _display displayCtrl 638;
private _backpackList = _display displayCtrl 619;


switch true do {
    case ((lbCurSel _uniformList) != -1): {
        _menu  = "uniform";
        _index = lbCurSel _uniformList;
    };

    case ((lbCurSel _vestList) != -1): {
        _menu  = "vest";
        _index = lbCurSel _vestList;
    };

    case ((lbCurSel _backpackList) != -1): {
        _menu  = "backpack";
        _index = lbCurSel _backpackList;
    };

    default {};
};

if(_index isEqualTo -1 && _menu isEqualTo "") exitWith {hint "Du musst ein Item auswählen!";
        ["InfoTitleAndText", format["%1 you need choose a item first!",_index]] call ExileClient_gui_toaster_addTemplateToast;

};
["InfoTitleAndText", format[" current menu is %1!",_menu]] call ExileClient_gui_toaster_addTemplateToast;
private _item = "";


////////////////////////////////////////////////////////
//// the following codes  cannot return the item I selected , it only toast me "there is no such item"
switch _menu do {
    case "uniform": {
        _item = _uniformList lbData _index;
    };

    case "vest": {
        _item = _vestList lbData _index;
    };

    case "backpack": {
        _item = _backpackList lbData _index;
    };
};

["InfoTitleAndText", format[" item selected IS %1!",_item]] call ExileClient_gui_toaster_addTemplateToast;
 diag_log format["plant_test %1",_item];
if(_item isEqualTo "") exitWith {hint "Kein Item mit diesem Namen gefunden!";
        ["InfoTitleAndText", format["%1 there is no such item!",_item]] call ExileClient_gui_toaster_addTemplateToast;


};


private _itemList = [];

{
    _itemList pushBack (configName _x);
} forEach ("true" configClasses (missionConfigFile >> "CfgPlants"));

if (_item in _itemList) then {
    [_item] call plants_fnc_plantsAdd;
} else {
    hint "Dieses Item kann nicht angepflanzt werden!";
        ["InfoTitleAndText", format["%1 cannot plant",_item]] call ExileClient_gui_toaster_addTemplateToast;

};

 

Share this post


Link to post
Share on other sites

I had no idea I'd even forked that... 

 

I know I never used it but, must probably been planning to sometime ago... 

Share this post


Link to post
Share on other sites

I didn't delete it at all. I had a fork of the original repo and the original repo was taken down. Then the creator of that repo filed an illegal DMCA on my fork. Technically, he can't do that because it was originally shared without a licence publicly on GitHub and it is code modified from exile's shared code under their licence.

 

But, I didn't use it in the end anyway and couldn't be bothered to get involved in the argument. 

 

 

Share this post


Link to post
Share on other sites

×