Skip to content

Commit

Permalink
Revert "Проба html - жирные названия локаций и эхо команды курсивом"
Browse files Browse the repository at this point in the history
This reverts commit 73ba9d0
  • Loading branch information
realsonic committed Oct 16, 2018
1 parent 9aa989d commit d7c88e8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion libs/standard/verbs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@
<procedures>
<procedure name="ОписатьТекущуюЛокацию" inheritsSystemProcedure="showLocation">
<procedureBody>
<showMessage position="1" type="expression" message="'&lt;strong&gt;' + ТекущаяЛокация.Имя + '&lt;/strong&gt;'"/>
<showMessage position="1" type="expression" message="ТекущаяЛокация.Имя"/>
<showMessage position="2" type="expression" message="ТекущаяЛокация.Описание"/>
<loop position="3" collection="ТекущаяЛокация.Предметы" element="предмет"
condition="не предмет.частьПейзажа">
Expand Down
9 changes: 3 additions & 6 deletions src/ifml2/players/guiplayer/GUIPlayer.form
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,19 @@
<constraints/>
<properties>
<background awt-color="black"/>
<contentType value="text/html"/>
<editable value="false"/>
<font name="Segoe UI" size="16"/>
<foreground awt-color="green"/>
<margin top="4" left="4" bottom="4" right="4"/>
</properties>
<clientProperties>
<JEditorPane.honorDisplayProperties class="java.lang.Boolean" value="true"/>
</clientProperties>
</component>
</children>
</scrollpane>
</children>
</grid>
<inspectionSuppressions>
<suppress inspection="NoLabelFor"/>
<suppress inspection="I18nForm" id="26eea"/>
<suppress inspection="NoLabelFor" id="c53bd"/>
<suppress inspection="NoLabelFor" id="3c7c7"/>
<suppress inspection="NoLabelFor" id="ff8d8"/>
</inspectionSuppressions>
</form>
12 changes: 5 additions & 7 deletions src/ifml2/players/guiplayer/GUIPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@
import javax.swing.filechooser.FileView;
import javax.swing.plaf.FontUIResource;
import javax.swing.text.BadLocationException;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.StyledDocument;
import javax.xml.bind.ValidationEvent;
import java.awt.*;
import java.awt.event.*;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.MessageFormat;
Expand Down Expand Up @@ -597,7 +596,7 @@ private void echoCommand(String command)
}

// echo command
outputPlainText("<em>&gt; " + command + "</em>\n");
outputPlainText("> " + command + "\n");

// scroll to inputted command
final Point viewPosition = new Point(startLocation.x, startLocation.y);
Expand All @@ -620,11 +619,10 @@ private void echoCommand(String command)

@Override
public void outputPlainText(String text) {
HTMLDocument document = (HTMLDocument) logTextPane.getStyledDocument();
StyledDocument document = logTextPane.getStyledDocument();
try {
String translatedText = text.replace("\n", "<br/>");
document.insertAfterEnd(document.getCharacterElement(document.getLength()), translatedText);
} catch (BadLocationException | IOException e) {
document.insertString(document.getLength(), text, null);
} catch (BadLocationException e) {
LOG.error("Error while inserting string to JTextPane", e);
throw new RuntimeException(e);
}
Expand Down
8 changes: 4 additions & 4 deletions src/ifml2/vm/VirtualMachine.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Value callProcedureWithParameters(@NotNull Procedure procedure, List<Vari
}
}

private void runProcedure(@NotNull Procedure procedure, List<Variable> parameters) throws IFML2Exception
void runProcedure(@NotNull Procedure procedure, List<Variable> parameters) throws IFML2Exception
{
try
{
Expand Down Expand Up @@ -145,7 +145,7 @@ public void showLocation(@Nullable Location location) throws IFML2Exception
else
{
// not inherited! do as usual...
outTextLn("<strong>" + location.getName() + "</strong>");
outTextLn(location.getName());
outTextLn(location.getDescription());
if (location.getItems().size() > 0)
{
Expand Down Expand Up @@ -184,7 +184,7 @@ else if (iterator.hasNext()) // there is an another word after that
return result;
}

Value resolveSymbol(String symbol) throws IFML2VMException
public Value resolveSymbol(String symbol) throws IFML2VMException
{
String loweredSymbol = symbol.toLowerCase();

Expand Down Expand Up @@ -226,7 +226,7 @@ public void outText(String text)
engine.outText(text);
}

Variable searchGlobalVariable(String name)
public Variable searchGlobalVariable(String name)
{
return engine.searchGlobalVariable(name);
}
Expand Down

0 comments on commit d7c88e8

Please sign in to comment.