红警2!!!
发布网友
发布时间:2022-05-10 02:07
我来回答
共4个回答
热心网友
时间:2023-10-19 00:39
当然是你弄错了,光有代码只能建造这个单位,你没有配套的建造图片和文字以及他的模型当然没建造图标和外形了!只有他的功能。基洛夫空艇你可以去网上淘一淘,有他的图片和模型的。具体的我不会,但是这个理论我明白。纯手打望采纳!(友情提示:有的时候不同版本会不兼容的。比如尤里复仇和共和国之辉的可能不兼容,红3和红2也不兼容。。)追问怎么淘啊?把网址发过来。而且代码里有写建造图标是什么什么的和外形是什么什么的。还有,什么兼容啊?看不懂。。。
追答代码写建造图标?我服了你了。。。不可能的。。。。红2文件夹里有一个文件夹放的是建造图标,你去找一下,把基洛夫的图标放进去(百度图片就有)。模型的话也有文件夹放的,模型你去百度搜索红警之家,红警之家里啥都有,游戏,介绍,图标,模型、、、、兼容的话,就是说版本不一样,这个版本就无法读取另一个版本的模型等等。。。。懂了不?还不懂追问
热心网友
时间:2023-10-19 00:39
是没有,用这个吧
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.ComponentModel;
using SoleTools.Win32;
namespace SoleTools
{
/// <summary>
/// Specifies the style of the <see cref= "TextBoxEx "/> .
/// </summary>
public enum TextBoxStyle
{
/// <summary>
/// Default.
/// </summary>
Default = 0,
/// <summary>
/// Text is all numeric.
/// </summary>
Numeric = 0x2000,
/// <summary>
/// Text is all upper-case.
/// </summary>
UpperCase = 0x8,
/// <summary>
/// Text is all lower-case.
/// </summary>
LowerCase = 0x10
}
/// <summary>
/// Represents an enhanced TextBoxEx.
/// </summary>
public class TextBoxEx : TextBox
{
private TextBoxStyle style;
#region Tag
private object mTag;
/// <summary>
/// Gets or sets the object that contains data about the control.
/// </summary>
public new object Tag
{
get
{
return mTag;
}
set
{
mTag = value;
}
}
#endregion
private int defaultStyle = 0;
protected virtual new event EventHandler OnStyleChanged;
/// <summary>
/// Create a new instance of TextBoxEx.
/// </summary>
public TextBoxEx()
{
defaultStyle = Win32Window.GetWindowLong(hwnd, (int)GWL.STYLE);
InitContextMenu();
}
void InitContextMenu()
{
this.ContextMenu = new ContextMenu();
MenuItem menuItem;
menuItem = new MenuItem();
menuItem.Text = "剪切 ";
menuItem.Click += new System.EventHandler(menuCut_Click);
this.ContextMenu.MenuItems.Add(menuItem);
menuItem = new MenuItem();
menuItem.Text = "复制 ";
menuItem.Click += new System.EventHandler(menuCopy_Click);
this.ContextMenu.MenuItems.Add(menuItem);
menuItem = new MenuItem();
menuItem.Text = "粘贴 ";
menuItem.Click += new System.EventHandler(menuPaste_Click);
this.ContextMenu.MenuItems.Add(menuItem);
}
void menuCopy_Click(object sender, EventArgs e)
{
Copy();
}
void menuCut_Click(object sender, EventArgs e)
{
Cut();
}
void menuPaste_Click(object sender, EventArgs e)
{
Paste();
}
#region Handle
private IntPtr hwnd = IntPtr.Zero;
/// <summary>
/// Gets the window handle that the control is bound to.
/// </summary>
/// <value> An IntPtr that contains the window handle (HWND) of the control. </value>
public new IntPtr Handle
{
get
{
if(hwnd == IntPtr.Zero)
{
this.Capture = true;
hwnd = Win32Window.GetCapture();
this.Capture = false;
}
return hwnd;
}
}
#endregion
/// <summary>
/// Sets the TextBoxStyle.
/// </summary>
/// <remarks> Similar to the CharacterCasing property in the full framework. </remarks>
public TextBoxStyle TextBoxStyle
{
get { return style; }
set
{
style = value;
OnTextBoxStyleChanged(null);
}
}
/// <summary>
/// Raises the OnStyleChanged event.
/// </summary>
/// <param name= "e "> </param>
private void OnTextBoxStyleChanged(EventArgs e)
{
switch(style)
{
case TextBoxStyle.Default:
Win32Window.SetWindowLong(hwnd, (int)GWL.STYLE, defaultStyle);
break;
case TextBoxStyle.Numeric:
Win32Window.SetWindowLong(hwnd, (int)GWL.STYLE, defaultStyle|(int)ES.NUMBER);
break;
case TextBoxStyle.UpperCase:
Win32Window.SetWindowLong(hwnd, (int)GWL.STYLE, defaultStyle|(int)ES.UPPERCASE);
break;
case TextBoxStyle.LowerCase:
Win32Window.SetWindowLong(hwnd, (int)GWL.STYLE, defaultStyle|(int)ES.LOWERCASE);
break;
default:
Win32Window.SetWindowLong(hwnd, (int)GWL.STYLE, defaultStyle);
break;
}
if(OnStyleChanged != null)
OnStyleChanged(this,e);
}
protected override void OnParentChanged(System.EventArgs e)
{
//reset handle
//next attempt to retrieve it will capture again
hwnd = IntPtr.Zero;
}
protected override void OnKeyUp(KeyEventArgs e)
{
if(e.Control)
{
switch(e.KeyData)
{
case Keys.Z | Keys.Control:
Undo();
break;
case Keys.X | Keys.Control:
Cut();
break;
case Keys.C | Keys.Control:
Copy();
break;
case Keys.V | Keys.Control:
Paste();
break;
}
}
base.OnKeyUp (e);
}
#region Clipboard Support
/// <summary>
/// Moves the current selection in the <see cref= "TextBoxEx "/> to the Clipboard.
/// <para> <b> New in v1.1 </b> </para>
/// </summary>
public new void Cut()
{
//send Cut message
Win32Window.SendMessage(this.Handle, (int)WM.CUT, 0, 0);
}
/// <summary>
/// Copies the current selection in the <see cref= "TextBoxEx "/> to the Clipboard.
/// <para> <b> New in v1.1 </b> </para>
/// </summary>
public new void Copy()
{
//send Copy message
Win32Window.SendMessage(this.Handle, (int)WM.COPY, 0, 0);
}
/// <summary>
/// Replaces the current selection in the <see cref= "TextBoxEx "/> with the contents of the Clipboard.
/// <para> <b> New in v1.1 </b> </para>
/// </summary>
public new void Paste()
{
//send Paste message
Win32Window.SendMessage(this.Handle, (int)WM.PASTE, 0, 0);
}
/// <summary>
/// Clears all text from the <see cref= "TextBoxEx "/> control.
/// <para> <b> New in v1.1 </b> </para>
/// </summary>
public new void Clear()
{
//send Clear message
Win32Window.SendMessage(this.Handle, (int)WM.CLEAR, 0, 0);
}
/// <summary>
/// Undoes the last edit operation in the <see cref= "TextBoxEx "/> .
/// <para> <b> New in v1.1 </b> </para>
/// </summary>
public new void Undo()
{
//send Undo message
Win32Window.SendMessage(this.Handle, (int)WM.UNDO, 0, 0);
}
#endregion
}
}追问这是什么啊?一串文字看不懂
热心网友
时间:2023-10-19 00:40
当然是你弄错了,光有代码只能建造这个单位,你没有配套的建造图片和文字以及他的模型当然没建造图标和外形了!
热心网友
时间:2023-10-19 00:40
新注册的基洛夫代码下面须加下面代码!才能有图形!改变单位外形都可用此代码,建造图标要在art.ini中设定。没有会调用默认红色的那个图标。ZEP是大写!
Image=ZEP
苏军基地车图形代码如下:
Image=SMCV追问那为什么里面已经有了lmage了啊?