private string generateLua(ModelItem item, CrModes crm) { string pattern = ""; switch (crm) { case CrModes.Character: pattern = PSMC.Properties.Resources.PlayerModelPattern; break; case CrModes.Custom: pattern = PSMC.Properties.Settings.Default.CustomModelPattern; break; case CrModes.Hat: pattern = PSMC.Properties.Resources.HatModelPattern; break; case CrModes.Item: pattern = PSMC.Properties.Resources.ItemModelPattern; break; default: break; } pattern = pattern.Replace("%MODEL_NAME%", item.Text); pattern = pattern.Replace("%MODEL_VIRTUAL_PATH%", item.ModelVirtualPath); pattern = pattern.Replace("%MODEL_FILENAME%", Modelhandling.getModelNameFromPath(item.ModelPath) + ".mdl"); pattern = pattern.Replace("%MODEL_PRICE%", item.ModelPrice.ToString()); pattern = pattern.Replace("%MODEL_CLEAN_NAME%", Tools.AdjustPath(item.Text)); return(pattern); }
public ModelItem(string path) { InitializeComponent(); this.ModelPath = path; this.Image = Tools.BitmapSource2BitmapImage(System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(PSMC.Properties.Resources.Image1.GetHbitmap(), IntPtr.Zero, System.Windows.Int32Rect.Empty, BitmapSizeOptions.FromWidthAndHeight(PSMC.Properties.Resources.Image1.Width, PSMC.Properties.Resources.Image1.Height))); this.Description = ""; this.Text = Modelhandling.getModelNameFromPath(path); this.ModelPrice = 100; }