Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

HeroCodeGUI problem

MasterOf13FPS

Administrator
Staff member
Administrator
MasterOf13FPS
Joined
Jul 11, 2020
Messages
0
Reaction score
25
Points
0
I have a Problem with HeroCode.
I need a Setting Manager method.
The method names "getSettingsByModule".
Can a Member post me this method pls.
Here the Code snippet:
if (Client.setMgr.getSettingByName(imod.toString()) != null)
for (Setting s : Client.setMgr.getSettingByModule(imod)) { <----- here this method
if (s.isCheck()) {
menuelements.add(new ElementCheckBox(this, s));
} else if (s.isSlider()) {
menuelements.add(new ElementSlider(this, s));
} else if (s.isCombo()) {
menuelements.add(new ElementComboBox(this, s));
}
}
 
[HIDE]
Code:
package refract.settings;

import java.util.ArrayList;

import refract.Refract;
import refract.module.Module;


/**
 *  Made by HeroCode
 *  it's free to use
 *  but you have to credit me
 *
 *  @author HeroCode
 */
public class SettingsManager {
   
    private ArrayList<Setting> settings;
   
    public SettingsManager(){
        this.settings = new ArrayList<>();
    }
   
    public void rSetting(Setting in){
        this.settings.add(in);
    }
   
    public ArrayList<Setting> getSettings(){
        return this.settings;
    }
   
    public ArrayList<Setting> getSettingsByMod(Module mod){
        ArrayList<Setting> out = new ArrayList<>();
        for(Setting s : getSettings()){
            if(s.getParentMod().equals(mod)){
                out.add(s);
            }
        }
        if(out.isEmpty()){
            return null;
        }
        return out;
    }
   
    public Setting getSettingByName(String name){
        for(Setting set : getSettings()){
            if(set.getName().equalsIgnoreCase(name)){
                return set;
            }
        }
        Refract.client.addChatMessage(" Error Setting NOT found: '" + name +"'!");
        return null;
    }

}
[/HIDE]
 
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top