Kalonline cursors

Results 1 to 11 of 11
  1. #1
    Account Upgraded | Title Enabled! mukso is offline
    MemberRank
    Nov 2007 Join Date
    HungaryLocation
    333Posts

    Kalonline cursors

    Hi all,
    can somebody tell me where kalonline cursors stored? [ the on in normal condition and the one when we drag on a monster (little sword)]

    or just get an image of them from somewhere, anyway i couldnt


    the second thing is, im triing to load a custom cursor into delphi, but i fail all the time :(
    i already made a cursor in image editor, and i have a cursor named as cursor1.cur.... and i tired to add with this code:

    const
    cursor1 = 15;
    CurFile = 'cursor1.cur';
    var
    CurFilePath: string;

    begin
    CurFilePath := ExtractFileDir(Application.ExeName) + '\' + CurFile;
    Screen.Cursors:=LoadCursor(C:\cursor\cursor1.cur);
    LoadCursorFromFile(PChar(CurFilePath));
    Screen.Cursor := cursor1;
    end;

    end.

    im sure my code it wrong, mby on even more places, sincei know nothing about delphi programmint so pls dont flame

    i added a screenshot about the problem too.

    btw im triing to add the code on this way: File -> New -> Application --> then i click on for1 twince to see code and delete all and pase my code

    thanks in advance,
    Mukso




    EDIT:

    i think i correct the code

    {$R cursor1.res}
    const
    cursor1 = 15;
    CurFile = 'cursor1.cur';
    var
    CurFilePath: string;

    begin
    CurFilePath := ExtractFileDir(Application.ExeName) + '\' + CurFile;
    Screen.Cursors[CURSOR1]:=LoadCursor(HInstance,'C:\cursor\cursor1');
    LoadCursorFromFile(PChar(CurFilePath));
    Screen.Cursor := cursor1;


    end.



    becouse it let's me though to next problem -,-

    but it's almost done i think... check 2nd attachment
    Attached Thumbnails Attached Thumbnails 1.jpg   2.jpg  
    Last edited by mukso; 12-04-09 at 01:52 PM.


  2. #2
    Account Upgraded | Title Enabled! mukso is offline
    MemberRank
    Nov 2007 Join Date
    HungaryLocation
    333Posts

    Re: Kalonline cursors

    ok, i think i almost realised all, i have to add curosr1.res to that folder where is my project (now its the psupdater2 source folder) and i have to add this code to Form1

    the only problem is, the red text is wrong, and i really dont have any clue what should i use

    {$RESOURCE cursor1.res}
    procedure TForm1.FormCreate(Sender: TObject);
    const
    cursor1 = 5;
    begin
    Screen.Cursors[cursor1] := LoadCursor(HInstance, 'cursor1');
    end;


    so it looks like this in Form1 of psupdater source, in Unit1:

    unit Unit1;

    interface

    uses
    Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
    IdTCPClient, IdHTTP, INIFiles, ExtActns, ComCtrls, ExtCtrls, ShellAPI,
    IdAntiFreezeBase, IdAntiFreeze, ScktComp, OverbyteIcsMD5, jpeg,
    Menus;

    type
    TForm1 = class(TForm)
    IdHTTP1: TIdHTTP;
    ProgressBar1: TProgressBar;
    Image1: TImage;
    Memo1: TMemo;
    IdAntiFreeze1: TIdAntiFreeze;
    Timer1: TTimer;
    Image2: TImage;
    Image3: TImage;
    Image4: TImage;
    Image5: TImage;
    procedure FormCreate(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    private
    { Private declarations }
    public
    procedure URL_OnDownloadProgress(Sender: TDownLoadURL; Progress, ProgressMax: Cardinal; StatusCode: TURLDownloadStatus; StatusText: String; var Cancel: Boolean);
    function DoDownload(const strWhichURL,strLocalFile:string): boolean;
    function DoReadINI(const strFile,strWhichSection,strString:string): string;
    procedure DoWriteINI(const strFileWRI,strWhichSectionWRI, strNameWRI, strStringWRI:string);
    procedure CompareStrings(const string1, string2, filename: string);
    procedure CheckMD5();
    end;

    var
    Form1: TForm1;

    implementation

    uses Unit2;

    {$R *.dfm}

    procedure TForm1.URL_OnDownloadProgress;

    begin

    ProgressBar1.Max:= ProgressMax;

    ProgressBar1.Position:= Progress;

    end;
    function TForm1.DoReadINI(const strFile,strWhichSection,strString:string): string;
    var
    ReadINI : TINIFile;
    begin
    try
    ReadINI := TINIFile.Create(strFile);
    result := ReadINI.ReadString(strWhichSection, strString, 'Default');
    finally
    ReadINI.Free;
    end;
    end;

    procedure TForm1.DoWriteINI(const strFileWRI,strWhichSectionWRI,strNameWRI,strStringWRI:string);
    var
    WriteINI : TINIFile;
    begin
    try
    WriteINI := TINIFile.Create(strFileWRI);
    WriteINI.WriteString(strWhichSectionWRI, strNameWRI, strStringWRI);
    finally
    WriteINI.Free;
    end;
    end;

    function TForm1.DoDownload(const strWhichURL,strLocalFile:string): boolean;

    begin
    Result:=True;
    with TDownloadURL.Create(nil) do

    try

    URL := strWhichURL;

    FileName := strLocalFile;

    OnDownloadProgress := URL_OnDownloadProgress;
    try
    Application.ProcessMessages;
    ExecuteTarget(nil);
    except
    ShowMessage('Can not Download ' + strWhichURL);
    Result:=False
    end;


    finally

    Free;
    ProgressBar1.Position := 0;

    end;

    end;

    procedure TForm1.CompareStrings(const string1, string2, filename: string);
    var result : Integer;
    FiledownloadInet, FileDownloadName : string;

    begin
    result := AnsiCompareStr(string1, string2);

    if result < 0 then
    begin

    //Different

    //showmessage('Start Download');
    FileDownloadName := filename;
    Delete(FileDownloadName, 1,1);
    FiledownloadInet := DoReadINI('./updater.ini','Settings','UpdateHost') + FileDownloadName;

    Application.ProcessMessages;

    DoDownload(FiledownloadInet,filename);
    //showmessage('DIFF String1:' + string1 + ' String2: ' + string2 + ' Filename: ' + filename);


    end;
    if result = 0 then
    begin
    //Same
    { do nothing }
    //showmessage('==SAME ServMD5 ' + string1 + ' LocalMD5 ' + string2 + ' FileName ' + filename);

    end;
    if result > 0 then
    begin

    //showmessage('Start Download');
    FileDownloadName := filename;
    Delete(FileDownloadName, 1,1);
    FiledownloadInet := DoReadINI('./updater.ini','Settings','UpdateHost') + FileDownloadName;

    Application.ProcessMessages;

    DoDownload(FiledownloadInet,filename);
    //showmessage('String1:' + string1 + ' String2: ' + string2 + ' Filename: ' + filename);

    //Error
    //showmessage('==ERROR ServMD5 ' + string1 + ' LocalMD5 ' + string2 + ' FileName ' + filename);
    //ShowMessage('Error In Version');
    end;
    end;

    procedure TForm1.CheckMD5();
    var
    SomeTxtFile : TextFile;
    buffer, md5filename, md5var, SrvMD5 : string;
    Line : TStringList;
    begin
    AssignFile(SomeTxtFile, './file.list') ;
    Reset(SomeTxtFile) ;
    while not EOF(SomeTxtFile) do
    begin
    ReadLn(SomeTxtFile, buffer) ;
    Line := TStringList.Create;
    Line.CommaText := buffer;
    SrvMD5 := AnsiUpperCase(Line[1]);
    md5filename := Line[0];
    md5var := FileMD5(md5filename);

    Application.ProcessMessages;

    CompareStrings(md5var, SrvMD5, Line[0]);
    //showmessage('ServMD5 ' + SrvMD5 + ' LocalMD5 ' + md5var + ' FileName ' + Line[0]);
    Screen.Cursor := crDefault;
    end;
    CloseFile(SomeTxtFile) ;
    end;

    procedure TForm1.FormCreate(Sender: TObject);
    var
    UpdaterTitle: string;
    begin
    //Center Form
    Left:=(Screen.Width-Width) div 2;
    Top:=(Screen.Height-Height) div 2;
    //Change Title
    UpdaterTitle := DoReadINI('./updater.ini','Settings','UpdaterTitle');



    end;

    {$RESOURCE cursor1.res}
    procedure TForm1.FormCreate(Sender: TObject);
    const
    cursor1 = 5;
    begin
    Screen.Cursors[cursor1] := LoadCursor(HInstance, 'cursor1');
    end;



    procedure TForm1.Button4Click(Sender: TObject);
    begin
    Close;
    end;

    procedure TForm1.Button2Click(Sender: TObject);
    begin
    ShellExecute(Form1.Handle, 'open', 'engine.exe', '/setup', nil, SW_SHOWNORMAL);
    end;

    procedure TForm1.Button3Click(Sender: TObject);
    var
    SiteButtonURL: string;
    begin
    SiteButtonURL := DoReadINI('./updater.ini','Settings','WebsiteButtonURL');
    ShellExecute(Form1.Handle, 'open', PChar(SiteButtonURL), nil, nil, SW_SHOWNORMAL);

    end;

    procedure TForm1.Timer1Timer(Sender: TObject);
    var
    NoticeLocalFile, NoticeInetFile, UpdateFileLocal, UpdateFileInet: string;
    begin
    Timer1.enabled:=false;

    //Notice File

    NoticeLocalFile := DoReadINI('./updater.ini','Settings','NoticeFile');
    NoticeInetFile := DoReadINI('./updater.ini','Settings','UpdateHost') + '/' + DoReadINI('./updater.ini','Settings','NoticeFile');
    DoDownload(NoticeInetFile,NoticeLocalFile);
    if FileExists(NoticeLocalFile) then
    Memo1.Lines.LoadFromFile(NoticeLocalFile)
    else
    ShowMessage('Can not Display Notice File');

    //Download Update List
    UpdateFileLocal := DoReadINI('./updater.ini','Settings','UpdateFile');
    UpdateFileInet := DoReadINI('./updater.ini','Settings','UpdateHost') + '/' + DoReadINI('./updater.ini','Settings','UpdateFile');

    DoDownload(UpdateFileInet,UpdateFileLocal);
    CheckMD5();
    end;

    procedure TForm1.Button5Click(Sender: TObject);
    begin
    form1.visible := false;
    form2.visible := true;
    end;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ShellExecute(Form1.Handle, 'open', 'engine.exe', '/load /config debug', nil, SW_SHOWNORMAL);
    close;
    end;

    end.



    see error in attachment too



    ohh, and thanks bjorn for cursors, they stored in engine.exe



    EDIT:

    ok i could add all, i see. i had to declase it, so i added this code sucessfully, but i still cant choose the new cursor from delphi

    now no syntax error:

    so i added this code:

    {$RESOURCE cursor1.res}
    procedure TForm1.DrawCreate(Sender: TObject);
    const
    cursor1 = 5;
    begin
    Screen.Cursors[cursor1] := LoadCursor(HInstance, 'cursor1');
    end;


    and declared it by:

    procedure DrawCreate(Sender: TObject);



    and yes, cursor.RES is in that folder where prjoect is (so in psupdater2 source folder)


    but why i cant choose new cursor??


    EDIT3:

    if i do with:

    {$RESOURCE cursor1.cur}
    procedure TForm1.DrawCreate(Sender: TObject);
    const
    cursor1 = 5;
    begin
    Screen.Cursors[cursor1] := LoadCursor(HInstance, 'cursor1');
    end;


    then it almost seems like work :O

    then i get this error: 2nd attachment
    Attached Thumbnails Attached Thumbnails 11.jpg   111.jpg  

  3. #3
    Member Abeceda is offline
    MemberRank
    Apr 2009 Join Date
    55Posts

    Re: Kalonline cursors

    Hmm.... i wouldn't know that ...

    GoodLuck with your question

  4. #4
    Arrogant Wizard DeathArt is offline
    MemberRank
    Mar 2007 Join Date
    StockholmLocation
    2,657Posts

    Re: Kalonline cursors

    Pascal is fail, mkay?

  5. #5
    Account Upgraded | Title Enabled! mukso is offline
    MemberRank
    Nov 2007 Join Date
    HungaryLocation
    333Posts

    Re: Kalonline cursors

    Quote Originally Posted by DeathArt View Post
    Pascal is fail, mkay?
    i know nothing, no pascal, no c#, no delphi, only a bit php and sql.

    i know im not able to do it alone, thatwhy i asked for help... would be nice if you tell whats wrong :X

    btw i already know it must be in .res not in .cur becouse delphi accept only if its in .res....

    i can convert it by: \Borland\Delphi7\Bin\BRC32.EXE

    so this is the newest thing what im triing... it doesnt write any error, so i really dont know why it doesnt add my custom cursor to other cursors

    so:

    {$RESOURCE cursor1.res}
    procedure TForm1.DrawCreate(Sender: TObject);
    const
    cursor1 = 5;
    begin
    Screen.Cursors[cursor1] := LoadCursor(HInstance, 'cursor1');
    Cursor := cursor1;
    end;

    and the declaration:

    procedure DrawCreate(Sender: TObject);

  6. #6
    Account Upgraded | Title Enabled! mukso is offline
    MemberRank
    Nov 2007 Join Date
    HungaryLocation
    333Posts

    Re: Kalonline cursors

    Finally im "succeed" only 75% but i can't solve the rest -,-

    i realised, all projects got a resource file, and inside resource we can find cursors,bitmaps,icons and whatever....

    so i had to add there the cursor -,-

    my really last problem is that i cant make 2 kind of cursors [ one for background, and one for butons ]
    but i dont really care anymore i tried but im too dumb

    that problem i can't take a screenshot with cursor -,-

    in attachment you can download all 8 cursors which kalonline uses
    Attached Files Attached Files

  7. #7
    Member Abeceda is offline
    MemberRank
    Apr 2009 Join Date
    55Posts

    Re: Kalonline cursors

    just try to change their design or something :P

  8. #8
    Novice #chronix is offline
    MemberRank
    Apr 2009 Join Date
    1Posts

    Re: Kalonline cursors

    It is not that hard :

    Code:
    var
    cursor1,cursor2: TCursor; 
    
    begin
    
    screen.Cursors[cursor1] := LoadCursor(HInstance,'Cursor1');
    screen.Cursors[cursor2] := LoadCursor(HInstance,'Cursor3');
    
    Cursor := cursor1;
    
    Button1.Cursor  := cursor2;
    
    end;
    or if you want to load the cursors from files :

    Code:
    var
    cursor1,cursor2: TCursor; 
    
    begin
    
    screen.Cursors[cursor1] := LoadCursorFromFile('C:\cursor1.cur');
    screen.Cursors[cursor2] := LoadCursorFromFile('C:\cursor2.cur');
    
    Cursor := cursor1;
    
    Button1.Cursor  := cursor2;
    
    end;

  9. #9
    Infraction Banned hero322 is offline
    MemberRank
    Nov 2006 Join Date
    CanadaLocation
    1,036Posts

    Re: Kalonline cursors

    i thought the cursor for kal is in hypertext? lol how else can it load the image... its not a default windows cursor

    although i have no clue but i am sure its client side o.O

  10. #10
    Account Upgraded | Title Enabled! mukso is offline
    MemberRank
    Nov 2007 Join Date
    HungaryLocation
    333Posts

    Re: Kalonline cursors

    Quote Originally Posted by hero322 View Post
    i thought the cursor for kal is in hypertext? lol how else can it load the image... its not a default windows cursor

    although i have no clue but i am sure its client side o.O


    yes, clientside --> engine.exe

    it is in the .RES file of engine exe [ in source], if you check cursor cant be seen when you take a screenshot, so it cant be a normal hypertext image

  11. #11
    Infraction Banned hero322 is offline
    MemberRank
    Nov 2006 Join Date
    CanadaLocation
    1,036Posts

    Re: Kalonline cursors

    Quote Originally Posted by mukso View Post
    yes, clientside --> engine.exe

    it is in the .RES file of engine exe [ in source], if you check cursor cant be seen when you take a screenshot, so it cant be a normal hypertext image
    omfg... i always noticed that but now its starting to make sense.... interesting interesting...
    go go mukso :D



Advertisement