Jump to content

Unigine::Widgets::DialogColor paletteColors


photo

Recommended Posts

Posted

Hi,

 

Looking into sources I find in "scripts/common/dialogs.h":

 

string config_name = "color_dialog_palette_default";


/* load dialog setting from config
*/
void load_config() {
    if(engine.config.isExist(config_name)) {
      dialog.setPaletteColors(engine.config.getString(config_name));
    }
}

 

It would be nice if we could have the  same functionality in "core/systems/widgets/widget_dialog_color.h", as follows:

 

// constructor
DialogColor(string str = 0) {
   dialog_color = new WidgetDialogColor(engine.getGui(),str);
   dialog = dialog_color;


    string config_name = "color_dialog_palette_default";
    if(engine.config.isExist(config_name)) {
      dialog_color.setPaletteColors(engine.config.getString(config_name));
     }


     #ifdef HAS_INTERFACE
       interface = new InterfaceWindow(0,"core/gui/");
       dialog.setCallback(PRESSED,"Unigine::Widgets::Dialog::pressed_callback",this);
       dialog.setPosition(0,0);
        dialog.setMoveable(0);
     #endif
     widget = dialog;
}

Even better if we can pass the palette as an argument in function dialogColor(string str,vec4 &color,CallbackBase callback = NULL, string palette = "")

 

 

Thanks in advance,

 

      David

×
×
  • Create New...