Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Terminals.
Hypercube Offline
Member

Posts: 124
Threads: 20
Joined: Sep 2015
Reputation: 1
#1
Terminals.

I think I'm getting a tiny bit better at them, or at least understand it. But I need help. How do you get the ImGui_SetTransCategory("insert name here") to connect with your lang file? For example, mine is "computer bedroom", I have the language file, but how do you connect the script to the lang file? Is there a preprocessor, a helper of some sort? I included the correct stuff in my resources file, so I'm not sure by this point. I'm not too good with this stuff.

Huh
(This post was last modified: 03-31-2016, 09:14 PM by Hypercube.)
03-31-2016, 09:14 PM
Find
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#2
RE: Terminals.

It sounds like you've already done most of it, so all that's left is to call ImGui_SetTransCategory at the beginning of your terminal's OnGui function. Make sure that you have #include "helpers/helper_imgui.hps" at the top of your map script. If it still doesn't work, try replacing the spaces in your lang file categories with underscores (none of the SOMA lang files have spaces in the category names, so maybe spaces aren't supported).
03-31-2016, 09:34 PM
Find
Hypercube Offline
Member

Posts: 124
Threads: 20
Joined: Sep 2015
Reputation: 1
#3
RE: Terminals.

(03-31-2016, 09:34 PM)Abion47 Wrote: It sounds like you've already done most of it, so all that's left is to call ImGui_SetTransCategory at the beginning of your terminal's OnGui function. Make sure that you have #include "helpers/helper_imgui.hps" at the top of your map script. If it still doesn't work, try replacing the spaces in your lang file categories with underscores (none of the SOMA lang files have spaces in the category names, so maybe spaces aren't supported).
So I already have the gui helper, and I am using underscores. What could be the problem?
here's what I have for the terminal:
void computer_bedroom_OnGui(const tString&in asEntityName, float afTimeStep)
{
ImGui_SetTransCategory("computer_bedroom");

//Background
StationGuiBG_Scanlines();
StationGuiBG_Taskbar("theta");

int lActiveApp = StationGui_GetActiveApp(eComputerTerminalApp_MainMenu);
bool bBackButton = true;
switch(lActiveApp)
{
case eComputerTerminalApp_MainMenu:
StationGui_AddApp("Containment Status",true,eComputerTerminalApp_Containment);
StationGui_AddApp("Test Subject #26",false,eComputerTerminalApp_TestSubject);
StationGui_AddApp("Test Subject #37",true,eComputerTerminalApp_TestSubject);
StationGui_MainMenu();
bBackButton = false;
break;

case eComputerTerminalApp_Containment:
StationGui_TextReaderSingle("TerminalLogCaption","TerminalLog");
bBackButton = true;
break;

case eComputerTerminalApp_TestSubject:
StationGui_TextReaderSingle("TestSubjectCaption","TestSubject");
bBackButton = true;
break;
}
StationGui_BackButton(bBackButton);
}
03-31-2016, 09:51 PM
Find
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#4
RE: Terminals.

What does your lang file look like?
03-31-2016, 10:41 PM
Find
Hypercube Offline
Member

Posts: 124
Threads: 20
Joined: Sep 2015
Reputation: 1
#5
RE: Terminals.

(03-31-2016, 10:41 PM)Abion47 Wrote: What does your lang file look like?
Just so you know, in the add app section of the script, I put the whole name there because I wanted to figure this out first then change the name.

Lang file:
<LANGUAGE>

<RESOURCES>
<Directory Path="fonts/" />
<Directory Path="lang/eng" />
</RESOURCES>

<CATEGORY Name="computer_bedroom">
<Entry Name="TerminalApp_Containment">Containment Status</Entry>
<Entry Name="TerminalApp_Document">Test Subject #37</Entry>
<Entry Name="TerminalLogCaption">Containment Status:</Entry>
<Entry Name="TerminalLog">All entrances sealed, preparing to lock chamber doors...[br]//ERROR [Security systems inactive][br]Containment breach! Initiating emergency lockdown![br]Attempt failed, restarting lockdown...[br]//ERROR [Door control inactive][br]Awaiting further command...</Entry>
<Entry Name="TestSubjectCaption">Subject Report #37</Entry>
<Entry Name="TestSubject"></Entry>
</CATEGORY>

</LANGUAGE>

I'm assuming this would be the file with the problem in it.
03-31-2016, 10:48 PM
Find
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#6
RE: Terminals.

When you change the lang file you are using with ImGui_SetTransCategory, anything you put in the text parameter of the app functions (such as StationGui_AddApp) will be interpreted as an entry in that lang file rather than as plain text. So you are basically telling SOMA that you want it to use the text in the entry "Containment Status" in your lang file, but since no such entry exists, I imagine that you are getting apps with no text at all.

If you want to use plain text, then use ImGui_SetTransCategory(""). Otherwise, you have to give the functions the names of the entries you want it to use, not the text inside them.
04-01-2016, 05:58 AM
Find
Hypercube Offline
Member

Posts: 124
Threads: 20
Joined: Sep 2015
Reputation: 1
#7
RE: Terminals.

(04-01-2016, 05:58 AM)Abion47 Wrote: When you change the lang file you are using with ImGui_SetTransCategory, anything you put in the text parameter of the app functions (such as StationGui_AddApp) will be interpreted as an entry in that lang file rather than as plain text. So you are basically telling SOMA that you want it to use the text in the entry "Containment Status" in your lang file, but since no such entry exists, I imagine that you are getting apps with no text at all.

If you want to use plain text, then use ImGui_SetTransCategory(""). Otherwise, you have to give the functions the names of the entries you want it to use, not the text inside them.

I figured that was the problem once you started talking about the add app functions. I knew I had to put the entry names but I didn't think that was the problem. I'll try it and see if it works.

(04-01-2016, 10:02 PM)Hypercube Wrote:
(04-01-2016, 05:58 AM)Abion47 Wrote: When you change the lang file you are using with ImGui_SetTransCategory, anything you put in the text parameter of the app functions (such as StationGui_AddApp) will be interpreted as an entry in that lang file rather than as plain text. So you are basically telling SOMA that you want it to use the text in the entry "Containment Status" in your lang file, but since no such entry exists, I imagine that you are getting apps with no text at all.

If you want to use plain text, then use ImGui_SetTransCategory(""). Otherwise, you have to give the functions the names of the entries you want it to use, not the text inside them.

I figured that was the problem once you started talking about the add app functions. I knew I had to put the entry names but I didn't think that was the problem. I'll try it and see if it works.
It's still not working. Maybe the problem could be that how the break is [br] in the brackets. So how one of the entries has something like [security systems down] It's reading it as a wrong command of sorts? I'm not sure.
Edit: It still doesn't work.
(This post was last modified: 04-01-2016, 10:07 PM by Hypercube.)
04-01-2016, 10:02 PM
Find
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#8
RE: Terminals.

I probably should have asked this first, but what exactly is it doing now?
04-01-2016, 10:12 PM
Find
Hypercube Offline
Member

Posts: 124
Threads: 20
Joined: Sep 2015
Reputation: 1
#9
RE: Terminals.

(04-01-2016, 10:12 PM)Abion47 Wrote: I probably should have asked this first, but what exactly is it doing now?
Still nothing. No words, same effect as usual
04-01-2016, 10:15 PM
Find
Abion47 Offline
Senior Member

Posts: 369
Threads: 22
Joined: Oct 2015
Reputation: 46
#10
RE: Terminals.

Also, how are you storing the values in your lang file? Are you adding to an existing file or creating a new one?
04-01-2016, 10:16 PM
Find




Users browsing this thread: 1 Guest(s)