Jump to content
The Dark Mod Forums

GUI - Creating guicode for login screen


freyk

Recommended Posts

As you maybe know, I am working on several GUIs for a scifi fm for the dark mod.

At this moment I am working on a loginscreen.

I would like that the player input is a word-string, instead of numbers.

 

So I would like to find a way to compare strings.

Is there a way to compare a string using an if-statement, instead of using a float (or a gui_param)?

Or do i have to use a script? please give an example.

Or do i just have to use numbers, floats and gui_param?

 

code in the spoiler

 

 

//define password
#define LS_pwd "freyk"

//editdef for entering password
editDef ePassword
{
rect	137,50,123,18
visible	1
text	""
textscale	0.2
backcolor	1,1,1,1
shadow		1
hovercolor	0,0,0,1
}

//button to check.
windowDef btnLogin
{
rect	212,72,48,21
visible	1
bordersize	1
bordercolor	0,0.25098041,0,1
forecolor	1,1,1,1
text	"Login"
textscale	0.2
textalign	1
backcolor	0.50196081,0.50196081,0.50196081,1

onAction {
if ("ePassword::text" == LS_pwd ) { 
set "iFirmLogo::text" "ok" ;
} else {
set "iFirmLogo::text" "error" ;
}
}

}
}

 

Edited by freyk

Info: My portfolio and darkmod graphical installer
Amnesty for Bikerdude!

Link to comment
Share on other sites

I guess you will need a script for this, as the gui does not provide a native implementation for this feature. I could take a look at this (if I don't forget it :) ).

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

So I have taken a look at it. It is possible to run a script when the OK button is pressed to compare the input to the desired password. The problem is that you can't use your keyboard to directly type the password. Unfortunately I haven't found a way to bypass this. It is possible in the menu (see savegame name field for example) and you can type if you call the gui via testgui, but it seems not possible ingame. :(

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Thanks for looking in to it.

 

I have not tested the gui ingame and not tested the keyboardinput correctly.

So i did not noticed that the keyboardinput not work. because the keys are used for playermovement.

Is there a way to disable them using a script?

And how does a script that compares editdef-text looks like?

 

As a workarounds

  • I can create a touchkeyboard, but touching in the credentials will take long.
  • i can display the logininterface fullscreen (like the ingame mainmenu),
    but then the player loses the ingame atmosphere. (when like reading letters in Thief 1 til 3)

Or use two nummeric editdefs, 1 for the username and 1 for the password.

Edited by freyk

Info: My portfolio and darkmod graphical installer
Amnesty for Bikerdude!

Link to comment
Share on other sites

Touchkeyboard is fine. Fullscreen is not needed.

 

The text gets written to a gui parameter which can be accessed via script. Comparision is done using the script. If you need a demo I can set it up for you.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...