本文整理汇总了C#中DropDownButtonWidget.RemovePanel方法的典型用法代码示例。如果您正苦于以下问题:C# DropDownButtonWidget.RemovePanel方法的具体用法?C# DropDownButtonWidget.RemovePanel怎么用?C# DropDownButtonWidget.RemovePanel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DropDownButtonWidget
的用法示例。
在下文中一共展示了DropDownButtonWidget.RemovePanel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowColorDropDown
public static void ShowColorDropDown(DropDownButtonWidget color, ColorPreviewManagerWidget preview, World world)
{
Action onExit = () =>
{
Game.Settings.Player.Color = preview.Color;
Game.Settings.Save();
};
color.RemovePanel();
Action<HSLColor> onChange = c => preview.Color = c;
var colorChooser = Game.LoadWidget(world, "COLOR_CHOOSER", null, new WidgetArgs()
{
{ "onChange", onChange },
{ "initialColor", Game.Settings.Player.Color }
});
color.AttachPanel(colorChooser, onExit);
}
示例2: ShowColorDropDown
void ShowColorDropDown(DropDownButtonWidget color, Session.Client client)
{
var colorChooser = Game.modData.WidgetLoader.LoadWidget( new WidgetArgs() { {"worldRenderer", worldRenderer} }, null, "COLOR_CHOOSER" );
var hueSlider = colorChooser.GetWidget<SliderWidget>("HUE_SLIDER");
hueSlider.Value = orderManager.LocalClient.ColorRamp.H / 255f;
var satSlider = colorChooser.GetWidget<SliderWidget>("SAT_SLIDER");
satSlider.Value = orderManager.LocalClient.ColorRamp.S / 255f;
var lumSlider = colorChooser.GetWidget<SliderWidget>("LUM_SLIDER");
lumSlider.Value = orderManager.LocalClient.ColorRamp.L / 255f;
var rangeSlider = colorChooser.GetWidget<SliderWidget>("RANGE_SLIDER");
rangeSlider.Value = orderManager.LocalClient.ColorRamp.R / 255f;
Action updateColorPreview = () => UpdateColorPreview(hueSlider.Value, satSlider.Value, lumSlider.Value, rangeSlider.Value);
hueSlider.OnChange += _ => updateColorPreview();
satSlider.OnChange += _ => updateColorPreview();
lumSlider.OnChange += _ => updateColorPreview();
rangeSlider.OnChange += _ => updateColorPreview();
updateColorPreview();
colorChooser.GetWidget<ButtonWidget>("BUTTON_OK").OnClick = () =>
{
updateColorPreview();
UpdatePlayerColor(hueSlider.Value, satSlider.Value, lumSlider.Value, rangeSlider.Value);
color.RemovePanel();
};
color.AttachPanel(colorChooser);
}
示例3: ShowColorDropDown
public static void ShowColorDropDown(DropDownButtonWidget color, Session.Client client,
OrderManager orderManager, World world, ColorPreviewManagerWidget preview)
{
Action onExit = () =>
{
if (client.Bot == null)
{
Game.Settings.Player.Color = preview.Color;
Game.Settings.Save();
}
color.RemovePanel();
orderManager.IssueOrder(Order.Command("color {0} {1}".F(client.Index, preview.Color)));
};
Action<HSLColor> onChange = c => preview.Color = c;
var colorChooser = Game.LoadWidget(world, "COLOR_CHOOSER", null, new WidgetArgs()
{
{ "onChange", onChange },
{ "initialColor", client.Color }
});
color.AttachPanel(colorChooser, onExit);
}
示例4: ShowColorDropDown
public static void ShowColorDropDown(DropDownButtonWidget color, Session.Client client,
OrderManager orderManager, ColorPickerPaletteModifier preview)
{
Action<ColorRamp> onSelect = c =>
{
if (client.Bot == null)
{
Game.Settings.Player.ColorRamp = c;
Game.Settings.Save();
}
color.RemovePanel();
orderManager.IssueOrder(Order.Command("color {0} {1}".F(client.Index, c)));
};
Action<ColorRamp> onChange = c => preview.Ramp = c;
var colorChooser = Game.LoadWidget(orderManager.world, "COLOR_CHOOSER", null, new WidgetArgs()
{
{ "onSelect", onSelect },
{ "onChange", onChange },
{ "initialRamp", client.ColorRamp }
});
color.AttachPanel(colorChooser);
}
示例5: ShowColorPicker
bool ShowColorPicker(DropDownButtonWidget color, PlayerSettings s)
{
Action<HSLColor> onChange = c => colorPreview.Color = c;
Action onExit = () =>
{
s.Color = colorPreview.Color;
color.RemovePanel();
};
var colorChooser = Game.LoadWidget(world, "COLOR_CHOOSER", null, new WidgetArgs()
{
{ "onExit", onExit },
{ "onChange", onChange },
{ "initialColor", s.Color }
});
color.AttachPanel(colorChooser, onExit);
return true;
}
示例6: ShowColorPicker
bool ShowColorPicker(DropDownButtonWidget color, PlayerSettings s)
{
Action<ColorRamp> onSelect = c => { s.ColorRamp = c; color.RemovePanel(); };
Action<ColorRamp> onChange = c => { playerPalettePreview.Ramp = c; };
var colorChooser = Game.LoadWidget(world, "COLOR_CHOOSER", null, new WidgetArgs()
{
{ "onSelect", onSelect },
{ "onChange", onChange },
{ "initialRamp", s.ColorRamp }
});
color.AttachPanel(colorChooser);
return true;
}