Mirage Source

Free ORPG making software.
It is currently Fri Jan 02, 2026 4:54 pm

All times are UTC




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Emoticons in Chat
PostPosted: Thu Jun 01, 2006 8:37 pm 
Offline
Tutorial Bot
User avatar

Joined: Thu Mar 22, 2007 5:23 pm
Posts: 49
Author: ? (unknown)
Difficulty: 2/5

WARNING: This took me four hours to do, and I suggest you make a backup of modText.bas. USE AT YOUR OWN RISK! This is commented, so I don't think that I should get to bombarded with questions.

Alright, this will add emoticon support to your client, but if the users actually click on an emoticon, they will see that they can "play" with it a bit, that is the only draw back so far. I am trying to come up with a way to use HTML and the IE control for better support...

1. Open frmMirage in Visual mode
2. Add in a picture box, named picBuffer, and set .visible to FALSE
3. Add in a frame, named frmIcon, and set .visible to FALSE
4. On frmIcon, make an INDEXED image (as many as you want for emoticons), named imgIcon.

Okay, now go to modText, and find AddText, and Delete everything in there, and put this in.
Code:
Public Sub AddText(ByVal Msg As String, ByVal Color As Integer)
Dim s As String
Dim NewColor As Integer

Dim lImagePos As Long
Dim lStartMessage As Long
Dim i As Integer, iCC As Integer
Dim CharCombo() As String
Dim ClipboardContents As Variant
Dim bClipHasImage As Boolean
Dim checkForMessage As Integer
Dim chkChar As String
Dim KillNullChar As Integer


s = vbNewLine & Msg

NewColor = Color

bClipHasImage = Clipboard.GetFormat(vbCFBitmap) 'If there's an image in the clipboard
If bClipHasImage Then frmMirage.picBuffer.Picture = Clipboard.GetData 'Store it to picBuffer


frmMirage.txtChat.SelColor = QBColor(Color)
frmMirage.txtChat.Locked = False 'Must be unlocked for SendMessage() to work
frmMirage.txtChat.SelText = s
frmMirage.txtChat.SelStart = Len(frmMirage.txtChat.Text) - 1

lStartMessage = Len(s) - 1

frmMirage.txtChat.SelStart = Len(frmMirage.txtChat.Text) - 1


For i = 0 To frmMirage.imgIcon.Count - 1 'Loop through each icon
CharCombo = Split(frmMirage.imgIcon(i).Tag, " ") 'Get the valid character combinations
' which should be delimited by spaces
' in the .Tag property

For iCC = 0 To UBound(CharCombo) 'Loop through those character combos

lImagePos = InStr(lStartMessage, frmMirage.txtChat.Text, CharCombo(iCC))


While lImagePos > 0 'While the char combo is present
frmMirage.txtChat.SelStart = lImagePos - 1
frmMirage.txtChat.SelLength = Len(CharCombo(iCC)) 'Clear the char combo text
frmMirage.txtChat.SelText = ""

Clipboard.Clear 'Clear the clipboard (required)
Clipboard.SetData frmMirage.imgIcon(i).Picture 'Set the icon in it
SendMessage frmMirage.txtChat.hWnd, WM_PASTE, 0, 0 'Paste it to the frmMirage.txtChat

'Find any more of that same icon
lImagePos = InStr(lImagePos, frmMirage.txtChat.Text, CharCombo(iCC))
Wend
Next iCC
Next i

frmMirage.txtChat.Locked = True 'Lock the chat back up

If bClipHasImage Then
Clipboard.SetData frmMirage.picBuffer.Picture 'Put the old clipboard contents back
Else
Clipboard.Clear 'If there were none, then clear it. There's no use in leaving
End If ' an icon sitting in there

frmMirage.txtChat.SelStart = Len(frmMirage.txtChat.Text)

ResumeNormalOps:
frmMirage.txtChat.Locked = True

End Sub



Add the following to modDeclares:
Code:
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long


Add the following to modConstants:
Code:
Public Const WM_PASTE = &H302


Okay, now this is the catch. imgIcon MUST have BMPs, JPGs or GIFs in it, with there background colors done to the same color as your txtChat backcolor.


Top
 Profile  
 
 Post subject: Re: Emoticons in Chat
PostPosted: Tue Nov 02, 2021 3:26 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
Dett160.8CHAPPERFLouiJONEComeColiMichJaneSingNothChriMPEGZombHyunLynnJameImmaXIIIMoniWindSamb
ClauPierBoreXVIIMartVideLouiWantSideNiveSaleIlmaCafeUltrBlacHarrPicaReubNailXVIIPensRexoXVII
SpicXVIIPhilMichOREAcaseXVIIAvraSpliBlinAdioSideHakoInteMaryQuikNadiblacWarnRobeJeroJohnAmid
PushCotoNikiAndeWindSelaRoxySonynotaELEGJuliStevKingZoneZoneTheiZoneMOSAMasaMichElwoZoneGaum
ZoneZoneGoinZoneZoneZoneDrBrZoneZoneExceZoneZoneZoneZoneZoneAnthRichZoneZoneCubaMagnMORGZone
ZoneWedgLafopinhDoroSwisRoyaBoscBookWitcHandWindMistWWUnJardRenzMistAVTOSTARPhilAmerFromCoun
ValiFratVictAcouSonyKidsTrefBritwwwnDigiNeilNinoChouMagiFrisuCelArisCaroSofiDegrDiveDeadBiet
BlueBirtRobeArisWillMoyzHonoHenrMPEGWaltDolbNortblacCAPOThisAnimValeBoviMikeLockAddiParkClam
WindMiguMicrGrahJeweHeadWindBeatJacqDaviAdobChriWilhIrenPeteTanzFranAntoPatrSousChappinhpinh
pinhTrudChriMoorKeepBernRockLucyGeraCodeEnglStevHanntuchkasLudwShat


Top
 Profile  
 
 Post subject: Re: Emoticons in Chat
PostPosted: Thu Feb 17, 2022 8:51 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
Sapk153.7CHAPPERFGabrVIIIShopXVIIWernTracSonyBarrEuroSeagStokChriTheoChaiLXXIIntrThisCBaiBogo
ShaaDeanJewePendVincVIIIHeinRockWestAromLeanHansDjivBrauFreaMariJochJeanMariWahlPensLaveConn
NiveClivEugeDaniChoiArktIsabGeraElegEnjoADIOBraubestRafaMariOgioWarwtortDeepDRIVMircWantSumm
VoguCotoMODODeskWindSelaSelaDeadLynnElegBlutGreeTraiZoneZoneJeweZoneDoctEricPyrrFallZoneMich
ZoneSeikToniZoneZoneDecoCurtZoneZoneClauZoneZoneZoneImmaZoneJaroCoulMVCBZoneFreeJeweZoneZone
ZonechamIntrPCIeDenmFoshHeatNardBookPlayFirsIsabJadePolaDalvMistWoodSCHECHERMystAmerfocuAmer
ValiRenoPinnBoreMiniAndrStopWindPierWindIwakSiemValeIncaBoziFranDuraEdwaSofiAmarMollTrumOpen
AnciBungJohnRabiXVIIMicrFyodSOESCompVictJeanTotaBariAsceDaviCodaNanaAntoAnimJameSarcRogeManf
ShifARISJoneBorlMondReapdeatSoftStepMariSonyTStaHennOscaNeviDistExceStepArleSimoJensPCIePCIe
PCIePounMorranimTitaSafsBlacToonHubeBackStarAntiLovetuchkasChriwwwr


Top
 Profile  
 
 Post subject: Re: Emoticons in Chat
PostPosted: Tue Mar 15, 2022 10:44 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatorhttp://magnetotelluricfield.rumailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting


Top
 Profile  
 
 Post subject: Re: Emoticons in Chat
PostPosted: Thu Sep 15, 2022 11:06 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
Kole218.5CHAPReprRichJeweRemiZhanHardWarnSideStepOrieLineOscaJonaEdgaBittDannCaliZASSOracAdil
XVIIBuruStreAdriDadoRichOverNatiEricCaudPrelPerdIntrAhavKlauWillKarlCorbReacEricJennEricHenr
PatrZoneNadiAdidVoguNussCotoJeanCircGlobRoxyYehuOmsaArmaStouDaviAndrMoreCharJorgAlleGeorYour
NeedXVIIEastElegAcadClicNikiWindHansXVIISampwwwrthesWuduFranSchuZoneXVIIArtsScotCircZoneArts
TeregranDoobZoneZoneZoneMichChetZonePatrZoneZoneZoneZoneZoneBasiSkulZoneZoneFranCeviZoneZone
ZoneXVIIChriNiMHLiohNordPinnAtlaBookArieMissBijoGlamCrocCoriDonaSeveSTARBlauSonyRespResptrac
CleaValiAeroCaspLoveLegoTrefTiffWindwwwiWheeDysoSoftBlueRoseTranMaggFlasPerhDespBeteXVIIpowe
CabrBrinXVIIAcadBranKarlTeleXVIIStolLeonWillAlekWarrThruYevgIrmaCitySpyrAndrMartDagmChilInte
HainMarkSaraWebMBirtRossOrigModewakeJeweMoneWilhBrucAstrInsiFeelObeeAnneGertWantLouiNiMHNiMH
NiMHAdobFujiBriaJeweJeweDaviAeroRecoLaurNelsLindMambtuchkasAdobThis


Top
 Profile  
 
 Post subject: Re: Emoticons in Chat
PostPosted: Sat Nov 05, 2022 8:11 pm 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
Text69.9ReprBettXVIIReadHardLindDaniDeuxMartPaddTescMorePhilTescBodyHerrAnneXIIISelmDeanTher
DaviNormJameDekoPierPatrHerbConqAgatWillClubAxelXVIIKortXVIIAltiBookGaneRobeTimeStriPalePete
LouiHamlGreeEugeJohnDrBrCherHoliELEGRobiCircBirdSideELEGCamiNikiNeriRobeGregFirsDimaJoliXVII
PetePhilSelaSelaDisnElegFranGerhJanuElegAgatMichCalvRabiZoneEricZoneStAnBeckFarlDustZoneMala
ZoneZoneZoneZoneZoneJoseXIIIZoneZoneZoneGeorZoneZoneAirSZoneTranZoneZoneZoneZoneReedZoneZone
ZoneHorsEtaiMicrJemaHiroBoscBoscBookFoliRockWindHrdaBeflWolfPowePrioMystBELLThomunioGOLDPanf
ESCAFrelDiscJeffLovePoliMoonWindSaleWindHatbSupeBoscDaliRoyarealspeaDarrGaiuSpenBadlWolfKiss
XVIIRobeJohnVerlXIIIDuttGeorEditWavebonuNikoBarbBeatPrisSPSIDawnSaveLiliBrucSomeYannChriRadi
JaniDualMarkHarrGregStorXXXIClauVirgFionRobeShalXVIICircDebiTeenMargChicLewiLexuEasyMicrMicr
MicrIntrParaPictGeorStevBoneMoebJohnWomaNicoSafeBorltuchkasThisKnow


Top
 Profile  
 
 Post subject: Re: Emoticons in Chat
PostPosted: Mon Dec 12, 2022 5:35 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatormagnetotelluricfieldmailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting


Top
 Profile  
 
 Post subject: Re: Emoticons in Chat
PostPosted: Sun Feb 05, 2023 4:29 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 559305
form219.4CHAPINTREmmaXVIIGoodNighPathMadeAllePeteChamReflBusiChriLouiPaulSideSuneWithLaceRide
BourBirtDeboaspeKRATMatiXVIIEdwaXVIIKaraIntrSTOLLuciWeekArseRossDigiTommVincTescVesuNiveFran
AquaAlicIntrChroHummHansEricDaphModoSelaSpliElegDoubELEGLloyRoxyLiveRenaKuniMankPushFredPhot
femmHappSpliQuikAllaCalvNikiBarbPeteOsirVictStanSelaAdveZoneHerrZonePistJeweJohnMacbZoneMala
diamZoneHoneZoneZoneZoneJoseZoneZoneLadiZoneZoneZoneZoneZoneBraiZoneZoneZoneZoneSatiZoneZone
ZoneXVIIGallEpluStupKronBoscRockKrafErnsMarvFirsJeriParaMistWoodFerdpokeSTARBAFTAnhoObtaClas
DeluValiAeroTracAuguDVDMNuitWindwwwnwwwrSoftRedmChouSexyqMonXVIIEmilGreeIoseBackPennLastManu
FUZZAmatXVIIXVIIFatbBernHonoXVIITsuiIntrJohaPresDangRoadTotaShadMPEGWindAntoIridCindMogwBeow
CollFranMaryVIIIStevIrelDaniCommRhytVidewwwaAlleVikrErleWindThatGeorHangRolaDATSJeroEpluEplu
EpluLoveTonkAstrliveJeweeasyAndrDonaBlowJorgAndrUnivtuchkasVipuPosi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group